|
|
@@ -291,13 +291,27 @@ namespace PRSDesktop
|
|
|
{
|
|
|
var ids = Kanbans.Where(x => !x.ColorKey.Equals(QA_COLOR)).Select(x => Guid.Parse(x.ID)).ToArray();
|
|
|
|
|
|
- var treatments = new Client<ManufacturingTreatment>().Query(Filter<ManufacturingTreatment>.Where(x => x.Packet.ID).InList(ids));
|
|
|
+ var treatments = Client.Query(
|
|
|
+ Filter<ManufacturingTreatment>.Where(x => x.Packet.ID).InList(ids),
|
|
|
+ Columns.None<ManufacturingTreatment>()
|
|
|
+ .Add(x => x.ID)
|
|
|
+ .Add(x => x.Parameter)
|
|
|
+ .Add(x => x.Product.ID)
|
|
|
+ .Add(x => x.Product.Code)
|
|
|
+ .Add(x => x.Packet.ID)
|
|
|
+ .Add(x => x.Packet.Setout.Job.ID)
|
|
|
+ .Add(x => x.Packet.Setout.Job.JobNumber)
|
|
|
+ .Add(x => x.Packet.Serial)
|
|
|
+ .Add(x => x.Packet.Title)
|
|
|
+ .Add(x => x.Packet.Quantity));
|
|
|
var window = new ManufacturingTreatmentWindow(treatments);
|
|
|
if (window.ShowDialog() != true)
|
|
|
return;
|
|
|
|
|
|
Progress.Show("Creating Purchase Order");
|
|
|
|
|
|
+ var treatmentPOSettings = new GlobalConfiguration<TreatmentPOSettings>().Load();
|
|
|
+
|
|
|
var order = new PurchaseOrder();
|
|
|
order.Supplier.ID = window.SupplierID;
|
|
|
order.Supplier.Name = window.SupplierName; //supplier != null ? supplier.Name : "Unknown Supplier";
|
|
|
@@ -305,6 +319,7 @@ namespace PRSDesktop
|
|
|
order.IssuedBy.ID = App.EmployeeID;
|
|
|
order.IssuedDate = DateTime.Today;
|
|
|
order.DueDate = DateTime.Today.AddDays(7);
|
|
|
+ order.Category.CopyFrom(treatmentPOSettings.DefaultTreatmentPurchaseOrderCategory);
|
|
|
Client.Save(order, $"Materials Processing Request raised by {App.EmployeeName} from Factory Floor");
|
|
|
|
|
|
Progress.SetMessage("Processing Order");
|