mirror of
https://github.com/Karaka-Management/oms-SalesAnalysis.git
synced 2026-01-11 19:38:39 +00:00
Unit test fixes and invoice impl. started
This commit is contained in:
parent
cc0898a285
commit
b16236f41a
|
|
@ -1,522 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @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 <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct($dbPool)
|
||||
{
|
||||
$this->dbPool = $dbPool;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $id
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getReference()
|
||||
{
|
||||
return $this->reference;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $reference
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setReference($reference)
|
||||
{
|
||||
$this->reference = $reference;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getOrderer()
|
||||
{
|
||||
return $this->orderer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $orderer
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setOrderer($orderer)
|
||||
{
|
||||
$this->orderer = $orderer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getOrdered()
|
||||
{
|
||||
return $this->ordered;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $ordered
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setOrdered($ordered)
|
||||
{
|
||||
$this->ordered = $ordered;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getCreator()
|
||||
{
|
||||
return $this->creator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $creator
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setCreator($creator)
|
||||
{
|
||||
$this->creator = $creator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getCreated()
|
||||
{
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $created
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setCreated($created)
|
||||
{
|
||||
$this->created = $created;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getClient()
|
||||
{
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $client
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setClient($client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getDeliveryAddress()
|
||||
{
|
||||
return $this->deliveryAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $deliveryAddress
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setDeliveryAddress($deliveryAddress)
|
||||
{
|
||||
$this->deliveryAddress = $deliveryAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getBillingAddress()
|
||||
{
|
||||
return $this->billingAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $billingAddress
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setBillingAddress($billingAddress)
|
||||
{
|
||||
$this->billingAddress = $billingAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getPayment()
|
||||
{
|
||||
return $this->payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $payment
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setPayment($payment)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getDelivery()
|
||||
{
|
||||
return $this->delivery;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $delivery
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setDelivery($delivery)
|
||||
{
|
||||
$this->delivery = $delivery;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getFreightage()
|
||||
{
|
||||
return $this->freightage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $freightage
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setFreightage($freightage)
|
||||
{
|
||||
$this->freightage = $freightage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getInvoiceItemList()
|
||||
{
|
||||
return $this->invoiceItemList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $invoiceItemList
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getInfo()
|
||||
{
|
||||
return $this->info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $info
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setInfo($info)
|
||||
{
|
||||
$this->info = $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $status
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->status = $status;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @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 <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @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 */
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @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 <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @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;
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
$SalesPriceNames = [
|
||||
0 => 'DefaultInternational',
|
||||
1 => 'DefaultNational',
|
||||
];
|
||||
Loading…
Reference in New Issue
Block a user