Files
OMS/app/ome/lib/desktop/widgets/service/delivery.php
2025-12-28 23:13:25 +08:00

82 lines
3.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
class ome_desktop_widgets_service_delivery{
/**
* 获取_menugroup
* @return mixed 返回结果
*/
public function get_menugroup(){
$deliCfgLib = kernel::single('wms_delivery_cfg');
$deliveryObj = app::get('wms')->model('delivery');
$data['label'] = '发货单';
$data['type'] = 'delivery';
$btncombi = $deliCfgLib->btnCombi();
$basicFilter = array('status'=>array('0'),'type'=>'normal');
#$unprintFilter = array('type'=>'normal','pause'=>'FALSE' ,'verify'=>'FALSE' ,'process'=>'FALSE','deli_cfg|notin'=>array('single','multi'));
//$unprintFilter = array('type'=>'normal','pause'=>'FALSE' ,'verify'=>'FALSE' ,'process'=>'FALSE');
switch ($btncombi) {
case '1_1':
$unprintFilter['todo'] = '1';
break;
case '1_0':
$unprintFilter['todo'] = '2';
break;
case '0_1':
$unprintFilter['todo'] = '3';
break;
case '0_0':
$unprintFilter['todo'] = '4';
break;
}
#获取自建仓库
$ownerBranch = array();
$ownerBranch = kernel::single('ome_branch_type')->getOwnBranchIds();
#非管理员取管辖仓
$is_super = kernel::single('desktop_user')->is_super();
if (!$is_super) {
$oBranch = app::get('ome')->model('branch');
$branch_ids = $oBranch->getBranchByUser(true);
if ($branch_ids) {
$tmp_filter['ext_branch_id'] = $branch_ids;
} else {
$tmp_filter['ext_branch_id'] = false;
}
}
#非管理员取管辖仓与自建仓的交集
$tmp_filter['ext_branch_id'] = $tmp_filter['ext_branch_id']?array_intersect($tmp_filter['ext_branch_id'], $ownerBranch) : $ownerBranch;
$basicFilter['ext_branch_id'] = $tmp_filter['ext_branch_id'];
$data['value'][0] = array(
'count' => $deliveryObj->count(array_merge($unprintFilter,$basicFilter)),
'link' => 'index.php?app=wms&ctl=admin_receipts_print&act=index&status=0&sku=',
'label' => '待打印',
);
$uncheckFilter = array('process_status'=>1);
$btncombi_single = $deliCfgLib->btnCombi('single');
$btncombi_multi = $deliCfgLib->btnCombi('multi');
$btncombi_basic = $deliCfgLib->btnCombi();
$uncheckFilter['print_finish'] = array(
''=> $btncombi_basic,
'single' => $btncombi_single,
'multi' => $btncombi_multi,
);
$data['value'][1] = array(
'count' => $deliveryObj->count(array_merge($uncheckFilter,$basicFilter)),
'link' => 'index.php?app=wms&ctl=admin_receipts_print&act=index&status=1',
'label' => '待校验',
);
$data['value'][2] = array(
'count' => $deliveryObj->count($basicFilter),
'link' => 'index.php?app=wms&ctl=admin_receipts_print&act=index&status=4',
'label' => '待发货',
);
return $data;
}
}