diff --git a/Admin/Install/db.json b/Admin/Install/db.json index e9c1c61..8708564 100644 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -1,359 +1,401 @@ { - "billing_invoice": { - "name": "billing_invoice", + "billing_type": { + "name": "billing_type", "fields": { - "billing_invoice_id": { - "name": "billing_invoice_id", + "billing_type_id": { + "name": "billing_type_id", + "type": "INT", + "null": false, + "primary": true, + "autoincrement": true + } + } + }, + "billing_type_l11n": { + "name": "billing_type_l11n", + "fields": { + "billing_type_l11n_id": { + "name": "billing_type_l11n_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, - "billing_invoice_number": { - "name": "billing_invoice_number", + "billing_type_l11n_name": { + "name": "billing_type_l11n_name", "type": "VARCHAR(255)", "null": false }, - "billing_invoice_info": { - "name": "billing_invoice_info", + "billing_type_l11n_type": { + "name": "billing_type_l11n_type", + "type": "INT", + "null": false, + "foreignTable": "billing_type", + "foreignKey": "billing_type_id" + }, + "billing_type_l11n_language": { + "name": "billing_type_l11n_language", + "type": "VARCHAR(2)", + "default": null, + "null": true, + "foreignTable": "language", + "foreignKey": "language_639_1" + } + } + }, + "billing_out": { + "name": "billing_out", + "fields": { + "billing_out_id": { + "name": "billing_out_id", + "type": "INT", + "null": false, + "primary": true, + "autoincrement": true + }, + "billing_out_number": { + "name": "billing_out_number", + "type": "VARCHAR(255)", + "null": false + }, + "billing_out_info": { + "name": "billing_out_info", "type": "TEXT", "default": null, "null": true }, - "billing_invoice_status": { - "name": "billing_invoice_status", + "billing_out_status": { + "name": "billing_out_status", "type": "TINYINT", "null": false }, - "billing_invoice_type": { - "name": "billing_invoice_type", - "type": "TINYINT", - "null": false - }, - "billing_invoice_client": { - "name": "billing_invoice_client", + "billing_out_type": { + "name": "billing_out_type", "type": "INT", "null": false, - "foreignTable": "account", - "foreignKey": "account_id" + "foreignTable": "billing_type", + "foreignKey": "billing_type_id" }, - "billing_invoice_shipTo": { - "name": "billing_invoice_shipTo", + "billing_out_client": { + "name": "billing_out_client", + "type": "INT", + "null": false, + "foreignTable": "clientmgmt_client", + "foreignKey": "clientmgmt_client_id" + }, + "billing_out_shipTo": { + "name": "billing_out_shipTo", "type": "VARCHAR(255)", "null": false }, - "billing_invoice_shipFAO": { - "name": "billing_invoice_shipFAO", + "billing_out_shipFAO": { + "name": "billing_out_shipFAO", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_shipAddr": { - "name": "billing_invoice_shipAddr", + "billing_out_shipAddr": { + "name": "billing_out_shipAddr", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_shipCity": { - "name": "billing_invoice_shipCity", + "billing_out_shipCity": { + "name": "billing_out_shipCity", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_shipZip": { - "name": "billing_invoice_shipZip", + "billing_out_shipZip": { + "name": "billing_out_shipZip", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_shipCountry": { - "name": "billing_invoice_shipCountry", + "billing_out_shipCountry": { + "name": "billing_out_shipCountry", "type": "VARCHAR(3)", "default": null, "null": true }, - "billing_invoice_billTo": { - "name": "billing_invoice_billTo", + "billing_out_billTo": { + "name": "billing_out_billTo", "type": "VARCHAR(255)", "null": false }, - "billing_invoice_billFAO": { - "name": "billing_invoice_billFAO", + "billing_out_billFAO": { + "name": "billing_out_billFAO", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_billAddr": { - "name": "billing_invoice_billAddr", + "billing_out_billAddr": { + "name": "billing_out_billAddr", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_billCity": { - "name": "billing_invoice_billCity", + "billing_out_billCity": { + "name": "billing_out_billCity", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_billZip": { - "name": "billing_invoice_billZip", + "billing_out_billZip": { + "name": "billing_out_billZip", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_billCountry": { - "name": "billing_invoice_billCountry", + "billing_out_billCountry": { + "name": "billing_out_billCountry", "type": "VARCHAR(3)", "default": null, "null": true }, - "billing_invoice_created_at": { - "name": "billing_invoice_created_at", + "billing_out_created_at": { + "name": "billing_out_created_at", "type": "DATETIME", "null": false }, - "billing_invoice_created_by": { - "name": "billing_invoice_created_by", + "billing_out_created_by": { + "name": "billing_out_created_by", "type": "INT", "null": false, "foreignTable": "account", "foreignKey": "account_id" }, - "billing_invoice_finished_at": { - "name": "billing_invoice_finished_at", - "type": "DATETIME", + "billing_out_gross": { + "name": "billing_out_gross", + "type": "INT", + "null": false + }, + "billing_out_net": { + "name": "billing_out_net", + "type": "INT", + "null": false + }, + "billing_out_costs": { + "name": "billing_out_costs", + "type": "INT", + "null": false + }, + "billing_out_profit": { + "name": "billing_out_profit", + "type": "INT", + "null": false + }, + "billing_out_currency": { + "name": "billing_out_currency", + "type": "INT", + "null": false + }, + "billing_out_referral": { + "name": "billing_out_referral", + "type": "INT", + "null": true, "default": null, - "null": false - }, - "billing_invoice_gross": { - "name": "billing_invoice_gross", - "type": "INT", - "null": false - }, - "billing_invoice_net": { - "name": "billing_invoice_net", - "type": "INT", - "null": false - }, - "billing_invoice_costs": { - "name": "billing_invoice_costs", - "type": "INT", - "null": false - }, - "billing_invoice_profit": { - "name": "billing_invoice_profit", - "type": "INT", - "null": false - }, - "billing_invoice_currency": { - "name": "billing_invoice_currency", - "type": "INT", - "null": false - }, - "billing_invoice_freightage": { - "name": "billing_invoice_freightage", - "type": "INT", - "null": false - }, - "billing_invoice_insurance": { - "name": "billing_invoice_insurance", - "type": "INT", - "null": false - }, - "billing_invoice_customs": { - "name": "billing_invoice_customs", - "type": "INT", - "null": false - }, - "billing_invoice_packaging": { - "name": "billing_invoice_packaging", - "type": "INT", - "null": false - }, - "billing_invoice_referral": { - "name": "billing_invoice_referral", - "type": "INT", - "null": false, "foreignTable": "account", "foreignKey": "account_id" }, - "billing_invoice_referral_name": { - "name": "billing_invoice_referral_name", + "billing_out_referral_name": { + "name": "billing_out_referral_name", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_reference": { - "name": "billing_invoice_reference", + "billing_out_reference": { + "name": "billing_out_reference", "type": "INT", "null": false }, - "billing_invoice_payment": { - "name": "billing_invoice_payment", + "billing_out_payment": { + "name": "billing_out_payment", "type": "INT", "null": false }, - "billing_invoice_payment_text": { - "name": "billing_invoice_payment_text", + "billing_out_payment_text": { + "name": "billing_out_payment_text", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_terms": { - "name": "billing_invoice_terms", + "billing_out_paymentterms": { + "name": "billing_out_paymentterms", "type": "INT", "null": false }, - "billing_invoice_terms_text": { - "name": "billing_invoice_terms_text", + "billing_out_paymentterms_text": { + "name": "billing_out_paymentterms_text", "type": "VARCHAR(255)", "default": null, "null": true }, - "billing_invoice_ship_type": { - "name": "billing_invoice_ship_type", + "billing_out_ship_type": { + "name": "billing_out_ship_type", "type": "INT", "null": false }, - "billing_invoice_ship_text": { - "name": "billing_invoice_ship_text", + "billing_out_ship_text": { + "name": "billing_bill_ship_text", "type": "VARCHAR(255)", "default": null, "null": true } } }, - "billing_element": { - "name": "billing_element", + "billing_out_element": { + "name": "billing_out_element", "fields": { - "billing_element_id": { - "name": "billing_element_id", + "billing_out_element_id": { + "name": "billing_out_element_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, - "billing_element_order": { - "name": "billing_element_order", - "type": "SMALLINT", - "null": false - }, - "billing_element_item": { - "name": "billing_element_item", + "billing_out_element_order": { + "name": "billing_out_element_order", "type": "INT", "null": false }, - "billing_element_item_segment": { - "name": "billing_element_item_segment", + "billing_out_element_item": { + "name": "billing_out_element_item", + "type": "INT", + "null": true, + "default": null + }, + "billing_out_element_item_segment": { + "name": "billing_out_element_item_segment", "type": "INT", "default": null, "null": true }, - "billing_element_item_name": { - "name": "billing_element_item_name", + "billing_out_element_item_number": { + "name": "billing_out_element_item_number", "type": "VARCHAR(255)", "null": false }, - "billing_element_item_desc": { - "name": "billing_element_item_desc", + "billing_out_element_item_name": { + "name": "billing_out_element_item_name", "type": "VARCHAR(255)", "null": false }, - "billing_element_quantity": { - "name": "billing_element_quantity", + "billing_out_element_item_desc": { + "name": "billing_out_element_item_desc", + "type": "VARCHAR(255)", + "null": false + }, + "billing_out_element_quantity": { + "name": "billing_out_element_quantity", "type": "INT", "null": false }, - "billing_element_purchase_price": { - "name": "billing_element_purchase_price", + "billing_out_element_purchase_price": { + "name": "billing_out_element_purchase_price", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_price_single": { - "name": "billing_element_price_single", + "billing_out_element_price_single": { + "name": "billing_out_element_price_single", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_price_total": { - "name": "billing_element_price_total", + "billing_out_element_price_total": { + "name": "billing_out_element_price_total", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_price_discount_single": { - "name": "billing_element_price_discount_single", + "billing_out_element_price_discount_single": { + "name": "billing_out_element_price_discount_single", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_price_discount_total": { - "name": "billing_element_price_discount_total", + "billing_out_element_price_discount_total": { + "name": "billing_out_element_price_discount_total", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_percentage_discount_single": { - "name": "billing_element_percentage_discount_single", + "billing_out_element_percentage_discount_single": { + "name": "billing_out_element_percentage_discount_single", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_percentage_discount_total": { - "name": "billing_element_percentage_discount_total", + "billing_out_element_percentage_discount_total": { + "name": "billing_out_element_percentage_discount_total", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_quantity_discount": { - "name": "billing_element_quantity_discount", + "billing_out_element_quantity_discount": { + "name": "billing_out_element_quantity_discount", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_price_single_net": { - "name": "billing_element_price_single_net", + "billing_out_element_price_single_net": { + "name": "billing_out_element_price_single_net", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_price_total_net": { - "name": "billing_element_price_total_net", + "billing_out_element_price_total_net": { + "name": "billing_out_element_price_total_net", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_tax_price": { - "name": "billing_element_tax_price", + "billing_out_element_tax_price": { + "name": "billing_out_element_tax_price", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_tax_type": { - "name": "billing_element_tax_type", + "billing_out_element_tax_type": { + "name": "billing_out_element_tax_type", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_tax_percentage": { - "name": "billing_element_tax_percentage", + "billing_out_element_tax_percentage": { + "name": "billing_out_element_tax_percentage", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_price_single_gross": { - "name": "billing_element_price_single_gross", + "billing_out_element_price_single_gross": { + "name": "billing_out_element_price_single_gross", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_price_total_gross": { - "name": "billing_element_price_total_gross", + "billing_out_element_price_total_gross": { + "name": "billing_out_element_price_total_gross", "type": "INT", - "null": false + "null": true, + "default": null }, - "billing_element_invoice": { - "name": "billing_element_invoice", + "billing_out_element_bill": { + "name": "billing_out_element_bill", "type": "INT", "null": false, - "foreignTable": "billing_invoice", - "foreignKey": "billing_invoice_id" + "foreignTable": "billing_out", + "foreignKey": "billing_out_id" }, - "billing_element_promotion": { - "name": "billing_element_promotion", + "billing_out_element_promotion": { + "name": "billing_out_element_promotion", "type": "INT", "default": null, "null": true }, - "billing_element_event": { - "name": "billing_element_event", + "billing_out_element_event": { + "name": "billing_out_element_event", "type": "INT", "default": null, "null": true diff --git a/Admin/Installer.php b/Admin/Installer.php index 01252d2..55a31b0 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -14,7 +14,15 @@ declare(strict_types=1); namespace Modules\Billing\Admin; +use Modules\Billing\Models\BillType; +use Modules\Billing\Models\BillTypeMapper; +use Modules\Billing\Models\BillTypeL11n; +use Modules\Billing\Models\BillTypeL11nMapper; +use phpOMS\Config\SettingsInterface; +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Localization\ISO639x1Enum; use phpOMS\Module\InstallerAbstract; +use phpOMS\Module\ModuleInfo; /** * Installer class. @@ -26,4 +34,51 @@ use phpOMS\Module\InstallerAbstract; */ final class Installer extends InstallerAbstract { + /** + * {@inheritdoc} + */ + public static function install(DatabasePool $dbPool, ModuleInfo $info, SettingsInterface $cfgHandler) : void + { + parent::install($dbPool, $info, $cfgHandler); + + self::createBillTypes(); + } + + /** + * Install default bill types + * + * @return BillType[] + * + * @since 1.0.0 + */ + private static function createBillTypes() : array + { + $billType = []; + + $billType['offer'] = new BillType('Offer'); + BillTypeMapper::create($billType['offer']); + BillTypeL11nMapper::create(new BillTypeL11n($billType['offer']->getId(), 'Angebot', ISO639x1Enum::_DE)); + + $billType['order_confirmation'] = new BillType('Order Confirmation'); + BillTypeMapper::create($billType['order_confirmation']); + BillTypeL11nMapper::create(new BillTypeL11n($billType['order_confirmation']->getId(), 'Auftragsbestaetigung', ISO639x1Enum::_DE)); + + $billType['delivery_note'] = new BillType('Delivery Note'); + BillTypeMapper::create($billType['delivery_note']); + BillTypeL11nMapper::create(new BillTypeL11n($billType['delivery_note']->getId(), 'Lieferschein', ISO639x1Enum::_DE)); + + $billType['invoice'] = new BillType('Invoice'); + BillTypeMapper::create($billType['invoice']); + BillTypeL11nMapper::create(new BillTypeL11n($billType['invoice']->getId(), 'Rechnung', ISO639x1Enum::_DE)); + + $billType['credit_note'] = new BillType('Credit Note'); + BillTypeMapper::create($billType['credit_note']); + BillTypeL11nMapper::create(new BillTypeL11n($billType['credit_note']->getId(), 'Rechnungskorrektur', ISO639x1Enum::_DE)); + + $billType['reverse_invoice'] = new BillType('Credit Note'); + BillTypeMapper::create($billType['reverse_invoice']); + BillTypeL11nMapper::create(new BillTypeL11n($billType['reverse_invoice']->getId(), 'Gutschrift', ISO639x1Enum::_DE)); + + return $billType; + } } diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 3349b9a..e5c4ab9 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -28,6 +28,17 @@ return [ ], ], ], + '^.*/sales/invoice\?.*$' => [ + [ + 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoice', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::SALES_INVOICE, + ], + ], + ], '^.*/purchase/invoice/create.*$' => [ [ 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate', diff --git a/Controller/ApiController.php b/Controller/ApiController.php new file mode 100644 index 0000000..ddc4a2d --- /dev/null +++ b/Controller/ApiController.php @@ -0,0 +1,191 @@ +validateBillCreate($request))) { + $response->set($request->uri->__toString(), new FormValidation($val)); + $response->header->status = RequestStatusCode::R_400; + + return; + } + + $bill = $this->createBillFromRequest($request, $response, $data); + $this->createModel($request->header->account, $bill, BillMapper::class, 'bill', $request->getOrigin()); + $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Bill', 'Bill successfully created.', $bill); + } + + /** + * Method to create a wiki entry from request. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return Bill + * + * @since 1.0.0 + */ + public function createBillFromRequest(RequestAbstract $request, ResponseAbstract $response, $data = null) : Bill + { + $bill = new Bill(); + $bill->setCreatedBy(new NullAccount($request->header->account)); + $bill->type = new NullBillType((int) $request->getData('type')); + $bill->client = new NullClient((int) $request->getData('client')); + + return $bill; + } + + /** + * Method to validate wiki entry creation from request + * + * @param RequestAbstract $request Request + * + * @return array + * + * @since 1.0.0 + */ + private function validateBillCreate(RequestAbstract $request) : array + { + $val = []; + /*if (($val['title'] = empty($request->getData('title'))) + || ($val['plain'] = empty($request->getData('plain'))) + || ($val['status'] = ( + $request->getData('status') !== null + && !WikiStatus::isValidValue((int) $request->getData('status')) + )) + ) { + return $val; + }*/ + + return []; + } + + /** + * Api method to create a wiki entry + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return void + * + * @api + * + * @since 1.0.0 + */ + public function apiBillElementCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + { + if (!empty($val = $this->validateBillElementCreate($request))) { + $response->set($request->uri->__toString(), new FormValidation($val)); + $response->header->status = RequestStatusCode::R_400; + + return; + } + + $element = $this->createBillElementFromRequest($request, $response, $data); + $this->createModel($request->header->account, $element, BillElementMapper::class, 'bill_element', $request->getOrigin()); + $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Bill element', 'Bill element successfully created.', $element); + } + + /** + * Method to create a wiki entry from request. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return BillElement + * + * @since 1.0.0 + */ + public function createBillElementFromRequest(RequestAbstract $request, ResponseAbstract $response, $data = null) : BillElement + { + $element = new BillElement(); + $element->bill = (int) $request->getData('bill'); + $element->item = $request->getData('item', 'int'); + + if ($element->item !== null) { + $item = ItemMapper::withConditional('language', $response->getLanguage())::get($element->item); + // @todo: which item name should be stored in the database? server language (problem for international company with subsidiaries)? customer default language/customer invoice language? + $element->itemNumber = $item->number; + $element->itemName = $item->getL11n('name1')->description; + $element->quantity = $request->getData('quantity', 'int');; + } + + return $element; + } + + /** + * Method to validate wiki entry creation from request + * + * @param RequestAbstract $request Request + * + * @return array + * + * @since 1.0.0 + */ + private function validateBillElementCreate(RequestAbstract $request) : array + { + $val = []; + if (($val['bill'] = empty($request->getData('bill'))) + ) { + return $val; + } + + return []; + } +} diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 88af7b3..e99e471 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,10 +14,14 @@ declare(strict_types=1); namespace Modules\Billing\Controller; +use Modules\Billing\Models\BillMapper; use phpOMS\Contract\RenderableInterface; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; use phpOMS\Views\View; +use Modules\Billing\Models\BillType; +use Modules\Billing\Models\BillTypeL11n; +use phpOMS\DataStorage\Database\RelationType; /** * Billing class. @@ -44,9 +48,51 @@ final class BackendController extends Controller public function viewBillingInvoiceList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); - $view->setTemplate('/Modules/Billing/Theme/Backend/invoice-list'); + $view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill-list'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response)); + if ($request->getData('ptype') === 'p') { + $view->setData('bills', + BillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + ::getBeforePivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 4) + ); + } elseif ($request->getData('ptype') === 'n') { + $view->setData('bills', + BillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + ::getAfterPivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 4) + ); + } else { + $view->setData('bills', + BillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + ::getAfterPivot(0, limit: 25, depth: 4) + ); + } + + return $view; + } + + /** + * Routing end-point for application behaviour. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewBillingInvoice(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app->l11nManager, $request, $response); + $view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response)); + + $bill = BillMapper::get((int) $request->getData('id')); + + $view->setData('bill', $bill); + return $view; } diff --git a/Models/Invoice.php b/Models/Bill.php similarity index 92% rename from Models/Invoice.php rename to Models/Bill.php index 7b3d6ba..7f3b799 100644 --- a/Models/Invoice.php +++ b/Models/Bill.php @@ -14,18 +14,20 @@ declare(strict_types=1); namespace Modules\Billing\Models; +use Modules\Admin\Models\Account; +use Modules\Admin\Models\NullAccount; use phpOMS\Localization\ISO4217CharEnum; use phpOMS\Localization\Money; /** - * Invoice class. + * Bill class. * * @package Modules\Billing\Models * @license OMS License 1.0 * @link https://orange-management.org * @since 1.0.0 */ -class Invoice implements \JsonSerializable +class Bill implements \JsonSerializable { /** * ID. @@ -44,40 +46,46 @@ class Invoice implements \JsonSerializable private string $number = ''; /** - * Invoice type. + * Bill type. + * + * @var int|BillType + * @since 1.0.0 + */ + public int|BillType $type = 0; + + /** + * Bill status. * * @var int * @since 1.0.0 */ - private int $type = InvoiceType::BILL; + private int $status = BillStatus::DRAFT; /** - * Invoice status. - * - * @var int - * @since 1.0.0 - */ - private int $status = InvoiceStatus::DRAFT; - - /** - * Invoice created at. + * Bill created at. * * @var \DateTime * @since 1.0.0 */ - private \DateTime $createdAt; + public \DateTimeImmutable $createdAt; /** - * Invoice send at. + * Bill send at. * * @var null|\DateTime * @since 1.0.0 */ private ?\DateTime $send = null; - private $createdBy = 0; + /** + * Creator. + * + * @var Account + * @since 1.0.0 + */ + public Account $createdBy; - private $client = 0; + public $client = 0; /** * Receiver. @@ -181,19 +189,17 @@ class Invoice implements \JsonSerializable * @var int * @since 1.0.0 */ - private int $referer = 0; + private $referral; - private $refererName = ''; + private $referralName = ''; - private $taxId = ''; + public ?Money $net = null; - private $insurance = null; + public ?Money $gross = null; - private $freight = null; + public ?Money $costs = null; - private $net = null; - - private $gross = null; + public ?Money $profit = null; private $currency = ISO4217CharEnum::_EUR; @@ -218,7 +224,7 @@ class Invoice implements \JsonSerializable private $elements = []; /** - * Reference to other invoice (delivery note/credit note etc). + * Reference to other Bill (delivery note/credit note etc). * * @var int * @since 1.0.0 @@ -232,12 +238,40 @@ class Invoice implements \JsonSerializable */ public function __construct() { - $this->insurance = new Money(); - $this->freight = new Money(); - $this->net = new Money(); - $this->gross = new Money(); + $this->net = new Money(0); + $this->gross = new Money(0); + $this->costs = new Money(0); + $this->profit = new Money(0); - $this->createdAt = new \DateTime(); + $this->createdAt = new \DateTimeImmutable(); + $this->createdBy = new NullAccount(); + $this->referer = new NullAccount(); + } + + /** + * Get created by + * + * @return Account + * + * @since 1.0.0 + */ + public function getCreatedBy() : Account + { + return $this->createdBy; + } + + /** + * Set created by + * + * @param Account $account Created by + * + * @return void + * + * @since 1.0.0 + */ + public function setCreatedBy(Account $account) : void + { + $this->createdBy = $account; } /** @@ -253,7 +287,7 @@ class Invoice implements \JsonSerializable } /** - * Get invoice number. + * Get Bill number. * * @return string * @@ -265,9 +299,9 @@ class Invoice implements \JsonSerializable } /** - * Set invoice number. + * Set Bill number. * - * @param string $number Invoice number + * @param string $number Bill number * * @return void * @@ -368,32 +402,6 @@ class Invoice implements \JsonSerializable return $this->send; } - /** - * Get created by - * - * @return int|\phpOMS\Account\Account - * - * @since 1.0.0 - */ - public function getCreatedBy() - { - return $this->createdBy; - } - - /** - * Set creator. - * - * @param int $creator Creator - * - * @return void - * - * @since 1.0.0 - */ - public function setCreatedBy(int $creator) : void - { - $this->createdBy = $creator; - } - /** * Get client. * @@ -1149,7 +1157,7 @@ class Invoice implements \JsonSerializable } /** - * Get invoice elements. + * Get Bill elements. * * @return array * @@ -1161,9 +1169,9 @@ class Invoice implements \JsonSerializable } /** - * Add invoice element. + * Add Bill element. * - * @param mixed $element Invoice element + * @param mixed $element Bill element * * @return void * diff --git a/Models/InvoiceElement.php b/Models/BillElement.php similarity index 97% rename from Models/InvoiceElement.php rename to Models/BillElement.php index 6b1a1e1..55b5072 100644 --- a/Models/InvoiceElement.php +++ b/Models/BillElement.php @@ -17,14 +17,14 @@ namespace Modules\Billing\Models; use phpOMS\Localization\Money; /** - * Invoice class. + * Bill class. * * @package Modules\Billing\Models * @license OMS License 1.0 * @link https://orange-management.org * @since 1.0.0 */ -class InvoiceElement implements \JsonSerializable +class BillElement implements \JsonSerializable { /** * ID. @@ -34,15 +34,17 @@ class InvoiceElement implements \JsonSerializable */ protected int $id = 0; - private $order = 0; + private int $order = 0; - private $item = 0; + public $item = null; - private $itemName = ''; + public string $itemNumber = ''; - private $itemDescription = ''; + public string $itemName = ''; - private $quantity = 0; + public string $itemDescription = ''; + + public int|float $quantity = 0; private $singlePrice = null; @@ -72,7 +74,7 @@ class InvoiceElement implements \JsonSerializable private $promotion = 0; - private $invoice = 0; + public $bill = 0; /** * Get id. diff --git a/Models/BillElementMapper.php b/Models/BillElementMapper.php new file mode 100644 index 0000000..4be3f86 --- /dev/null +++ b/Models/BillElementMapper.php @@ -0,0 +1,75 @@ + + * @since 1.0.0 + */ + protected static array $columns = [ + 'billing_out_element_id' => ['name' => 'billing_out_element_id', 'type' => 'int', 'internal' => 'id'], + 'billing_out_element_order' => ['name' => 'billing_out_element_order', 'type' => 'int', 'internal' => 'order'], + 'billing_out_element_item' => ['name' => 'billing_out_element_item', 'type' => 'int', 'internal' => 'item'], + 'billing_out_element_item_number' => ['name' => 'billing_out_element_item_number', 'type' => 'string', 'internal' => 'itemNumber'], + 'billing_out_element_item_name' => ['name' => 'billing_out_element_item_name', 'type' => 'string', 'internal' => 'itemName'], + 'billing_out_element_item_desc' => ['name' => 'billing_out_element_item_desc', 'type' => 'string', 'internal' => 'itemDescription'], + 'billing_out_element_quantity' => ['name' => 'billing_out_element_quantity', 'type' => 'int', 'internal' => 'quantity'], + 'billing_out_element_bill' => ['name' => 'billing_out_element_bill', 'type' => 'int', 'internal' => 'bill'], + ]; + + /** + * Belongs to. + * + * @var array + * @since 1.0.0 + */ + protected static array $belongsTo = [ + 'bill' => [ + 'mapper' => BillMapper::class, + 'external' => 'billing_out_element_bill', + ], + ]; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + protected static string $primaryField = 'billing_out_element_id'; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + protected static string $table = 'billing_out_element'; +} diff --git a/Models/BillMapper.php b/Models/BillMapper.php new file mode 100644 index 0000000..fb42f91 --- /dev/null +++ b/Models/BillMapper.php @@ -0,0 +1,138 @@ + + * @since 1.0.0 + */ + protected static array $columns = [ + 'billing_out_id' => ['name' => 'billing_out_id', 'type' => 'int', 'internal' => 'id'], + 'billing_out_number' => ['name' => 'billing_out_number', 'type' => 'string', 'internal' => 'number'], + 'billing_out_type' => ['name' => 'billing_out_type', 'type' => 'int', 'internal' => 'type'], + 'billing_out_info' => ['name' => 'billing_out_info', 'type' => 'string', 'internal' => 'info'], + 'billing_out_status' => ['name' => 'billing_out_status', 'type' => 'int', 'internal' => 'status'], + 'billing_out_shipTo' => ['name' => 'billing_out_shipTo', 'type' => 'string', 'internal' => 'shipTo'], + 'billing_out_shipFAO' => ['name' => 'billing_out_shipFAO', 'type' => 'string', 'internal' => 'shipFAO'], + 'billing_out_shipAddr' => ['name' => 'billing_out_shipAddr', 'type' => 'string', 'internal' => 'shipAddress'], + 'billing_out_shipCity' => ['name' => 'billing_out_shipCity', 'type' => 'string', 'internal' => 'shipCity'], + 'billing_out_shipZip' => ['name' => 'billing_out_shipZip', 'type' => 'string', 'internal' => 'shipZip'], + 'billing_out_shipCountry' => ['name' => 'billing_out_shipCountry', 'type' => 'string', 'internal' => 'shipCountry'], + 'billing_out_billTo' => ['name' => 'billing_out_billTo', 'type' => 'string', 'internal' => 'billTo'], + 'billing_out_billFAO' => ['name' => 'billing_out_billFAO', 'type' => 'string', 'internal' => 'billFAO'], + 'billing_out_billAddr' => ['name' => 'billing_out_billAddr', 'type' => 'string', 'internal' => 'billAddress'], + 'billing_out_billCity' => ['name' => 'billing_out_billCity', 'type' => 'string', 'internal' => 'billCity'], + 'billing_out_billZip' => ['name' => 'billing_out_billZip', 'type' => 'string', 'internal' => 'billZip'], + 'billing_out_billCountry' => ['name' => 'billing_out_billCountry', 'type' => 'string', 'internal' => 'billCountry'], + 'billing_out_gross' => ['name' => 'billing_out_gross', 'type' => 'Serializable', 'internal' => 'gross'], + 'billing_out_net' => ['name' => 'billing_out_net', 'type' => 'Serializable', 'internal' => 'net'], + 'billing_out_costs' => ['name' => 'billing_out_costs', 'type' => 'Serializable', 'internal' => 'costs'], + 'billing_out_profit' => ['name' => 'billing_out_profit', 'type' => 'Serializable', 'internal' => 'profit'], + 'billing_out_currency' => ['name' => 'billing_out_currency', 'type' => 'int', 'internal' => 'currency'], + 'billing_out_referral' => ['name' => 'billing_out_referral', 'type' => 'int', 'internal' => 'referral'], + 'billing_out_referral_name' => ['name' => 'billing_out_referral_name', 'type' => 'string', 'internal' => 'referralName'], + 'billing_out_reference' => ['name' => 'billing_out_reference', 'type' => 'int', 'internal' => 'reference'], + 'billing_out_payment' => ['name' => 'billing_out_payment', 'type' => 'int', 'internal' => 'payment'], + 'billing_out_payment_text' => ['name' => 'billing_out_payment_text', 'type' => 'string', 'internal' => 'paymentText'], + 'billing_out_paymentterms' => ['name' => 'billing_out_paymentterms', 'type' => 'int', 'internal' => 'terms'], + 'billing_out_paymentterms_text' => ['name' => 'billing_out_paymentterms_text', 'type' => 'string', 'internal' => 'termsText'], + 'billing_out_ship_type' => ['name' => 'billing_out_ship_type', 'type' => 'int', 'internal' => 'shipping'], + 'billing_out_ship_text' => ['name' => 'billing_out_ship_text', 'type' => 'string', 'internal' => 'shippingText'], + 'billing_out_client' => ['name' => 'billing_out_client', 'type' => 'int', 'internal' => 'client'], + 'billing_out_created_by' => ['name' => 'billing_out_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], + 'billing_out_created_at' => ['name' => 'billing_out_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], + ]; + + /** + * Has many relation. + * + * @var array + * @since 1.0.0 + */ + protected static array $hasMany = [ + 'elements' => [ + 'mapper' => BillElementMapper::class, + 'table' => 'billing_out_element', + 'self' => 'billing_out_element_bill', + 'external' => null, + ], + ]; + + /** + * Has one relation. + * + * @var array + * @since 1.0.0 + */ + protected static array $ownsOne = [ + 'type' => [ + 'mapper' => BillTypeMapper::class, + 'external' => 'billing_out_type', + ], + 'referral' => [ + 'mapper' => AccountMapper::class, + 'external' => 'billing_out_referral', + ], + ]; + + /** + * Belongs to. + * + * @var array + * @since 1.0.0 + */ + protected static array $belongsTo = [ + 'createdBy' => [ + 'mapper' => AccountMapper::class, + 'external' => 'billing_out_created_by', + ], + 'client' => [ + 'mapper' => ClientMapper::class, + 'external' => 'billing_out_client', + ], + ]; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + protected static string $primaryField = 'billing_out_id'; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + protected static string $table = 'billing_out'; +} diff --git a/Models/InvoiceStatus.php b/Models/BillStatus.php similarity index 93% rename from Models/InvoiceStatus.php rename to Models/BillStatus.php index c397827..7037ec4 100644 --- a/Models/InvoiceStatus.php +++ b/Models/BillStatus.php @@ -24,7 +24,7 @@ use phpOMS\Stdlib\Base\Enum; * @link https://orange-management.org * @since 1.0.0 */ -abstract class InvoiceStatus extends Enum +abstract class BillStatus extends Enum { public const ACTIVE = 1; public const ARCHIVED = 2; diff --git a/Models/BillType.php b/Models/BillType.php new file mode 100644 index 0000000..b51609f --- /dev/null +++ b/Models/BillType.php @@ -0,0 +1,100 @@ +setL11n($name); + } + + /** + * Get id + * + * @return int + * + * @since 1.0.0 + */ + public function getId() : int + { + return $this->id; + } + + /** + * Set l11n + * + * @param string|BillTypeL11n $l11n Tag article l11n + * @param string $lang Language + * + * @return void + * + * @since 1.0.0 + */ + public function setL11n($l11n, string $lang = ISO639x1Enum::_EN) : void + { + if ($l11n instanceof BillTypeL11n) { + $this->l11n = $l11n; + } elseif ($this->l11n instanceof BillTypeL11n && \is_string($l11n)) { + $this->l11n->name = $l11n; + } elseif (\is_string($l11n)) { + $this->l11n = new BillTypeL11n(); + $this->l11n->name = $l11n; + $this->l11n->setLanguage($lang); + } + } + + /** + * @return string + * + * @since 1.0.0 + */ + public function getL11n() : string + { + return $this->l11n instanceof BillTypeL11n ? $this->l11n->name : $this->l11n; + } +} diff --git a/Models/BillTypeL11n.php b/Models/BillTypeL11n.php new file mode 100644 index 0000000..12838dd --- /dev/null +++ b/Models/BillTypeL11n.php @@ -0,0 +1,162 @@ +type = $type; + $this->name = $name; + $this->language = $language; + } + + /** + * Get id + * + * @return int + * + * @since 1.0.0 + */ + public function getId() : int + { + return $this->id; + } + + /** + * Set type. + * + * @param int $type Type id + * + * @return void + * + * @since 1.0.0 + */ + public function setBillType(int $type) : void + { + $this->type = $type; + } + + /** + * Get type + * + * @return int + * + * @since 1.0.0 + */ + public function getType() : int + { + return $this->type; + } + + /** + * Get language + * + * @return string + * + * @since 1.0.0 + */ + public function getLanguage() : string + { + return $this->language; + } + + /** + * Set language + * + * @param string $language Language + * + * @return void + * + * @since 1.0.0 + */ + public function setLanguage(string $language) : void + { + $this->language = $language; + } + + /** + * {@inheritdoc} + */ + public function toArray() : array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'type' => $this->type, + 'language' => $this->language, + ]; + } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() + { + return $this->toArray(); + } +} diff --git a/Models/BillTypeL11nMapper.php b/Models/BillTypeL11nMapper.php new file mode 100644 index 0000000..89938e4 --- /dev/null +++ b/Models/BillTypeL11nMapper.php @@ -0,0 +1,57 @@ + + * @since 1.0.0 + */ + protected static array $columns = [ + 'billing_type_l11n_id' => ['name' => 'billing_type_l11n_id', 'type' => 'int', 'internal' => 'id'], + 'billing_type_l11n_name' => ['name' => 'billing_type_l11n_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], + 'billing_type_l11n_type' => ['name' => 'billing_type_l11n_type', 'type' => 'int', 'internal' => 'type'], + 'billing_type_l11n_language' => ['name' => 'billing_type_l11n_language', 'type' => 'string', 'internal' => 'language'], + ]; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + protected static string $table = 'billing_type_l11n'; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + protected static string $primaryField = 'billing_type_l11n_id'; +} diff --git a/Models/BillTypeMapper.php b/Models/BillTypeMapper.php new file mode 100644 index 0000000..9d3ae5a --- /dev/null +++ b/Models/BillTypeMapper.php @@ -0,0 +1,94 @@ + + * @since 1.0.0 + */ + protected static array $columns = [ + 'billing_type_id' => ['name' => 'billing_type_id', 'type' => 'int', 'internal' => 'id'], + ]; + + /** + * Has many relation. + * + * @var array + * @since 1.0.0 + */ + protected static array $hasMany = [ + 'l11n' => [ + 'mapper' => BillTypeL11nMapper::class, + 'table' => 'billing_type_l11n', + 'self' => 'billing_type_l11n_type', + 'column' => 'name', + 'conditional' => true, + 'external' => null, + ], + ]; + + /** + * Belongs to. + * + * @var array + * @since 1.0.0 + */ + /* + protected static array $belongsTo = [ + 'owner' => [ + 'mapper' => AccountMapper::class, + 'external' => 'billing_type_owner', + ], + ]; + */ + + /** + * Model to use by the mapper. + * + * @var string + * @since 1.0.0 + */ + protected static string $model = BillType::class; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + protected static string $table = 'billing_type'; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + protected static string $primaryField = 'billing_type_id'; +} diff --git a/Models/InvoiceMapper.php b/Models/InvoiceMapper.php deleted file mode 100644 index e78f4ee..0000000 --- a/Models/InvoiceMapper.php +++ /dev/null @@ -1,44 +0,0 @@ -id = $id; + parent::__construct(); + } } diff --git a/Theme/Backend/invoice-create.tpl.php b/Theme/Backend/invoice-create.tpl.php index 3a156f1..c8578c6 100644 --- a/Theme/Backend/invoice-create.tpl.php +++ b/Theme/Backend/invoice-create.tpl.php @@ -135,22 +135,22 @@ echo $this->getData('nav')->render(); ?> - getHtml('Item') ?> - getHtml('Variation') ?> - getHtml('Name') ?> - getHtml('Quantity') ?> - getHtml('Discount') ?> - getHtml('DiscountP') ?> - getHtml('Bonus') ?> - getHtml('Tax') ?> - getHtml('Net') ?> + getHtml('Item'); ?> + getHtml('Variation'); ?> + getHtml('Name'); ?> + getHtml('Quantity'); ?> + getHtml('Discount'); ?> + getHtml('DiscountP'); ?> + getHtml('Bonus'); ?> + getHtml('Tax'); ?> + getHtml('Net'); ?> - getHtml('Freightage') ?>: 0.00 - - getHtml('Net') ?>: 0.00 - - getHtml('Tax') ?>: 0.00 - - getHtml('Total') ?>: 0.00 + getHtml('Freightage'); ?>: 0.00 - + getHtml('Net'); ?>: 0.00 - + getHtml('Tax'); ?>: 0.00 - + getHtml('Total'); ?>: 0.00 @@ -215,15 +215,15 @@ echo $this->getData('nav')->render(); ?>
-

getHtml('Media') ?>

+

getHtml('Media'); ?>

-
-
-
+
+
+
@@ -249,9 +249,9 @@ echo $this->getData('nav')->render(); ?> IP getHtml('ID', '0', '0'); ?> - getHtml('Name') ?> - getHtml('Log') ?> - getHtml('Date') ?> + getHtml('Name'); ?> + getHtml('Log'); ?> + getHtml('Date'); ?> diff --git a/Theme/Backend/invoice-list.tpl.php b/Theme/Backend/invoice-list.tpl.php deleted file mode 100644 index 5155519..0000000 --- a/Theme/Backend/invoice-list.tpl.php +++ /dev/null @@ -1,51 +0,0 @@ -l11nManager, $this->request, $this->response); -$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); -$footerView->setPages(20); -$footerView->setPage(1); - -echo $this->getData('nav')->render(); ?> - -
-
-
- - - - - - - - $value) : ++$count; ?> - - -
getHtml('Invoices'); ?>
getHtml('ID', '0', '0'); ?> - getHtml('Type') ?> - getHtml('ClientID') ?> - getHtml('Client') ?> - getHtml('Net') ?> - getHtml('Gross') ?> - getHtml('Created') ?> - getHtml('Due') ?> -
-
getHtml('Empty', '0', '0'); ?> - -
-
-
-
- diff --git a/Theme/Backend/invoice-single.tpl.php b/Theme/Backend/invoice-single.tpl.php deleted file mode 100644 index 52f46d5..0000000 --- a/Theme/Backend/invoice-single.tpl.php +++ /dev/null @@ -1,18 +0,0 @@ -getData('nav')->render(); diff --git a/Theme/Backend/purchase-invoice-list.tpl.php b/Theme/Backend/purchase-invoice-list.tpl.php index 195f497..419bfd0 100644 --- a/Theme/Backend/purchase-invoice-list.tpl.php +++ b/Theme/Backend/purchase-invoice-list.tpl.php @@ -28,13 +28,13 @@ echo $this->getData('nav')->render(); ?> getHtml('ID', '0', '0'); ?> - getHtml('Type') ?> - getHtml('SupplierID') ?> - getHtml('Supplier') ?> - getHtml('Net') ?> - getHtml('Gross') ?> - getHtml('Created') ?> - getHtml('Due') ?> + getHtml('Type'); ?> + getHtml('SupplierID'); ?> + getHtml('Supplier'); ?> + getHtml('Net'); ?> + getHtml('Gross'); ?> + getHtml('Created'); ?> + getHtml('Due'); ?> diff --git a/Theme/Backend/sales-bill-list.tpl.php b/Theme/Backend/sales-bill-list.tpl.php new file mode 100644 index 0000000..52c131a --- /dev/null +++ b/Theme/Backend/sales-bill-list.tpl.php @@ -0,0 +1,66 @@ +getData('bills') ?? []; + +echo $this->getData('nav')->render(); ?> + +
+
+
+
getHtml('Invoices'); ?>
+ + + + + $value) : + ++$count; + $url = UriFactory::build('{/prefix}sales/invoice?{?}&id=' . $value->getId()); + ?> + +
getHtml('Id', '', ''); ?> + getHtml('Type'); ?> + getHtml('ClientID'); ?> + getHtml('Client'); ?> + getHtml('Address'); ?> + getHtml('Postal'); ?> + getHtml('City'); ?> + getHtml('Country'); ?> + getHtml('Net'); ?> + getHtml('Gross'); ?> + getHtml('Profit'); ?> + getHtml('Created'); ?> +
getId(); ?> + type->getL11n(); ?> + client->number; ?> + printHtml($value->client->profile->account->name3 . ' ' . $value->client->profile->account->name2 . ' ' . $value->client->profile->account->name1); ?> + client->mainAddress->address; ?> + client->mainAddress->postal; ?> + client->mainAddress->city; ?> + client->mainAddress->getCountry(); ?> + net->getCurrency(); ?> + gross->getCurrency(); ?> + profit->getCurrency(); ?> + createdAt->format('Y-m-d'); ?> + + +
getHtml('Empty', '0', '0'); ?> + +
+
+
+
+ diff --git a/Theme/Backend/sales-bill.tpl.php b/Theme/Backend/sales-bill.tpl.php new file mode 100644 index 0000000..5b898f1 --- /dev/null +++ b/Theme/Backend/sales-bill.tpl.php @@ -0,0 +1,287 @@ +getData('bill'); +$elements = $bill->getElements(); + +echo $this->getData('nav')->render(); ?> + +
+
+ +
+
+ +
+
+
+
+
+
getHtml('Invoice'); ?>
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

getHtml('Invoice'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

getHtml('Delivery'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
getHtml('Invoice'); ?>
+ + + + + + + +
+ getHtml('Item'); ?> + getHtml('Variation'); ?> + getHtml('Name'); ?> + getHtml('Quantity'); ?> + getHtml('Discount'); ?> + getHtml('DiscountP'); ?> + getHtml('Bonus'); ?> + getHtml('Tax'); ?> + getHtml('Net'); ?> +
+ + + + + + + + + + +
+ + + + + + + + + +
+
+ getHtml('Freightage'); ?>: 0.00 - + getHtml('Net'); ?>: 0.00 - + getHtml('Tax'); ?>: 0.00 - + getHtml('Total'); ?>: 0.00 +
+
+
+
+
+ +
+
+ +
+
+
+
+

getHtml('Payment'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+

getHtml('Media'); ?>

+ +
+
+ + +
+
+
+
+
+
+
+
+
+
+
+ +
+ l11nManager, $this->request, $this->response); + $footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); + $footerView->setPages(20); + $footerView->setPage(1); + ?> +
+
+
+ + + + + + + + +
getHtml('Logs'); ?>
IP + getHtml('ID', '0', '0'); ?> + getHtml('Name'); ?> + getHtml('Log'); ?> + getHtml('Date'); ?> +
+
printHtml($this->request->getOrigin()); ?> + printHtml((string) $this->request->header->account); ?> + printHtml((string) $this->request->header->account); ?> + Create Invoice + printHtml((new \DateTime('now'))->format('Y-m-d H:i:s')); ?> +
+
+
+
+
+
+
+