From b16236f41a9a1ce45a24aaf41f8c10c6da5c112a 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 --- Models/Article.php | 0 Models/Client.php | 0 Models/Invoice.php | 522 ----------------------------------- Models/InvoiceItem.php | 0 Models/InvoiceStatus.php | 45 --- Models/InvoiceType.php | 41 --- Models/sales_price_names.php | 19 -- 7 files changed, 627 deletions(-) delete mode 100644 Models/Article.php delete mode 100644 Models/Client.php delete mode 100644 Models/Invoice.php delete mode 100644 Models/InvoiceItem.php delete mode 100644 Models/InvoiceStatus.php delete mode 100644 Models/InvoiceType.php delete mode 100644 Models/sales_price_names.php diff --git a/Models/Article.php b/Models/Article.php deleted file mode 100644 index e69de29..0000000 diff --git a/Models/Client.php b/Models/Client.php deleted file mode 100644 index e69de29..0000000 diff --git a/Models/Invoice.php b/Models/Invoice.php deleted file mode 100644 index 399500f..0000000 --- a/Models/Invoice.php +++ /dev/null @@ -1,522 +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\Sales\Models; - -/** - * Sales invoice class. - * - * @category Modules - * @package Modules\Sales - * @author OMS Development Team - * @author Dennis Eichhorn - * @license OMS License 1.0 - * @link http://orange-management.com - * @since 1.0.0 - */ -class Invoice -{ - - /** - * Database instance. - * - * @var \phpOMS\DataStorage\Database\Database - * @since 1.0.0 - */ - private $dbPool = null; - - /** - * private $id = null;. - * - * private $referer = null; - * - * private $reference = null; - * - * private $orderer = null; - * - * private $ordered = null; - * - * private $creator = null; - * - * private $created = null; - * - * private $client = null; - * - * private $deliveryAddress = null; - * - * private $billingAddress = null; - * - * private $payment = null; - * - * private $delivery = null; - * - * private $freightage = null; - * - * private $invoiceItemList = []; - * - * private $info = ''; - * - * private $status = null; - * - * private $price = null; - * - * private $currency = null; - * - * /** - * Constructor - * - * @param \phpOMS\DataStorage\Database\DatabasePool $dbPool Database pool instance - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function __construct($dbPool) - { - $this->dbPool = $dbPool; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getId() - { - return $this->id; - } - - /** - * @param null $id - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setId($id) - { - $this->id = $id; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getReference() - { - return $this->reference; - } - - /** - * @param null $reference - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setReference($reference) - { - $this->reference = $reference; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getOrderer() - { - return $this->orderer; - } - - /** - * @param null $orderer - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setOrderer($orderer) - { - $this->orderer = $orderer; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getOrdered() - { - return $this->ordered; - } - - /** - * @param null $ordered - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setOrdered($ordered) - { - $this->ordered = $ordered; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getCreator() - { - return $this->creator; - } - - /** - * @param null $creator - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setCreator($creator) - { - $this->creator = $creator; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getCreated() - { - return $this->created; - } - - /** - * @param null $created - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getClient() - { - return $this->client; - } - - /** - * @param null $client - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setClient($client) - { - $this->client = $client; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getDeliveryAddress() - { - return $this->deliveryAddress; - } - - /** - * @param null $deliveryAddress - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setDeliveryAddress($deliveryAddress) - { - $this->deliveryAddress = $deliveryAddress; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getBillingAddress() - { - return $this->billingAddress; - } - - /** - * @param null $billingAddress - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setBillingAddress($billingAddress) - { - $this->billingAddress = $billingAddress; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getPayment() - { - return $this->payment; - } - - /** - * @param null $payment - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setPayment($payment) - { - $this->payment = $payment; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getDelivery() - { - return $this->delivery; - } - - /** - * @param null $delivery - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setDelivery($delivery) - { - $this->delivery = $delivery; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getFreightage() - { - return $this->freightage; - } - - /** - * @param null $freightage - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setFreightage($freightage) - { - $this->freightage = $freightage; - } - - /** - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInvoiceItemList() - { - return $this->invoiceItemList; - } - - /** - * @param array $invoiceItemList - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setInvoiceItemList($invoiceItemList) - { - $this->invoiceItemList = $invoiceItemList; - } - - /** - * {@inheritdoc} - */ - public function serialize() - { - // TODO: Implement serialize() method. - } - - /** - * {@inheritdoc} - */ - public function unserialize($serialized) - { - // TODO: Implement unserialize() method. - } - - /** - * {@inheritdoc} - */ - public function delete() - { - // TODO: Implement delete() method. - } - - /** - * {@inheritdoc} - */ - public function create() - { - // TODO: Implement create() method. - } - - /** - * {@inheritdoc} - */ - public function update() - { - // TODO: Implement update() method. - } - - /** - * {@inheritdoc} - */ - public function init($id) - { - // TODO: Implement init() method. - } - - public function getPrice() - { - } - - public function getDiscount() - { - } - - public function getDiscountP() - { - } - - public function getProfit() - { - } - - public function getGrossProfit() - { - } - - public function getPayed() - { - } - - /** - * @return string - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInfo() - { - return $this->info; - } - - /** - * @param string $info - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setInfo($info) - { - $this->info = $info; - } - - /** - * @return null - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getStatus() - { - return $this->status; - } - - /** - * @param null $status - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setStatus($status) - { - $this->status = $status; - } -} diff --git a/Models/InvoiceItem.php b/Models/InvoiceItem.php deleted file mode 100644 index e69de29..0000000 diff --git a/Models/InvoiceStatus.php b/Models/InvoiceStatus.php deleted file mode 100644 index 2e12086..0000000 --- a/Models/InvoiceStatus.php +++ /dev/null @@ -1,45 +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\Sales\Models; - -use phpOMS\Datatypes\Enum; - -/** - * Invoice types enum. - * - * @category Modules - * @package Sales - * @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 BLOCKED = 0; /* Invoice needs approval */ - /* public */ const DRAFT = 1; /* Invoice is still in draft */ - /* public */ const READY = 2; /* Invoice is ready for accounting transfer */ - /* public */ const UNPAID = 3; /* Invoice is not paid */ - /* public */ const PAID_PARTIALLY = 4; /* Invoice is partially paid */ - /* public */ const PAID = 5; /* Invoice is paid */ - /* public */ const OFFSETTING = 6; /* This invoice may receive a credit */ - /* public */ const OPEN = 7; /* offer & confirmation */ - /* public */ const CHANGED = 8; /* offer & confirmation */ - /* public */ const CLOSED = 9; /* offer & confirmation */ - /* public */ const ACCEPTED = 10; /* offer & confirmation */ -} diff --git a/Models/InvoiceType.php b/Models/InvoiceType.php deleted file mode 100644 index 1618126..0000000 --- a/Models/InvoiceType.php +++ /dev/null @@ -1,41 +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\Sales\Models; - -use phpOMS\Datatypes\Enum; - -/** - * Invoice types enum. - * - * @category Modules - * @package Sales - * @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 OFFER = 0; - - /* public */ const CONTRACT_NOTE = 1; - - /* public */ const DELIVERY_NOTE = 2; - - /* public */ const BILL = 3; -} diff --git a/Models/sales_price_names.php b/Models/sales_price_names.php deleted file mode 100644 index 0560d87..0000000 --- a/Models/sales_price_names.php +++ /dev/null @@ -1,19 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -$SalesPriceNames = [ - 0 => 'DefaultInternational', - 1 => 'DefaultNational', -];