Beispiel #1
0
 /**
  * 渲染对应审核人员待审核出库单审核列表
  */
 public function view_getAuditOutStoreList()
 {
     $userid = $_SESSION['userId'];
     $whIoStoreAct = new WhIoStoreAct();
     $Inlists = $whIoStoreAct->act_getAuditOutStoreList($userid);
     //面包屑
     $navlist = array(array('url' => '', 'title' => '单据业务'), array('url' => '', 'title' => '待审核出库单'));
     $this->smarty->assign('toplevel', 3);
     $this->smarty->assign('secondlevel', 34);
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('ioType', 2);
     $this->smarty->assign('InStoreLists', $Inlists);
     //循环列表
     $this->smarty->display("whIoPendingStore.htm");
 }
Beispiel #2
0
 public function view_internalBuySubmit()
 {
     //单据明细组装
     $newArrays = array();
     if (is_array($_POST)) {
         foreach ($_POST['sku'] as $pkey => $pvalue) {
             $shippingArr = array();
             $newArray['sku'] = $pvalue;
             $newArray['amount'] = $_POST['num'][$pkey];
             $newArray['cost'] = $_POST['price'][$pkey];
             //$shippingArr	        = explode("-",$_POST['shipping'][$pkey]);
             $newArray['positionId'] = $_POST['shippingId'][$pkey];
             //仓位ID
             $newArray['purchaseId'] = $_POST['purchaseId'][$pkey];
             $newArrays[] = $newArray;
         }
     }
     //单据表头数据组装
     $storeInfoArr = array();
     $invoiceTypeId = $_POST['ioTypeinvoiceChoose'];
     //出入库单据类型列表ID
     $this->where = " where id = {$invoiceTypeId}";
     $InternalIoSellManagement = new InternalIoSellManagementAct();
     $invoiceTypeArr = $InternalIoSellManagement->act_invoiceTypeList($this->where);
     $ioType = $invoiceTypeArr[0]['ioType'];
     if ($ioType == 0) {
         $ioType = 1;
         //出库类型
     } else {
         if ($ioType == 1) {
             $ioType = 2;
             //入库类型
         }
     }
     $userId = $_SESSION['userId'];
     //申请人ID (未转换)$_POST['userId']
     $ordersn = $_POST['ordersn'];
     //单据号(单据编码)
     $note = trim($_POST['noteInput']);
     //备注
     $paymentMethodsId = isset($_POST['paymentMethods']) ? $_POST['paymentMethods'] : 3;
     //付款方式
     $companyId = 1;
     //公司ID
     $storeId = 1;
     //出库ID
     $storeInfoArr['invoiceTypeId'] = $invoiceTypeId;
     $storeInfoArr['ioType'] = $ioType;
     $storeInfoArr['userId'] = $userId;
     $storeInfoArr['ordersn'] = $ordersn;
     $storeInfoArr['note'] = $note;
     $storeInfoArr['paymentMethodsId'] = $paymentMethodsId;
     $storeInfoArr['companyId'] = $companyId;
     $storeInfoArr['storeId'] = $storeId;
     //插入表头
     $whIoStoreAct = new WhIoStoreAct();
     $internalBuyList = $whIoStoreAct->act_addWhIoStoreForWh($storeInfoArr);
     //返回0 插入错误  返回刚刚插入的ID 成功  插入明细表
     if ($internalBuyList != 0) {
         //插入明细
         foreach ($newArrays as $insertVal) {
             $insertVal['iostoreId'] = $internalBuyList;
             //出入库单据编号(id)
             //一条一条插入
             $storeDetailList = $whIoStoreAct->act_addWhIoStoreDetailForWh($insertVal);
             //if($storeDetailList){
             //echo $insertVal['sku']."提交成功!"."<br>";
             //}
         }
         header("location:index.php?mod=internalIoSell&act=internalUseIostoreList");
     } else {
         header("location:index.php?mod=internalIoSell&act=internalBuyList");
     }
 }
Beispiel #3
0
 function act_updateWhIoStoreStatus()
 {
     $id = isset($_GET['id']) ? $_GET['id'] : '';
     //id
     $ioStatus = $_GET['ioStatus'];
     //待修改数量的sku
     if (empty($id)) {
         self::$errCode = 0101;
         self::$errMsg = 'empty id';
         return 0;
     }
     if (!isset($_GET['ioStatus'])) {
         self::$errCode = 0201;
         self::$errMsg = 'unset ioStatus';
         return 0;
     }
     $ioStatus = intval($ioStatus);
     if ($ioStatus != 0 && $ioStatus != 1) {
         self::$errCode = 0301;
         self::$errMsg = 'illegal ioStatus';
         return 0;
     }
     $tName = 'wh_iostore';
     $set = "SET ioStatus='{$ioStatus}' ";
     $where = "WHERE id='{$id}' ";
     $affectRows = WhIoStoreModel::updateTNameRow($tName, $set, $where);
     if ($affectRows === FALSE) {
         //执行错误或者无affectedRow
         self::$errCode = 0401;
         self::$errMsg = 'updateRow error';
         return 0;
     } else {
         self::$errCode = 200;
         self::$errMsg = 'success';
         return $affectRows;
     }
 }