mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-02-16 16:28:41 +00:00
More unit tests
This commit is contained in:
parent
202fdd44df
commit
c0ccccd120
|
|
@ -12,8 +12,12 @@
|
||||||
* @link http://website.orange-management.de
|
* @link http://website.orange-management.de
|
||||||
*/
|
*/
|
||||||
declare(strict_types = 1);
|
declare(strict_types = 1);
|
||||||
|
|
||||||
namespace Modules\Billing\Models;
|
namespace Modules\Billing\Models;
|
||||||
|
|
||||||
|
use phpOMS\Localization\ISO4217CharEnum;
|
||||||
|
use phpOMS\Localization\Money;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice class.
|
* Invoice class.
|
||||||
*
|
*
|
||||||
|
|
@ -41,7 +45,7 @@ class Invoice implements \JsonSerializable
|
||||||
* @var int
|
* @var int
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $type = InvoiceType::Bill;
|
private $type = InvoiceType::BILL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice status.
|
* Invoice status.
|
||||||
|
|
@ -49,7 +53,7 @@ class Invoice implements \JsonSerializable
|
||||||
* @var int
|
* @var int
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $status = InvoiceStatus::DONE;
|
private $status = InvoiceStatus::DRAFT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice created at.
|
* Invoice created at.
|
||||||
|
|
@ -103,7 +107,7 @@ class Invoice implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
private $referer = 0;
|
private $referer = 0;
|
||||||
|
|
||||||
private $refererName = 0;
|
private $refererName = '';
|
||||||
|
|
||||||
private $taxId = '';
|
private $taxId = '';
|
||||||
|
|
||||||
|
|
@ -146,13 +150,12 @@ class Invoice implements \JsonSerializable
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$insurance = new Money();
|
$this->insurance = new Money();
|
||||||
$freight = new Money();
|
$this->freight = new Money();
|
||||||
$net = new Money();
|
$this->net = new Money();
|
||||||
$gross = new Money();
|
$this->gross = new Money();
|
||||||
|
|
||||||
$this->createdAt = new \DateTime();
|
$this->createdAt = new \DateTime();
|
||||||
$this->send = new \DateTime();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId() : int
|
public function getId() : int
|
||||||
|
|
@ -185,7 +188,7 @@ class Invoice implements \JsonSerializable
|
||||||
return $this->status;
|
return $this->status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSatus(int $status) /* : void */
|
public function setStatus(int $status) /* : void */
|
||||||
{
|
{
|
||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
}
|
}
|
||||||
|
|
@ -200,7 +203,7 @@ class Invoice implements \JsonSerializable
|
||||||
$this->send = $send;
|
$this->send = $send;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSend() : \DateTime
|
public function getSend()
|
||||||
{
|
{
|
||||||
return $this->send;
|
return $this->send;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,7 @@ abstract class InvoiceStatus extends Enum
|
||||||
{
|
{
|
||||||
/* public */ const ACTIVE = 1;
|
/* public */ const ACTIVE = 1;
|
||||||
/* public */ const ARCHIVED = 2;
|
/* public */ const ARCHIVED = 2;
|
||||||
/* public */ const DELETED = 3;
|
/* public */ const DELETED = 4;
|
||||||
|
/* public */ const DONE = 8;
|
||||||
|
/* public */ const DRAFT = 16;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user