Quintiq file version 2.0
#parent: #root
Method EnableDisableTotalSupply () id:Method_DialogSmartPlan_EnableDisableTotalSupply
{
  #keys: '[137862.0.115152153]'
  Body:
  [*
    // Enable/Disable the total supply editor based on the checkbox
    
    isspecifytotalsupply := CheckboxSpecifyTotalSupply.Checked();
    text := '';
    
    // Enable to total supply editor if the checkbox is checked
    if( isspecifytotalsupply )
    {
      data := DataHolderDialogData.Data();  
      text := ApplicationMacroPlanner.FormatRealToString( data.WrappedInstance().GetDemandQuantity() );
      
      if( data.HasTotalSupplyUser() )
      {
        text := ApplicationMacroPlanner.FormatRealToString( data.TotalSupplyUser() );
      }
    }
    
    EditFieldTotalSupply.Enabled( isspecifytotalsupply, 
                                  Translations::MP_Designer_DialogSmartPlan_TotalSupplyCheckboxUnchecked() );
    EditFieldTotalSupply.Text( text );
  *]
}
