| | |
| | | String werk, |
| | | Date startdate, |
| | | Date enddate, |
| | | const MacroPlan macroplanfrom, |
| | | const MacroPlan macroplanto, |
| | | String versionfrom, |
| | | String versionto, |
| | | Boolean versionflag, |
| | | const Product_MPs products, |
| | | String executor |
| | |
| | | , Success := true |
| | | ); |
| | | ms64 := owner.AOnlineAndMOfflinePlanMS64( relnew, Werk := werk, StartDate := startdate, EndDate := enddate |
| | | , VersionFrom := macroplanfrom.ScenarioName() |
| | | , VersionTo := macroplanto.ScenarioName(), IsActive := versionflag ); |
| | | , VersionFrom := versionfrom |
| | | , VersionTo := versionto, IsActive := versionflag ); |
| | | loginfo.AOnlineAndMOfflinePlanMS64( relinsert, ms64 ); |
| | | traverse( products, Elements, product, product.IsLeaf() ){ |
| | | ms64.MS64Data( relnew, Product := product.ID() ); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute ZPPPSCode |
| | | { |
| | | #keys: '3[415136.0.1046220023][415136.0.1046220022][415136.0.1046220024]' |
| | | ValueType: String |
| | | } |
| | |
| | | owner.AOnlineAndMOfflinePlanPIR( relflush ); |
| | | } |
| | | nowdate := DateTime::ActualTime(); |
| | | productids := construct( Strings ); |
| | | loginfo := owner.InterfaceLoginfo( relnew, ExecuteUser := executor |
| | | , Name := Translations::InterfaceDataset_AOnlineAndMOfflinePlanPIR_Name() |
| | | , InterfaceDateTime := nowdate |
| | |
| | | , ReturnMsg := 'Success' |
| | | , Success := true |
| | | ); |
| | | pir := owner.AOnlineAndMOfflinePlanPIR( relnew, Werk := werk, Version := macroplan.ScenarioName(), StartDate := startdate, EndDate := enddate ); |
| | | pir := owner.AOnlineAndMOfflinePlanPIR( relnew, ZPPPSCode := OS::GenerateGUIDAsString(), Werk := werk, Version := macroplan.ScenarioName(), StartDate := startdate, EndDate := enddate ); |
| | | loginfo.AOnlineAndMOfflinePlanPIR( relinsert, pir ); |
| | | traverse( macroplan, AssemblyOnlinePlanColumn, column ){ |
| | | traverse( column, AssemblyOnlinePlanCell, cell, cell.Value() <> '' and cell.AssemblyOnlinePlanRow().RowNr() = '1' ){ |
| | | traverse( macroplan, AssemblyOnlinePlanColumn, column, column.ColumnDate() >= startdate and column.ColumnDate() <= enddate ){ |
| | | traverse( column, AssemblyOnlinePlanCell, cell, ( werk = 'All' or cell.AssemblyOnlinePlanRow().ProductionLine().FindString( werk, 0 ) > -1 ) |
| | | and cell.AssemblyOnlinePlanRow().RowNr() = '1' ){ |
| | | quantityrow := cell.AssemblyOnlinePlanRow(); |
| | | if( not exists( productids, Elements, e, e = quantityrow.ProductID() ) ){ |
| | | productids.Add( quantityrow.ProductID() ); |
| | | } |
| | | |
| | | pir.PIRData( relnew, Product := quantityrow.ProductID() |
| | | , PlanningDate := column.ColumnDate() |
| | |
| | | } |
| | | |
| | | traverse( macroplan, OfflinePlanTable, table ){ |
| | | traverse( table, OfflinePlanColumn, column ){ |
| | | traverse( column, OfflinePlanCell, cell, cell.Value() <> '' |
| | | traverse( table, OfflinePlanColumn, column, column.ColumnDate() >= startdate and column.ColumnDate() <= enddate ){ |
| | | traverse( column, OfflinePlanCell, cell, ( werk = 'All' or cell.OfflinePlanRow().ProductionLine().FindString( werk, 0 ) > -1 ) |
| | | and ( cell.OfflinePlanRow().ProductionLine() <> 'DL_MOMO' or cell.OfflinePlanRow().ProductionLine() <> 'CC_MOMO' ) ){ |
| | | row := cell.OfflinePlanRow(); |
| | | |
| | | pir.PIRData( relnew, Product := row.ProductID() |
| | | , PlanningDate := column.ColumnDate() |
| | | , PlanningQty := [Number]cell.Value()); |
| | | if( not exists( productids, Elements, e, e = row.ProductID() ) ){ |
| | | productids.Add( row.ProductID() ); |
| | | } |
| | | pirdata := selectobject( pir, PIRData, pirdata, pirdata.Product() = row.ProductID() and pirdata.PlanningDate() = column.ColumnDate() ); |
| | | if( isnull( pir ) ){ |
| | | pirdata := pir.PIRData( relnew, Product := row.ProductID() |
| | | , PlanningDate := column.ColumnDate() |
| | | , PlanningQty := 0 ); |
| | | } |
| | | pirdata.PlanningQty( pirdata.PlanningQty() + [Number]cell.Value() ); |
| | | } |
| | | } |
| | | } |
| | | traverse( productids, Elements, e ){ |
| | | for( date := startdate.StartOfWeek(); date <= enddate; date := ( date + Duration::Days( 1 ) ).Date() ){ |
| | | if( not exists( pir, PIRData, pirdata, pirdata.Product() = e and pirdata.PlanningDate() = date ) ){ |
| | | pir.PIRData( relnew, Product := e |
| | | , PlanningDate := date |
| | | , PlanningQty := 0 ); |
| | | } |
| | | } |
| | | } |
| | |
| | | Body: |
| | | [* |
| | | dlg := construct( DialogZEDPPSMS64 ); |
| | | ApplicationMacroPlanner.ShowFormModal( dlg ); |
| | | dlg.New(); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | |
| | | [* |
| | | dlg := construct( DialogZEDPPSPIR ); |
| | | //dlg.Title( Translations::InterfaceDataset_AssemblyOnlinePlanPPPSPush_Name() ); |
| | | ApplicationMacroPlanner.ShowFormModal( dlg ); |
| | | dlg.New(); |
| | | //dlg.New( Translations::InterfaceDataset_AssemblyOnlinePlanPPPSPush_Name() ); |
| | | *] |
| | | GroupServerCalls: false |
| | |
| | | [ |
| | | Label: 'å·¥å代ç ' |
| | | Taborder: 0 |
| | | Visible: false |
| | | ] |
| | | } |
| | | Component dsStartDate |
| | |
| | | Properties: |
| | | [ |
| | | Label: 'å¼å§æ¥æ' |
| | | Taborder: 1 |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | | Component dsEndDate |
| | |
| | | Properties: |
| | | [ |
| | | Label: 'ç»ææ¥æ' |
| | | Taborder: 2 |
| | | Taborder: 3 |
| | | ] |
| | | } |
| | | Component cbActiveVersion |
| | |
| | | [ |
| | | Checked: true |
| | | Label: 'æ¯å¦æ¿æ´»çæ¬' |
| | | Taborder: 5 |
| | | Taborder: 8 |
| | | ] |
| | | } |
| | | Component ddlOriginMacroPlan |
| | |
| | | [ |
| | | DisplayField: 'Name' |
| | | Label: 'ä»çæ¬' |
| | | Taborder: 3 |
| | | Taborder: 4 |
| | | Visible: false |
| | | ] |
| | | } |
| | | Component ddlDestinationMacroPlan |
| | |
| | | [ |
| | | DisplayField: 'Name' |
| | | Label: 'å°çæ¬' |
| | | Taborder: 4 |
| | | Taborder: 6 |
| | | Visible: false |
| | | ] |
| | | } |
| | | Component efVersionFrom |
| | | { |
| | | #keys: '[415136.0.1047640864]' |
| | | BaseType: 'WebEditField' |
| | | Properties: |
| | | [ |
| | | Label: 'ä»çæ¬' |
| | | Taborder: 5 |
| | | ] |
| | | } |
| | | Component efVersionTo |
| | | { |
| | | #keys: '[415136.0.1047640919]' |
| | | BaseType: 'WebEditField' |
| | | Properties: |
| | | [ |
| | | Label: 'å°çæ¬' |
| | | Taborder: 7 |
| | | ] |
| | | } |
| | | Component ddslFactory |
| | | { |
| | | #keys: '[415136.0.1047641023]' |
| | | BaseType: 'WebDropDownStringList' |
| | | Properties: |
| | | [ |
| | | Label: 'å·¥å代ç ' |
| | | Strings: 'All;DL;CC' |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method New () id:Method_DialogZEDPPSMS64_New |
| | | { |
| | | #keys: '[415136.0.1047779759]' |
| | | Body: |
| | | [* |
| | | // To create a new product |
| | | dsStartDate.Date( Date::ActualDate() ); |
| | | dsEndDate.Date( Date::ActualDate() ); |
| | | |
| | | ApplicationMacroPlanner.ShowFormModal( this ); |
| | | *] |
| | | } |
| | |
| | | Body: |
| | | [* |
| | | Form.ApplyChanges(); |
| | | componentmds := ApplicationScope.ComponentMDS(); |
| | | mdsinstanceF := select( componentmds, ComponentMDSKinds.ComponentMDSInstances, m, m.MDSID().MDSKey() = ddlOriginMacroPlan.Data().DatasetMDSID() ); |
| | | handleF := mdsinstanceF.GetMDSHandle() |
| | | macroplanF := handleF.AsMacroPlan(); |
| | | |
| | | mdsinstanceT := select( componentmds, ComponentMDSKinds.ComponentMDSInstances, m, m.MDSID().MDSKey() = ddlDestinationMacroPlan.Data().DatasetMDSID() ); |
| | | handleT := mdsinstanceT.GetMDSHandle() |
| | | macroplanT := handleT.AsMacroPlan(); |
| | | //componentmds := ApplicationScope.ComponentMDS(); |
| | | //mdsinstanceF := select( componentmds, ComponentMDSKinds.ComponentMDSInstances, m, m.MDSID().MDSKey() = ddlOriginMacroPlan.Data().DatasetMDSID() ); |
| | | //handleF := mdsinstanceF.GetMDSHandle() |
| | | //macroplanF := handleF.AsMacroPlan(); |
| | | // |
| | | //mdsinstanceT := select( componentmds, ComponentMDSKinds.ComponentMDSInstances, m, m.MDSID().MDSKey() = ddlDestinationMacroPlan.Data().DatasetMDSID() ); |
| | | //handleT := mdsinstanceT.GetMDSHandle() |
| | | //macroplanT := handleT.AsMacroPlan(); |
| | | |
| | | currentuser := QuintiqUser::CurrentUser().DisplayName(); |
| | | |
| | | AOnlineAndMOfflinePlanMS64::GenerateData( InterfaceDataset, efFactory.Text(), dsStartDate.Date(), dsEndDate.Date(), macroplanF, macroplanT, cbActiveVersion.Checked(), dhProducts.Data(), currentuser ); |
| | | AOnlineAndMOfflinePlanMS64::GenerateData( InterfaceDataset, efFactory.Text(), dsStartDate.Date(), dsEndDate.Date(), efVersionFrom.Text(), efVersionTo.Text(), cbActiveVersion.Checked(), dhProducts.Data(), currentuser ); |
| | | |
| | | Form.Close(); |
| | | *] |
| | |
| | | [ |
| | | Label: 'å·¥å代ç ' |
| | | Taborder: 0 |
| | | Visible: false |
| | | ] |
| | | } |
| | | Component dsStartDate id:dsStartDate_60 |
| | |
| | | Properties: |
| | | [ |
| | | Label: '计åå¼å§æ¶é´' |
| | | Taborder: 2 |
| | | Taborder: 3 |
| | | ] |
| | | } |
| | | Component dsEndDate id:dsEndDate_236 |
| | |
| | | Properties: |
| | | [ |
| | | Label: '计åç»ææ¶é´' |
| | | Taborder: 3 |
| | | Taborder: 4 |
| | | ] |
| | | } |
| | | Component ddlMacroPlan |
| | |
| | | [ |
| | | DisplayField: 'Name' |
| | | Label: 'çæ¬' |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | | Component ddslFactory id:ddslFactory_424 |
| | | { |
| | | #keys: '[415136.0.1047641312]' |
| | | BaseType: 'WebDropDownStringList' |
| | | Properties: |
| | | [ |
| | | Label: 'å·¥å代ç ' |
| | | Strings: 'All;DL;CC' |
| | | Taborder: 1 |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method New () id:Method_DialogZEDPPSPIR_New |
| | | { |
| | | #keys: '[415136.0.1047779645]' |
| | | Body: |
| | | [* |
| | | // To create a new product |
| | | dsStartDate.Date( Date::ActualDate() ); |
| | | dsEndDate.Date( Date::ActualDate() ); |
| | | |
| | | ApplicationMacroPlanner.ShowFormModal( this ); |
| | | *] |
| | | } |