|
|
@@ -1458,16 +1458,25 @@ namespace Business.ResourceExamineManagement
|
|
|
var zcPr = list.Where(a => a.pr_billno.StartsWith("PR")).ToList();
|
|
|
if (zcPr.Any())
|
|
|
{
|
|
|
- AutoCreateZCPOFromPR(zcPr, bangid, icitemlist, itemsupplierList, poaction);
|
|
|
+ AutoCreatePOFromPRByType(zcPr, bangid, icitemlist, itemsupplierList, poaction,1);
|
|
|
}
|
|
|
|
|
|
var wwPr = list.Where(a => a.pr_billno.StartsWith("WWPR")).ToList();
|
|
|
if (wwPr.Any())
|
|
|
{
|
|
|
- AutoCreateWWPOFromPR(wwPr, bangid, icitemlist, itemsupplierList, poaction);
|
|
|
+ AutoCreatePOFromPRByType(wwPr, bangid, icitemlist, itemsupplierList, poaction,2);
|
|
|
}
|
|
|
}
|
|
|
- private void AutoCreateZCPOFromPR(List<mo_srm_pr_main> list, long bangid, List<mo_ic_item> itemList, List<mo_srm_supplier> itemsupplierList, PoActionListDto poaction)
|
|
|
+ /// <summary>
|
|
|
+ /// 根据PR生成PO
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="list"></param>
|
|
|
+ /// <param name="bangid"></param>
|
|
|
+ /// <param name="itemList"></param>
|
|
|
+ /// <param name="itemsupplierList"></param>
|
|
|
+ /// <param name="poaction"></param>
|
|
|
+ /// <param name="poType">1正常PO,2是委外</param>
|
|
|
+ private void AutoCreatePOFromPRByType(List<mo_srm_pr_main> list, long bangid, List<mo_ic_item> itemList, List<mo_srm_supplier> itemsupplierList, PoActionListDto poaction,int poType)
|
|
|
{
|
|
|
List<mo_srm_po_main> polist = new List<mo_srm_po_main>();
|
|
|
List<mo_srm_po_list> podetaillist = new List<mo_srm_po_list>();
|
|
|
@@ -1478,7 +1487,7 @@ namespace Business.ResourceExamineManagement
|
|
|
list = list.OrderBy(a => a.pr_purchaseid).ThenBy(b => b.pr_rarrive_date).ToList();
|
|
|
long? supplierId = -1;
|
|
|
DateTime supplierDate = DateTime.Now;
|
|
|
- foreach (mo_srm_pr_main item in list)
|
|
|
+ foreach (var item in list)
|
|
|
{
|
|
|
mo_srm_po_occupy srm_Po_Occupy = new mo_srm_po_occupy();
|
|
|
srm_Po_Occupy.id = help.NextId();
|
|
|
@@ -1495,7 +1504,7 @@ namespace Business.ResourceExamineManagement
|
|
|
mo_srm_po_main po_Main = new mo_srm_po_main();
|
|
|
po_Main.id = help.NextId();
|
|
|
po_Main.mysql_id = help.NextId();
|
|
|
- po_Main.po_billno = GetMaxSerialNumber(416188684804165);
|
|
|
+ po_Main.po_billno = poType==1? GetMaxSerialNumber(416188684804165) : GetMaxSerialNumber(416555323363397);
|
|
|
po_Main.po_purchaser = item.pr_purchaser;
|
|
|
po_Main.po_purchaser_no = item.pr_purchaser_num;
|
|
|
po_Main.po_ssend_date = DateTime.Now;
|
|
|
@@ -1506,7 +1515,7 @@ namespace Business.ResourceExamineManagement
|
|
|
po_Main.po_note = "PR自动转PO";
|
|
|
po_Main.po_order_type = 1;
|
|
|
po_Main.currency = item.currencytype;
|
|
|
- po_Main.bill_type = 1;
|
|
|
+ po_Main.bill_type = poType;
|
|
|
po_Main.supplier_id = item.pr_purchaseid;
|
|
|
po_Main.supplier_name = item.pr_purchasename;
|
|
|
po_Main.supplier_no = item.pr_purchasenumber;
|
|
|
@@ -1619,8 +1628,8 @@ namespace Business.ResourceExamineManagement
|
|
|
podetail.factory_id = param.factoryId;
|
|
|
podetail.tenant_id = param.tenantId;
|
|
|
podetail.bang_id = bangid;
|
|
|
- podetaillist.Add(podetail);
|
|
|
podetail.stock_id = 1;
|
|
|
+ podetaillist.Add(podetail);
|
|
|
|
|
|
srm_Po_Occupy.polist_id = podetail.mysql_id;
|
|
|
srm_Po_Occupy.polist_row = podetail.polist_row;
|
|
|
@@ -1639,7 +1648,7 @@ namespace Business.ResourceExamineManagement
|
|
|
mo_srm_po_main po_Main = new mo_srm_po_main();
|
|
|
po_Main.id = help.NextId();
|
|
|
po_Main.mysql_id = help.NextId();
|
|
|
- po_Main.po_billno = GetMaxSerialNumber(416188684804165);
|
|
|
+ po_Main.po_billno = poType == 1 ? GetMaxSerialNumber(416188684804165) : GetMaxSerialNumber(416555323363397);
|
|
|
po_Main.po_purchaser = item.pr_purchaser;
|
|
|
po_Main.po_purchaser_no = item.pr_purchaser_num;
|
|
|
po_Main.po_ssend_date = DateTime.Now;
|
|
|
@@ -1650,7 +1659,7 @@ namespace Business.ResourceExamineManagement
|
|
|
po_Main.po_note = "PR自动转PO";
|
|
|
po_Main.po_order_type = 1;
|
|
|
po_Main.currency = item.currencytype;
|
|
|
- po_Main.bill_type = 1;
|
|
|
+ po_Main.bill_type = poType;
|
|
|
po_Main.supplier_id = item.pr_purchaseid;
|
|
|
po_Main.supplier_name = item.pr_purchasename;
|
|
|
po_Main.supplier_no = item.pr_purchasenumber;
|
|
|
@@ -1732,7 +1741,7 @@ namespace Business.ResourceExamineManagement
|
|
|
purOrdMasters.Add(new PurOrdMaster
|
|
|
{
|
|
|
Domain = "1001",
|
|
|
- Potype = "po",
|
|
|
+ Potype = poType==1?"po":"pw",
|
|
|
PurOrd = a.po_billno,
|
|
|
Buyer = a.po_purchaser,
|
|
|
OrdDate = a.po_ssend_date,
|
|
|
@@ -1754,7 +1763,7 @@ namespace Business.ResourceExamineManagement
|
|
|
purOrdDetails.Add(new PurOrdDetail
|
|
|
{
|
|
|
Domain = "1001",
|
|
|
- Potype = "po",
|
|
|
+ Potype = poType == 1 ? "po" : "pw",
|
|
|
PurOrd = a.po_billno,
|
|
|
IsActive = true,
|
|
|
CreateTime = a.create_time,
|
|
|
@@ -1771,310 +1780,6 @@ namespace Business.ResourceExamineManagement
|
|
|
});
|
|
|
poaction.poDetailList.AddRange(purOrdDetails);
|
|
|
}
|
|
|
- private void AutoCreateWWPOFromPR(List<mo_srm_pr_main> list, long bangid, List<mo_ic_item> itemList, List<mo_srm_supplier> itemsupplierList, PoActionListDto poaction)
|
|
|
- {
|
|
|
- List<mo_srm_po_main> polist = new List<mo_srm_po_main>();
|
|
|
- List<mo_srm_po_list> podetaillist = new List<mo_srm_po_list>();
|
|
|
- //var itemList = _ic_item.Find(a => a.tenant_id == input.tenantId && a.factory_id == input.factoryId).Result;
|
|
|
- //将PR按供应商和物料和日期(一周内)进行合并,生成PO
|
|
|
- //1.按照供应商、需求日期排序
|
|
|
- //2.判断是不是同一个供应商,不是的话就新建一个PO;是的话判断是不是同一周,不是的话就新建一个PO,是的话判断有没有相同物料,有的话合并物料数量价格,没有的话新建一条明细
|
|
|
- list = list.OrderBy(a => a.pr_purchaseid).ThenBy(b => b.pr_rarrive_date).ToList();
|
|
|
- long? supplierId = -1;
|
|
|
- DateTime supplierDate = DateTime.Now;
|
|
|
- foreach (var item in list)
|
|
|
- {
|
|
|
- mo_srm_po_occupy srm_Po_Occupy = new mo_srm_po_occupy();
|
|
|
- srm_Po_Occupy.id = help.NextId();
|
|
|
- srm_Po_Occupy.mysql_id = help.NextId();
|
|
|
- srm_Po_Occupy.bang_id = bangid;
|
|
|
- srm_Po_Occupy.morder_mo = item.pr_mono;
|
|
|
- srm_Po_Occupy.qty = item.pr_aqty;
|
|
|
- srm_Po_Occupy.eid = item.sentry_id;
|
|
|
-
|
|
|
- if (item.pr_purchaseid != supplierId)
|
|
|
- {
|
|
|
- var itemsupplier = itemsupplierList.Find(a => a.mysql_id == item.pr_purchaseid && a.tenant_id == param.tenantId && a.factory_id == param.factoryId);
|
|
|
- //新建一个PO
|
|
|
- mo_srm_po_main po_Main = new mo_srm_po_main();
|
|
|
- po_Main.id = help.NextId();
|
|
|
- po_Main.mysql_id = help.NextId();
|
|
|
- po_Main.po_billno = GetMaxSerialNumber(416555323363397);//WWPO
|
|
|
- po_Main.po_purchaser = item.pr_purchaser;
|
|
|
- po_Main.po_purchaser_no = item.pr_purchaser_num;
|
|
|
- po_Main.po_ssend_date = DateTime.Now;
|
|
|
- po_Main.po_total = item.pr_orderprice;
|
|
|
- po_Main.po_tax_rate = item.pr_rate;
|
|
|
- po_Main.po_express = 1;
|
|
|
- po_Main.state = 0;
|
|
|
- po_Main.po_note = "PR自动转PO";
|
|
|
- po_Main.po_order_type = 1;
|
|
|
- po_Main.currency = item.currencytype;
|
|
|
- po_Main.bill_type = 2;
|
|
|
- po_Main.supplier_id = item.pr_purchaseid;
|
|
|
- po_Main.supplier_name = item.pr_purchasename;
|
|
|
- po_Main.supplier_no = item.pr_purchasenumber;
|
|
|
- po_Main.contact = itemsupplier is null ? "" : itemsupplier.contact;
|
|
|
- po_Main.suppliertelephone = itemsupplier is null ? "" : itemsupplier.telephone;
|
|
|
- po_Main.deliveryaddress = "";
|
|
|
- po_Main.supplierdddress = itemsupplier is null ? "" : itemsupplier.supplier_address;
|
|
|
- po_Main.confirmstate = 1;
|
|
|
- po_Main.logisticsstate = 0;
|
|
|
- po_Main.financialstate = 0;
|
|
|
- po_Main.create_time = DateTime.Now;
|
|
|
- po_Main.factory_id = param.factoryId;
|
|
|
- po_Main.tenant_id = param.tenantId;
|
|
|
- po_Main.bang_id = bangid;
|
|
|
- po_Main.po_delivery = 1;
|
|
|
- polist.Add(po_Main);
|
|
|
-
|
|
|
- mo_srm_po_list podetail = new mo_srm_po_list();
|
|
|
- podetail.id = help.NextId();
|
|
|
- podetail.mysql_id = help.NextId();
|
|
|
- podetail.po_id = po_Main.mysql_id;
|
|
|
- podetail.po_billno = po_Main.po_billno;
|
|
|
- podetail.polist_row = podetaillist.Where(a => a.po_billno == po_Main.po_billno).Count() + 1;
|
|
|
- podetail.pr_id = item.mysql_id;
|
|
|
- podetail.pr_billno = item.pr_billno;
|
|
|
- podetail.pr_purchase_id = po_Main.supplier_id;
|
|
|
- podetail.pr_purchase_name = po_Main.supplier_name;
|
|
|
- podetail.icitem_id = item.icitem_id;
|
|
|
- podetail.ItemNum = itemList.First(a => a.mysql_id == item.icitem_id).number;
|
|
|
- podetail.icitem_name = item.icitem_name;
|
|
|
- podetail.qty = item.pr_aqty;
|
|
|
- podetail.netprice = item.pr_price;
|
|
|
- podetail.rate = item.pr_rate;
|
|
|
- podetail.price = item.pr_orderprice / item.pr_aqty;
|
|
|
- podetail.total_price = item.pr_orderprice;
|
|
|
- podetail.plan_qty = item.pr_aqty;
|
|
|
- podetail.unit = item.pr_unit;
|
|
|
- podetail.state = item.state;
|
|
|
- podetail.rarrdate = item.pr_rarrive_date;
|
|
|
- podetail.rnumber = 0;
|
|
|
- podetail.currencytype = item.currencytype;
|
|
|
- podetail.create_time = DateTime.Now;
|
|
|
- podetail.factory_id = param.factoryId;
|
|
|
- podetail.tenant_id = param.tenantId;
|
|
|
- podetail.bang_id = bangid;
|
|
|
- podetail.stock_id = 1;
|
|
|
- podetaillist.Add(podetail);
|
|
|
-
|
|
|
- srm_Po_Occupy.polist_id = podetail.mysql_id;
|
|
|
- srm_Po_Occupy.polist_row = podetail.polist_row;
|
|
|
- srm_Po_Occupy.type = MorderEnum.Zyjc_Type;//TODO:类型未知
|
|
|
- srm_Po_Occupy.stime = podetail.create_time;
|
|
|
- srm_Po_Occupy.etime = podetail.rarrdate;
|
|
|
-
|
|
|
- supplierId = item.pr_purchaseid;
|
|
|
- supplierDate = item.pr_rarrive_date.Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //同一个供应商先判断需求日期是否在同一周
|
|
|
- if (IsSameWeek(supplierDate, item.pr_rarrive_date.Value))
|
|
|
- {
|
|
|
- var pomain = polist.FindAll(x => x.supplier_id == item.pr_purchaseid).OrderByDescending(b => b.create_time).First();
|
|
|
- List<mo_srm_po_list> detail = podetaillist.FindAll(a => a.po_billno == pomain.po_billno && a.icitem_id == item.icitem_id);
|
|
|
- if (detail.Count > 0)
|
|
|
- {
|
|
|
- //TODO:只能记录一条PR,可能需要先合PR
|
|
|
- //存在同一种物料,存在就计算数量和价格,
|
|
|
- detail[0].qty = detail[0].qty + item.pr_aqty;
|
|
|
- detail[0].netprice = detail[0].netprice + item.pr_price;
|
|
|
- detail[0].total_price = detail[0].total_price + item.pr_orderprice;
|
|
|
- detail[0].plan_qty = detail[0].plan_qty + item.pr_aqty;
|
|
|
- detail[0].rarrdate = item.pr_rarrive_date;
|
|
|
- pomain.po_total = pomain.po_total + item.pr_orderprice;
|
|
|
-
|
|
|
- srm_Po_Occupy.polist_id = detail[0].mysql_id;
|
|
|
- srm_Po_Occupy.polist_row = detail[0].polist_row;
|
|
|
- srm_Po_Occupy.type = MorderEnum.Zyjc_Type;//TODO:类型未知
|
|
|
- srm_Po_Occupy.stime = detail[0].create_time;
|
|
|
- srm_Po_Occupy.etime = detail[0].rarrdate;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //不存在同一种物料新增一条明细
|
|
|
- mo_srm_po_list podetail = new mo_srm_po_list();
|
|
|
- podetail.id = help.NextId();
|
|
|
- podetail.mysql_id = help.NextId();
|
|
|
- podetail.po_id = pomain.mysql_id;
|
|
|
- podetail.po_billno = pomain.po_billno;
|
|
|
- podetail.polist_row = podetaillist.Where(a => a.po_billno == pomain.po_billno).Count() + 1;
|
|
|
- podetail.pr_id = item.mysql_id;
|
|
|
- podetail.pr_billno = item.pr_billno;
|
|
|
- podetail.pr_purchase_id = pomain.supplier_id;
|
|
|
- podetail.pr_purchase_name = pomain.supplier_name;
|
|
|
- podetail.icitem_id = item.icitem_id;
|
|
|
- podetail.ItemNum = itemList.First(a => a.mysql_id == item.icitem_id).number;
|
|
|
- podetail.icitem_name = item.icitem_name;
|
|
|
- podetail.qty = item.pr_aqty;
|
|
|
- podetail.netprice = item.pr_price;
|
|
|
- podetail.rate = item.pr_rate;
|
|
|
- podetail.price = item.pr_orderprice / item.pr_aqty;
|
|
|
- podetail.total_price = item.pr_orderprice;
|
|
|
- podetail.plan_qty = item.pr_aqty;
|
|
|
- podetail.unit = item.pr_unit;
|
|
|
- podetail.state = item.state;
|
|
|
- podetail.rarrdate = item.pr_rarrive_date;
|
|
|
- podetail.rnumber = 0;
|
|
|
- podetail.currencytype = item.currencytype;
|
|
|
- podetail.create_time = DateTime.Now;
|
|
|
- podetail.factory_id = param.factoryId;
|
|
|
- podetail.tenant_id = param.tenantId;
|
|
|
- podetail.bang_id = bangid;
|
|
|
- podetail.stock_id = 1;
|
|
|
- podetaillist.Add(podetail);
|
|
|
- pomain.po_total = pomain.po_total + item.pr_orderprice;
|
|
|
-
|
|
|
- srm_Po_Occupy.polist_id = podetail.mysql_id;
|
|
|
- srm_Po_Occupy.polist_row = podetail.polist_row;
|
|
|
- srm_Po_Occupy.type = MorderEnum.Zyjc_Type;//TODO:类型未知
|
|
|
- srm_Po_Occupy.stime = podetail.create_time;
|
|
|
- srm_Po_Occupy.etime = podetail.rarrdate;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //不在同一周需要新建一张PO
|
|
|
- var itemsupplier = itemsupplierList.Find(a => a.mysql_id == item.pr_purchaseid && a.tenant_id == param.tenantId && a.factory_id == param.factoryId);
|
|
|
- //新建一个PO单
|
|
|
- mo_srm_po_main po_Main = new mo_srm_po_main();
|
|
|
- po_Main.id = help.NextId();
|
|
|
- po_Main.mysql_id = help.NextId();
|
|
|
- po_Main.po_billno = GetMaxSerialNumber(416555323363397);
|
|
|
- po_Main.po_purchaser = item.pr_purchaser;
|
|
|
- po_Main.po_purchaser_no = item.pr_purchaser_num;
|
|
|
- po_Main.po_ssend_date = DateTime.Now;
|
|
|
- po_Main.po_total = item.pr_orderprice;
|
|
|
- po_Main.po_tax_rate = item.pr_rate;
|
|
|
- po_Main.po_express = 1;
|
|
|
- po_Main.state = 0;
|
|
|
- po_Main.po_note = "PR自动转PO";
|
|
|
- po_Main.po_order_type = 1;
|
|
|
- po_Main.currency = item.currencytype;
|
|
|
- po_Main.bill_type = 2;
|
|
|
- po_Main.supplier_id = item.pr_purchaseid;
|
|
|
- po_Main.supplier_name = item.pr_purchasename;
|
|
|
- po_Main.supplier_no = item.pr_purchasenumber;
|
|
|
- po_Main.contact = itemsupplier is null ? "" : itemsupplier.contact;
|
|
|
- po_Main.suppliertelephone = itemsupplier is null ? "" : itemsupplier.telephone;
|
|
|
- po_Main.deliveryaddress = "";
|
|
|
- po_Main.supplierdddress = itemsupplier is null ? "" : itemsupplier.supplier_address;
|
|
|
- po_Main.confirmstate = 1;
|
|
|
- po_Main.logisticsstate = 0;
|
|
|
- po_Main.financialstate = 0;
|
|
|
- po_Main.create_time = DateTime.Now;
|
|
|
- po_Main.factory_id = param.factoryId;
|
|
|
- po_Main.tenant_id = param.tenantId;
|
|
|
- po_Main.bang_id = bangid;
|
|
|
- po_Main.po_delivery = 1;
|
|
|
- polist.Add(po_Main);
|
|
|
-
|
|
|
- mo_srm_po_list podetail = new mo_srm_po_list();
|
|
|
- podetail.id = help.NextId();
|
|
|
- podetail.mysql_id = help.NextId();
|
|
|
- podetail.po_id = po_Main.mysql_id;
|
|
|
- podetail.po_billno = po_Main.po_billno;
|
|
|
- podetail.polist_row = podetaillist.Where(a => a.po_billno == po_Main.po_billno).Count() + 1;
|
|
|
- podetail.pr_id = item.mysql_id;
|
|
|
- podetail.pr_billno = item.pr_billno;
|
|
|
- podetail.pr_purchase_id = po_Main.supplier_id;
|
|
|
- podetail.pr_purchase_name = po_Main.supplier_name;
|
|
|
- podetail.icitem_id = item.icitem_id;
|
|
|
- podetail.ItemNum = itemList.First(a => a.mysql_id == item.icitem_id).number;
|
|
|
- podetail.icitem_name = item.icitem_name;
|
|
|
- podetail.qty = item.pr_aqty;
|
|
|
- podetail.netprice = item.pr_price;
|
|
|
- podetail.rate = item.pr_rate;
|
|
|
- podetail.price = item.pr_orderprice / item.pr_aqty;
|
|
|
- podetail.total_price = item.pr_orderprice;
|
|
|
- podetail.plan_qty = item.pr_aqty;
|
|
|
- podetail.unit = item.pr_unit;
|
|
|
- podetail.state = item.state;
|
|
|
- podetail.rarrdate = item.pr_rarrive_date;
|
|
|
- podetail.rnumber = 0;
|
|
|
- podetail.currencytype = item.currencytype;
|
|
|
- podetail.create_time = DateTime.Now;
|
|
|
- podetail.factory_id = param.factoryId;
|
|
|
- podetail.tenant_id = param.tenantId;
|
|
|
- podetail.bang_id = bangid;
|
|
|
- podetail.stock_id = 1;
|
|
|
- podetaillist.Add(podetail);
|
|
|
-
|
|
|
- srm_Po_Occupy.polist_id = podetail.mysql_id;
|
|
|
- srm_Po_Occupy.polist_row = podetail.polist_row;
|
|
|
- srm_Po_Occupy.type = MorderEnum.Zyjc_Type;//TODO:类型未知
|
|
|
- srm_Po_Occupy.stime = podetail.create_time;
|
|
|
- srm_Po_Occupy.etime = podetail.rarrdate;
|
|
|
-
|
|
|
- supplierId = item.pr_purchaseid;
|
|
|
- supplierDate = item.pr_rarrive_date.Value;
|
|
|
- }
|
|
|
- }
|
|
|
- srm_Po_Occupy.state = 1;
|
|
|
- srm_Po_Occupy.tenant_id = param.tenantId;//取销售子表企业ID
|
|
|
- srm_Po_Occupy.factory_id = param.factoryId;
|
|
|
- srm_Po_Occupy.create_time = DateTime.Now;
|
|
|
- srm_Po_Occupy.create_by_name = "admin";
|
|
|
- srm_Po_Occupy.update_time = DateTime.Now;
|
|
|
- srm_Po_Occupy.update_by_name = "admin";
|
|
|
- poaction.poOccupiesList.Add(srm_Po_Occupy);
|
|
|
- }
|
|
|
-
|
|
|
- List<srm_po_main> po_mainlist = ObjectMapper.Map<List<mo_srm_po_main>, List<srm_po_main>>(polist);
|
|
|
- var po_listlist = ObjectMapper.Map<List<mo_srm_po_list>, List<srm_po_list>>(podetaillist);
|
|
|
-
|
|
|
- poaction.poMain.AddRange(po_mainlist);
|
|
|
- poaction.polist.AddRange(po_listlist);
|
|
|
- poaction.mopoMain.AddRange(polist);
|
|
|
- poaction.mopolist.AddRange(podetaillist);
|
|
|
- List<PurOrdMaster> purOrdMasters = new List<PurOrdMaster>();
|
|
|
- po_mainlist.ForEach(a =>
|
|
|
- {
|
|
|
- purOrdMasters.Add(new PurOrdMaster
|
|
|
- {
|
|
|
- Domain = "1001",
|
|
|
- Potype = "pw",
|
|
|
- PurOrd = a.po_billno,
|
|
|
- Buyer = a.po_purchaser,
|
|
|
- OrdDate = a.po_ssend_date,
|
|
|
- Curr = "CNY",
|
|
|
- Supp = a.supplier_no,
|
|
|
- Tax1 = a.po_tax_rate,
|
|
|
- Department = a.purchasing_orgname,
|
|
|
- CustPhone = a.suppliertelephone,
|
|
|
- CustAddress = a.supplierdddress,
|
|
|
- IsActive = true,
|
|
|
- CreateTime = a.create_time,
|
|
|
- UpdateTime = a.update_time
|
|
|
- });
|
|
|
- });
|
|
|
- poaction.poMasterList.AddRange(purOrdMasters);
|
|
|
- List<PurOrdDetail> purOrdDetails = new List<PurOrdDetail>();
|
|
|
- po_listlist.ForEach(a =>
|
|
|
- {
|
|
|
- purOrdDetails.Add(new PurOrdDetail
|
|
|
- {
|
|
|
- Domain = "1001",
|
|
|
- Potype = "pw",
|
|
|
- PurOrd = a.po_billno,
|
|
|
- IsActive = true,
|
|
|
- CreateTime = a.create_time,
|
|
|
- UpdateTime = a.update_time,
|
|
|
- Line = a.polist_row,
|
|
|
- ItemNum = a.ItemNum,
|
|
|
- QtyOrded = a.qty.GetValueOrDefault(),
|
|
|
- QtyReceived = a.rqty.GetValueOrDefault(),
|
|
|
- PurCost = a.price,
|
|
|
- StdCost= a.price/(1+ a.rate),
|
|
|
- TaxRate = a.rate,
|
|
|
- DueDate = a.rarrdate
|
|
|
- });
|
|
|
- });
|
|
|
- poaction.poDetailList.AddRange(purOrdDetails);
|
|
|
- }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 计划工单齐套检查
|