mirror of
https://gitee.com/ShopeX/OMS
synced 2026-04-05 14:45:33 +08:00
1. 【新增】售后单售后原因类型支持搜索
2. 【新增】手工创建订单折扣可输入正数 3. 【优化】盘点申请单确认 4. 【修复】采购退货单模拟出库失败问题 5. 【新增】订单金额客户实付与结算金额 6. 【优化】仓库发货统计报表物料名称显示 7. 【优化】自有仓储虚拟发货逻辑 8. 【修复】基础物料分类管理问题
This commit is contained in:
@@ -73,11 +73,12 @@ class financebase_ctl_admin_expenses_splititem extends desktop_controller {
|
||||
$modelName = 'financebase_mdl_expenses_split';
|
||||
if($view == 3) {
|
||||
$params['base_filter'] = array('split_status' => ['1','2']);
|
||||
} else if($view == 0) {
|
||||
}
|
||||
if($view == 0) {
|
||||
$params['actions'][] = array(
|
||||
'label' => '导入对账状态',
|
||||
'href' => 'index.php?app=financebase&ctl=admin_expenses_splititem&act=importReconciled',
|
||||
'target' => "dialog::{width:500,height:200,title:'导入对账状态'}",
|
||||
'label' => '导入记账',
|
||||
'href' => $this->url.'&act=execlImportDailog&p[0]=expenses_split',
|
||||
'target' => 'dialog::{width:500,height:300,title:\'导入记账\'}',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -181,74 +182,4 @@ class financebase_ctl_admin_expenses_splititem extends desktop_controller {
|
||||
echo json_encode($retArr),'ok.';exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入对账状态页面
|
||||
*/
|
||||
public function importReconciled()
|
||||
{
|
||||
$this->display('admin/expenses/import_reconciled.html');
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理导入对账状态
|
||||
*/
|
||||
public function doImportReconciled()
|
||||
{
|
||||
$this->begin('index.php?app=financebase&ctl=admin_expenses_splititem&act=index');
|
||||
|
||||
if (!$_FILES['import_file']['tmp_name']) {
|
||||
$this->end(false, '请选择要导入的文件');
|
||||
}
|
||||
|
||||
$file = fopen($_FILES['import_file']['tmp_name'], 'r');
|
||||
if (!$file) {
|
||||
$this->end(false, '文件打开失败');
|
||||
}
|
||||
|
||||
// 读取标题行
|
||||
$header = fgetcsv($file);
|
||||
if (!$header || !in_array('id', $header) || !in_array('是否对账', $header)) {
|
||||
fclose($file);
|
||||
$this->end(false, '文件格式不正确,必须包含"id"和"是否对账"列');
|
||||
}
|
||||
|
||||
// 获取列的索引
|
||||
$idIndex = array_search('id', $header);
|
||||
$reconciledIndex = array_search('是否对账', $header);
|
||||
|
||||
$mdl = app::get('financebase')->model('expenses_split');
|
||||
$success = 0;
|
||||
$error = 0;
|
||||
|
||||
while (($data = fgetcsv($file)) !== false) {
|
||||
$id = $data[$idIndex];
|
||||
$isReconciled = $data[$reconciledIndex];
|
||||
|
||||
// 验证数据
|
||||
if (!$id || !in_array($isReconciled, ['是', '否'])) {
|
||||
$error++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 更新数据
|
||||
$result = $mdl->update(
|
||||
['confirm_status' => $isReconciled === '是' ? '1' : '0'],
|
||||
['id' => $id]
|
||||
);
|
||||
|
||||
if ($result) {
|
||||
$success++;
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
fclose($file);
|
||||
|
||||
if ($success > 0) {
|
||||
$this->end(true, sprintf('导入完成:成功 %d 条,失败 %d 条', $success, $error));
|
||||
} else {
|
||||
$this->end(false, '导入失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user