diff --git a/DSWeb.Service.Output.DS7/DS7Service.cs b/DSWeb.Service.Output.DS7/DS7Service.cs index 7ff8d6f8..c43a0475 100644 --- a/DSWeb.Service.Output.DS7/DS7Service.cs +++ b/DSWeb.Service.Output.DS7/DS7Service.cs @@ -612,6 +612,7 @@ namespace DSWeb.Service.Output.DS7 var SOURCEOP = ""; var 费用标准结算对象 = ""; + var 船代 = ""; var custEdi = dS7Data.CodeCustEdi.AsNoTracking().FirstOrDefault(x => x.EDINAME == "DJY_OUTPUT" && x.EDICODE == WeiTuoFaSongFang); if (custEdi != null) @@ -619,7 +620,10 @@ namespace DSWeb.Service.Output.DS7 费用标准结算对象 = custEdi.CUST; } - + var 船代Edi= dS7Data.CodeCustEdi.AsNoTracking().FirstOrDefault(x => x.EDINAME == "DJY_OUTPUT" && x.EDICODE == _edi.FORWARDER); + if (船代Edi != null) { + 船代 = 船代Edi.CUST; + } //如果大简云业务中的【订舱编号】空着,则用大简云舱单界面的【委托发送方】 ,寻找EDI代码设置中的EDICODE =【委托发送方】 EDINAME = 大简云的客户 填入【委托单位】字段的内容 @@ -666,6 +670,8 @@ namespace DSWeb.Service.Output.DS7 SOURCEOP = orderinfo[1]; } + var 委托单位 = dS7Data.InfoClient.FirstOrDefault(x => x.SHORTNAME == CUSTOMERNAME); + if (op_other == null || op_other.BSNO == null || op_other.BSNO == "") { @@ -699,12 +705,12 @@ namespace DSWeb.Service.Output.DS7 FEESTATUS = false, MBLNO = MBLNO, HBLNO = "", - CUSTOMERNAME = CUSTOMERNAME, - CUSTOMERNAME2=WeiTuoFaSongFang,//20230313-大简云舱单界面的【委托发送方】录入东胜系统的实际客户, + CUSTOMERNAME = 委托单位.SHORTNAME, + CUSTOMERNAME2 = WeiTuoFaSongFang,//20230313-大简云舱单界面的【委托发送方】录入东胜系统的实际客户, //CARRIER BSDATE = DateTime.Today, ACCDATE = DateTime.Now.ToString("yyyy-MM"), - BSSOURCE = "", + BSSOURCE = 委托单位.BSSOURCE, OP = opUser.SHOWNAME, CUSTSERVICE = opUser.SHOWNAME, SALE = opUser.SHOWNAME, @@ -713,11 +719,12 @@ namespace DSWeb.Service.Output.DS7 //SR2023011000005 PORTLOAD = _edi.PORTLOAD,//装货港 PORTDISCHARGE = _edi.PORTDISCHARGE,//卸货港 - PKGS= PKGS, - KGS= KGS, - NETWEIGHT=0, - CBM= CBM, - SOURCEOP= SOURCEOP + PKGS = PKGS, + KGS = KGS, + NETWEIGHT = 0, + CBM = CBM, + SOURCEOP = SOURCEOP, + SHIPAGENT = 船代 }; //,DUIYUEHAO = 对账约号 //20230317 对账约号存于opLogic @@ -877,6 +884,10 @@ namespace DSWeb.Service.Output.DS7 //查询配置,生成应收 var fee = dS7Data.CustFeeTemplateDetail.AsNoTracking().FirstOrDefault(x => x.CUSTOMERNAME == 费用标准结算对象 && x.FEENAME == FeeShouName); + if (fee == null) { + fee = dS7Data.CustFeeTemplateDetail.AsNoTracking().FirstOrDefault(x => x.CUSTOMERNAME == 委托单位.SHORTNAME && x.FEENAME == FeeShouName); + } + if (fee != null ) { var feeShou = new ChFee(); @@ -943,6 +954,17 @@ namespace DSWeb.Service.Output.DS7 } } + if (FeePayCustomerType == "船代") { + //20230327 改为: + //如应付对象类型为船代 则结算对象改为该业务的船代公司 + + FeePayCustomer = 船代; + } + + var 分单号 = HBLNO; + if (string.IsNullOrWhiteSpace(HBLNO)) { + 分单号 = MBLNO; + } //应付 if (string.IsNullOrEmpty(HBLNO) && FeePayPrice>0) //主单才插入船代费用 { @@ -994,7 +1016,7 @@ namespace DSWeb.Service.Output.DS7 feeFu.ISACC = false; feeFu.CUSTDUI = false; - feeFu.BXGID = HBLNO; + feeFu.BXGID = 分单号; dS7Data.ChFee.Add(feeFu); dS7Data.SaveChanges(); @@ -1050,7 +1072,7 @@ namespace DSWeb.Service.Output.DS7 feeFuDJY.ISACC = false; feeFuDJY.CUSTDUI = false; - feeFuDJY.BXGID = HBLNO; + feeFuDJY.BXGID = 分单号; dS7Data.ChFee.Add(feeFuDJY); diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpOther/MsOpOther_CangDanEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpOther/MsOpOther_CangDanEdit.js index e99b7605..3379a47d 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpOther/MsOpOther_CangDanEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpOther/MsOpOther_CangDanEdit.js @@ -630,7 +630,8 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, { fieldLabel: '源操作', name: 'SOURCEOP' } - , { xtype: 'hiddenfield', flex: 2 } + ,this.comboxBSSOURCE + , { xtype: 'hiddenfield', flex: 1 } ] } @@ -723,21 +724,26 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, { defaults: { anchor: '100%' }, - items: [{ - xtype: 'container', - layout: 'hbox', - defaultType: 'textfield', - items: [this.comboxBSSOURCE, this.comboxBSSOURCEDETAIL, { + items: [ + { + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + hidden: true, + items: [this.comboxBSSOURCEDETAIL//this.comboxBSSOURCE, + , { fieldLabel: '装货港', name: 'PORTLOAD' }, { fieldLabel: '卸货港', name: 'PORTDISCHARGE' }, this.comboxTRANSTYPE, this.comboxTRADETYPE] - }, { + }, + { xtype: 'container', layout: 'hbox', - defaultType: 'textfield', + defaultType: 'textfield', + hidden: true, items: [{ fieldLabel: '业务日期', format: 'Y-m-d', @@ -780,10 +786,12 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, { } } }, this.comboxGOODSNAME] - }, { + }, + { xtype: 'container', layout: 'hbox', - defaultType: 'textfield', + defaultType: 'textfield', + hidden: true, items: [ { fieldLabel: '毛重', name: 'KGS', @@ -824,10 +832,12 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, { regex: /^\d+(\.\d{1,4})?$/, regexText: '请输入正确的数值类型!' }, this.comboxCustWmsCode] - }, { + }, + { xtype: 'container', layout: 'hbox', - defaultType: 'textfield', + defaultType: 'textfield', + hidden: true, items: [{ fieldLabel: '订舱编号', name: 'ORDERNO' @@ -843,7 +853,8 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, { fieldLabel: '手册号', name: 'BOOKNO' }, this.comboxCUSTOMSER, this.comboxCountry] - }, { + }, + { xtype: 'container', layout: 'hbox', defaultType: 'textfield',