1. 【新增】售后单售后原因类型支持搜索

2. 【新增】手工创建订单折扣可输入正数

3. 【优化】盘点申请单确认

4. 【修复】采购退货单模拟出库失败问题

5. 【新增】订单金额客户实付与结算金额

6. 【优化】仓库发货统计报表物料名称显示

7. 【优化】自有仓储虚拟发货逻辑

8. 【修复】基础物料分类管理问题
This commit is contained in:
chenping
2026-04-01 11:59:17 +08:00
parent 9341122827
commit 61783b7d01
754 changed files with 46179 additions and 5700 deletions

View File

@@ -14,9 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class ome_finder_orders{
class ome_finder_orders
{
static $_syncErrorMsgs = null;
var $detail_basic = '基本信息';
@@ -335,6 +334,12 @@ class ome_finder_orders{
}
}
// 取消订单权限
$is_allow_cancel = true;
if (!kernel::single('desktop_user')->has_permission('ome.action.order.cancel')) {
$is_allow_cancel = false;
}
$render->pagedata['is_allow_cancel'] = $is_allow_cancel;
return $render->fetch('admin/order/detail_basic.html');
}
@@ -433,7 +438,7 @@ class ome_finder_orders{
}
// orderInfo
$orders = $oOrder->getRow($base_filter,'order_id,shop_type,order_source,process_status,settlement_amount');
$orders = $oOrder->dump($base_filter,'order_id,shop_type,order_source,process_status,settlement_amount');
if(empty($orders)){
$error_msg = '订单不存在,或者账号无权访问该订单明细';
return '<div style="padding:16px;color:#c00;">' . htmlspecialchars($error_msg, ENT_QUOTES, 'UTF-8') . '</div>';
@@ -611,12 +616,24 @@ class ome_finder_orders{
//福袋优惠分摊
$order_items[$luckybag_id]['part_mjz_discount'] = $itemVal['part_mjz_discount'];
//福袋客户实付
$order_items[$luckybag_id]['actually_amount'] = $itemVal['actually_amount'];
//福袋商家结算
$order_items[$luckybag_id]['settlement_amount'] = $itemVal['settlement_amount'];
}else{
//福袋实付金额
$order_items[$luckybag_id]['divide_order_fee'] += $itemVal['divide_order_fee'];
//福袋优惠分摊
$order_items[$luckybag_id]['part_mjz_discount'] += $itemVal['part_mjz_discount'];
//福袋客户实付
$order_items[$luckybag_id]['actually_amount'] += $itemVal['actually_amount'];
//福袋商家结算
$order_items[$luckybag_id]['settlement_amount'] += $itemVal['settlement_amount'];
}
//基础物料价格贡献比
@@ -634,6 +651,15 @@ class ome_finder_orders{
}
}
// 订单明细格式化把PKG组合放到数组末尾显示
if(isset($item_list['pkg'])){
$pkgItems = $item_list['pkg'];
unset($item_list['pkg']);
// pkg
$item_list['pkg'] = $pkgItems;
}
$render->pagedata['is_host'] = $is_host;
$render->pagedata['lucky_flag'] = $lucky_flag;
$render->pagedata['is_hold_time'] = $is_hold_time;
@@ -680,7 +706,7 @@ class ome_finder_orders{
//优惠券信息
$pmts = $oOrder_pmt->getList('*',array('order_id'=>$order_id));
$render->pagedata['pmts'] = $pmts;
if(in_array($orderInfo['shop_type'], ['luban','taobao','360buy','wxshipin'])) {
//if(in_array($orderInfo['shop_type'], ['luban','taobao','360buy'])) {
$couponOrder = app::get('ome')->model('order_coupon')->getList('type,type_name as pmt_describe,total_amount as pmt_amount, oid,material_bn,amount', array('order_id'=>$order_id));
$title = ['oid'=>'子单号','material_bn'=>'物料编号'];
$pmts = [];
@@ -693,9 +719,11 @@ class ome_finder_orders{
$pmts[$index][$pmtIndex] = ($pmts[$index][$pmtIndex] ? $pmts[$index][$pmtIndex] . ' | ' : '') . $pmt_amount;
$title[$pmtIndex] = $pmtIndex;
}
$render->pagedata['coupon']['title'] = $title;
$render->pagedata['coupon']['pmts'] = $pmts;
}
if($pmts) {
$render->pagedata['coupon']['title'] = $title;
$render->pagedata['coupon']['pmts'] = $pmts;
}
//}
if(in_array($orderInfo['shop_type'], ['360buy']) && $orderInfo['api_version'] < 3) {
$title = ['oid'=>'子单号','material_bn'=>'物料编号'];
foreach(app::get('ome')->model('order_coupon')->getList('type,type_name as pmt_describe', array('order_id'=>$order_id)) as $v) {
@@ -971,32 +999,15 @@ class ome_finder_orders{
if($_POST){
$order_id = $_POST['order']['order_id'];
//取出原备注信息
$oldmemo = $oOrders->dump(array('order_id'=>$order_id), 'mark_text');
$oldmemo= unserialize($oldmemo['mark_text']);
$op_name = kernel::single('desktop_user')->get_name();
if ($oldmemo)
foreach($oldmemo as $k=>$v){
$memo[] = $v;
}
$newmemo = htmlspecialchars($_POST['order']['mark_text']);
$newmemo = array('op_name'=>$op_name, 'op_time'=>date('Y-m-d H:i:s',time()), 'op_content'=>$newmemo);
$memo[] = $newmemo;
$_POST['order']['mark_text'] = serialize($memo);
$plainData = $_POST['order'];
$oOrders->save($plainData);
//写操作日志
$memo = "订单备注修改";
//订单留言 API
foreach(kernel::servicelist('service.order') as $object=>$instance){
if(method_exists($instance, 'update_memo')){
$instance->update_memo($order_id, $newmemo);
}
// 使用ome_order_marktext::add方法添加备注
list($success, $message) = kernel::single('ome_order_marktext')->add($order_id, $_POST['order']['mark_text'], $op_name);
if (!$success) {
// 可以在这里处理错误,比如显示错误消息
// 这里暂时不做特殊处理,因为原逻辑也没有错误处理
}
$oOperation_log = app::get('ome')->model('operation_log');
$oOperation_log->write_log('order_modify@ome',$order_id,$memo);
}
$order_detail = $oOrders->dump($order_id);
@@ -1193,7 +1204,7 @@ class ome_finder_orders{
return $render->fetch('admin/order/detail_shipment.html');
}
var $addon_cols = "print_status,confirm,dt_begin,status,process_status,tax_no,ship_status,op_id,group_id,mark_text,auto_status,custom_mark,mark_type,tax_company,createtime,paytime,sync,pay_status,is_cod,source,order_type,order_bool_type,timing_confirm,shop_type,tostr,itemnum,delivery_time,abnormal_status,shipping,order_source,is_delivery,step_trade_status";
var $addon_cols = "print_status,confirm,dt_begin,status,process_status,tax_no,ship_status,op_id,group_id,mark_text,auto_status,custom_mark,mark_type,tax_company,createtime,paytime,sync,pay_status,is_cod,source,order_type,order_bool_type,timing_confirm,shop_type,tostr,itemnum,delivery_time,abnormal_status,shipping,order_source,is_delivery,step_trade_status,is_not_combine";
var $column_confirm='操作';
var $column_confirm_width = "120";
@@ -1203,6 +1214,8 @@ class ome_finder_orders{
if($_GET['act'] == 'index') {
return $this->_get_index_btn($row);
}
return $this->_get_confirm_btn($row);
} elseif ($_GET['ctl']=='admin_order_lack') {
return $this->_get_lack_btn($row);
@@ -1356,18 +1369,19 @@ EOF;
if (($row[$this->col_prefix.'pay_status'] == 1 || $row[$this->col_prefix.'pay_status'] == 4 || ($row[$this->col_prefix.'is_cod'] == 'true' && ($row[$this->col_prefix.'pay_status'] == 0 || $row[$this->col_prefix.'pay_status'] == 3)) || ($row[$this->col_prefix.'pay_status'] == 3 && $row[$this->col_prefix.'step_trade_status'] == 'FRONT_PAID_FINAL_NOPAID' && kernel::single('ome_order_func')->checkPresaleOrder())|| kernel::single('ome_order')->canDeliveryFromBillLabel($labelCode) ) && in_array($row[$this->col_prefix.'process_status'], array('unconfirmed', 'confirmed','splitting')) && $row[$this->col_prefix.'ship_status'] == '0')
{
if ($row[$this->col_prefix.'confirm'] == 'N' && !in_array($row[$this->col_prefix.'process_status'],array('splited','cancel','remain_cancel')) && $row[$this->col_prefix.'status'] == 'active')
{
if ($row[$this->col_prefix.'confirm'] == 'N' && !in_array($row[$this->col_prefix.'process_status'],array('splited','cancel','remain_cancel')) && $row[$this->col_prefix.'status'] == 'active' && $row[$this->col_prefix.'is_not_combine'] == 0){
if($row[$this->col_prefix.'shop_type'] == '360buy' && $row[$this->col_prefix.'source'] == 'matrix') {
return $button_batch . ' | ' . $button_platform_split;
}
return $button_batch;
}
if (!in_array($row[$this->col_prefix.'process_status'],array('splited','unconfirmed','cancel','remain_cancel')) && $row[$this->col_prefix.'status'] == 'active'){
if (!in_array($row[$this->col_prefix.'process_status'],array('splited','unconfirmed','cancel','remain_cancel')) && $row[$this->col_prefix.'status'] == 'active' && $row[$this->col_prefix.'is_not_combine'] == 0){
if($row[$this->col_prefix.'shop_type'] == '360buy' && $row[$this->col_prefix.'source'] == 'matrix') {
return $button_batch . ' | ' . $button_platform_split;
}
return $button_batch;
}
}
@@ -1515,15 +1529,9 @@ EOF;
//新增
var $column_fail_status = '注意事项';
var $column_fail_status_width = "130";
function column_fail_status($row) {
//$order_id = $row['order_id'];
//$oObj = app::get('ome')->model('orders');
//$row = $oObj->dump($order_id,'*');
foreach ($row as $key => $val) {
$key = str_replace('_0_', '', $key);
$key = str_replace($this->col_prefix, '', $key);
$row[$key] = $val;
}
@@ -1551,11 +1559,11 @@ EOF;
var $column_deff_time_order_field = "createtime";
function column_deff_time($row) {
if ($row['_0_is_cod'] == 'true') {
$difftime = kernel::single('ome_func')->toTimeDiff(time(), $row['_0_createtime']);
if ($row[$this->col_prefix.'is_cod'] == 'true') {
$difftime = kernel::single('ome_func')->toTimeDiff(time(), $row[$this->col_prefix.'createtime']);
} else {
if ($row['_0_paytime'] > 0) {
$difftime = kernel::single('ome_func')->toTimeDiff(time(), $row['_0_paytime']);
if ($row[$this->col_prefix.'paytime'] > 0) {
$difftime = kernel::single('ome_func')->toTimeDiff(time(), $row[$this->col_prefix.'paytime']);
} else {
//return '<span style="color:red;font-weight:700;">未支付</span>';
return '';
@@ -2310,6 +2318,24 @@ EOF;
return $str;
}
var $column_is_not_combine = '是否允许审核';
var $column_is_not_combine_width = 230;
public function column_is_not_combine($row)
{
if($row[$this->col_prefix.'is_not_combine'] > 0){
// 加载不允许审核标签
$str = kernel::single('ome_order_combine_const')->getIdentifier($row[$this->col_prefix.'is_not_combine']);
$prefix_str = sprintf("<span class='tag-label' title='%s' style='background-color:%s;color:#ffffff;'>%s</span>", '不允许审核', '#FF1493', '否');
return $prefix_str . $str;
}else{
$str = sprintf("<span class='tag-label' title='%s' style='background-color:%s;color:#ffffff;'>%s</span>", '', '#00CD66', '是');
return $str;
}
}
/**
* 配送方式映射展示
*/