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
Quintiq file version 2.0
#parent: #root
MethodOverride GetHasValidLotCost () declarative remote as Boolean
{
  TextBody:
  [*
    value := true;
    
    lotaccount := this.CostDriver() = Translations::MP_AccountAssignmentCostDriverLot();
    if( lotaccount and this.Cost() > 0.0 )
    { 
      nextlotcost := minselect( this, LaneLeg.LaneLegCost, llc, llc.CostDriver() = this.CostDriver() and llc.Start() > this.Start(), true );
      
      //within the lot cost period, there should be no up transport with lot size 0
      value := forall( this, 
                       LaneLeg.Lane.Unit.UnitPeriod.astype( UnitPeriodTransportBase ), 
                       upt, 
                       upt.StartDate() >= this.Start()
                       and upt.StartDate() < guard( nextlotcost.Start(), Date::MaxDate() ),                    
                       upt.LotSize() > 0 );
    }
    return value;
  *]
}