From e2494303609cb24dd805b65c2654b82538be8c36 Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期五, 18 十月 2024 11:22:24 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev

---
 _Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl                                        |   51 ++++++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_bRefresh_OnClick.def             |    2 
 _Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl                                                        |   23 ++++-
 _Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pDL.def                             |   10 ++
 _Main/Sys/Repr/Global/PackagingPlanCell.qrp                                                                            |   51 ++++++++++++
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlActions_btnOk_OnClick.def |    4 
 _Main/BL/Type_MachineLogisticsCostReportRow/Method_Filter.qbl                                                          |    8 ++
 _Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl                                               |   52 ++++++++++---
 _Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanLotSize/Component_pHeader.def                                 |    2 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Component_pnlContent.def              |    4 +
 _Main/BL/Type_PackagingPlanCell/Attribute_NewSupply.qbl                                                                |    8 ++
 _Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pCC.def                             |   10 ++
 _Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def                                  |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Component_MatrixEditor912.def                     |    2 
 14 files changed, 207 insertions(+), 22 deletions(-)

diff --git a/_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl b/_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl
index a347a1c..98564c2 100644
--- a/_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl
+++ b/_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl
@@ -1,8 +1,7 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod CreateData (
-  MacroPlan macroPlan,
-  String factory
+  MacroPlan macroPlan
 )
 {
   TextBody:
@@ -36,15 +35,24 @@
                         and tempLCM.StartDate() <= mlcrc.StartDate() and tempLCM.EndDate() >= mlcrc.StartDate().StartOfNextMonth() );
         
         // 杩愯緭鎴愭湰鍙傛暟
-        lct  := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = mlcrr.Category() and 
-                        tempLCT.Origin() = "闀挎槬澶栫搴�" and tempLCT.Destination() = "CC 鍘傚唴搴�" );
+        lct  := select( macroPlan, LogisticsCostTransport, tempLCT, 
+                        tempLCT.Product()     = mlcrr.Category()                                                   and 
+                        tempLCT.Origin()      = ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "闀挎槬澶栫搴�", "澶ц繛鍘傚唴搴�" ) and 
+                        tempLCT.Destination() = ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "澶ц繛鍦哄唴搴�", "闀挎槬澶栫搴�" ) );
+        lct1 := select( macroPlan, LogisticsCostTransport, tempLCT, 
+                        tempLCT.Product()     = mlcrr.Category()                                                   and 
+                        tempLCT.Origin()      = ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "澶ц繛鍘傚唴搴�", "CC 鍘傚唴搴�" ) and 
+                        tempLCT.Destination() = ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "澶ц繛澶栫搴�", "闀挎槬澶栫搴�" ) );
+                        
+         // 褰撳墠鏈堟湯鏈�鍚庝竴澶╂棩鏈�                
+        lastDayOfThisMonth := mlcrc.StartDate().StartOfNextMonth() - 1; 
         
         cell := mlcrr.MachineLogisticsCostReportCell( relnew );
           
         // 璁剧疆鍖呰璐圭敤锛堝寘瑁呴噺 * 鍖呰鍗曚环锛�
         packageQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, 
                                 tempPPC.PackagingPlanRow().Category()             = mlcrr.Category()          and
-                                tempPPC.PackagingPlanRow().Factory()              = factory                   and
+                                tempPPC.PackagingPlanRow().Factory()              = mlcrr.Factory()           and
                                 tempPPC.PackagingPlanColumn().StartDate().Year()  = mlcrc.StartDate().Year()  and
                                 tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(),
                                 tempPPC.Package() );
@@ -53,7 +61,7 @@
         // 璁剧疆鎷嗗寘璐圭敤锛堟媶鍖呴噺 * 鎷嗗寘鍗曚环锛�
         unpackingQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, 
                                   tempPPC.PackagingPlanRow().Category()             = mlcrr.Category()          and
-                                  tempPPC.PackagingPlanRow().Factory()              = factory                   and
+                                  tempPPC.PackagingPlanRow().Factory()              = mlcrr.Factory()           and
                                   tempPPC.PackagingPlanColumn().StartDate().Year()  = mlcrc.StartDate().Year()  and
                                   tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(),
                                   tempPPC.Unpacking() );
