public static function createFromInterface(InvoicePainterItemInterface $invoicePainterItemInterface) { $obj = new self(); $obj->setAmountEx($invoicePainterItemInterface->getInvoicePainterAmountEx()); $obj->setTaxRate($invoicePainterItemInterface->getInvoicePainterTaxRate()); $obj->setDescription($invoicePainterItemInterface->getInvoicePainterDescription()); $obj->setDate($invoicePainterItemInterface->getInvoicePainterDate()); return $obj; }
public static function add($data) { if ($data['taxRateID']) { $tr = self::getByID($data['taxRateID']); } else { $tr = new self(); } $tr->setEnabled($data['taxEnabled']); $tr->setTaxLabel($data['taxLabel']); $tr->setTaxRate($data['taxRate']); $tr->setTaxBasedOn($data['taxBased']); $tr->setTaxAddress($data['taxAddress']); $tr->setTaxCountry($data['taxCountry']); $tr->setTaxState($data['taxState']); $tr->setTaxCity($data['taxCity']); $tr->save(); return $tr; }