yypsybs
2023-10-13 edfbb3b9cb8a6700df14ee75a6981f48e13c76c5
_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate0.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateOrUpdate (
  GlobalOTDTable parent,
  MacroPlan macroPlan,
  String orgCode,
  String productId,
@@ -17,15 +18,15 @@
  TextBody:
  [*
    // yypsybs Aug-25-2023 (created)
    parent := select( macroPlan, ManufactureLTImputation, item, item.OrgCode() = orgCode and item.SkuID() = productId );
    if( isnull( parent ) ) {
        parent := macroPlan.ManufactureLTImputation( relnew, OrgCode := orgCode, SkuID := productId, Describe := parentDesc );
    ltParent := select( parent, ManufactureLTImputation, item, item.OrgCode() = orgCode and item.SkuID() = productId );
    if( isnull( ltParent ) ) {
        ltParent := parent.ManufactureLTImputation( relnew, OrgCode := orgCode, SkuID := productId, Describe := parentDesc );
    } else {
        parent.Describe( parentDesc );
        ltParent.Describe( parentDesc );
    }
    child := select( parent, ManufactureLTProcessSection, item, item.ProcessSection() = processSection and item.Sequence() = seq and item.Line() = line );
    child := select( ltParent, ManufactureLTProcessSection, item, item.ProcessSection() = processSection and item.Sequence() = seq and item.Line() = line );
    if( isnull( child ) ) {
        child := parent.ManufactureLTProcessSection( relnew,
        child := ltParent.ManufactureLTProcessSection( relnew,
                                                     ProcessSection := processSection, Sequence := seq, Line := line, SystemLT := systemLt, 
                                                     Edited := edited, EditLT := editLt, Describe := childDesc );
    } else {