| | |
| | | [* |
| | | // Administrator Aug-21-2023 (created) |
| | | // list to deal |
| | | listtodeal := construct( structured[MappingOperation] ); |
| | | listtodeal := construct( structured[Global_MappingOperation] ); |
| | | |
| | | if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | listtodeal := selectset( this, MappingOperation, item, true ); |
| | | listtodeal := selectset( globalOTDTable, Global_MappingOperation, item, true ); |
| | | } else { |
| | | organcodelist := selectvalues( globalOTDTable, BusinessType.OrganCode, organ, businesstypes.Find( organ.BusinessType().BusinessTypeName() ) <> -1, organ.OrganCodeName() ); |
| | | listtodeal := selectset( this, |
| | | MappingOperation, |
| | | listtodeal := selectset( globalOTDTable, Global_MappingOperation, |
| | | item, |
| | | ( businesstypes.Find( item.BusinessType() ) <> -1 ) and |
| | | ( organcodelist.Find( item.OrganCode() ) >= 0 ) ); |
| | | } |
| | | |
| | | // Get the list to deal with max sequence number |
| | | listtodealwithmaxsn := construct( structured[MappingOperation] ); |
| | | listtodealwithmaxsn := construct( structured[Global_MappingOperation] ); |
| | | traverse( listtodeal, Elements, item ){ |
| | | maxsn := maxselect( this, |
| | | MappingOperation, |
| | | maxsn := maxselect( globalOTDTable, Global_MappingOperation, |
| | | moperation, |
| | | moperation.OrganCode() = item.OrganCode(), |
| | | moperation.ProductID() = item.ProductID(), |
| | |
| | | isfromdb := false; |
| | | existoperationcost := OperationCost::FindOperationCostTypeIndex( id ); |
| | | if( isnull( existoperationcost ) ){ |
| | | connecteditem := select( this, |
| | | MappingOperationCost, |
| | | connecteditem := select( globalOTDTable, |
| | | Global_MappingOperationCost, |
| | | moperationcost, |
| | | moperationcost.OrgCode() = item.OrganCode(), |
| | | moperationcost.ProductID() = item.ProductID() ); |