| Quintiq file version 2.0 | 
| #parent: #root | 
| Method Update ( | 
|   Product_MP owner, | 
|   StockingPoint_MP stockingpoint, | 
|   Date date, | 
|   Date manufactureddate, | 
|   Real inventoryquantity, | 
|   String description, | 
|   Boolean isfromdb | 
| ) | 
| { | 
|   Description: 'Update inventory supply' | 
|   TextBody: | 
|   [* | 
|     // Wayne Apr-15-2013 (created) | 
|     oldpisp := this.ProductInStockingPoint_MP(); | 
|      | 
|     needsync := isnull( oldpisp ) | 
|                 or oldpisp.Product_MP() <> owner | 
|                 or oldpisp.StockingPoint_MP() <> stockingpoint; | 
|      | 
|     if( needsync ) | 
|     { | 
|       owner.InventorySupply( relmove, this ); | 
|      | 
|       // create pisp when there is changes to prodcut / stocking point | 
|       owner.AddToStockingPoint( stockingpoint ); | 
|        | 
|       // Update PISPAccount for associated InventorySupplyCost | 
|       traverse( this, InventorySupplyCost, inventorysupplycost, not isnull( inventorysupplycost.PISPAccount() )) | 
|       { | 
|         inventorysupplycost.UpdateCommitLogic(); | 
|       } | 
|     } | 
|      | 
|     this.Date( date ); | 
|     this.ManufacturedDate( manufactureddate ); | 
|     this.Update( inventoryquantity ); | 
|     this.Description( description ); | 
|      | 
|     this.UpdateForeignKey( owner.ID(), stockingpoint.ID() ); | 
|     this.IsManuallyConfigured( not isfromdb ); | 
|   *] | 
| } |