|
|
@@ -2427,16 +2427,17 @@ namespace Business.ResourceExamineManagement
|
|
|
}
|
|
|
private void AutoCreatePOFromPR(List<srm_pr_main> list, List<ic_item> icitemlist, List<srm_supplier> itemsupplierList, List<srm_purchase> purchaselist, PoActionListDto poaction)
|
|
|
{
|
|
|
- var zcPr = list.Where(a => a.pr_billno.StartsWith("PR") && a.supplier_type != "委外").ToList();
|
|
|
+ //var zcPr = list.Where(a => a.pr_billno.StartsWith("PR") && a.supplier_type != "委外").ToList();
|
|
|
+ var zcPr = list.Where(a => a.pr_billno.StartsWith("PR")).ToList();
|
|
|
if (zcPr.Any())
|
|
|
{
|
|
|
AutoCreatePOFromPRByType(zcPr, icitemlist, itemsupplierList, purchaselist, poaction, 1);
|
|
|
}
|
|
|
- var wwPr = list.Where(a => a.pr_billno.StartsWith("PR") && a.supplier_type=="委外").ToList();
|
|
|
- if (wwPr.Any())
|
|
|
- {
|
|
|
- AutoCreatePOFromPRByType(wwPr, icitemlist, itemsupplierList, purchaselist, poaction, 2);
|
|
|
- }
|
|
|
+ //var wwPr = list.Where(a => a.pr_billno.StartsWith("PR") && a.supplier_type=="委外").ToList();
|
|
|
+ //if (wwPr.Any())
|
|
|
+ //{
|
|
|
+ // AutoCreatePOFromPRByType(wwPr, icitemlist, itemsupplierList, purchaselist, poaction, 2);
|
|
|
+ //}
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 根据PR生成PO
|
|
|
@@ -2693,15 +2694,16 @@ namespace Business.ResourceExamineManagement
|
|
|
ReqLine = 1,
|
|
|
Typed = poType == 1 ? "" : "s",
|
|
|
Project = poType == 1 ? "" : "3",
|
|
|
+ Drawing= refItem?.Drawing,
|
|
|
Status = ""
|
|
|
});
|
|
|
});
|
|
|
poaction.poDetailList.AddRange(purOrdDetails);
|
|
|
- if (poType == 2)
|
|
|
- {
|
|
|
- var purOrdDetailBatches = GetPurOrdDetailBatches(purOrdDetails,domain, list[0].company_id.ToString()).Result;
|
|
|
- poaction.poDetailBatchList.AddRange(purOrdDetailBatches);
|
|
|
- }
|
|
|
+ //if (poType == 2)
|
|
|
+ //{
|
|
|
+ // var purOrdDetailBatches = GetPurOrdDetailBatches(purOrdDetails,domain, list[0].company_id.ToString()).Result;
|
|
|
+ // poaction.poDetailBatchList.AddRange(purOrdDetailBatches);
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
public async Task<List<PurOrdDetailBatch>> GetPurOrdDetailBatches(List<PurOrdDetail> purOrdDetails,string domain,string company_id)
|
|
|
@@ -2793,7 +2795,7 @@ namespace Business.ResourceExamineManagement
|
|
|
ItemNum = a.ItemNum,
|
|
|
SuppItem = item.item_number,
|
|
|
QtyOrded = a.QtyOrded,
|
|
|
- QtyBO = item.unit == "KG" || item.unit == "M" ? item.qty + ((item.qty * item.scrap.GetValueOrDefault()) / 100) : Math.Ceiling(item.qty + ((item.qty * item.scrap.GetValueOrDefault()) / 100)),
|
|
|
+ QtyBO = item.qty,
|
|
|
QtyReleased = item.unit == "KG" || item.unit == "M" ? a.QtyOrded * (item.qty + ((item.qty * item.scrap.GetValueOrDefault()) / 100)) : Math.Ceiling(a.QtyOrded * (item.qty + ((item.qty * item.scrap.GetValueOrDefault()) / 100))),
|
|
|
Status = ""
|
|
|
});
|
|
|
@@ -2822,7 +2824,7 @@ namespace Business.ResourceExamineManagement
|
|
|
ItemNum = a.ItemNum,
|
|
|
SuppItem = item.item_number,
|
|
|
QtyOrded = a.QtyOrded,
|
|
|
- QtyBO = item.unit == "KG" || item.unit == "M" ? item.qty.GetValueOrDefault() + ((item.qty.GetValueOrDefault() * item.Scrap) / 100) : Math.Ceiling(item.qty.GetValueOrDefault() + ((item.qty.GetValueOrDefault() * item.Scrap) / 100).GetValueOrDefault()),
|
|
|
+ QtyBO = item.qty,
|
|
|
QtyReleased = item.unit == "KG" || item.unit == "M" ? a.QtyOrded * (item.qty.GetValueOrDefault() + ((item.qty.GetValueOrDefault() * item.Scrap) / 100)) : Math.Ceiling(a.QtyOrded * (item.qty.GetValueOrDefault() + ((item.qty.GetValueOrDefault() * item.Scrap) / 100)).GetValueOrDefault()),
|
|
|
Status = ""
|
|
|
});
|