@@ -67,20 +75,40 @@
           
         // 璁剧疆璋冩嫧璐圭敤锛堣皟鎷ㄦ暟閲� / 鍖呰瀹归噺 / 瑁呰浇瀹归噺 * 杩愯緭鍗曚环锛�
         transferQuantity := sum( macroPlan, TransferPlanRow.TransferPlanCell, tempTPC,
-                                 tempTPC.TransferPlanRow().Category()              = mlcrr.Category()                                       and
-                                 tempTPC.TransferPlanRow().Name()                  = ifexpr( factory = "澶ц繛宸ュ巶", "CC to DL", "DL to CC" ) and
-                                 tempTPC.TransferPlanColumn().ColumnDate().Year()  = mlcrc.StartDate().Year()                               and
-                                 tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(),
+                                 tempTPC.TransferPlanRow().Category()                      = mlcrr.Category()                                               and
+                                 tempTPC.TransferPlanRow().Name()                          = ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "CC to DL", "DL to CC" ) and
+                                 guard( tempTPC.TransferPlanColumn().ColumnDate().Year()   = mlcrc.StartDate().Year(), false )                              and
+                                 guard(  tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(), false ),
                                  [Number]tempTPC.Value() );
         cell.TransferCost( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) );
           
         // 澶栫搴撳叆搴撹垂鐢紙鍏ュ簱閲廩鍖呰閲廬 / 鍖呰瀹归噺 * 鍏ュ簱鍗曚环锛�
-      //  cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) );
+        cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) );
           
         // 澶栫搴撳嚭搴撹垂鐢紙鍑哄簱閲廩鎷嗗寘閲廬 / 鍖呰瀹归噺 * 鍑哄簱鍗曚环锛�
-      //  cell.OutboundExpensesForRentedWarehouses( unpackingQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.OutboundPrice(), 1 ) );
+        cell.OutboundExpensesForRentedWarehouses( unpackingQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.OutboundPrice(), 1 ) );
           
         // 澶栫搴撹繍杈撹垂鐢紙杩愯緭鏁伴噺 / 鍖呰瀹归噺 / 瑁呰浇瀹归噺 * 杩愯緭鍗曚环锛�
+        transportationQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, 
+                                       tempPIT.Product_MP().ParentID()                                                  =  mlcrr.Category()   and
+                                       tempPIT.Trip().Departure().Date()                                                >= mlcrc.StartDate()  and
+                                       tempPIT.Trip().Arrival().Date()                                                  <= lastDayOfThisMonth and
+                                       tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      = "CC 鍘傚唴搴�"         and
+                                       tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "闀挎槬澶栫搴�",
+                                       tempPIT.Quantity()
+                                      );
+        cell.ExternalRentalWarehouseTransportationCosts( transportationQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct1.LoadingCapacity(), 1 ) * guard( lct1.TransportPrice(), 1 ) );
+        
+        // 澶栫搴撲粨鍌ㄨ垂鐢細浠撳偍鏁伴噺/鍖呰瀹归噺*浠撳偍鍗曚环
+        plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
+                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf()                                                                 and
+                                 exists( tempPISPIP.ProductInStockingPoint_MP().Product_MP(), AllParent.AsParent, tempPMP, tempPMP.ID() =  "鏈哄姞浠�" )         and
+                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().ParentID()                                         =  mlcrr.Category()   and
+                                 tempPISPIP.Start().Date()                                                                              >= mlcrc.StartDate()  and
+                                 tempPISPIP.End().Date()                                                                                <= lastDayOfThisMonth and
+                                 tempPISPIP.ProductInStockingPoint_MP().StockingPointID()                                               =  ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "澶ц繛澶栫搴�", "闀挎槬澶栫搴�" ),
+                                 tempPISPIP.PlannedInventoryLevelEnd() );
+        cell.RentalWarehouseStorageFees( plannedInventory / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.StoragePrice(), 1 ) );
         
         cell.MachineLogisticsCostReportColumn( relset, mlcrc );
       }
diff --git a/_Main/BL/Type_MachineLogisticsCostReportRow/Method_Filter.qbl b/_Main/BL/Type_MachineLogisticsCostReportRow/Method_Filter.qbl
new file mode 100644
index 0000000..4ad4649
--- /dev/null
+++ b/_Main/BL/Type_MachineLogisticsCostReportRow/Method_Filter.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Method Filter (
+  String factory
+) declarative remote as Boolean
+{
+  TextBody: 'return this.Factory() = factory;'
+}
diff --git a/_Main/BL/Type_PackagingPlanCell/Attribute_NewSupply.qbl b/_Main/BL/Type_PackagingPlanCell/Attribute_NewSupply.qbl
new file mode 100644
index 0000000..4b563cc
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanCell/Attribute_NewSupply.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute NewSupply
+{
+  #keys: '3[415754.0.436130246][415754.0.436130245][415754.0.436130247]'
+  Description: '渚涘簲'
+  ValueType: Real
+}
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
index 78add67..4e84001 100644
--- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -36,13 +36,8 @@
         // 鍒涘缓鍗曞厓鏍�
         cell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = ppc );
         if ( isnull( cell ) ) {
-          cell := ppr.PackagingPlanCell( relnew );
-          cell.NetDemand( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() );
-          cell.EndingInventory( pispipl.InventoryLevelEnd() );
+          cell := ppr.PackagingPlanCell( relnew ); 
           cell.PackagingPlanColumn( relset, ppc );
-        } else {
-          cell.NetDemand( cell.NetDemand() + ( pispipl.InventoryLevelEnd() + pispipl.NewSupplyQuantity() - pispipl.DependentDemandAndSalesDemandQuantity() ) );
-          cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
         }
         
         // 璁剧疆璋冨嚭
