当前位置: 首页>>代码示例>>PHP>>正文


PHP Place::free_place方法代码示例

本文整理汇总了PHP中Place::free_place方法的典型用法代码示例。如果您正苦于以下问题:PHP Place::free_place方法的具体用法?PHP Place::free_place怎么用?PHP Place::free_place使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Place的用法示例。


在下文中一共展示了Place::free_place方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: UpdateTicket

 /**
  * 
  * Update Ticket into Database
  * @param	array 		$aryTicket		Ticket object	
  */
 private function UpdateTicket($aryTicket)
 {
     global $db, $conf;
     $function = "UpdateTicket";
     $idTicket = -1;
     $data = $aryTicket['data'];
     $lines = $data['lines'];
     $idTicket = $data['id'];
     $statut = 0;
     if (!$data['customerId']) {
         $cash = new Cash($db);
         $terminal = $_SESSION['TERMINAL_ID'];
         $cash->fetch($terminal);
         $socid = $cash->fk_soc;
     } else {
         $socid = $data['customerId'];
     }
     if (!$data['employeeId']) {
         $employee = $_SESSION['uid'];
     } else {
         $employee = $data['employeeId'];
     }
     $object = new Ticket($db);
     $object->fetch($idTicket);
     $object->type = $data['type'];
     $object->socid = $socid;
     $object->statut = $data['state'];
     $object->fk_cash = $_SESSION['TERMINAL_ID'];
     $object->remise_percent = $data['discount_percent'];
     $object->remise_absolut = $data['discount_qty'];
     $object->mode_reglement_id = $data['payment_type'];
     $object->fk_place = $data['id_place'];
     $object->note = $data['note'];
     $cash = new Cash($db);
     $cash->fetch($_SESSION['TERMINAL_ID']);
     if ($data['payment_type'] != $cash->fk_modepaycash) {
         if ($data['points'] > 0) {
             $object->customer_pay = $data['total_with_points'];
         } else {
             $object->customer_pay = $data['total'];
         }
     } else {
         $object->customer_pay = $data['customerpay'];
     }
     $data['customerpay'] = $object->customer_pay;
     $object->diff_payment = $data['difpayment'];
     $object->id_source = $data['idsource'];
     $userstatic = new User($db);
     $userstatic->fetch($employee);
     $db->begin;
     $res = $object->update($userstatic->id);
     $data['ref'] = $object->ref;
     if ($res < 0) {
         $db->rollback();
         return -5;
     } else {
         //Adding lines
         $idLines = self::addTicketLines($lines, $idTicket);
         if ($idLines < 0) {
             $db->rollback();
             return -2;
         } else {
             $place = new Place($db);
             $place->fetch($object->fk_place);
             if ($object->statut != 0) {
                 //Adding Payments
                 $payment = self::addPayment($data);
                 if (!$payment) {
                     $db->rollback();
                     return -3;
                 } else {
                     if ($object->diff_payment <= 0) {
                         $object->set_paid($user);
                     }
                 }
                 //Decrease stock
                 $stock = self::quitSotck($lines);
                 if ($stock) {
                     $db->rollback();
                     return -4;
                 }
                 // liberar puesto
                 $place->free_place();
             } else {
                 // usar puesto
                 $place->set_place($idTicket);
             }
         }
     }
     $db->commit;
     return $idTicket;
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:97,代码来源:pos.class.mañanero.php

示例2: Place

 /**
  * Delete ticket and all the lines
  * @return number		<0 if KO, >0 if OK
  */
 function delete_ticket()
 {
     dol_include_once('/pos/class/place.class.php');
     global $user, $langs, $conf, $db;
     $sql = "DELETE FROM " . MAIN_DB_PREFIX . "pos_ticketdet WHERE fk_ticket=" . $this->id;
     $resql = $this->db->query($sql);
     if ($resql) {
         $sql = "DELETE FROM " . MAIN_DB_PREFIX . "pos_ticket";
         $sql .= " WHERE rowid= " . $this->id;
         $sql .= " AND entity = " . $conf->entity;
         $resql = $this->db->query($sql);
         if ($resql) {
             if ($this->statut == 0) {
                 $place = new Place($db);
                 $place->fetch($this->fk_place);
                 $place->free_place();
             }
             $this->db->commit();
             return 1;
         } else {
             $this->db->rollback();
             return -1;
         }
     } else {
         $this->db->rollback();
         return -1;
     }
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:32,代码来源:ticket.class.php


注:本文中的Place::free_place方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。