yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Quintiq file version 2.0
#parent: #root
Method CreateOperationBOM (
  Product_MP product,
  StockingPoint_MP stockingpoint,
  Boolean isinput,
  Boolean isfromdb
)
{
  Description: 'Given product and stocking point, Create or use existing pisp  and link to the operation as operation input/output.'
  TextBody:
  [*
    // DWE2 Mar-27-2016 (created)
    pisps := construct( ProductInStockingPoint_MPs );
    
    pisp := product.AddToStockingPoint( stockingpoint );
    
    // If it already exists, do not add
    if( ( isinput and not exists( this, OperationInput.ProductInStockingPoint_MP, psp, psp = pisp ) )
         or ( not isinput and not exists( this, OperationOutput.ProductInStockingPoint_MP, psp, psp = pisp ) ) )
    {
      pisps.Add( pisp );
      this.LinkPISPs( pisps, isinput );
    }
    
    this.IsManuallyConfigured( not isfromdb );
  *]
}