Merge branch 'master' of gitlab.com:jankstudio/resq
This commit is contained in:
commit
d46ce9e187
4 changed files with 95 additions and 1 deletions
48
src/Entity/Invoice.php
Normal file
48
src/Entity/Invoice.php
Normal 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;
|
||||
}
|
||||
|
|
@ -42,6 +42,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")
|
||||
|
|
@ -101,6 +107,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();
|
||||
|
|
|
|||
34
src/Ramcar/JOStatus.php
Normal file
34
src/Ramcar/JOStatus.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace App\Ramcar;
|
||||
|
||||
class JOStatus
|
||||
{
|
||||
const PENDING => 'pending';
|
||||
const ASSIGNED => 'assigned';
|
||||
const IN_PROGRESS => 'in_progress';
|
||||
const CANCELLED => 'cancelled';
|
||||
const FULFILLED => 'fulfilled';
|
||||
|
||||
const COLLECTION = [
|
||||
'pending' => 'Pending',
|
||||
'assigned' => 'Assigned',
|
||||
'in_progress' => 'In Progress',
|
||||
'cancelled' => 'Cancelled',
|
||||
'fulfilled' => 'Fulfilled',
|
||||
];
|
||||
|
||||
static public function getCollection()
|
||||
{
|
||||
return self::COLLECTION;
|
||||
}
|
||||
|
||||
static public function validate($type_text)
|
||||
{
|
||||
if (isset(self::COLLECTION[$type_text]))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ class ServiceType
|
|||
];
|
||||
|
||||
|
||||
static public function getServiceTypes()
|
||||
static public function getCollection()
|
||||
{
|
||||
return self::COLLECTION;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue