|
|
@@ -6,7 +6,7 @@ trait RollerHandligHelper
|
|
|
{
|
|
|
public function getAllScooterDataByCode($code)
|
|
|
{
|
|
|
- $deviceTypes = ['5' => 'Seev Citycoco', '6' => 'WIZTEM'];
|
|
|
+ $deviceTypes = ['6' => 'Seev Citycoco', '7' => 'WIZTEM', '8' => 'MONSTERROLLER', '9' => 'NEOS'];
|
|
|
$rentableStatuses = [110, 115];
|
|
|
$sql = "SELECT
|
|
|
i.rowid, i.entity, i.ref, i.fk_warehouse, i.status, i.title
|
|
|
@@ -136,7 +136,7 @@ trait RollerHandligHelper
|
|
|
|
|
|
public function getRollerrenthistoryDataByInvetoryId($inventory_id)
|
|
|
{
|
|
|
- $rollerrenthistoryData = '';
|
|
|
+ $rollerrenthistoryData = new stdClass();
|
|
|
$sql = "SELECT * FROM llx_rollerstorage_rollerrenthistory WHERE inventory_id = {$inventory_id} AND status = 1 ORDER BY date_creation DESC LIMIT 1";
|
|
|
$result = $this->db->query($sql);
|
|
|
if ($this->db->num_rows($result) > 0) {
|
|
|
@@ -144,6 +144,7 @@ trait RollerHandligHelper
|
|
|
$rollerrenthistoryData = $row;
|
|
|
}
|
|
|
}
|
|
|
+ $rollerrenthistoryData->ticket_id = '';
|
|
|
return $rollerrenthistoryData;
|
|
|
}
|
|
|
|
|
|
@@ -191,6 +192,7 @@ trait RollerHandligHelper
|
|
|
|
|
|
public function checkExpireDate($ticket_id)
|
|
|
{
|
|
|
+ $array = [];
|
|
|
$now = date("Y-m-d H:i:s", dol_now());
|
|
|
if ($ticket_id !== '') {
|
|
|
$sql = "SELECT expire_at FROM llx_bbus_bbticket WHERE rowid = {$ticket_id}";
|
|
|
@@ -198,16 +200,19 @@ trait RollerHandligHelper
|
|
|
if ($this->db->num_rows($result) > 0) {
|
|
|
while ($row = $this->db->fetch_object($result)) {
|
|
|
if (strtotime($row->expire_at) < strtotime($now)) {
|
|
|
- return true;
|
|
|
+ $array['isExpired'] = true;
|
|
|
+ $array['date'] = $row->expire_at;
|
|
|
+ return $array;
|
|
|
} else {
|
|
|
- return false;
|
|
|
+ $array['isExpired'] = false;
|
|
|
+ return $array;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- throw new RestException(508);
|
|
|
+ $array['isExpired'] = false;
|
|
|
}
|
|
|
- return false;
|
|
|
+ return $array;
|
|
|
}
|
|
|
|
|
|
public function getTicketIdByInvoiceNumber($invoice_number, $timestamp)
|