@@ -65,12 +60,26 @@
           cell.TransferIn( cell.TransferIn() + pit.Quantity() );
         }
         
-        // 闀挎槬宸ュ巶鐗规畩鎯呭喌璁剧疆鍖呰搴撳瓨鍜岄潪鍖呰搴撳瓨
+        // 澶ц繛宸ュ巶璁剧疆鍊�
+        if ( factory = "澶ц繛宸ュ巶" ) {
+          // 鍑�闇�姹�&鍓╀綑搴撳瓨&渚涘簲閲�
+          cell.NetDemand( cell.NetDemand() + pispipl.DependentDemandAndSalesDemandQuantity() );
+          cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
+          cell.NewSupply( cell.NewSupply() + pispipl.NewSupplyQuantity() );
+        }
+        
+        // 闀挎槬宸ュ巶璁剧疆鍊�
         if ( factory = "闀挎槬宸ュ巶" ) {
+          // 鍓╀綑搴撳瓨&渚涘簲閲�
+          cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
+          cell.NewSupply( cell.NewSupply() + pispipl.NewSupplyQuantity() );
+          
+          // 鍑�闇�姹傘�愬彧鍙栫嚎杈瑰簱銆�&鍖呰搴撳瓨&闈炲寘瑁呭簱瀛�
           if ( pisp.StockingPointID().Regex( "澶栫搴�" ) ) {
             cell.CC_PackagingInventory( pispipl.InventoryLevelEnd() );
           } else if ( pisp.StockingPointID().Regex( "绾胯竟搴�" ) ) {
             cell.CC_UnpackagedInventory( pispipl.InventoryLevelEnd() );
+            cell.NetDemand( cell.NetDemand() + pispipl.DependentDemandAndSalesDemandQuantity() );
           }
         }
         
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl
index 72ed702..fab92f2 100644
--- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl
@@ -91,5 +91,56 @@
         }
       }
     }
