|
@@ -72,38 +72,38 @@ namespace PRSDesktop
|
|
private bool ReserveStock(CoreRow row)
|
|
private bool ReserveStock(CoreRow row)
|
|
{
|
|
{
|
|
StockHolding holding = row.ToObject<StockHolding>();
|
|
StockHolding holding = row.ToObject<StockHolding>();
|
|
- if (holding.Job.IsValid())
|
|
|
|
- {
|
|
|
|
- CoreTable table = new Client<StockMovement>().Query(new Filter<StockMovement>(x => x.Location.ID).IsEqualTo(holding.ID)
|
|
|
|
- .And(x => x.JobRequisitionItem.ID).IsEqualTo(RequiItemID),
|
|
|
|
- new Columns<StockMovement>(x => x.ID));
|
|
|
|
- if (table.Rows.Any())
|
|
|
|
- {
|
|
|
|
- var choiceresult = MessageBox.Show("This will reverse previous stock movements created to reserve from this location. Proceed?", "Alert", MessageBoxButton.YesNo);
|
|
|
|
- switch (choiceresult)
|
|
|
|
- {
|
|
|
|
- case MessageBoxResult.Yes:
|
|
|
|
- break;
|
|
|
|
- case MessageBoxResult.No:
|
|
|
|
- return false;
|
|
|
|
- default:
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- List<StockMovement> movements = new List<StockMovement>();
|
|
|
|
- foreach (CoreRow stockmovementRow in table.Rows)
|
|
|
|
- {
|
|
|
|
- StockMovement movement = new StockMovement { ID = Guid.Parse(stockmovementRow.Values[0].ToString()) };
|
|
|
|
- movements.Add(movement);
|
|
|
|
- }
|
|
|
|
- new Client<StockMovement>().Delete(movements, "Stock movements reversed from Job Requi Review Dashboard");
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- MessageBox.Show("The stock movements for this holding cannot be reversed");
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //if (holding.Job.IsValid())
|
|
|
|
+ //{
|
|
|
|
+ // CoreTable table = new Client<StockMovement>().Query(new Filter<StockMovement>(x => x.Location.ID).IsEqualTo(holding.ID)
|
|
|
|
+ // .And(x => x.JobRequisitionItem.ID).IsEqualTo(RequiItemID),
|
|
|
|
+ // new Columns<StockMovement>(x => x.ID));
|
|
|
|
+ // if (table.Rows.Any())
|
|
|
|
+ // {
|
|
|
|
+ // var choiceresult = MessageBox.Show("This will reverse previous stock movements created to reserve from this location. Proceed?", "Alert", MessageBoxButton.YesNo);
|
|
|
|
+ // switch (choiceresult)
|
|
|
|
+ // {
|
|
|
|
+ // case MessageBoxResult.Yes:
|
|
|
|
+ // break;
|
|
|
|
+ // case MessageBoxResult.No:
|
|
|
|
+ // return false;
|
|
|
|
+ // default:
|
|
|
|
+ // return false;
|
|
|
|
+ // }
|
|
|
|
+ // List<StockMovement> movements = new List<StockMovement>();
|
|
|
|
+ // foreach (CoreRow stockmovementRow in table.Rows)
|
|
|
|
+ // {
|
|
|
|
+ // StockMovement movement = new StockMovement { ID = Guid.Parse(stockmovementRow.Values[0].ToString()) };
|
|
|
|
+ // movements.Add(movement);
|
|
|
|
+ // }
|
|
|
|
+ // new Client<StockMovement>().Delete(movements, "Stock movements reversed from Job Requi Review Dashboard");
|
|
|
|
+ // return true;
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // MessageBox.Show("The stock movements for this holding cannot be reversed");
|
|
|
|
+ // return false;
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
var result = MessageBox.Show("This will reserve stock from the holding now. Proceed?", "Alert", MessageBoxButton.YesNo);
|
|
var result = MessageBox.Show("This will reserve stock from the holding now. Proceed?", "Alert", MessageBoxButton.YesNo);
|
|
switch (result)
|
|
switch (result)
|
|
{
|
|
{
|
|
@@ -125,6 +125,7 @@ namespace PRSDesktop
|
|
List<StockMovement> movements = new List<StockMovement>();
|
|
List<StockMovement> movements = new List<StockMovement>();
|
|
|
|
|
|
StockMovement issuemovement = new StockMovement();
|
|
StockMovement issuemovement = new StockMovement();
|
|
|
|
+ issuemovement.System = true;
|
|
issuemovement.Batch.Notes = batch.Notes;
|
|
issuemovement.Batch.Notes = batch.Notes;
|
|
issuemovement.Batch.Type = StockMovementBatchType.Transfer;
|
|
issuemovement.Batch.Type = StockMovementBatchType.Transfer;
|
|
issuemovement.Units = units;
|
|
issuemovement.Units = units;
|