陈清红
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
StaticMethod DetectingNegativeValues (
  MacroPlan macroPlan
) as String
{
  Description: '检测负值'
  TextBody:
  [*
    nopt := maxselect( macroPlan, NewOfflinePlanTable, tempOPT, true, tempOPT.SaveDateTime() );
    
    res  := "";
    
    // 循环遍历明细数据
    traverse ( nopt, NewOfflinePlanRow, npr, npr.Type() = "1" ) {
      traverse ( npr, NewOfflinePlanCell, npcell, npcell.Quantity() < 0 ) {
        res := res      +
               "产线:" + npr.ProductionLine()                                          + " " +
               "产品:" + npr.ProductID()                                               + " " +
               "时间:" + npcell.NewOfflinePlanColumn().StartDate().Format( "Y-M2-D2" ) + " " +
               "数量:" + [String]npcell.Quantity()                                     + "\n";
      }
    }
    
    if ( res = "" ) {
      res := "暂未出现负值";
    }
    
    return res;
  *]
}