+    
+    // 璁剧疆鎷嗗寘鍊硷紙绗﹀悎lotsize鍜屼竴鏃ユ渶澶у寘瑁呴噺锛�
+    traverse ( macroPlan, PackagingPlanRow, ppr/*, ppr.Factory() = "澶ц繛宸ュ巶" and ppr.ProductID() = "06K103011CM"*/ ) {
+      traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) {
+        // Product_MP
+        pmp                     := select( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and tempPMP.ID() = ppr.ProductID() );
+        // 鍖呰lotsize
+        ppls                    := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() = ppr.Factory() and 
+                                           tempPPLS.ProductID() = ifexpr( exists( macroPlan, PackagingPlanLotSize, tempPPLS1, tempPPLS1.ProductID() = pmp.ID() ),
+                                                                          pmp.ID(),
+                                                                          pmp.ParentID() ) );
+        // 涓�鏃ュ寘瑁呭閲�
+        ppnc                    := select( macroPlan, PackagingPlanNewCapability, tempPPNC, tempPPNC.Factory() = ppr.Factory() and 
+                                           tempPPNC.ProductID() = ifexpr( exists( macroPlan, PackagingPlanNewCapability, tempPPNC1, tempPPNC1.ProductID() = pmp.ID() ),
+                                                                          pmp.ID(),
+                                                                          pmp.ParentID() ) );
+        // Unit
+        us                      := selectset( macroPlan, Unit, tempU, tempU.ID().Regex( ppr.FactoryAbbreviation() + " " + ppr.Category() ) );
+         
+        // 褰撳墠闈炲寘瑁呭簱瀛� + 涓嬩竴澶╃殑NewSupply < 涓嬩竴澶╃殑鍑�闇�姹�
+        if ( ppcell.UnpackagedInventory() < guard( ppcell.Next().NetDemand(), 0 ) and not isnull( ppls ) and not isnull( ppnc ) ) {
+          // 闇�瑕佸寘瑁呯殑鏁伴噺
+          needPackagingQuantity := abs( ppcell.PackagingInventory() ).Round( 0 );
+          // 鍖呰寮�濮嬬殑绱㈠紩
+          indexPPCell           := ppcell.Previous();
+          
+    //      info( "浜х嚎涓暟锛�", us.Size(), "    寮�濮嬫椂闂达細", ppcell.StartDate().Format( "Y-M2-D2" ), "    鍖呰搴撳瓨鏁伴噺锛�", ppcell.PackagingInventory(), "    闇�瑕佸寘瑁呯殑鏁伴噺锛�", needPackagingQuantity, 
+    //            "    鍖呰lotsize锛�",guard( ppls.LotSize(), 0 ), "    鏈�澶у寘瑁呭閲忥細", ppnc.MaximumDailyPackagingQuantity() );
+          
+          while ( not isnull( indexPPCell )                                                   and 
+                  indexPPCell.StartDate() >= plannedStartDate                                 and 
+                  exists( us, Elements.UnitPeriod.astype( UnitPeriodTime ).ShiftPlan, tempSP, 
+                          tempSP.UnitPeriodTime().StartDate() = indexPPCell.StartDate(),
+                          tempSP.Outcome() <> "" )                                            and
+                  needPackagingQuantity > 0 ) {
+            // 鑳藉寘瑁呯殑鏁伴噺
+            canPackagingQuantity  := ifexpr( ceil( needPackagingQuantity / ppls.LotSize() ) < floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ),
+                                             ceil( needPackagingQuantity / ppls.LotSize() ),
+                                             floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ) ) * ppls.LotSize();
+    //        info( "寮�濮嬪寘瑁呯殑鏃ユ湡锛�", indexPPCell.StartDate().Format( "Y-M2-D2" ), "    鑳藉寘瑁呯殑鏁伴噺:", canPackagingQuantity );
+            
+            indexPPCell.Package( canPackagingQuantity );
+            Transaction::Transaction().Propagate( attribute( PackagingPlanCell, PackagingInventory ) );
+            Transaction::Transaction().Propagate( attribute( PackagingPlanCell, UnpackagedInventory ) );
+            
+            needPackagingQuantity := needPackagingQuantity - canPackagingQuantity;
+            indexPPCell           := indexPPCell.Previous();
+          }
+        }
+      }
+    }
   *]
 }
diff --git a/_Main/Sys/Repr/Global/PackagingPlanCell.qrp b/_Main/Sys/Repr/Global/PackagingPlanCell.qrp
new file mode 100644
index 0000000..876c5e6
--- /dev/null
+++ b/_Main/Sys/Repr/Global/PackagingPlanCell.qrp
@@ -0,0 +1,51 @@
+Quintiq file version 2.0
+#parent: #root
+TypeRepresentation PackagingPlanCell
+{
+  AttributeRepresentation EndingInventory
+  {
+    AttributeKey: '[413988.0.1393320114]'
+    Synonym: 'Inventory end'
+  }
+  AttributeRepresentation NetDemand
+  {
+    AttributeKey: '[413988.0.1393320104]'
+    Synonym: 'Demand'
+  }
+  AttributeRepresentation NewSupply
+  {
+    AttributeKey: '[415754.0.436130245]'
+    Synonym: 'New supply'
+  }
+  AttributeRepresentation Out
+  {
+    AttributeKey: '[413988.0.1393320156]'
+    Synonym: 'Transport-out'
+  }
+  AttributeRepresentation Package
+  {
+    AttributeKey: '[413988.0.1393320188]'
+    Synonym: 'Package'
+  }
+  AttributeRepresentation PackagingInventory
+  {
+    AttributeKey: '[413988.0.1393320143]'
+    Synonym: 'Packaged'
+  }
+  AttributeRepresentation TransferIn
+  {
+    AttributeKey: '[413988.0.1393320166]'
+    Synonym: 'Transport-in'
+  }
+  AttributeRepresentation UnpackagedInventory
+  {
+    AttributeKey: '[413988.0.1393320130]'
+    Synonym: 'Unpackaged'
+  }
+  AttributeRepresentation Unpacking
+  {
+    AttributeKey: '[413988.0.1393320198]'
+    Synonym: 'Unpackage'
+  }
+  RelationRepresentation AsFirst { RelationKey: '[413988.0.1425205682]' Visibility: 'Normal' }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Component_pnlContent.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Component_pnlContent.def
index 0ef7aff..f4af62e 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Component_pnlContent.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Component_pnlContent.def
@@ -25,6 +25,8 @@
       [
         DataBinding: 'DataHolderDialogData.Data.MaximumDailyPackagingQuantity'
         Label: 'Maximum daily packaging quantity'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 2
       ]
     }
