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,27 +14,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* 供应商货品
* 供应商基础物料
*
* @access public
* @author wangbiao<wangbiao@shopex.cn>
*/
class purchase_ctl_admin_supplier_goods extends desktop_controller{
var $name = "供应商货品";
var $name = "供应商基础物料";
var $workground = "purchase_manager";
/*
* 供应商货品列表
* 供应商基础物料列表
*/
function index()
{
$finder_id = $_REQUEST['_finder']['finder_id'];
$base_filter = array();
$params = array('title'=>'供应商货品管理',
$params = array('title'=>'供应商基础物料管理',
'actions'=>array(
array(
'label' => '物料关联',
@@ -396,7 +395,7 @@ class purchase_ctl_admin_supplier_goods extends desktop_controller{
{
header("Content-Type: text/csv");
$filename = "供应商货品模板.csv";
$filename = "供应商基础物料模板.csv";
$encoded_filename = urlencode($filename);
$encoded_filename = str_replace("+", "%20", $encoded_filename);

View File

@@ -0,0 +1,59 @@
<?php
$db['po_items_props'] = array(
'columns' => array(
'id' => array(
'type' => 'int unsigned',
'extra' => 'auto_increment',
'pkey' => true,
'editable' => false,
'label' => '自增ID',
),
'item_id' => array(
'type' => 'table:po_items@purchase',
'label' => '采购单明细ID',
'parent_id' => true,
'in_list' => true,
'default_in_list' => true,
'order' => 10,
),
'props_col' => array(
'type' => 'varchar(255)',
'label' => '键名',
'in_list' => true,
'default_in_list' => true,
'order' => 20,
),
'props_value' => array(
'type' => 'varchar(255)',
'label' => '键值',
'in_list' => true,
'default_in_list' => true,
'order' => 30,
),
'at_time' => array(
'type' => 'TIMESTAMP',
'label' => '创建时间',
'default' => 'CURRENT_TIMESTAMP',
'in_list' => true,
'default_in_list' => true,
'order' => 1000,
),
'up_time' => array(
'type' => 'TIMESTAMP',
'label' => '更新时间',
'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
'in_list' => true,
'default_in_list' => true,
'order' => 1010,
),
),
'index' => array(
'idx_props_col' => array('columns' => array('props_col')),
'idx_at_time' => array('columns' => array('at_time')),
'idx_up_time' => array('columns' => array('up_time')),
),
'engine' => 'innodb',
'commit' => '',
'version' => 'Rev: 41996 $',
);

View File

@@ -0,0 +1,60 @@
<?php
$db['po_props'] = array(
'columns' => array(
'id' => array(
'type' => 'int unsigned',
'extra' => 'auto_increment',
'pkey' => true,
'editable' => false,
'label' => '自增ID',
),
'po_id' => array(
'type' => 'table:po@purchase',
'label' => '采购单ID',
'parent_id' => true,
'in_list' => true,
'default_in_list' => true,
'order' => 10,
),
'props_col' => array(
'type' => 'varchar(255)',
'label' => '键名',
'in_list' => true,
'default_in_list' => true,
'order' => 20,
),
'props_value' => array(
'type' => 'varchar(255)',
'label' => '键值',
'in_list' => true,
'default_in_list' => true,
'order' => 30,
),
'at_time' => array(
'type' => 'TIMESTAMP',
'label' => '创建时间',
'default' => 'CURRENT_TIMESTAMP',
'in_list' => true,
'default_in_list' => true,
'order' => 1000,
),
'up_time' => array(
'type' => 'TIMESTAMP',
'label' => '更新时间',
'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
'in_list' => true,
'default_in_list' => true,
'order' => 1010,
),
),
'index' => array(
'idx_props_col' => array('columns' => array('props_col')),
'idx_at_time' => array('columns' => array('at_time')),
'idx_up_time' => array('columns' => array('up_time')),
),
'engine' => 'innodb',
'commit' => '',
'version' => 'Rev: 41996 $',
);

View File

@@ -38,7 +38,7 @@
<permission id="purchase_eo">入库单</permission>
<permission id="purchase_returned">采购退货单</permission>-->
<permission id="purchase_supplier">供应商</permission>
<permission id="purchase_supplier_goods">供应商货品</permission>
<permission id="purchase_supplier_goods">供应商基础物料</permission>
<permission id="purchase_do_need">补货提醒</permission>
@@ -85,7 +85,7 @@
<workground name="基础档案" id="goods_manager" order="600" icon="icon-jichudangan-01">
<menugroup name="供应商管理" en="supplier-management">
<menu controller='admin_supplier' action='index' permission='purchase_supplier' display='true' order='5000100'>供应商</menu>
<menu controller='admin_supplier_goods' action='index' permission='purchase_supplier_goods' display='true' order='5000101'>供应商货品</menu>
<menu controller='admin_supplier_goods' action='index' permission='purchase_supplier_goods' display='true' order='5000101'>供应商基础物料</menu>
</menugroup>
</workground>
<workground name="单据报表" id="invoice_center" order="1200" icon="icon-danjubaobiao-01">

View File

@@ -36,7 +36,7 @@ return array (
'采购订单' => 'Purchase Order',
'采购退货单' => 'Purchase Return Form',
'供应商' => 'Supplier',
'供应商货品' => 'Supplier Product',
'供应商货品' => 'Supplier Basic Material',
'采购结算统计' => 'Purchase Settlement Statistics',
'现购单' => 'Cash Purchase Order',
'赊购单' => 'Credit Purchase Order',

View File

@@ -36,7 +36,7 @@ return array (
'采购订单' => '仕入註文',
'采购退货单' => '仕入返品伝票',
'供应商' => 'サプライヤー',
'供应商货品' => '納品品',
'供应商货品' => 'サプライヤー基本物料',
'采购结算统计' => '仕入決算統計',
'现购单' => 'ご購入伝票',
'赊购单' => '掛け買い伝票',

View File

@@ -36,7 +36,7 @@ return array (
'采购订单' => '采购订单',
'采购退货单' => '采购退货单',
'供应商' => '供应商',
'供应商货品' => '供应商货品',
'供应商货品' => '供应商基础物料',
'采购结算统计' => '采购结算统计',
'现购单' => '现购单',
'赊购单' => '赊购单',

View File

@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class purchase_finder_supplier{
var $detail_basic = "详细信息";
var $detail_current_account = "往来帐";
@@ -99,7 +98,7 @@ class purchase_finder_supplier{
$supplier_bn = $row[$this->col_prefix.'bn'];
//$button .= "&nbsp;&nbsp;&nbsp;<a class=\"lnk\" href=\"index.php#app=ome&amp;ctl=admin_goods&p[0]=$supplier_id\" target=\"_blank\">查看商品</a>";
$url='index.php?app=desktop&act=alertpages&goto='.urlencode('index.php?app=purchase&ctl=admin_purchase&act=findMaterial&p[0]='.$supplier_id);
$button .= "&nbsp;&nbsp;&nbsp;<a class=\"lnk\" href=\"".$url."\" target='_blank'>查看关联货品</a>";
$button .= "&nbsp;&nbsp;&nbsp;<a class=\"lnk\" href=\"".$url."\" target='_blank'>查看关联基础物料</a>";
//往来帐
//$button .= "&nbsp;&nbsp;<span class=\"lnk\" onclick=\"new Dialog('index.php?app=purchase&amp;ctl=admin_statement&act=statement_counter&p[0]=$supplier_id',{height:300,width:750,title:'$supplier_name - 往来账(供应商编号:$supplier_bn)'});\">往来账</span>";
//预付款
@@ -139,4 +138,4 @@ class purchase_finder_supplier{
}
*/
}
?>
?>

View File

@@ -16,7 +16,7 @@
*/
/***
* 导入供应商货品数据
* 导入供应商基础物料数据
*/
class purchase_supplier_goods_to_import
{

View File

@@ -1128,6 +1128,8 @@ class purchase_mdl_po extends dbeav_model{
"*:条形码" => mb_convert_encoding($item['barcode'], 'GBK', 'UTF-8'),
"*:数量" => $item['num'],
"*:已入库数量" => $item['in_num'],
"*:入库取消" => $item['out_num'],
"*:不良品" => $item['defective_num'],
"*:价格" => $item['price'],
);
$data[$row_num] = implode(',', $temp_row);
@@ -1143,6 +1145,8 @@ class purchase_mdl_po extends dbeav_model{
'*:条形码',
'*:数量',
'*:已入库数量',
'*:入库取消',
'*:不良品',
'*:价格',
);
foreach ((array)$title as $key => $value) {

View File

@@ -14,14 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* CSV导入
*/
class purchase_mdl_supplier_goods extends dbeav_model {
* 供应商商品
*/
class purchase_mdl_supplier_goods extends dbeav_model{
/*
* 获取供应商商品列表
*/
function getSupplierGoods($supplier_id=null){
$filter = array("supplier_id"=>$supplier_id);
@@ -43,10 +44,6 @@ class purchase_mdl_supplier_goods extends dbeav_model {
return $base_filter;
}
/**
* 搜索Options
* @return mixed 返回值
*/
public function searchOptions()
{
return array(
@@ -55,13 +52,6 @@ class purchase_mdl_supplier_goods extends dbeav_model {
);
}
/**
* _filter
* @param mixed $filter filter
* @param mixed $tableAlias tableAlias
* @param mixed $baseWhere baseWhere
* @return mixed 返回值
*/
public function _filter($filter,$tableAlias=null,$baseWhere=null)
{
$where = ' 1 ';
@@ -157,7 +147,7 @@ class purchase_mdl_supplier_goods extends dbeav_model {
foreach($pSdf as $v){
$queueData = array(
'queue_title'=>'供应商货品导入',
'queue_title'=>'供应商基础物料导入',
'start_time'=>time(),
'params'=>array(
'sdfdata'=>$v,
@@ -228,7 +218,7 @@ class purchase_mdl_supplier_goods extends dbeav_model {
$tempData = $this->dump(array('supplier_id'=>$sdfRow['supplier_id'], 'bm_id'=>$sdfRow['bm_id']), '*');
if($tempData)
{
$msg['error'] = '供应商货品关系已经存在,不能重复导入!';
$msg['error'] = '供应商基础物料关系已经存在,不能重复导入!';
return false;
}
@@ -245,4 +235,4 @@ class purchase_mdl_supplier_goods extends dbeav_model {
return null;
}
}
?>
?>

View File

@@ -20,156 +20,141 @@
<form action="index.php?<{$env.server.QUERY_STRING}>" method="post" id="modifyForm">
<input type="hidden" name="supplier_id" value=<{$detail.supplier_id}> />
<div class="tableform">
<h3>基本信息</h3>
<div class="division">
<table width='100%' cellspacing="0" cellpadding="0">
<tr>
<td colspan="4"><h3>基本信息</h3></td>
</tr>
<tr>
<th>供应商编码:</th>
<td>
<input type="hidden" name="ini_bn" value="<{$detail.bn}>" />
<input type="text" name="bn" value="<{$detail.bn}>" vtype="required" /> <em class="c-red">*</em>
</td>
<th>供应商名称:</th>
<td>
<input type="hidden" value="<{$detail.name}>" name="ini_name" />
<input type="text" value="<{$detail.name}>" name="name" vtype="required" /> <em class="c-red">*</em></td>
</tr>
<tr>
<th>供应商快速索引:</th>
<td>
<{input type="text" name="brief" id="brief" value="{$detail.brief}" size='12' maxlength='20' }>
</td>
<th>公司名称:</th>
<td>
<{input type="text" name="company" id="company" value="{$detail.company}" maxlength='20' size='20' }>
</td>
<table width='100%' cellspacing="0" cellpadding="0">
<tr>
<th>供应商编码:</th>
<td>
<input type="hidden" name="ini_bn" value="<{$detail.bn}>" />
<input type="text" name="bn" value="<{$detail.bn}>" vtype="required" /> <em class="c-red">*</em>
</td>
<th>供应商名称:</th>
<td>
<input type="hidden" value="<{$detail.name}>" name="ini_name" />
<input type="text" value="<{$detail.name}>" name="name" vtype="required" /> <em class="c-red">*</em></td>
</tr>
<tr>
<th>供应商快速索引:</th>
<td>
<{input type="text" name="brief" id="brief" value="{$detail.brief}" size='12' maxlength='20' }>
</td>
<th>公司名称:</th>
<td>
<{input type="text" name="company" id="company" value="{$detail.company}" maxlength='20' size='20' }>
</td>
</tr>
<tr>
<th>所在地区:</th>
<td>
<{if $detail.area_defined and $detail.area<>'' }>
<{input id="area_defined" type="text" name="area" value="{$detail.area}" size="28" }>
<span id="area" style="display:none;">
<{input type='region' app='eccommon' name="area" value=""}>
</span>
<{button name="modify" id="modify" label="修改" }>
<{button name="cancel_modify" style="display:none" id="cancel_modify" label="取消" }>
</tr>
<{else}>
<{input type='region' app='eccommon' name="area" value="{$detail.area}" }>
<{/if}>
</td>
<th>街道地址:</th>
<td>
<{input type="text" name="addr" value="{$detail.addr}" size="30" }>
</td>
</tr>
<tr>
<th>邮编:</th>
<td><{input type="text" value="{$detail.zip}" name="zip" size="6" }></td>
<th>电话/手机:</th>
<td><{input type="text" value="{$detail.telphone}" name="telphone" size="12" }></td>
</tr>
<tr>
<th>信用等级:</th>
<td>
<select name="credit_lv">
<option value="">请选择</option>
<{foreach from=$credit_lev item=value key=keys }>
<option value="<{$keys}>" <{if $detail.credit_lv==$keys}> selected <{/if}> ><{$value}></option>
<{/foreach}>
</select>
</td>
<th>传真:</th>
<td><{input type="text" name="fax" value="{$detail.fax}" size="12" }></td>
</tr>
<tr>
<th>到货天数:</th>
<td>
<{input type="number" name="arrive_days" value="{$detail.arrive_days}" size='3' }> <span class="notice-inline"></span>
</td>
<th>采购员:</th>
<td>
<{input type="text" name="operator" value="{$detail.operator}" size="8" }>
</td>
</tr>
<tr>
<th>供应品牌:</th>
<td colspan="3">
<{foreach from=$brandlist item=brand}>
<input type="checkbox" name="brand[]" value="<{$brand.brand_id}>" <{if in_array($brand.brand_id, $brand_detail)}>checked<{/if}> ><{$brand.brand_name}>
<{/foreach}>
</td>
</tr>
<tr>
<th>备注:</th>
<td colspan="3"><{input type="textarea" name="memo" value="{$detail.memo}" rows="5" style="width:90%" }></td>
</tr>
</table>
</div>
<h3>联系人信息</h3>
<div class="division">
<table class="gridlist" cellpadding="0" cellspacing="0" style="width:100%">
<caption>
<{button label="添加联系人" id="add_lianximan" }>
</caption>
<thead>
<th style="width:20%">联系人</th>
<th style="width:20%">电话</th>
<th style="width:25%">E-mail</th>
<th style="width:20%">qq/旺旺</th>
<th style="width:5%">操作</th>
</thead>
<tbody id="lianximan">
<{foreach from=$detail.contacter item=items}>
<tr>
<th>所在地区:</th>
<td>
<{if $detail.area_defined and $detail.area<>'' }>
<{input id="area_defined" type="text" name="area" value="{$detail.area}" size="28" }>
<span id="area" style="display:none;">
<{input type='region' app='eccommon' name="area" value=""}>
</span>
<{button name="modify" id="modify" label="修改" }>
<{button name="cancel_modify" style="display:none" id="cancel_modify" label="取消" }>
<{else}>
<{input type='region' app='eccommon' name="area" value="{$detail.area}" }>
<{/if}>
</td>
<th>街道地址:</th>
<td>
<{input type="text" name="addr" value="{$detail.addr}" size="30" }>
</td>
<td><input type="text" size="15" name="lianxi_name[]" value="<{$items.name}>"></td>
<td><input type="text" size="15" name="lianxi_telphone[]" value="<{$items.telphone}>"></td>
<td><input type="text" size="15" name="lianxi_email[]" value="<{$items.email}>"></td>
<td><input type="text" size="15" name="lianxi_qqwangwang[]" value="<{$items.qqwangwang}>"></td>
<td><{img src="bundle/delecate.gif" app="desktop" class="pointer del"}></td>
</tr>
<{/foreach}>
</tbody>
</table>
</div>
<tr>
<th>邮编:</th>
<td><{input type="text" value="{$detail.zip}" name="zip" size="6" }></td>
<th>电话/手机:</th>
<td><{input type="text" value="{$detail.telphone}" name="telphone" size="12" }></td>
</tr>
<h3>财务信息</h3>
<div class="division">
<table cellspacing="0" cellpadding="0">
<tr>
<th>开户行:</th>
<td><{input type="text" name="bank" value="{$detail.bank}" size="32" }></td>
<th>银行帐号:</th>
<td>
<{input type="text" name="account" value="{$detail.account}" size="32" }>
</td>
</tr>
</table>
</div>
</div>
<tr>
<th>信用等级:</th>
<td>
<select name="credit_lv">
<option value="">请选择</option>
<{foreach from=$credit_lev item=value key=keys }>
<option value="<{$keys}>" <{if $detail.credit_lv==$keys}> selected <{/if}> ><{$value}></option>
<{/foreach}>
</select>
</td>
<th>传真:</th>
<td><{input type="text" name="fax" value="{$detail.fax}" size="12" }></td>
</tr>
<tr>
<th>到货天数:</th>
<td>
<{input type="number" name="arrive_days" value="{$detail.arrive_days}" size='3' }> <span class="notice-inline"></span>
</td>
<th>采购员:</th>
<td>
<{input type="text" name="operator" value="{$detail.operator}" size="8" }>
</td>
</tr>
<tr>
<th>供应品牌:</th>
<td colspan="3">
<{foreach from=$brandlist item=brand}>
<input type="checkbox" name="brand[]" value="<{$brand.brand_id}>" <{if in_array($brand.brand_id, $brand_detail)}>checked<{/if}> ><{$brand.brand_name}>
<{/foreach}>
</td>
</tr>
<tr>
<th>备注:</th>
<td colspan="3"><{input type="textarea" name="memo" value="{$detail.memo}" rows="5" style="width:90%" }></td>
</tr>
<tr>
<td colspan="4"><h3>联系人信息</h3></td>
</tr>
<tr>
<td colspan="4">
<table class="gridlist" cellpadding="0" cellspacing="0" style="width:100%">
<caption>
<{button label="添加联系人" id="add_lianximan" }>
</caption>
<thead>
<th style="width:20%">联系人</th>
<th style="width:20%">电话</th>
<th style="width:25%">E-mail</th>
<th style="width:20%">qq/旺旺</th>
<th style="width:5%">操作</th>
</thead>
<tbody id="lianximan">
<{foreach from=$detail.contacter item=items}>
<tr>
<td><input type="text" size="15" name="lianxi_name[]" value="<{$items.name}>"></td>
<td><input type="text" size="15" name="lianxi_telphone[]" value="<{$items.telphone}>"></td>
<td><input type="text" size="15" name="lianxi_email[]" value="<{$items.email}>"></td>
<td><input type="text" size="15" name="lianxi_qqwangwang[]" value="<{$items.qqwangwang}>"></td>
<td><{img src="bundle/delecate.gif" app="desktop" class="pointer del"}></div>
</tr>
<{/foreach}>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="4"><h3>财务信息</h3></td>
</tr>
<tr>
<th>开户行:</th>
<td><{input type="text" name="bank" value="{$detail.bank}" size="32" }></td>
<th>银行帐号:</th>
<td>
<{input type="text" name="account" value="{$detail.account}" size="32" }>
</td>
</tr>
</table>
</div>
</div>
<div class="table-action">
<{input type="hidden" name="editSubmit" value="do" }>
<{button class="btn-primary" type="submit" id="modify" label="保存"}>
<{button class="btn-secondary" type="button" id="closeBut" label="取消"}>
</div>
<div class="table-action">
<{input type="hidden" name="editSubmit" value="do" }>
<{button class="btn-primary" type="submit" id="modify" label="保存"}>
<{button class="btn-secondary" type="button" id="closeBut" label="取消"}>
</div>
</form>
<script>
(function(){
@@ -196,17 +181,6 @@ $('modifyForm').store('target',{
$('closeBut').addEvent('click', function(event){
window.close();
});
//选择品牌
$('choice_brand').addEvent('click',function(){
var url = 'index.php?<{$env.server.QUERY_STRING|replace:"editsupplier":"choice_brand"}>&p[0]=';
new Dialog(url,{
title:'品牌选择',
width:550,
height:300,
modal:true,
resizeable:false
});
});
//删除联系人
function del(obj,type){
if (type==0) var parent = obj.getParent();
@@ -229,27 +203,6 @@ $('add_lianximan').addEvent('click', function(){
});
});
/*
$('add_lianximan').addEvent('click', function(){
var ul = new Element('ul').inject($('lianximan'));
var titleArr = new Array('联系人:','电话:','E-mail','qq/旺旺:');
var titleName = new Array('lianxi_name','lianxi_telphone','lianxi_email','lianxi_qqwangwang');
var k=0;
for (var i=1;i<=9;i++){
if (i==9){
var oLi = new Element('li').inject(ul);
new Element('input', {id:'delid[]',type:'button',value:'删除',events:{'click':function(){del(oLi,'0');}}}).inject(oLi);
}else{
if (i%2==0){
var oLi = new Element('li',{html:titleArr[k]}).inject(ul);
oLi.setStyle('float', 'left');
new Element('input', {name:titleName[k]+'[]', size:'16'}).inject(oLi);
k++;
}
}
}
});
*/
<{if $detail.area_defined}>
//修改
$("modify").addEvent('click',function(){