Ejemplo n.º 1
0
 /**
  * 保存
  *
  * @param Array $data  Example:$data["modify"] = array()
  *                             $data["delete"} = array()
  */
 public function save($data)
 {
     try {
         $stocks = new StocksManagerAction();
         $result = $stocks->save($data);
         if (!$result) {
             $result = $stocks->getError();
         }
         return $result;
     } catch (Executive $e) {
         system_out("StocksManager.save Exception:{$e}");
         throw new Exception($e);
     }
 }
Ejemplo n.º 2
0
 /**
  * 出仓发货确认
  *@param array $data  //单据数据
  * @param string $code  //表码
  * @return Boolean
  */
 public function confirmOutstation($data, $code)
 {
     try {
         $stocksmanager = new StocksManagerAction();
         $result = $stocksmanager->queryCurrentStocks("code ='{$code}'");
         if (sizeof($result) > 0) {
             $item = $result[0];
             $item["inoutType"] = 'OUT';
             $item["sysno"] = $data["sysno"];
             $item["billType"] = $data["billType"];
             $item["billDate"] = $data["billDate"];
             $item["billNo"] = $data["billNo"];
             $item["place"] = $data["place"];
             $item["placeno"] = $data["placeno"];
             $item["toplace"] = $data["toplace"];
             $item["sendMan"] = $data["sendMan"];
             $item["saveMan"] = $data["saveMan"];
             $item["client"] = $data["client"];
             $item["address"] = $data["address"];
             $item["inqty"] = 0;
             $item["outqty"] = $item["qty"];
             $item["id"] = '';
             $data = array();
             $data["modify"] = array($item);
             $rtn = $stocksmanager->save($data);
             if (!$rtn) {
                 $error = $stocksmanager->getError();
                 $this->setError($error);
                 return false;
             }
             return $rtn;
         } else {
             $this->setError("表库里没有该表");
             return false;
         }
     } catch (Executive $e) {
         system_out("UnconfirmstationAction.confirmOutStation error:{$e},\n\t\t\t\t\t\tcode:{$code},data:" . print_r($data, true));
         throw new Exception($e);
     }
 }