@@ -36,6 +38,8 @@
       [
         DataBinding: 'DataHolderDialogData.Data.MaximumDailyUnpackingQuantity'
         Label: 'Maximum daily unpacking quantity'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 3
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlActions_btnOk_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlActions_btnOk_OnClick.def
index e9f8566..2f45da0 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlActions_btnOk_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditPackagingPlanNewCapability/Response_pnlActions_btnOk_OnClick.def
@@ -6,7 +6,9 @@
   DefinitionID: 'Responsedef_WebButton_OnClick'
   Precondition:
   [*
-    return not exists( MacroPlan, PackagingPlanNewCapability, tempPPNC, true, tempPPNC.ProductionLine() = ddslFactory.Text() );
+    return not exists( MacroPlan, PackagingPlanNewCapability, tempPPNC, true, 
+                       tempPPNC.Factory()   = ddslFactory.Text()   and
+                       tempPPNC.ProductID() = ddslProductID.Text() );
   *]
   QuillAction
   {
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanLotSize/Component_pHeader.def b/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanLotSize/Component_pHeader.def
index 023aaa3..7114e81 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanLotSize/Component_pHeader.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanLotSize/Component_pHeader.def
@@ -61,6 +61,8 @@
       Properties:
       [
         Label: 'Lot size'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 2
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pCC.def b/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pCC.def
index 48991c2..2c02b7a 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pCC.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pCC.def
@@ -13,6 +13,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.CC_ZKG'
         Label: 'ZKG(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 0
       ]
     }
@@ -24,6 +26,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.CC_ZKM'
         Label: 'ZKM(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 1
       ]
     }
@@ -35,6 +39,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.CC_PL'
         Label: 'PL(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 2
       ]
     }
@@ -46,6 +52,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.CC_KW'
         Label: 'KW(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 3
       ]
     }
@@ -57,6 +65,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.CC_AGW'
         Label: 'AGW(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 4
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pDL.def b/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pDL.def
index 63a6b81..5b8a7ee 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pDL.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogPackagingPlanMaximumQuantity/Component_pDL.def
@@ -13,6 +13,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.DL_ZKG'
         Label: 'ZKG(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 0
       ]
     }
@@ -24,6 +26,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.DL_ZKM'
         Label: 'ZKM(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 1
       ]
     }
@@ -35,6 +39,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.DL_PL'
         Label: 'PL(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 2
       ]
     }
@@ -46,6 +52,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.DL_KW'
         Label: 'KW(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 3
       ]
     }
@@ -57,6 +65,8 @@
       [
         DataBinding: 'DataHolderDialog.Data.DL_AGW'
         Label: 'AGW(pcs)'
+        Mask: 'NUMBER'
+        Min: '0'
         Taborder: 4
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Component_MatrixEditor912.def b/_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Component_MatrixEditor912.def
index dcc3160..bae3842 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Component_MatrixEditor912.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Component_MatrixEditor912.def
@@ -45,6 +45,8 @@
           Properties:
           [
             DataType: 'MacroPlan'
+            FilterArguments: 'factory:QLibMacroPlannerWebUI::ApplicationMacroPlanner.dhSelectedFactoryMCRR'
+            FixedFilter: 'object.Filter( factory )'
             Source: 'MacroPlan'
             Taborder: 0
             Transformation: 'MachineLogisticsCostReportRow'
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_bRefresh_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_bRefresh_OnClick.def
index c02e5b9..fd71984 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_bRefresh_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_bRefresh_OnClick.def
@@ -13,7 +13,7 @@
   {
     Body:
     [*
-      MachineLogisticsCostReportCell::CreateData( MacroPlan, ddslFactory.Text() );
+      MachineLogisticsCostReportCell::CreateData( MacroPlan );
       
       WebMessageBox::Success( Translations::A_VWED_Success() );
     *]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def
index c33b1c6..6a2a171 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def
@@ -26,7 +26,7 @@
       ]
       Properties:
       [
-        Attributes: 'NetDemand;EndingInventory;UnpackagedInventory;PackagingInventory;Out;TransferIn;Package;Unpacking'
+        Attributes: 'NetDemand;NewSupply;EndingInventory;Out;TransferIn;UnpackagedInventory;PackagingInventory;Package;Unpacking'
         Column: 'PackagingPlanColumn'
         Row: 'PackagingPlanRow'
         Taborder: 0

--
Gitblit v1.9.3