hanxuntao 4 months ago
commit b20d7023ba

@ -2859,7 +2859,7 @@ namespace DSWeb.Areas.CommMng.DAL
return;
}
var cdc = new CommonDataContext();
//var cdc = new CommonDataContext();
try
{
var result= hp.GetFee();

@ -465,10 +465,29 @@ namespace DSWeb.Areas.CommMng.Models
return result;
}
var = Convert.ToDecimal( BillHead.bill_details.FirstOrDefault(x => x.cost_name == "单证费").cost_amount);
var = 0M;
var = ;
if (BillHead.bill_details.Exists(x => x.cost_name == "单证费"))
{
=Convert.ToDecimal(BillHead.bill_details.FirstOrDefault(x => x.cost_name == "单证费").cost_amount);
= ;
}
else
if (BillHead.bill_details.Exists(x => x.cost_name == "出口码头操作费--THC"))
{
=Convert.ToDecimal(BillHead.bill_details.FirstOrDefault(x => x.cost_name == "出口码头操作费--THC").cost_amount);
= ;
}
else if (BillHead.bill_details.Exists(x => x.cost_name == "出口码头操作费"))
{
=Convert.ToDecimal(BillHead.bill_details.FirstOrDefault(x => x.cost_name == "出口码头操作费").cost_amount);
= ;
}
var List = new List<ch_fee_md>();
void add(ch_fee_md newfee,op_ctn_md ctn)
@ -537,7 +556,7 @@ namespace DSWeb.Areas.CommMng.Models
if ( > 0)
{
if (head.LANE != "DNY东南亚航线")
if (head.LANE != "DNY东南亚航线" && head.LANE != "东南亚航线")
{
var price = GetPrice("单证费");
var feename = GetFeeName("单证费");
@ -882,6 +901,9 @@ namespace DSWeb.Areas.CommMng.Models
3"
*/
//2024-718 东南亚航线 没有单证费 没有码头操作费 只有出口码头操作费
var List = GetBillFeeName("出口码头操作费");
if (!BillHead.bill_details.Exists(x => List.Contains( x.cost_name )) || !(ctnList != null && ctnList.Count > 0))
@ -895,27 +917,27 @@ namespace DSWeb.Areas.CommMng.Models
var List = new List<ch_fee_md>();
void Add(op_ctn_md ctn, decimal price)
void Add(op_ctn_md ctn, decimal price,string FEENAME= "码头操作费")
{
var ctnnum = ctn.CTNNUM == null ? 0 : (Int32)ctn.CTNNUM;
var amount = price * ctnnum;
if (Amount >= price)
{
if (List.Exists(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price))
if (List.Exists(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price && x.FEENAME== FEENAME))
{
List.First(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price).QUANTITY += ctnnum;
List.First(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price).AMOUNT += amount;
List.First(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price && x.FEENAME == FEENAME).QUANTITY += ctnnum;
List.First(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price && x.FEENAME == FEENAME).AMOUNT += amount;
List.First(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price).REMARK += ";" + ctn.CNTRNO;
List.First(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price).setTax();
List.First(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price && x.FEENAME == FEENAME).REMARK += ";" + ctn.CNTRNO;
List.First(x => x.UNIT == ctn.CTNALL && x.UNITPRICE == price && x.FEENAME == FEENAME).setTax();
}
else
{
//var 码头操作费 = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, "码头操作费", price, ctn.CTNALL, 1, "", ctn.CNTRNO);
var = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, "码头操作费", amount, ctn.CTNALL, ctnnum, "", ctn.CNTRNO);
var = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, FEENAME, amount, ctn.CTNALL, ctnnum, "", ctn.CNTRNO);
List.Add();
}
Amount -= price;
Amount -= amount;
}
else
{
@ -960,68 +982,16 @@ namespace DSWeb.Areas.CommMng.Models
if (head.LANE != "DNY东南亚航线")
if (head.LANE != "DNY东南亚航线" && head.LANE != "东南亚航线")
{
var price = GetPrice("单证费");
var feename = GetFeeName("单证费");
var newfee = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, feename, price, "单票", 1);
Add(newfee);
}
//var 高雄20 = GetPrice("高雄20");
//var 高雄40 = GetPrice("高雄40");
//var 高雄20RH = GetPrice("高雄20RH");
//var 高雄40RH = GetPrice("高雄40RH");
//var ctn20 = GetPrice("20");
//var ctn40 = GetPrice("40");
//var All40RH = GetPrice("40RH");
//if (head.PORTDISCHARGE == "KAOHSIUNG")
//if (台湾价格港口.Exists(x=>x.EnumValueName== head.PORTDISCHARGE))
//{
// foreach (var ctn in ctnList)
// {
// if (ctn.CTNALL == "20RH")
// {
// 码头操作费Add(ctn, 高雄20RH);
// }
// else
// if (ctn.CTNALL == "40RH")
// {
// 码头操作费Add(ctn, 高雄40RH);
// }
// else
// if (ctn.SIZE == "40")
// {
// 码头操作费Add(ctn, 高雄20);
// }
// else
// if (ctn.SIZE == "20")
// {
// 码头操作费Add(ctn, 高雄40);
// }
// }
//}
//else
//{
// foreach (var ctn in ctnList)
// {
// if (ctn.CTNALL == "40RH")
// {
// 码头操作费Add(ctn, All40RH);
// }
// else
// if (ctn.SIZE == "40")
// {
// 码头操作费Add(ctn, ctn40);
// }
// else
// if (ctn.SIZE == "20")
// {
// 码头操作费Add(ctn, ctn20);
// }
// }
//}
var price = 0M;
@ -1076,8 +1046,59 @@ namespace DSWeb.Areas.CommMng.Models
}
}
if (Amount > 0) {
//代表存在剩余尾数 先尝试处理铅封费信息费
var price = GetPrice("铅封费");
var price = GetPrice("信息费");
if (Amount < CtnNum * (price + price))
{
foreach (var ctn in ctnList)
{
//var newfee = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, "海运费", 单价 * (decimal)ctn.CTNNUM, ctn.CTNALL, (decimal)ctn.CTNNUM);
var = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, "铅封费", price * (decimal)ctn.CTNNUM, ctn.CTNALL, (decimal)ctn.CTNNUM);
//var 信息费 = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, "信息费", 信息费price * (decimal)ctn.CTNNUM, ctn.CTNALL, (decimal)ctn.CTNNUM);
//SetUsd(ref 铅封费);
//SetUsd(ref 信息费);
Add( ctn, price, "铅封费");
//add单证费(信息费, ctn);
}
}
else
{
foreach (var ctn in ctnList)
{
//var newfee = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, "海运费", 单价 * (decimal)ctn.CTNNUM, ctn.CTNALL, (decimal)ctn.CTNNUM);
var = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, "铅封费", price * (decimal)ctn.CTNNUM, ctn.CTNALL, (decimal)ctn.CTNNUM);
var = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, "信息费", price * (decimal)ctn.CTNNUM, ctn.CTNALL, (decimal)ctn.CTNNUM);
//SetUsd(ref 铅封费);
//SetUsd(ref 信息费);
Add(ctn, price, "铅封费");
Add(ctn, price, "信息费");
}
}
}
if (Amount > 0) {
//var feename = GetFeeName("码头操作费");
var newfee = MsChFeeDAL.getChFee(OP.GID, head.BSNO, head.FORWARDER, 2, "码头操作费", Amount, "单票", 1);
Add(newfee);
}
addfee(List);
return result;
}

Loading…
Cancel
Save