Exemplo n.º 1
0
 /**
  * 查询出入库记录
  *
  * @param string $sdate	开始入库日期
  * @param string $edate	结束入库日期
  * @param string $goodsName	品名
  * @param string $code		条码
  * @param string $billNo	单据号
  * @param string $inoutType	出/入库
  * @param string $place		仓库
  * @param string $billType	单据类型
  * @return array
  */
 public function query($sdate = '', $edate = '', $goodsName = '', $code = '*', $billNo = '', $inoutType = '', $place = '', $billType = '')
 {
     try {
         $stoks = new StocksManagerAction();
         $result = $stoks->query($sdate, $edate, $goodsName, $code, $billNo, $inoutType, '');
         return $result;
     } catch (Executive $e) {
         system_out("StocksManager.query Exception:{$e}");
         throw new Exception($e);
     }
 }
Exemplo n.º 2
0
 /**
  * 查询库存明细
  *
  * @param String $condition
  */
 public function queryStocksDetail($sdate = '', $edate = '', $goodsName = '', $barcode = '*', $client = '')
 {
     try {
         $action = new StocksManagerAction();
         $result = $action->query($sdate, $edate, $goodsName, $barcode, '', '', '', '', $client);
         if ($result) {
             //计算合计
             $sumrecord['goodsName'] = '合计:';
             $sumrecord["inqty"] = ExFunction::ex_array_sum($result, 'inqty');
             $sumrecord["outqty"] = ExFunction::ex_array_sum($result, 'outqty');
             array_push($result, $sumrecord);
         }
         $field = "billNo,billDate,goodsName,madeIn,code,factoryNo,spec,client,billType,inqty,outqty,voltage1,current1," . "direct,constant,grade,madeDate,memo,place,station";
         $struct = $action->getStruct();
         //如果字段不是全部的,则把必须的字段替换
         if ($field != '*') {
             $field = explode(',', $field);
             $visible = array("_type_" => "INCLUDE", "data" => $field);
             $struct["visible"] = $visible;
             $struct["item"] = $field;
         }
         $rtn["struct"] = $struct;
         $rtn["data"] = $result;
         return $rtn;
     } catch (Exception $e) {
         system_out("Report.queryStocksDetail error" . $e);
         throw new ExcelDateUtil($e);
     }
 }