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:
103
app/finance/controller/gaptype.php
Normal file
103
app/finance/controller/gaptype.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ============================
|
||||
* @Author: yaokangming
|
||||
* @describe:
|
||||
* ============================
|
||||
*/
|
||||
class finance_ctl_gaptype extends desktop_controller {
|
||||
|
||||
public function index() {
|
||||
$actions = array();
|
||||
$actions[] = array(
|
||||
'label' => '新增',
|
||||
'href' => $this->url.'&act=add',
|
||||
'target' => 'dialog::{width:600,height:300,title:\'新增\'}',
|
||||
);
|
||||
$actions[] = array(
|
||||
'label' => '删除',
|
||||
'submit' => $this->url.'&act=delete',
|
||||
'confirm' => '确定要删除吗?',
|
||||
'target' => 'refresh',
|
||||
);
|
||||
$params = array(
|
||||
'title'=>'差异类型管理',
|
||||
'use_buildin_set_tag'=>false,
|
||||
'use_buildin_filter'=>true,
|
||||
'use_buildin_export'=>false,
|
||||
'use_buildin_recycle'=>false,
|
||||
'actions'=>$actions,
|
||||
'base_filter'=>['disabled'=>'false'],
|
||||
'orderBy'=>'id desc',
|
||||
);
|
||||
$this->finder('finance_mdl_gaptype', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增差异类型
|
||||
*/
|
||||
public function add() {
|
||||
$this->display('gaptype/form.html');
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑差异类型
|
||||
*/
|
||||
public function edit($id) {
|
||||
$mdl = app::get('finance')->model('gaptype');
|
||||
$row = $mdl->db_dump(['id'=>$id]);
|
||||
$this->pagedata['data'] = $row;
|
||||
$this->display('gaptype/form.html');
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存差异类型
|
||||
*/
|
||||
public function save() {
|
||||
$data = $_POST;
|
||||
$mdl = app::get('finance')->model('gaptype');
|
||||
if(empty($data['gap_name'])){
|
||||
$this->splash('error', null, '名称不能为空');
|
||||
}
|
||||
// 判断 gap_name 是否重复
|
||||
$filter = [
|
||||
'gap_name' => $data['gap_name'],
|
||||
'disabled' => 'false',
|
||||
];
|
||||
// 如果是编辑,排除自身
|
||||
if (isset($data['id']) && $data['id']) {
|
||||
$filter['id|notin'] = [$data['id']];
|
||||
}
|
||||
$count = $mdl->count($filter);
|
||||
if ($count > 0) {
|
||||
$this->splash('error', null, '类型名称已存在,请勿重复添加');
|
||||
}
|
||||
if(isset($data['id']) && $data['id']){
|
||||
$rs = $mdl->update($data, ['id'=>$data['id']]);
|
||||
if(is_bool($rs)){
|
||||
$this->splash('error', null, '保存失败');
|
||||
}
|
||||
}else{
|
||||
$rs = $mdl->insert($data);
|
||||
if(is_bool($rs)){
|
||||
$this->splash('error', null, '保存失败');
|
||||
}
|
||||
}
|
||||
$this->splash('success', $this->url, '保存成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除差异类型
|
||||
*/
|
||||
public function delete() {
|
||||
$mdl = app::get('finance')->model('gaptype');
|
||||
$row = $mdl->db_dump(['id'=>$_POST['id']]);
|
||||
if(!$row){
|
||||
$this->splash('error', null, '未找到该差异类型');
|
||||
}
|
||||
$mdl->update(['disabled'=>'true'], ['id'=>$_POST['id']]);
|
||||
$this->splash('success', $this->url, '删除成功');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -63,6 +63,11 @@ class finance_ctl_monthend_verification extends desktop_controller{
|
||||
'submit' => $this->url.'&act=ruleVerification&p[]='.$monthly_id.'&view='.$_GET['view'],
|
||||
'target' => 'dialog::{width:600,height:300,title:\'规则核销\'}'
|
||||
);
|
||||
$actions['import'] = array(
|
||||
'label' => '导入差异类型',
|
||||
'href' => 'index.php?app=finance&ctl=monthend_verification&act=displayImportV2&p[0]=finance_gap_type_import&finder_id={finder_id}&monthly_id='.$monthly_id,
|
||||
'target' => 'dialog::{width:760,height:300,title:\'' . app::get('desktop')->_('导入差异类型') . '\'}',
|
||||
);
|
||||
}
|
||||
if (!kernel::single('desktop_user')->has_permission('finance_export')) {
|
||||
unset($actions['export']);
|
||||
@@ -170,6 +175,16 @@ class finance_ctl_monthend_verification extends desktop_controller{
|
||||
|
||||
$this->pagedata['finder_id'] = $_GET['finder_id'];
|
||||
|
||||
// 获取差异类型列表(只显示有效的)
|
||||
$oGap = app::get('financebase')->model("gap");
|
||||
$gap_list = $oGap->getList('gap_name', array('status' => '1'));
|
||||
$this->pagedata['gap_list'] = $gap_list;
|
||||
|
||||
// 查询已保存的差异类型
|
||||
$mdlItem = app::get('finance')->model('monthly_report_items');
|
||||
$saved_gap_type = $mdlItem->getList('gap_type', array('order_bn' => $order_bn, 'monthly_id' => $monthly_id), 0, 1);
|
||||
$this->pagedata['saved_gap_type'] = $saved_gap_type ? $saved_gap_type[0]['gap_type'] : '';
|
||||
|
||||
$this->singlepage('monthed/verificate_detail.html');
|
||||
}
|
||||
|
||||
@@ -206,6 +221,19 @@ class finance_ctl_monthend_verification extends desktop_controller{
|
||||
*/
|
||||
public function doVerificate(){
|
||||
$this->begin('');
|
||||
|
||||
// 保存差异类型
|
||||
if($_POST['gap_type']) {
|
||||
$mdlBill = app::get('finance')->model('bill');
|
||||
$mdlBill->update(array('gap_type' => $_POST['gap_type']), array('order_bn' => $_POST['order_bn'], 'monthly_id' => $_POST['monthly_id']));
|
||||
|
||||
$mdlAr = app::get('finance')->model('ar');
|
||||
$mdlAr->update(array('gap_type' => $_POST['gap_type']), array('order_bn' => $_POST['order_bn'], 'monthly_id' => $_POST['monthly_id']));
|
||||
|
||||
$mdlItem = app::get('finance')->model('monthly_report_items');
|
||||
$mdlItem->update(array('gap_type' => $_POST['gap_type']), array('order_bn' => $_POST['order_bn'], 'monthly_id' => $_POST['monthly_id']));
|
||||
}
|
||||
|
||||
$res = kernel::single('finance_verification')->doManVerificate($_POST);
|
||||
$this->end(true, app::get('base')->_('核销成功'));
|
||||
}
|
||||
@@ -295,6 +323,16 @@ class finance_ctl_monthend_verification extends desktop_controller{
|
||||
$this->pagedata['monthly_id'] = $monthly_id;
|
||||
$this->pagedata['order_bn'] = $order_bn;
|
||||
|
||||
// 获取差异类型列表(只显示有效的)
|
||||
$oGap = app::get('financebase')->model("gap");
|
||||
$gap_list = $oGap->getList('gap_name', array('status' => '1'));
|
||||
$this->pagedata['gap_list'] = $gap_list;
|
||||
|
||||
// 查询已保存的差异类型
|
||||
$mdlItem = app::get('finance')->model('monthly_report_items');
|
||||
$saved_gap_type = $mdlItem->getList('gap_type', array('order_bn' => $order_bn, 'monthly_id' => $monthly_id), 0, 1);
|
||||
$this->pagedata['saved_gap_type'] = $saved_gap_type ? $saved_gap_type[0]['gap_type'] : '';
|
||||
|
||||
$this->display('monthed/gap_type.html');
|
||||
}
|
||||
|
||||
@@ -428,4 +466,32 @@ class finance_ctl_monthend_verification extends desktop_controller{
|
||||
);
|
||||
$this->finder('sales_mdl_sales', $params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新版导出模板方法,参考订单的实现方式
|
||||
*/
|
||||
public function exportTemplateV2()
|
||||
{
|
||||
$fileName = "差异类型导入模板.xlsx";
|
||||
$title = app::get('finance')->model('monthly_report_items')->exportTemplateV2('finance_monthly_report_items_import');
|
||||
kernel::single('omecsv_phpoffice')->export($fileName, [0 => $title]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入差异类型页面
|
||||
*/
|
||||
public function displayImportV2($type='', $extraParams=[])
|
||||
{
|
||||
// 如果是财务差异类型导入,添加monthly_id
|
||||
if ($type === 'finance_gap_type_import' && isset($_GET['monthly_id'])) {
|
||||
$extraParams[] = [
|
||||
'name' => 'queue_data[monthly_id]',
|
||||
'value' => $_GET['monthly_id']
|
||||
];
|
||||
}
|
||||
|
||||
// 调用父类方法,传递额外参数
|
||||
parent::displayImportV2($type, $extraParams);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,13 +33,13 @@ class finance_ctl_setting_init extends desktop_controller{
|
||||
$init_time = app::get('finance')->getConf('finance_setting_init_time');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$this->pagedata['year'] = $year;
|
||||
$this->pagedata['month'] = $month;
|
||||
$this->pagedata['day'] = $day;
|
||||
$this->pagedata['init_time'] = $init_time;
|
||||
$this->pagedata['isSaveInitTime'] = $init_time ? 'true' : 'false';
|
||||
$this->pagedata['isSaveInitTime'] = 'false';
|
||||
$this->pagedata['isInit'] = $init_time['flag'];
|
||||
|
||||
$this->pagedata['feeTypeCount'] = app::get('financebase')->model('bill_fee_type')->count();
|
||||
@@ -79,8 +79,9 @@ class finance_ctl_setting_init extends desktop_controller{
|
||||
$queueData['create_time'] = time();
|
||||
$queueData['queue_name'] = sprintf("账期初始化_%s", $monthly_date);
|
||||
$queueData['queue_data'] = array('begin_time' => $init_date_time, 'end_time' => $next_data_time - 1, 'monthly_date' => $monthly_date);
|
||||
|
||||
$queue_id = $oQueue->insert($queueData);
|
||||
$queue_id and financebase_func::addTaskQueue(array('queue_id'=>$queue_id),'initmonthlyreport');
|
||||
//$queue_id and financebase_func::addTaskQueue(array('queue_id'=>$queue_id),'initmonthlyreport');
|
||||
|
||||
$init_date_time = $next_data_time;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user