陈清红
2025-04-14 0b84c9999f07bc46275f5947c4b8ebf5ce0c25cf
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
29
30
31
Quintiq file version 2.0
#parent: #root
Method SetQuantity (
  InventoryPlanArchiveColumn column,
  Real planqty,
  Real actualaty,
  NamedValueTree resetNVT
)
{
  TextBody:
  [*
    // 甄兰鸽 Jun-24-2024 (created)
    cell        := selectobject( this, Cell, cell, cell.Column() = column );
    if( isnull( cell ) ){
      cell      := this.Cell( relnew, PlanQuantity := 0, ActualQuantity := 0 );
    
      column.Cell( relinsert, cell );
    }
    
    // 判断是否重置为0
    resetH := resetNVT.GetHandle( this.ShowName() + column.StartDate().Format( "Y-M2-D2" ) );
    if ( guard( isnull( resetNVT.Root().Child( resetH ) ), true ) ) {
      cell.PlanQuantity( 0 );
      
      resetNVT.Root().AddChild( resetH );
    }
    
    cell.PlanQuantity( cell.PlanQuantity() + planqty );
    cell.ActualQuantity( actualaty );
  *]
}