From a725ccbaab7063586754205e328af259be878c32 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 19 Mar 2017 15:51:26 +0100 Subject: [PATCH] Unit test fixes and invoice impl. started --- Admin/Install/ItemReference.php | 52 ---- Admin/Installer.php | 111 ++++--- Models/Invoice.php | 521 ++++++++++++++++++++++++++++++++ Models/InvoiceElement.php | 280 +++++++++++++++++ Models/InvoiceMapper.php | 0 Models/InvoiceStatus.php | 37 +++ Models/InvoiceType.php | 40 +++ info.json | 3 +- 8 files changed, 950 insertions(+), 94 deletions(-) delete mode 100644 Admin/Install/ItemReference.php create mode 100644 Models/Invoice.php create mode 100644 Models/InvoiceElement.php create mode 100644 Models/InvoiceMapper.php create mode 100644 Models/InvoiceStatus.php create mode 100644 Models/InvoiceType.php diff --git a/Admin/Install/ItemReference.php b/Admin/Install/ItemReference.php deleted file mode 100644 index 14a8a31..0000000 --- a/Admin/Install/ItemReference.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -declare(strict_types=1); -namespace Modules\Billing\Admin\Install; - -use phpOMS\DataStorage\Database\DatabaseType; -use phpOMS\DataStorage\Database\DatabasePool; - -/** - * Media addition class. - * - * @category Modules - * @package Modules\Admin - * @author OMS Development Team - * @author Dennis Eichhorn - * @license OMS License 1.0 - * @link http://orange-management.com - * @since 1.0.0 - */ -class ItemReference -{ - - /** - * {@inheritdoc} - */ - public static function install(string $path, DatabasePool $dbPool, InfoManager $info) - { - - switch ($dbPool->get('core')->getType()) { - case DatabaseType::MYSQL: - $dbPool->get('core')->con->prepare( - 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'billing_invoice_element` - ADD KEY `billing_invoice_element_article` (`billing_invoice_element_article`), - ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'billing_invoice_element_ibfk_2` FOREIGN KEY (`billing_invoice_element_article`) REFERENCES `' . $dbPool->get('core')->prefix . 'itemreference` (`itemreference_id`);' - )->execute(); - break; - } - } -} diff --git a/Admin/Installer.php b/Admin/Installer.php index 9b9af20..521463d 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -47,35 +47,52 @@ class Installer extends InstallerAbstract $dbPool->get('core')->con->prepare( 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'billing_invoice` ( `billing_invoice_id` int(11) NOT NULL AUTO_INCREMENT, - `billing_invoice_status` tinyint(2) DEFAULT NULL, - `billing_invoice_shipTo` varchar(50) DEFAULT NULL, - `billing_invoice_shipFAO` varchar(30) DEFAULT NULL, - `billing_invoice_shipAddr` varchar(50) DEFAULT NULL, - `billing_invoice_shipCity` varchar(20) DEFAULT NULL, - `billing_invoice_shipZip` varchar(20) DEFAULT NULL, - `billing_invoice_shipCountry` varchar(30) DEFAULT NULL, - `billing_invoice_billTo` varchar(50) DEFAULT NULL, - `billing_invoice_billFAO` varchar(30) DEFAULT NULL, - `billing_invoice_billAddr` varchar(50) DEFAULT NULL, - `billing_invoice_billCity` varchar(20) DEFAULT NULL, - `billing_invoice_billZip` varchar(20) DEFAULT NULL, - `billing_invoice_billCountry` varchar(30) DEFAULT NULL, - `billing_invoice_type` tinyint(2) DEFAULT NULL, - `billing_invoice_created` datetime DEFAULT NULL, - `billing_invoice_shippdate` datetime DEFAULT NULL, - `billing_invoice_printed` datetime DEFAULT NULL, - `billing_invoice_price` decimal(9,2) DEFAULT NULL, - `billing_invoice_currency` varchar(3) DEFAULT NULL, - `billing_invoice_freightage` decimal(9,2) DEFAULT NULL, + `billing_invoice_number` varchar(255) DEFAULT NULL, `billing_invoice_info` text DEFAULT NULL, - `billing_invoice_voucher` int(11) DEFAULT NULL, - `billing_invoice_promotion` int(11) DEFAULT NULL, - `billing_invoice_creator` int(11) NOT NULL, + `billing_invoice_status` tinyint(2) DEFAULT NULL, + `billing_invoice_type` tinyint(2) DEFAULT NULL, `billing_invoice_client` int(11) NOT NULL, + + `billing_invoice_shipTo` varchar(255) DEFAULT NULL, + `billing_invoice_shipFAO` varchar(255) DEFAULT NULL, + `billing_invoice_shipAddr` varchar(255) DEFAULT NULL, + `billing_invoice_shipCity` varchar(255) DEFAULT NULL, + `billing_invoice_shipZip` varchar(20) DEFAULT NULL, + `billing_invoice_shipCountry` varchar(255) DEFAULT NULL, + + `billing_invoice_billTo` varchar(255) DEFAULT NULL, + `billing_invoice_billFAO` varchar(255) DEFAULT NULL, + `billing_invoice_billAddr` varchar(255) DEFAULT NULL, + `billing_invoice_billCity` varchar(255) DEFAULT NULL, + `billing_invoice_billZip` varchar(20) DEFAULT NULL, + `billing_invoice_billCountry` varchar(255) DEFAULT NULL, + + `billing_invoice_created_at` datetime DEFAULT NULL, + `billing_invoice_created_by` int(11) NOT NULL, + `billing_invoice_finished_at` datetime DEFAULT NULL, + + `billing_invoice_gross` int(11) DEFAULT NULL, + `billing_invoice_net` int(11) DEFAULT NULL, + `billing_invoice_currency` varchar(3) DEFAULT NULL, + `billing_invoice_taxid` varchar(255) DEFAULT NULL, + `billing_invoice_freightage` int(11) DEFAULT NULL, + `billing_invoice_insurance` int(11) DEFAULT NULL, + `billing_invoice_referer` int(11) DEFAULT NULL, + `billing_invoice_referer_name` int(11) DEFAULT NULL, + `billing_invoice_reference` int(11) DEFAULT NULL, + + `billing_invoice_payment` int(11) DEFAULT NULL, + `billing_invoice_payment_text` varchar(255) DEFAULT NULL, + + `billing_invoice_terms` int(11) DEFAULT NULL, + `billing_invoice_terms_text` varchar(255) DEFAULT NULL, + + `billing_invoice_ship_type` int(11) DEFAULT NULL, + `billing_invoice_ship_text` varchar(255) DEFAULT NULL, PRIMARY KEY (`billing_invoice_id`), - KEY `billing_invoice_creator` (`billing_invoice_creator`), + KEY `billing_invoice_created_by` (`billing_invoice_created_by`), KEY `billing_invoice_client` (`billing_invoice_client`), KEY `billing_invoice_referer` (`billing_invoice_referer`), KEY `billing_invoice_reference` (`billing_invoice_reference`) @@ -84,33 +101,45 @@ class Installer extends InstallerAbstract $dbPool->get('core')->con->prepare( 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'billing_invoice` - ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'billing_invoice_ibfk_1` FOREIGN KEY (`billing_invoice_creator`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`), + ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'billing_invoice_ibfk_1` FOREIGN KEY (`billing_invoice_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`), ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'billing_invoice_ibfk_2` FOREIGN KEY (`billing_invoice_client`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`), ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'billing_invoice_ibfk_3` FOREIGN KEY (`billing_invoice_referer`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`), ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'billing_invoice_ibfk_4` FOREIGN KEY (`billing_invoice_reference`) REFERENCES `' . $dbPool->get('core')->prefix . 'billing_invoice` (`billing_invoice_id`);' )->execute(); $dbPool->get('core')->con->prepare( - 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'billing_invoice_element` ( - `billing_invoice_element_id` int(11) NOT NULL AUTO_INCREMENT, - `billing_invoice_element_position` smallint(5) NOT NULL, - `billing_invoice_element_article` int(11) NOT NULL, - `billing_invoice_element_name` varchar(30) NOT NULL, - `billing_invoice_element_desc` text NOT NULL, - `billing_invoice_element_quantity` int(11) NOT NULL, - `billing_invoice_element_price` decimal(11,2) NOT NULL, - `billing_invoice_element_tax` decimal(5,2) NOT NULL, - `billing_invoice_element_discountp` decimal(5,2) NOT NULL, - `billing_invoice_element_discount` decimal(11,2) NOT NULL, - `billing_invoice_element_invoice` int(11) NOT NULL, - PRIMARY KEY (`billing_invoice_element_id`), - KEY `billing_invoice_element_invoice` (`billing_invoice_element_invoice`) + 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'billing_element` ( + `billing_element_id` int(11) NOT NULL AUTO_INCREMENT, + `billing_element_order` smallint(5) NOT NULL, + `billing_element_item` int(11) NOT NULL, + `billing_element_item_name` varchar(30) NOT NULL, + `billing_element_item_desc` text NOT NULL, + `billing_element_quantity` int(11) NOT NULL, + `billing_element_purchase_price` int(11) NOT NULL, + `billing_element_price_single` int(11) NOT NULL, + `billing_element_price_total` int(11) NOT NULL, + `billing_element_price_discount_single` int(11) NOT NULL, + `billing_element_price_discount_total` int(11) NOT NULL, + `billing_element_percentage_discount_single` int(11) NOT NULL, + `billing_element_percentage_discount_total` int(11) NOT NULL, + `billing_element_quantity_discount` int(11) NOT NULL, + `billing_element_price_single_net` int(11) NOT NULL, + `billing_element_price_total_net` int(11) NOT NULL, + `billing_element_tax_price` int(11) NOT NULL, + `billing_element_tax_percentage` int(11) NOT NULL, + `billing_element_price_single_gross` int(11) NOT NULL, + `billing_element_price_total_gross` int(11) NOT NULL, + `billing_element_invoice` int(11) NOT NULL, + `billing_element_promotion` int(11) DEFAULT NULL, + `billing_element_event` int(11) DEFAULT NULL, + PRIMARY KEY (`billing_element_id`), + KEY `billing_element_invoice` (`billing_element_invoice`) )ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' )->execute(); $dbPool->get('core')->con->prepare( - 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'billing_invoice_element` - ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'billing_invoice_element_ibfk_1` FOREIGN KEY (`billing_invoice_element_invoice`) REFERENCES `' . $dbPool->get('core')->prefix . 'billing_invoice` (`billing_invoice_id`);' + 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'billing_element` + ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'billing_element_ibfk_1` FOREIGN KEY (`billing_element_invoice`) REFERENCES `' . $dbPool->get('core')->prefix . 'billing_invoice` (`billing_invoice_id`);' )->execute(); break; } diff --git a/Models/Invoice.php b/Models/Invoice.php new file mode 100644 index 0000000..41c769e --- /dev/null +++ b/Models/Invoice.php @@ -0,0 +1,521 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +declare(strict_types=1); +namespace Modules\Billing\Models; + +/** + * Invoice class. + * + * @category Tasks + * @package Modules + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Invoice implements \JsonSerializable +{ + private $id = 0; + + /** + * Number ID. + * + * @var int + * @since 1.0.0 + */ + private $number = ''; + + /** + * Invoice type. + * + * @var int + * @since 1.0.0 + */ + private $type = InvoiceType::Bill; + + /** + * Invoice status. + * + * @var int + * @since 1.0.0 + */ + private $status = InvoiceStatus::DONE; + + /** + * Invoice created at. + * + * @var \DateTime + * @since 1.0.0 + */ + private $createdAt = null; + + /** + * Invoice send at. + * + * @var \DateTime + * @since 1.0.0 + */ + private $send = null; + + private $createdBy = 0; + + private $client = 0; + + private $shipTo = ''; + + private $shipFAO = ''; + + private $shipAddress = ''; + + private $shipCity = ''; + + private $shipZip = ''; + + private $shipCountry = ''; + + private $billTo = ''; + + private $billFAO = ''; + + private $billAddress = ''; + + private $billCity = ''; + + private $billZip = ''; + + private $billCountry = ''; + + /** + * Person refering for this order. + * + * @var \DateTime + * @since 1.0.0 + */ + private $referer = 0; + + private $refererName = 0; + + private $taxId = ''; + + private $insurance = null; + + private $freight = null; + + private $net = null; + + private $gross = null; + + private $currency = ISO4217CharEnum::_EUR; + + private $info = ''; + + private $payment = 0; + + private $paymentText = ''; + + private $terms = 0; + + private $termsText = ''; + + private $shipping = 0; + + private $shippingText = ''; + + private $vouchers = []; + + private $trackings = []; + + private $elements = []; + /** + * Reference to other invoice (delivery note/credit note etc). + * + * @var \DateTime + * @since 1.0.0 + */ + private $reference = 0; + + public function __construct() + { + $insurance = new Money(); + $freight = new Money(); + $net = new Money(); + $gross = new Money(); + + $this->createdAt = new \DateTime(); + $this->send = new \DateTime(); + } + + public function getId() : int + { + return $this->id; + } + + public function getNumber() : string + { + return $this->number; + } + + public function setNumber(string $number) /* : void */ + { + $this->number = $number; + } + + public function getType() : int + { + return $this->type; + } + + public function setType(int $type) /* : void */ + { + $this->type = $type; + } + + public function getStatus() : int + { + return $this->status; + } + + public function setSatus(int $status) /* : void */ + { + $this->status = $status; + } + + public function getCreatedAt() : \DateTime + { + return $this->createdAt; + } + + public function setSend(\DateTime $send) /* : void */ + { + $this->send = $send; + } + + public function getSend() : \DateTime + { + return $this->send; + } + + public function getCreatedBy() : int + { + return $this->createdBy; + } + + public function setCreatedBy(int $creator) /* : void */ + { + $this->createdBy = $creator; + } + + public function getClient() + { + return $this->client; + } + + public function setClient($client) /* : void */ + { + $this->client = $client; + } + + public function setShipTo(string $ship) /* : void */ + { + $this->shipTo = $ship; + } + + public function getShipTo() : string + { + return $this->shipTo; + } + + public function setShipFAO(string $ship) /* : void */ + { + $this->shipFAO = $ship; + } + + public function getShipFAO() : string + { + return $this->shipFAO; + } + + public function setShipAddress(string $ship) /* : void */ + { + $this->shipAddress = $ship; + } + + public function getShipAddress() : string + { + return $this->shipAddress; + } + + public function setShipCity(string $ship) /* : void */ + { + $this->shipCity = $ship; + } + + public function getShipCity() : string + { + return $this->shipCity; + } + + public function setShipZip($ship) /* : void */ + { + $this->shipZip = $ship; + } + + public function getShipZip() : string + { + return $this->shipZip; + } + + public function setShipCountry(string $ship) /* : void */ + { + $this->shipCountry = $ship; + } + + public function getShipCountry() : string + { + return $this->shipCountry; + } + + public function setBillTo(string $bill) /* : void */ + { + $this->billTo = $bill; + } + + public function getBillTo() : string + { + return $this->billTo; + } + + public function setBillFAO(string $bill) /* : void */ + { + $this->billFAO = $bill; + } + + public function getBillFAO() : string + { + return $this->billFAO; + } + + public function setBillAddress(string $bill) /* : void */ + { + $this->billAddress = $bill; + } + + public function getBillAddress() : string + { + return $this->billAddress; + } + + public function setBillCity(string $bill) /* : void */ + { + $this->billCity = $bill; + } + + public function getBillCity() : string + { + return $this->billCity; + } + + public function setBillZip($bill) /* : void */ + { + $this->billZip = $bill; + } + + public function getBillZip() : string + { + return $this->billZip; + } + + public function setBillCountry(string $bill) /* : void */ + { + $this->billCountry = $bill; + } + + public function getBillCountry() : string + { + return $this->billCountry; + } + + public function setReferer(int $referer) /* : void */ + { + $this->referer = $referer; + } + + public function getReferer() : int + { + return $this->referer; + } + + public function setRefererName(string $refererName) /* : void */ + { + $this->refererName = $refererName; + } + + public function getRefererName() : string + { + return $this->refererName; + } + + public function setTaxId(string $tax) /* : void */ + { + $this->taxId = $tax; + } + + public function getTaxId() : string + { + return $this->taxId; + } + + public function setInsurance(Money $insurance) /* : void */ + { + $this->insurance = $insurance; + } + + public function getInsurance() : Money + { + return $this->insurance; + } + + public function setFreight(Money $freigth) /* : void */ + { + $this->freight = $freight; + } + + public function getFreigth() : Money + { + return $this->freigth; + } + + public function getNet() : Money + { + return $this->net; + } + + public function getGross() : Money + { + return $this->gross; + } + + public function setCurrency(string $currency) /* : void */ + { + $this->currency = $currency; + } + + public function getCurrency() : string + { + return $this->currency; + } + + public function setInfo(string $info) /* : void */ + { + $this->info = $info; + } + + public function getInfo() : string + { + return $this->info; + } + + public function setPayment(int $payment) /* : void */ + { + $this->payment = $payment; + } + + public function getPayment() + { + return $this->payment; + } + + public function setPaymentText(string $payment) /* : void */ + { + $this->paymentText = $payment; + } + + public function getPaymentText() : string + { + return $this->paymentText; + } + + public function setTerms(int $terms) /* : void */ + { + $this->terms = $terms; + } + + public function getTerms() + { + return $this->terms; + } + + public function setTermsText(string $terms) /* : void */ + { + $this->termsText = $terms; + } + + public function getTermsText() : string + { + return $this->termsText; + } + + public function setShipping(int $shipping) /* : void */ + { + $this->shipping = $shipping; + } + + public function getShipping() + { + return $this->shipping; + } + + public function setShippingText(string $shipping) /* : void */ + { + $this->shippingText = $shipping; + } + + public function getShippingText() : string + { + return $this->shippingText; + } + + public function getVouchers() : array + { + return $this->vouchers; + } + + public function addVoucher(string $voucher) /* : void */ + { + $this->vouchers[] = $voucher; + } + + public function getTrackings() : array + { + return $this->trackings; + } + + public function addTracking(string $tracking) /* : void */ + { + $this->trackings[] = $tracking; + } + + public function getElements() : array + { + return $this->elements; + } + + public function addElement($element) /* : void */ + { + $this->elements[] = $element; + } +} \ No newline at end of file diff --git a/Models/InvoiceElement.php b/Models/InvoiceElement.php new file mode 100644 index 0000000..376a423 --- /dev/null +++ b/Models/InvoiceElement.php @@ -0,0 +1,280 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +declare(strict_types=1); +namespace Modules\Billing\Models; + +/** + * Invoice class. + * + * @category Tasks + * @package Modules + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class InvoiceElement implements \JsonSerializable +{ + private $id = 0; + + private $order = 0; + + private $item = 0; + + private $itemName = ''; + + private $itemDescription = ''; + + private $quantity = 0; + + private $singlePrice = null; + + private $totalPrice = null; + + private $singleDiscountP = null; + + private $totalDiscountP = null; + + private $singleDiscountR = 0; + + private $totalDiscountR = null; + + private $discountQ = 0; + + private $singlePriceNet = null; + + private $totalPriceNet = null; + + private $taxP = 0; + + private $taxR = null; + + private $singlePriceGross= null; + + private $totalPriceGross= null; + + private $event = 0; + + private $promotion = 0; + + private $invoice = 0; + + public function __construct() + { + + } + + public function getId() : int + { + return $this->id; + } + + public function setEvent(int $event) /* : void */ + { + $this->event = $event; + } + + public function getEvent() + { + return $this->event; + } + + public function setPromotion(int $promotion) /* : void */ + { + $this->promotion = $promotion; + } + + public function getPromotion() + { + return $this->promotion; + } + + public function setOrder(int $order) /* : void */ + { + $this->order = $order; + } + + public function getorder() : int + { + return $this->order; + } + + public function setItem($item) /* : void */ + { + $this->item = $item; + } + + public function setItemName(string $name) /* : void */ + { + $this->itemName = $name; + } + + public function getItemName() : string + { + return $this->itemName; + } + + public function setItemDescription(string $description) /* : void */ + { + $this->itemDescription = $description; + } + + public function getItemDescripion() : string + { + return $this->itemDescription; + } + + public function setQuantity(int $quantity) /* : void */ + { + $this->quantity = $quantity; + } + + public function getQuantity() : int + { + return $this->quantity; + } + + public function setSinglePrice(Money $price) /* : void */ + { + $this->singlePrice = $price; + } + + public function getSinglePrice() : Money + { + return $this->singlePrice; + } + + public function setTotalPrice(Money $price) /* : void */ + { + $this->totalPrice = $price; + } + + public function getTotalPrice() : Money + { + return $this->totalPrice; + } + + public function setDiscountPrice(Money $discount) /* : void */ + { + $this->singleDiscountP = $discount; + } + + public function getDiscountPrice() : Money + { + return $this->singleDiscountP; + } + + public function setTotalDiscountPrice(Money $discount) /* : void */ + { + $this->totalDiscountP = $discount; + } + + public function getTotalDiscountPrice() : Money + { + return $this->totalDiscountP; + } + + public function setDiscountPercentage(float $discount) /* : void */ + { + $this->singleDiscountR = $discount; + } + + public function getDiscountPercentage() : float + { + return $this->singleDiscountR; + } + + public function setTotalDiscountPercentage(float $discount) /* : void */ + { + $this->totalDiscountR = $discount; + } + + public function getTotalDiscountPercentage() : float + { + return $this->totalDiscountR; + } + + public function setDiscountQuantity($quantity) /* : void */ + { + $this->discountQ = $quantity; + } + + public function getDiscountQuantity() + { + return $this->discountQ; + } + + public function setSingleNetPrice(Money $price) /* : void */ + { + $this->singlePriceNet = $price; + } + + public function getSingleNetPrice() : Money + { + return $this->singlePriceNet; + } + + public function setTotalNetPrice(Money $price) /* : void */ + { + $this->totalPriceNet = $price; + } + + public function getTotalNetPrice() : Money + { + return $this->totalPriceNet; + } + + public function setTaxPrice(Money $tax) /* : void */ + { + $this->taxP = $tax; + } + + public function getTaxPrice() : Money + { + return $this->taxP; + } + + public function setTaxPercentag(float $tax) /* : void */ + { + $this->taxR = $tax; + } + + public function getTaxPercentag() : float + { + return $this->taxR; + } + + public function setSingleGrossPrice(Money $price) /* : void */ + { + $this->singlePriceGross = $price; + } + + public function getSingleGrossPrice() : Money + { + return $this->singlePriceGross; + } + + public function setTotalGrossPrice(Money $price) /* : void */ + { + $this->totalPriceGross = $price; + } + + public function getTotalGrossPrice() : Money + { + return $this->totalPriceGross; + } +} \ No newline at end of file diff --git a/Models/InvoiceMapper.php b/Models/InvoiceMapper.php new file mode 100644 index 0000000..e69de29 diff --git a/Models/InvoiceStatus.php b/Models/InvoiceStatus.php new file mode 100644 index 0000000..15a109a --- /dev/null +++ b/Models/InvoiceStatus.php @@ -0,0 +1,37 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +declare(strict_types=1); +namespace Modules\Billing\Models; + +use phpOMS\Datatypes\Enum; + +/** + * Task type enum. + * + * @category Tasks + * @package Modules + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +abstract class InvoiceStatus extends Enum +{ + /* public */ const ACTIVE = 1; + /* public */ const ARCHIVED = 2; + /* public */ const DELETED = 3; +} diff --git a/Models/InvoiceType.php b/Models/InvoiceType.php new file mode 100644 index 0000000..b9a7f8b --- /dev/null +++ b/Models/InvoiceType.php @@ -0,0 +1,40 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +declare(strict_types=1); +namespace Modules\Billing\Models; + +use phpOMS\Datatypes\Enum; + +/** + * Task type enum. + * + * @category Tasks + * @package Modules + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +abstract class InvoiceType extends Enum +{ + /* public */ const BILL = 1; + /* public */ const DELIVERY_NOTE = 2; + /* public */ const CREDIT_NOTE = 3; + /* public */ const DEBIT_NOTE = 4; + /* public */ const OFFER = 5; + /* public */ const ORDER_CONFIRMATION = 6; +} diff --git a/info.json b/info.json index 823bba6..eac99e8 100644 --- a/info.json +++ b/info.json @@ -17,7 +17,8 @@ "description": "Accounting module.", "directory": "Billing", "dependencies": { - "Admin" : "1.0.0" + "Admin" : "1.0.0", + "ClientManagement" : "1.0.0" }, "providing": { "Navigation": "*"