本文整理汇总了PHP中CommonModel::adjustPrintNum方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonModel::adjustPrintNum方法的具体用法?PHP CommonModel::adjustPrintNum怎么用?PHP CommonModel::adjustPrintNum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonModel
的用法示例。
在下文中一共展示了CommonModel::adjustPrintNum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: act_pdaAdjust
public function act_pdaAdjust()
{
$userCnName = $_SESSION['userCnName'];
$userId = $_SESSION['userId'];
$groupid = trim($_POST['groupid']);
$num = intval(trim($_POST['num']));
if ($num == 0) {
self::$errCode = "401";
self::$errMsg = "请输入正数";
return false;
}
$list = packageCheckModel::getSKUByGroupId($groupid);
if ($list) {
OmAvailableModel::begin();
$entryStatus = 0;
$nums = -$num;
$id = $list[0]['id'];
$batchNum = $list[0]['batchNum'];
$sku = $list[0]['sku'];
$beforeNum = $list[0]['num'];
$ichibanNums = $list[0]['ichibanNums'];
$shelvesNums = $list[0]['shelvesNums'];
$now_num = $beforeNum - $num;
$u_num = -$num;
/** 判断点货调整后数量是否为负数**/
if ($now_num <= 0) {
self::$errCode = 203;
self::$errMsg = "调整后数量必须大于0!";
return false;
}
/** 已上架情况下不许调整**/
if ($shelvesNums) {
self::$errCode = 203;
self::$errMsg = "料号已有上架数,不能调整!";
return false;
}
/** 判断有良品的情况下调整数量只能小于原先点货数量**/
if ($ichibanNums && $now_num > $beforeNum) {
self::$errCode = 203;
self::$errMsg = "良品存在时,点货调整后数量必须小于原点货数量!";
return false;
}
CommonModel::adjustPrintNum($batchNum, $nums);
//去除qc数量
if ($shelvesNums == 0) {
//释放采购hold住数量
$delCheckOnWaySku = CommonModel::checkOnWaySkuNum($sku, $beforeNum, 2);
//验证sku在途数量是否足够
$checkOnWaySku = CommonModel::checkOnWaySkuNum($sku, $now_num, 1);
if ($checkOnWaySku == 0) {
$u_num = -$num;
} else {
$entryStatus = 1;
$u_num = -$beforeNum;
}
}
$updateinfo = packageCheckModel::updateRecord($id, $nums, $entryStatus);
if (!$updateinfo) {
self::$errCode = 203;
self::$errMsg = "更新点货记录失败!";
OmAvailableModel::rollback();
return false;
}
$insertinfo = packageCheckModel::insertAdjustRecord($id, $nums, $beforeNum, $userId);
if (!$insertinfo) {
self::$errCode = 204;
self::$errMsg = "插入点货调整记录失败!";
OmAvailableModel::rollback();
return false;
}
$updatestore = packageCheckModel::updateStore($sku, $u_num);
if (!updatestore) {
self::$errCode = 205;
self::$errMsg = "更新总库存失败!";
OmAvailableModel::rollback();
return false;
}
if ($ichibanNums != 0 && $ichibanNums != NULL) {
$updateIchibanNums = packageCheckModel::updateIchibanNums($nums, $id);
if ($shelvesNums != 0) {
$updateshelvesNums = packageCheckModel::updateShelvesNums($nums, $sku, $id);
if (!$updateshelvesNums) {
self::$errCode = 206;
self::$errMsg = "更新上架库存失败!";
OmAvailableModel::rollback();
return false;
}
$update_onhand = CommonModel::adjustOut($sku, $nums, $userCnName);
if ($update_onhand == 0) {
self::$errCode = 206;
self::$errMsg = "更新旧erp库存失败";
OmAvailableModel::rollback();
return false;
}
}
}
self::$errMsg = "调整成功";
OmAvailableModel::commit();
return true;
} else {
//.........这里部分代码省略.........