| | |
| | | id := id + "_" + item.Line(); |
| | | } |
| | | operation := Operation::FindOperationTypeIndex( id ); |
| | | account := Account_MP::FindByName( this, "Operation cost" ); |
| | | isfromdb := false; |
| | | existoperationcost := OperationCost::FindOperationCostTypeIndex( id ); |
| | | if( isnull( existoperationcost ) ){ |
| | | connecteditem := select( globalOTDTable, |
| | | Global_MappingOperationCost, |
| | | moperationcost, |
| | | moperationcost.OrgCode() = item.OrganCode(), |
| | | moperationcost.ProductID() = item.ProductID() ); |
| | | cost := connecteditem.Cost(); |
| | | lengthoftime := connecteditem.LengthOfTime(); |
| | | start := connecteditem.Start(); |
| | | timeunit := connecteditem.TimeUnit(); |
| | | OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb ); |
| | | } |
| | | if(not isnull(operation)){ |
| | | account := Account_MP::FindByName( this, "Operating cost" ); |
| | | isfromdb := false; |
| | | existoperationcost := OperationCost::FindOperationCostTypeIndex( id ); |
| | | if( isnull( existoperationcost ) ){ |
| | | connecteditem := select( globalOTDTable, |
| | | Global_MappingOperationCost, |
| | | moperationcost, |
| | | moperationcost.OrgCode() = item.OrganCode(), |
| | | moperationcost.ProductID() = item.ProductID() ); |
| | | if( not isnull( connecteditem)){ |
| | | cost := connecteditem.Cost(); |
| | | lengthoftime := connecteditem.LengthOfTime(); |
| | | start := connecteditem.Start(); |
| | | timeunit := connecteditem.TimeUnit(); |
| | | OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb ); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | *] |
| | | } |