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,8 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* ShopEx licence
*
* @copyright Copyright (c) 2005-2012 ShopEx Technologies Inc. (http://www.shopex.cn)
* @license http://ecos.shopex.cn/ ShopEx License
* @date 2012-08-22
* 售后单
*/
class sales_mdl_aftersale extends dbeav_model{
//是否有导出配置
@@ -51,10 +57,6 @@ class sales_mdl_aftersale extends dbeav_model{
);
public $appendCols = 'order_id';
/**
* 搜索Options
* @return mixed 返回值
*/
public function searchOptions(){
$ext_columns = array(
@@ -66,13 +68,6 @@ class sales_mdl_aftersale extends dbeav_model{
return $ext_columns;
}
/**
* io_title
* @param mixed $filter filter
* @param mixed $ioType ioType
* @param mixed $return_type return_type
* @return mixed 返回值
*/
public function io_title( $filter=null,$ioType='csv',$return_type ){
switch( $ioType ){
case 'csv':
@@ -93,7 +88,7 @@ class sales_mdl_aftersale extends dbeav_model{
* @param main aftersale 主表字段 aftersale_items 明细字段
* @param type 1 退货单(return) 2 换货单(change) 3 拒收退货单(refuse) 4 退款单(refund)
* @author
* */
**/
public function get_return_type($main,$type){
return kernel::single('sales_export_aftersale')->io_title($main,$this->common_type[$type]);
@@ -303,12 +298,6 @@ class sales_mdl_aftersale extends dbeav_model{
return true;
}
/**
* export_csv
* @param mixed $data 数据
* @param mixed $exportType exportType
* @return mixed 返回值
*/
public function export_csv($data,$exportType = 1 ){
$output = array();
foreach( $data['title'] as $k => $val ){
@@ -317,13 +306,6 @@ class sales_mdl_aftersale extends dbeav_model{
echo implode("\n",$output);
}
/**
* _filter
* @param mixed $filter filter
* @param mixed $tableAlias tableAlias
* @param mixed $baseWhere baseWhere
* @return mixed 返回值
*/
public function _filter($filter,$tableAlias=null,$baseWhere=null){
$Obj = app::get('ome');
$where = '1 ';
@@ -497,15 +479,6 @@ class sales_mdl_aftersale extends dbeav_model{
}
//获取导出明细数据
/**
* 获取exportdetail
* @param mixed $fields fields
* @param mixed $filter filter
* @param mixed $offset offset
* @param mixed $limit limit
* @param mixed $has_title has_title
* @return mixed 返回结果
*/
public function getexportdetail($fields,$filter,$offset=0,$limit=1,$has_title=false){
$mdl_sa = app::get('sales')->model('aftersale');
$mdl_sai = app::get('sales')->model('aftersale_items');
@@ -717,11 +690,6 @@ class sales_mdl_aftersale extends dbeav_model{
return $data;
}
/**
* 获取CustomExportTitle
* @param mixed $main_title main_title
* @return mixed 返回结果
*/
public function getCustomExportTitle($main_title)
{
$main_title = array_keys($main_title);
@@ -731,10 +699,6 @@ class sales_mdl_aftersale extends dbeav_model{
}
/**
* aftersalesItemsExportTitle
* @return mixed 返回值
*/
public function aftersalesItemsExportTitle()
{
$items_title = array(
@@ -747,8 +711,8 @@ class sales_mdl_aftersale extends dbeav_model{
'详情付款方式' => 'payment',
'详情退款申请时间' => 'create_time',
'详情退款完成时间' => 'last_modified',
'详情货号' => 'bn',
'详情货品名称' => 'product_name',
'详情基础物料编码' => 'bn',
'详情基础物料名称' => 'product_name',
'详情申请数量' => 'apply_num',
'详情数量' => 'num',
'详情单价' => 'price',
@@ -765,13 +729,6 @@ class sales_mdl_aftersale extends dbeav_model{
return $items_title;
}
/**
* modifier_member_id
* @param mixed $member_id ID
* @param mixed $list list
* @param mixed $row row
* @return mixed 返回值
*/
public function modifier_member_id($member_id, $list, $row)
{
static $get_from_db, $order_list;
@@ -822,13 +779,6 @@ HTML;
return $order_list[$row['order_id']]['uname'];
}
/**
* modifier_ship_mobile
* @param mixed $mobile mobile
* @param mixed $list list
* @param mixed $row row
* @return mixed 返回值
*/
public function modifier_ship_mobile($mobile, $list, $row)
{
if ($this->is_export_data) return $mobile;
@@ -847,4 +797,4 @@ HTML;
return $mobile ? $return : $mobile;
}
}
}

View File

@@ -14,34 +14,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* ShopEx licence
*
* @copyright Copyright (c) 2005-2012 ShopEx Technologies Inc. (http://www.shopex.cn)
* @license http://ecos.shopex.cn/ ShopEx License
* @date 2012-08-22
* 基础物料销售发货明细类
*/
class sales_mdl_delivery extends dbeav_model{
var $export_name = '商品销售发货明细';
var $export_name = '基础物料销售发货明细';
function __construct($app){
parent::__construct(app::get('ome'));
}
/**
* 搜索Options
* @return mixed 返回值
*/
public function searchOptions(){
$Options = array(
'order_bn'=>'订单号',
'delivery_bn'=>'发货单号',
'bn'=>'货号',
'bn'=>'基础物料编码',
);
return $Options;
}
/**
* io_title
* @param mixed $ioType ioType
* @return mixed 返回值
*/
public function io_title( $ioType='csv' ){
switch( $ioType ){
case 'csv':
@@ -56,10 +53,10 @@ class sales_mdl_delivery extends dbeav_model{
'*:成交金额'=>'sales_amount',
'*:下单时间'=>'order_createtime',
'*:付款时间'=>'order_paytime',
'*:商品类型'=>'type_id',
'*:商品品牌'=>'brand_id',
'*:货号'=>'bn',
'*:商品名称'=>'name',
'*:基础物料类型'=>'type_id',
'*:基础物料品牌'=>'brand_id',
'*:基础物料编码'=>'bn',
'*:基础物料名称'=>'name',
'*:数量'=>'num',
'*:原始单价'=>'price',
'*:原始金额'=>'amount',
@@ -78,14 +75,6 @@ class sales_mdl_delivery extends dbeav_model{
return $this->ioTitle[$ioType]['delivery'];
}
/**
* fgetlist_csv
* @param mixed $data 数据
* @param mixed $filter filter
* @param mixed $offset offset
* @param mixed $exportType exportType
* @return mixed 返回值
*/
public function fgetlist_csv( &$data,$filter,$offset,$exportType = 1 ){
if( !$data['title'] ){
@@ -180,11 +169,6 @@ class sales_mdl_delivery extends dbeav_model{
return true;
}
/**
* count
* @param mixed $filter filter
* @return mixed 返回值
*/
public function count($filter = null){
$sql = 'select count(di.bn) as _count from sdb_ome_delivery d left join sdb_ome_delivery_items di on d.delivery_id = di.delivery_id where '.$this->_filter($filter).' and status="succ"';
@@ -232,11 +216,6 @@ sales_price 成交价格
return $data;
}
/**
* _filter
* @param mixed $filter filter
* @return mixed 返回值
*/
public function _filter($filter){
$where = ' 1 ';
@@ -365,7 +344,7 @@ sales_price 成交价格
),
'type_id' => array (
'type' => 'table:goods_type@ome',
'label' => '商品类型',
'label' => '基础物料类型',
'width' => 120,
'searchtype' => 'has',
'editable' => false,
@@ -374,7 +353,7 @@ sales_price 成交价格
),
'brand_id' => array (
'type' => 'table:brand@ome',
'label' => '商品品牌',
'label' => '基础物料品牌',
'width' => 120,
'searchtype' => 'has',
'editable' => false,
@@ -383,7 +362,7 @@ sales_price 成交价格
),
'bn' => array (
'type' => 'varchar(30)',
'label' => '货号',
'label' => '基础物料编码',
'width' => 85,
'searchtype' => 'has',
'editable' => false,
@@ -392,7 +371,7 @@ sales_price 成交价格
),
'name' => array (
'type' => 'varchar(200)',
'label' => '商品名称',
'label' => '基础物料名称',
'width' => 190,
'searchtype' => 'has',
'editable' => false,
@@ -545,4 +524,4 @@ sales_price 成交价格
);
return $schema;
}
}
}

View File

@@ -14,8 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* ShopEx licence
*
* @copyright Copyright (c) 2005-2012 ShopEx Technologies Inc. (http://www.shopex.cn)
* @license http://ecos.shopex.cn/ ShopEx License
* @date 2012-08-22
* 商品销售退货明细类
*/
class sales_mdl_reship extends dbeav_model{
var $export_name = '商品销售退货明细';
@@ -23,26 +29,17 @@ class sales_mdl_reship extends dbeav_model{
parent::__construct(app::get('ome'));
}
/**
* 搜索Options
* @return mixed 返回值
*/
public function searchOptions(){
$Options = array(
'return_bn'=>'售后申请单号',
'order_bn'=>'订单号',
'reship_bn'=>'退换货单号',
'bn'=>'货号',
'bn'=>'基础物料编码',
);
return $Options;
}
/**
* io_title
* @param mixed $ioType ioType
* @return mixed 返回值
*/
public function io_title( $ioType='csv' ){
switch( $ioType ){
case 'csv':
@@ -52,14 +49,14 @@ class sales_mdl_reship extends dbeav_model{
'*:售后申请单号'=>'return_bn',
'*:申请时间'=>'add_time',
'*:订单号'=>'order_id',
'*:货号'=>'bn',
'*:基础物料编码'=>'bn',
'*:数量'=>'num',
'*:售后类型'=>'return_type',
'*:退款金额'=>'refundmoney',
'*:商品名称'=>'name',
'*:退换货单号'=>'reship_id',
'*:商品品牌'=>'brand_id',
'*:商品类型'=>'type_id',
'*:基础物料品牌'=>'brand_id',
'*:基础物料类型'=>'type_id',
'*:收货时间'=>'reship_time',
'*:收货仓库'=>'branch_id',
);
@@ -69,14 +66,6 @@ class sales_mdl_reship extends dbeav_model{
return $this->ioTitle[$ioType]['reship'];
}
/**
* fgetlist_csv
* @param mixed $data 数据
* @param mixed $filter filter
* @param mixed $offset offset
* @param mixed $exportType exportType
* @return mixed 返回值
*/
public function fgetlist_csv( &$data,$filter,$offset,$exportType = 1 ){
if( !$data['title'] ){
@@ -142,11 +131,6 @@ class sales_mdl_reship extends dbeav_model{
return true;
}
/**
* count
* @param mixed $filter filter
* @return mixed 返回值
*/
public function count( $filter = null ){
return count($this->getList($filter));
@@ -185,13 +169,6 @@ class sales_mdl_reship extends dbeav_model{
return $data;
}
/**
* _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 ';
@@ -534,4 +511,4 @@ class sales_mdl_reship extends dbeav_model{
);
return $schema;
}
}
}

View File

@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class sales_mdl_sales extends dbeav_model{
//是否有导出配置
@@ -33,11 +32,6 @@ class sales_mdl_sales extends dbeav_model{
parent::__construct(app::get('ome'));
}
/**
* table_name
* @param mixed $real real
* @return mixed 返回值
*/
public function table_name($real=false){
$table_name = "sales";
if($real){
@@ -51,7 +45,7 @@ class sales_mdl_sales extends dbeav_model{
$parentOptions = parent::searchOptions();
$childOptions = array(
'order_bn'=>app::get('base')->_('订单号'),
'bn'=>app::get('base')->_('商品货号'),
'bn'=>app::get('base')->_('基础物料编码'),
);
return $Options = array_merge($childOptions,$parentOptions);
}
@@ -79,7 +73,7 @@ class sales_mdl_sales extends dbeav_model{
}
//货号查询
//基础物料编码查询
if(isset($filter['bn'])){
$sql = 'SELECT sale_id FROM sdb_ome_sales_items WHERE bn like \''.$filter['bn'].'\'';
@@ -181,12 +175,12 @@ class sales_mdl_sales extends dbeav_model{
$this->oSchema['csv']['sales_items'] = array(
'*:销售单号' => '',
'*:订单号' => '',
'*:货号' => '',
'*:基础物料编码' => '',
'*:商品名称' => '',
'*:商品规格' => '',
'*:基础物料规格' => '',
'*:吊牌价' => '',
'*:数量' => '',
'*:货品优惠' => '',
'*:基础物料优惠' => '',
'*:销售总价' => '',
'*:平摊优惠' => '',
'*:销售金额' => '',
@@ -445,12 +439,12 @@ class sales_mdl_sales extends dbeav_model{
$orderObjRow = array();
$orderObjRow['*:销售单号'] ="=\"\"".$aOrder['sale_bn']."\"\"";
$orderObjRow['*:订单号'] = "=\"\"".$order_bn."\"\"";
$orderObjRow['*:货号'] = $obj['bn'];
$orderObjRow['*:基础物料编码'] = $obj['bn'];
$orderObjRow['*:商品名称'] = str_replace([',', "\n"], '', $obj['name']);
$orderObjRow['*:商品规格'] = str_replace([',', "\n"], '', $obj['spec_name']);
$orderObjRow['*:基础物料规格'] = str_replace([',', "\n"], '', $obj['spec_name']);
$orderObjRow['*:吊牌价'] = $obj['price'];
$orderObjRow['*:数量'] = $obj['nums'];
$orderObjRow['*:货品优惠'] = $obj['pmt_price'];
$orderObjRow['*:基础物料优惠'] = $obj['pmt_price'];
$orderObjRow['*:数量'] = $obj['nums'];
$orderObjRow['*:销售总价'] = $obj['sale_price'];
$orderObjRow['*:平摊优惠'] = $obj['apportion_pmt'];
@@ -472,11 +466,6 @@ class sales_mdl_sales extends dbeav_model{
echo implode("\n",$output);
}
/**
* modifier_order_check_id
* @param mixed $row row
* @return mixed 返回值
*/
public function modifier_order_check_id($row){
switch($row){
@@ -650,7 +639,7 @@ class sales_mdl_sales extends dbeav_model{
$temp_item_data['name'] = $ordItem['name'];
$temp_item_data['price'] = $ordItem['price'];
$temp_item_data['nums'] = $ordItem['nums'];
$temp_item_data['pmt_price'] = $ordItem['pmt_price'];//取item层货品优惠,默认都是0
$temp_item_data['pmt_price'] = $ordItem['pmt_price'];//取item层基础物料优惠,默认都是0
$temp_item_data['sale_price'] = $ordItem['sale_price'];
$temp_item_data['sales_amount'] = $ordItem['amount'];
@@ -763,9 +752,9 @@ class sales_mdl_sales extends dbeav_model{
'*:关联销售物料编码',
'*:关联销售物料名称',
'*:商品规格',
'*:基础物料规格',
'*:吊牌价',
'*:货品优惠',
'*:基础物料优惠',
'*:数量',
'*:销售总价',
'*:平摊优惠',
@@ -875,13 +864,6 @@ class sales_mdl_sales extends dbeav_model{
return $row;
}
/**
* modifier_member_id
* @param mixed $member_id ID
* @param mixed $list list
* @param mixed $row row
* @return mixed 返回值
*/
public function modifier_member_id($member_id,$list,$row)
{
static $get_from_db,$order_list;
@@ -994,11 +976,6 @@ HTML;
return $data;
}
/**
* 获取CustomExportTitle
* @param mixed $main_title main_title
* @return mixed 返回结果
*/
public function getCustomExportTitle($main_title)
{
$main_title = array_keys($main_title);
@@ -1008,10 +985,6 @@ HTML;
}
/**
* salesItemsExportTitle
* @return mixed 返回值
*/
public function salesItemsExportTitle()
{
$items_title = array(
@@ -1020,9 +993,9 @@ HTML;
'详情销售物料类型' => 'type_name',
'详情关联销售物料编码' => 'sales_material_bn',
'详情关联销售物料名称' => 'sales_material_name',
'详情商品规格' => 'spec_name',
'详情基础物料规格' => 'spec_name',
'详情吊牌价' => 'price',
'详情货品优惠' => 'pmt_price',
'详情基础物料优惠' => 'pmt_price',
'详情数量' => 'nums',
'详情销售总价' => 'sale_price',
'详情平摊优惠' => 'apportion_pmt',
@@ -1066,13 +1039,6 @@ HTML;
}
}
/**
* modifier_shop_id
* @param mixed $shop_id ID
* @param mixed $list list
* @param mixed $row row
* @return mixed 返回值
*/
public function modifier_shop_id($shop_id,$list,$row){
static $shopList;
@@ -1087,13 +1053,6 @@ HTML;
return $shopList[$shop_id];
}
/**
* modifier_org_id
* @param mixed $org_id ID
* @param mixed $list list
* @param mixed $row row
* @return mixed 返回值
*/
public function modifier_org_id($org_id,$list,$row){
static $orgList;