Add invoice entity

This commit is contained in:
Kendrick Chan 2018-01-16 03:16:28 +08:00
parent e041623e9d
commit 0206b1e45a
2 changed files with 60 additions and 0 deletions

48
src/Entity/Invoice.php Normal file
View file

@ -0,0 +1,48 @@
<?php
namespace App;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
class Invoice
{
// unique id
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
// date invoice was created
/**
* @ORM\Column(type="datetime")
*/
protected $date_create;
// date that the invoice was paid
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $date_paid;
// date that the invoice was cancelled
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $date_cancel;
// user that created the invoice
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="invoice")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
protected $created_by;
// invoice items
protected $invoice_items;
// status
protected $status;
}

View file

@ -41,6 +41,12 @@ class JobOrder
*/
protected $date_fulfill;
// date that the job order was cancelled
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $date_cancel;
// coordinates of the customer vehicle that needs service
/**
* @ORM\Column(type="point")
@ -100,6 +106,12 @@ class JobOrder
*/
protected $source;
// status of the job order
/**
* @ORM\Column(type="string", length=10)
*/
protected $status;
public function __construct()
{
$this->date_create = new DateTime();