mirror of
https://gitee.com/ShopeX/OMS
synced 2026-04-07 07:15:33 +08:00
1. 【新增】售后单售后原因类型支持搜索
2. 【新增】手工创建订单折扣可输入正数 3. 【优化】盘点申请单确认 4. 【修复】采购退货单模拟出库失败问题 5. 【新增】订单金额客户实付与结算金额 6. 【优化】仓库发货统计报表物料名称显示 7. 【优化】自有仓储虚拟发货逻辑 8. 【修复】基础物料分类管理问题
This commit is contained in:
@@ -38,6 +38,17 @@ class material_basic_check
|
||||
//新增标记
|
||||
$is_new_add = $params['edit'] ? false : true;
|
||||
unset($params['edit']);
|
||||
|
||||
// 去除基础物料编码前后空格
|
||||
if (isset($params['material_bn'])) {
|
||||
$params['material_bn'] = trim($params['material_bn']);
|
||||
}
|
||||
if (isset($params['material_spu'])) {
|
||||
$params['material_spu'] = trim($params['material_spu']);
|
||||
}
|
||||
if (isset($params['material_code'])) {
|
||||
$params['material_code'] = trim($params['material_code']);
|
||||
}
|
||||
|
||||
//检查物料名称
|
||||
if(empty($params['material_name'])){
|
||||
@@ -67,13 +78,16 @@ class material_basic_check
|
||||
if($is_new_add)
|
||||
{
|
||||
//判断物料编码和物料条码只能是由数字英文下划线组成
|
||||
$reg_bn_code = "/^[0-9a-zA-Z\_\#\-\/]*$/";
|
||||
if(!preg_match($reg_bn_code,$params["material_bn"])){
|
||||
$err_msg = "物料编码只支持(数字、英文、_下划线、-横线、#井号、/斜杠)";
|
||||
// 物料编号:支持数字、英文、下划线、横线、井号、斜杠、空格
|
||||
$reg_bn = "/^[0-9a-zA-Z\_\#\-\/ ]*$/";
|
||||
if(!preg_match($reg_bn,$params["material_bn"])){
|
||||
$err_msg = "物料编码只支持(数字、英文、_下划线、-横线、#井号、/斜杠、空格)";
|
||||
return false;
|
||||
}
|
||||
if(!preg_match($reg_bn_code,$params["material_code"])){
|
||||
$err_msg = "物料条码只支持[数字英文_-#\]组成";
|
||||
// 物料条码:支持数字、英文、下划线、横线、井号、斜杠(不支持空格)
|
||||
$reg_code = "/^[0-9a-zA-Z\_\#\-\/]*$/";
|
||||
if(!preg_match($reg_code,$params["material_code"])){
|
||||
$err_msg = "物料条码只支持(数字、英文、_下划线、-横线、#井号、/斜杠)组成";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -425,4 +425,30 @@ class material_basic_material{
|
||||
}
|
||||
return $smIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定不需要管控库存的基础物料
|
||||
*
|
||||
* @param $bmIds
|
||||
* @return void
|
||||
*/
|
||||
public function getNotCtrlStoreProducts($bmIds)
|
||||
{
|
||||
$basicMaterialObj = app::get('material')->model('basic_material');
|
||||
|
||||
// check
|
||||
if(empty($bmIds)){
|
||||
return [];
|
||||
}
|
||||
|
||||
// 不需要管控库存的基础物料
|
||||
$materialList = $basicMaterialObj->getList('bm_id,material_bn,type,is_ctrl_store', array('bm_id'=>$bmIds, 'is_ctrl_store'=>2));
|
||||
if(empty($materialList)){
|
||||
return [];
|
||||
}
|
||||
|
||||
$materialList = array_column($materialList, null, 'bm_id');
|
||||
|
||||
return $materialList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,6 +794,9 @@ class material_basic_material_stock extends ome_redis{
|
||||
$dateline = 'UNIX_TIMESTAMP()';
|
||||
if ($opt == '+') {
|
||||
$store = "store=IFNULL(store, 0)+" . $item['quantity'] . ',';
|
||||
|
||||
// 库存增加时,记录“库存最后添加时间”
|
||||
$store .= " inc_store_lastmodify=" . $dateline . ",";
|
||||
} else {
|
||||
// opt='-'的时候,$item['quantity']为负,所以用+
|
||||
if ($item['negative_stock'] == 'true'){
|
||||
|
||||
@@ -258,11 +258,18 @@ class material_basic_material_stock_freeze{
|
||||
$obj_bn = $freezeData['obj_bn'] ? : '';
|
||||
$sub_bill_type = $freezeData['sub_bill_type'] ? : '';
|
||||
$log_type = $freezeData['log_type'] ? $freezeData['log_type'] : '';
|
||||
|
||||
// check
|
||||
if(empty($bm_id) || empty($obj_type) || empty($bmsq_id)){
|
||||
$error_msg = '冻结基础数据缺失';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 基础物料不管控库存,则跳过
|
||||
if (isset($freezeData['is_product_ctrl_store']) && $freezeData['is_product_ctrl_store'] === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$num = intval($num);
|
||||
|
||||
// 是否增加基础物料的冻结
|
||||
@@ -442,6 +449,12 @@ class material_basic_material_stock_freeze{
|
||||
$obj_id = $obj_type = $bill_type = '';
|
||||
$obj_type_arr = $obj_id_arr = [];
|
||||
foreach ($items as $item) {
|
||||
|
||||
// 基础物料不管控库存,则跳过
|
||||
if (isset($item['is_product_ctrl_store']) && $item['is_product_ctrl_store'] === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$bm_id = $item['bm_id'];
|
||||
$obj_type = $item['obj_type'];
|
||||
$bill_type = $item['bill_type'] ? $item['bill_type'] : 0;
|
||||
|
||||
@@ -418,6 +418,7 @@ class material_basic_select
|
||||
|
||||
//根据仓库ID、基础物料ID获取该物料仓库级的预占
|
||||
$branch_product[$key]['store_freeze'] = $basicMStockFreezeLib->getBranchFreeze($val['product_id'], $val['branch_id']);
|
||||
$branch_product[$key]['available_store'] = max(0, $val['store'] - $branch_product[$key]['store_freeze']);
|
||||
}
|
||||
|
||||
$pro['branch_product'] = $branch_product;
|
||||
|
||||
Reference in New Issue
Block a user