lihongji
2024-09-18 3ef592a0cd20ce531526b3ecbe73c3e0f31838b0
Merge remote-tracking branch 'origin/dev' into dev
已修改10个文件
已添加2个文件
177 ■■■■ 文件已修改
_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionColumn/Attribute_IsDay.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionReport/Method_Generate.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionReport/Method_GenerateColumn.qbl 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesColumn/Attribute_IsDay.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesReport/Method_GenerateColumn.qbl 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_MatrixEditorTable.def 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_MatrixEditorTable#623.def 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl
@@ -29,18 +29,21 @@
    //外租库入库费用:取自财务产量报表的产量,在产品表根据发动机号找到对应的Generation å’Œæ¨ªçºµåˆ¶ï¼Œåœ¨å‘动机成本参数表里找到对应的包装容量和入库单价,用公式计算,月度进行汇总
    traverse( owner, FinancialProductionSource, source, not source.IsImport() ){//财务产量报表非导入
      traverse( source, FinancialProductionReport, report, not report.IsShow() ){//财务产量报表不显示
        traverse( report, FinancialProductionRow, row, row.Unit() = ccunit and exists( row, FinancialProductionCell, cell, cell.Value() <> '0' ) ){//财务产量报表里的长春产量, ä¸ä¸º0
        traverse( report, FinancialProductionRow, row, row.Unit() = ccunit and exists( row, FinancialProductionCell, cell, cell.Value() <> '0' and cell.FinancialProductionColumn().IsDay() ) ){//财务产量报表里的长春产量, ä¸ä¸º0
          product             := row.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            //查询对应的发动机成本
            enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
            enginecosts       := selectset( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit );
            if( not isnull( enginecost ) ){
            if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){
              ccrow               := table.GetRow( row.Name() );
              products.Add( product );
              traverse( row, FinancialProductionCell, cell, cell.Value() <> '0' ){
              traverse( row, FinancialProductionCell, cell, cell.Value() <> '0' and cell.FinancialProductionColumn().IsDay() ){
                cellcolumn    := cell.FinancialProductionColumn();
                enginecost    := selectobject( enginecosts, Elements, engine, engine.StartDate() <= cellcolumn.Period() and engine.EndDate() >= cellcolumn.Period() );
                if( not isnull( enginecost ) ){
                //入库量/包装容量*入库单价,入库量等于长春产量
                quantity          := ceil( [Number]cell.Value() / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
                column            := selectobject( table, Column, column, column.Name() = cell.FinancialProductionColumn().Name() );
@@ -52,26 +55,31 @@
        }
      }
    }
    }
    //外租库出库费用:出库量等于长春销量,取自财务销量报表的销量,在产品表根据发动机号找到对应的Generation å’Œæ¨ªçºµåˆ¶ï¼Œåœ¨å‘动机成本参数表里找到对应的包装容量和出库单价,用公式计算,月度进行汇总
    traverse( owner, FinancialSalesSource, source, not source.IsImport() ){//财务销量报表非导入
      traverse( source, FinancialSalesReport, report, not report.IsShow() ){//财务销量报表不显示
        traverse( report, FinancialSalesRow, row, row.Unit() = ccunit and exists( row, FinancialSalesCell, cell, cell.Value() <> '0' ) ){//财务销量报表里的长春产量, ä¸ä¸º0
        traverse( report, FinancialSalesRow, row, row.Unit() = ccunit and exists( row, FinancialSalesCell, cell, cell.Value() <> '0' and cell.FinancialSalesColumn().IsDay() ) ){//财务销量报表里的长春产量, ä¸ä¸º0
          product             := row.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            //查询对应的发动机成本
            enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
            enginecosts       := selectset( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit );
            if( not isnull( enginecost ) ){
            if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){
              ccrow               := table.GetRow( row.Name() );
              products.Add( product );
              traverse( row, FinancialSalesCell, cell, cell.Value() <> '0' ){
              traverse( row, FinancialSalesCell, cell, cell.Value() <> '0' and cell.FinancialSalesColumn().IsDay() ){
                cellcolumn    := cell.FinancialSalesColumn();
                enginecost    := selectobject( enginecosts, Elements, engine, engine.StartDate() <= cellcolumn.Period() and engine.EndDate() >= cellcolumn.Period() );
                if( not isnull( enginecost ) ){
                //出库量/包装容量*出库单价,入库量等于长春销量
                quantity          := ceil( [Number]cell.Value() / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
                column            := selectobject( table, Column, column, column.Name() = cell.FinancialSalesColumn().Name() );
                //外租库出库费用
                ccrow.SetRentOutCost( column, quantity );
                }
              }
            }
          }
@@ -92,16 +100,19 @@
          periodname         := periodtime.Format( "M2/D2/Y" );
          
          column             := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
          enginecosts        := selectset( owner, LogisticsCostEngine, engine, engine.StartDate() <= trip.Arrival().Date() and engine.EndDate() >= trip.Arrival().Date() );
          transcosts         := selectset( owner, LogisticsCostTransport, trans, trans.StartDate() <= trip.Arrival().Date() and trans.EndDate() >= trip.Arrival().Date() );
          if( not isnull( enginecosts ) and enginecosts.Size() > 0 and not isnull( transcosts ) and transcosts.Size() > 0 ){
          traverse( trip, ProductInTrip, pit, pit.Quantity() <> 0 ){
            product          := pit.Product_MP();
            productparents   := product.GetAllParent();
            if( exists( productparents, Elements, e, e.ID() = produtparent ) ){////查询产品类型是发动机
              //在发动机成本参数表找到对应的包装容量
              enginecost       := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                enginecost     := selectobject( enginecosts, Elements, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit );
              //在运输成本参数表里找到发动机对应运输单价和装载容量
              transcost        := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = ccline
                transcost      := selectobject( transcosts, Elements, trans, trans.Origin() = ccline
                                                and trans.Destination() = ccrent 
                                                and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( '发动机', 0 ) >= 0, e.ID() = produtparent,  e.ID() = trans.Product() ) ) );
              if( not isnull( enginecost ) and not isnull( transcost ) ){
@@ -111,6 +122,7 @@
                quantity       := ceil( ceil( [Number]pit.Quantity() / enginecost.PackagingCapacity() ) / transcost.LoadingCapacity() ) * transcost.TransportPrice();//四舍五入
                
                row.SetFactoryToRentTransCost( column, quantity );
                }
              }
            }
          }
@@ -129,14 +141,16 @@
          productparents     := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){////查询产品类型是发动机
            //查询对应的发动机成本
            enginecost         := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
            enginecosts        := selectset( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit );
            if( not isnull( enginecost ) ){
            if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){
              row                := table.GetRow( pisp.ProductID() );
              products.Add( product );
              //当product planning的日期区间在需要的日期区间内 
              traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.NewSupplyQuantity() <> 0 ){
                enginecost     := selectobject( enginecosts, Elements, engine, engine.StartDate() <= pispip.Start().Date() and engine.EndDate() >= pispip.Start().Date() );
                if( not isnull( enginecost ) ){
                periodtime := pispip.Start().StartOfMonth().Date();
                periodname := periodtime.Format( "M2/D2/Y" );
                quantity   := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
@@ -150,6 +164,7 @@
        }
      }
    }
    }
    rows := selectsortedset( table, Row, row, row.Name() );
    i    := 0;
    traverse( rows, Elements, e ){
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl
@@ -46,6 +46,9 @@
          periodname         := periodtime.Format( "M2/D2/Y" );
          
          column             := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
          enginecosts        := selectset( owner, LogisticsCostEngine, engine, engine.StartDate() <= trip.Departure().Date() and engine.EndDate() >= trip.Departure().Date() );
          transcosts         := selectset( owner, LogisticsCostTransport, trans, trans.StartDate() <= trip.Departure().Date() and trans.EndDate() >= trip.Departure().Date() );
          if( not isnull( enginecosts ) and enginecosts.Size() > 0 and not isnull( transcosts ) and transcosts.Size() > 0 ){
          traverse( trip, ProductInTrip, pit, pit.Quantity() <> 0 and not isnull( column ) and exists( pit.Product_MP().GetAllParent(), Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            quantity         := [Number]pit.Quantity();
            row              := table.GetRow( pit.ProductID() );
@@ -53,7 +56,7 @@
            productparents   := product.GetAllParent();
            if( isccrent ){//目的地是长春外租库
              //在发动机成本参数表找到对应的包装容量
              enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                enginecost   := selectobject( enginecosts, Elements, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit );
              if( not isnull( enginecost ) ){
@@ -70,11 +73,11 @@
            }
            if( isdlrent ){//目的地是大连外租库
              //在发动机成本参数表找到对应的包装容量
              enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                enginecost   := selectobject( enginecosts, Elements, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = dlunit  );
              //在运输成本参数表里找到发动机对应运输单价和装载容量
              transcost      := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = laneleg.OriginStockingPointID()
                transcost    := selectobject( transcosts, Elements, trans, trans.Origin() = laneleg.OriginStockingPointID()
                                                and trans.Destination() = laneleg.DestinationStockingPointID() 
                                                and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( '发动机', 0 ) >= 0, e.ID() = produtparent,  e.ID() = trans.Product() ) ) );
              if( not isnull( enginecost ) and not isnull( transcost ) ){
@@ -89,21 +92,25 @@
        }
      }
    }
    }
    //大连外租库入库费用:入库量/包装容量*入库单价,入库量等于大连工厂该产品产量减去发往长春的数量
    traverse( owner, FinancialProductionSource, source, not source.IsImport() ){//财务产量报表非导入
      traverse( source, FinancialProductionReport, report, not report.IsShow() ){//财务产量报表不显示
        traverse( report, FinancialProductionRow, row, row.Unit() = dlunit and exists( row, FinancialProductionCell, cell, cell.Value() <> '0' ) ){//财务产量报表里的大连产量, ä¸ä¸º0
        traverse( report, FinancialProductionRow, row, row.Unit() = dlunit and exists( row, FinancialProductionCell, cell, cell.Value() <> '0' and cell.FinancialProductionColumn().IsDay() ) ){//财务产量报表里的大连产量, ä¸ä¸º0
          product             := row.Product_MP();
          products.Add( product );
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            //查询对应的发动机成本
            enginecost        := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
            enginecosts      := selectset( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = dlunit );
            if( not isnull( enginecost ) ){
            if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){
              products.Add( product );
              ccrow               := table.GetRow( row.Name() );
              traverse( row, FinancialProductionCell, cell, cell.Value() <> '0' ){
              traverse( row, FinancialProductionCell, cell, cell.Value() <> '0' and cell.FinancialProductionColumn().IsDay() ){
                cellcolumn   := cell.FinancialProductionColumn();
                enginecost   := selectobject( enginecosts, Elements, engine, engine.StartDate() <= cellcolumn.Period() and engine.EndDate() >= cellcolumn.Period() );
                if( not isnull( enginecost ) ){
                column        := selectobject( table, Column, column, column.Name() = cell.FinancialProductionColumn().Name() );
                //大连外租库入库费用
                ccrow.SetDLRentEnterCost( column, enginecost, cell );
@@ -113,24 +120,29 @@
        }
      }
    }
    }
    //大连外租库出库费用:出库量/包装容量*出库单价,出库量等于大连工厂该产品销量减去发往长春的数量
    traverse( owner, FinancialSalesSource, source, not source.IsImport() ){//财务销量报表非导入
      traverse( source, FinancialSalesReport, report, not report.IsShow() ){//财务销量报表不显示
        traverse( report, FinancialSalesRow, row, row.Unit() = ccunit and exists( row, FinancialSalesCell, cell, cell.Value() <> '0' ) ){//财务销量报表里的大连产量, ä¸ä¸º0
        traverse( report, FinancialSalesRow, row, row.Unit() = ccunit and exists( row, FinancialSalesCell, cell, cell.Value() <> '0' and cell.FinancialSalesColumn().IsDay() ) ){//财务销量报表里的大连产量, ä¸ä¸º0
          product             := row.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            products.Add( product );
            //查询对应的发动机成本
            enginecost        := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
            enginecosts      := selectset( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = dlunit );
            if( not isnull( enginecost ) ){
            if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){
              products.Add( product );
              ccrow               := table.GetRow( row.Name() );
              traverse( row, FinancialSalesCell, cell, cell.Value() <> '0' ){
              traverse( row, FinancialSalesCell, cell, cell.Value() <> '0' and cell.FinancialSalesColumn().IsDay() ){
                cellcolumn   := cell.FinancialSalesColumn();
                enginecost   := selectobject( enginecosts, Elements, engine, engine.StartDate() <= cellcolumn.Period() and engine.EndDate() >= cellcolumn.Period() );
                if(  not isnull( enginecost ) ){
                column        := selectobject( table, Column, column, column.Name() = cell.FinancialSalesColumn().Name() );
                //大连外租库出库费用
                ccrow.SetDLRentOutCost( column, enginecost, cell );
                }
              }
            }
          }
@@ -150,24 +162,29 @@
        iscc                   := table.IsInUnit( destisp, ccunit );
        if( isdl and iscc ){
          //查询对应的发动机成本
          enginecost           := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
          enginecosts          := selectset( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit );
          //在运输成本参数表里找到发动机对应运输单价和装载容量
          transcost            := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = tprow.SourceStockpoingPointID()
          transcosts           := selectset( owner, LogisticsCostTransport, trans, trans.Origin() = tprow.SourceStockpoingPointID()
                                                  and trans.Destination() = tprow.TargetStockpoingPointID() 
                                                  and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( '发动机', 0 ) >= 0, e.ID() = produtparent,  e.ID() = trans.Product() ) ) );
          if( not isnull( enginecost ) and not isnull( transcost ) ){
          if( not isnull( enginecosts ) and enginecosts.Size() > 0 and not isnull( transcosts ) and transcosts.Size() > 0 ){
            row                := table.GetRow( product.ID() );
            products.Add( product );
            traverse( tprow,TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() <> Date::MinDate() and [Number]tpcell.Value() > 0){
              periodtime       := tpcell.TransferPlanColumn().ColumnDate().StartOfMonth();
              tpcolumndate     := tpcell.TransferPlanColumn().ColumnDate();
              enginecost       := selectobject( enginecosts, Elements, engine, engine.StartDate() <= tpcolumndate and engine.EndDate() >= tpcolumndate );
              transcost        := selectobject( transcosts, Elements, trans, trans.StartDate() <= tpcolumndate and trans.EndDate() >= tpcolumndate );
              if( not isnull( enginecost ) and not isnull( transcost ) ){
                periodtime     := tpcolumndate.StartOfMonth();
              periodname       := periodtime.Format( "M2/D2/Y" );
              column           := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
               
              cost             := ceil( ceil( [Number]tpcell.Value() / enginecost.PackagingCapacity() ) / transcost.LoadingCapacity() ) * transcost.TransportPrice();
              cell             := selectobject( row, Cell, cell, cell.Column() = column );
              cell.CCLongTransCoat( cell.CCLongTransCoat() + cost );
              }
            }
          }
        }
@@ -183,15 +200,16 @@
        product               := forecast.Product_MP();
        productparents        := product.GetAllParent();
        if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
          products.Add( forecast.Product_MP() );
          //查询对应的发动机成本
          enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
          enginecosts         := selectset( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit );
          if( not isnull( enginecost ) ){
          if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){
            products.Add( forecast.Product_MP() );
            row                 := table.GetRow( forecast.ProductID() );
            traverse( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() > 0 ){
              enginecost      := selectobject( enginecosts, Elements, engine, engine.StartDate() <= psdip.StartDate() and engine.EndDate() >= psdip.StartDate() );
              if( not isnull( enginecost ) ){
              periodtime       := psdip.StartDate().StartOfMonth();
              periodname       := periodtime.Format( "M2/D2/Y" );
        //      info( '-------------------------', periodname, periodtime );
@@ -200,6 +218,7 @@
              cost             := ceil( [Number]psdip.Quantity() / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
              cell             := selectobject( row, Cell, cell, cell.Column() = column );
              cell.CCShortTransCost( cell.CCShortTransCost() + cost );
              }
            }
          }
        }
@@ -221,6 +240,8 @@
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            row               := table.GetRow( pisp.ProductID() );
            enginecosts       := selectset( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower() and engine.MLB_MQB() = product.MQBMLB() );
            if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){
            products.Add( pisp.Product_MP() );
            traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.NewSupplyQuantity() <> 0  ){
              periodtime      := pispip.Start().StartOfMonth().Date();
@@ -230,8 +251,7 @@
              
              if( isccrent ){
                //在发动机成本参数表找到对应的包装容量
                enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                   and engine.MLB_MQB() = product.MQBMLB()
                  enginecost     := selectobject( enginecosts, Elements, engine, engine.StartDate() <= pispip.Start().Date() and engine.EndDate() >= pispip.Start().Date()
                                                   and engine.Factory() = ccunit );
                 if( not isnull( enginecost ) ){
                   cost        := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
@@ -239,8 +259,7 @@
                 }
              } else {
                //在发动机成本参数表找到对应的包装容量
                enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                   and engine.MLB_MQB() = product.MQBMLB()
                  enginecost     := selectobject( enginecosts, Elements, engine, engine.StartDate() <= pispip.Start().Date() and engine.EndDate() >= pispip.Start().Date()
                                                   and engine.Factory() = dlunit  );
                 if( not isnull( enginecost ) ){
                   cost        := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
@@ -252,6 +271,7 @@
        }
      }
    }
    }
    rows := selectsortedset( table, Row, row, row.Name() );
    i    := 0;
    traverse( rows, Elements, e ){
_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl
@@ -31,7 +31,7 @@
                      or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
      feedback := Translations::MP_ChangeLossSetting_Exist()
    }
    if( exists( owner, ChangeLossSetting, cls, cls <> old and not ( cls.StartDate() > enddate or cls.EndDate() < startdate ) ) ){
    if( feedback = '' and exists( owner, ChangeLossSetting, cls, cls <> old and not ( cls.StartDate() > enddate or cls.EndDate() < startdate ) ) ){
      feedback := Translations::MP_ChangeLossSetting_DateCoincide()
    }
    
_Main/BL/Type_FinancialProductionColumn/Attribute_IsDay.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute IsDay
{
  #keys: '3[415136.0.1144791862][415136.0.1144791861][415136.0.1144791863]'
  ValueType: Boolean
}
_Main/BL/Type_FinancialProductionReport/Method_Generate.qbl
@@ -24,7 +24,7 @@
      if( productids.ContainsAll( productid ) ){
        showrow := this.FinancialProductionRow( relnew, Name := row.Name(), Unit := row.Unit(), RowNr := row.RowNr() );
        
        traverse( row, FinancialProductionCell, cell ){
        traverse( row, FinancialProductionCell, cell, not cell.FinancialProductionColumn().IsDay() ){
          column   := selectobject( this, FinancialProductionColumn, column, column.Name() = cell.FinancialProductionColumn().Name() );
          
          sumcell  := selectobject( column, FinancialProductionCell, c, c.FinancialProductionRow() = sumrow );
_Main/BL/Type_FinancialProductionReport/Method_GenerateColumn.qbl
@@ -11,10 +11,18 @@
    startofyear               := startofplanning.StartOfYear();
    startofnextyear           := startofplanning.StartOfNextYear();
    
    for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){
    //for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){
    //  periodtime := start.Date();
    //  periodname := periodtime.Format( "M2/D2/Y" );
    //  this.FinancialProductionColumn( relnew, Name := periodname, Period := periodtime );
    //}
    for( start := startofyear; start < startofnextyear; start := start + Duration::Days( 1 ) ){
      periodtime := start.Date();
      periodname := periodtime.Format( "M2/D2/Y" );
      this.FinancialProductionColumn( relnew, Name := periodname, Period := periodtime, IsDay := true );
      if( start = start.StartOfMonth() ){
      this.FinancialProductionColumn( relnew, Name := periodname, Period := periodtime );
    }
    }
  *]
}
_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl
@@ -52,12 +52,14 @@
          products.Add( pisp.Product_MP() );
          //当product planning的日期区间在需要的日期区间内 
          traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.NewSupplyQuantity() <> 0 ){
            dayperiodtime     := pispip.Start().Date();
            dayperiodname     := dayperiodtime.Format( "M2/D2/Y" );
            periodtime := pispip.Start().StartOfMonth().Date();
            periodname := periodtime.Format( "M2/D2/Y" );
            quantity   := [Number]pispip.NewSupplyQuantity();//四舍五入
            column := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime );
            daycolumn         := selectobject( table, FinancialProductionColumn, column, column.Name() = dayperiodname and column.Period() = dayperiodtime and column.IsDay() );
            column            := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime and not column.IsDay() );
            factoryrow.Initialize( daycolumn, quantity );
            factoryrow.Initialize( column, quantity );
            allrow.Initialize( column, quantity );
          }    
_Main/BL/Type_FinancialSalesColumn/Attribute_IsDay.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute IsDay
{
  #keys: '3[415136.0.1144791876][415136.0.1144791875][415136.0.1144791877]'
  ValueType: Boolean
}
_Main/BL/Type_FinancialSalesReport/Method_GenerateColumn.qbl
@@ -11,10 +11,18 @@
    startofyear               := startofplanning.StartOfYear();
    startofnextyear           := startofplanning.StartOfNextYear();
    
    for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){
    //for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){
    //  periodtime := start.Date();
    //  periodname := periodtime.Format( "M2/D2/Y" );
    //  this.FinancialSalesColumn( relnew, Name := periodname, Period := periodtime );
    //}
    for( start := startofyear; start < startofnextyear; start := start + Duration::Days( 1 ) ){
      periodtime := start.Date();
      periodname := periodtime.Format( "M2/D2/Y" );
      this.FinancialSalesColumn( relnew, Name := periodname, Period := periodtime, IsDay := true );
      if( start = start.StartOfMonth() ){
      this.FinancialSalesColumn( relnew, Name := periodname, Period := periodtime );
    }
    }
  *]
}
_Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl
@@ -53,14 +53,18 @@
      
        products.Add( product );
        traverse( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() <> 0 ){
          dayperiodtime      := psdip.StartDate();
          dayperiodname      := dayperiodtime.Format( "M2/D2/Y" );
          periodtime         := psdip.StartDate().StartOfMonth();
          periodname         := periodtime.Format( "M2/D2/Y" );
    //      info( '-------------------------', periodname, periodtime );
          column             := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
          daycolumn          := selectobject( table, FinancialSalesColumn, column, column.Name() = dayperiodname and column.Period() = dayperiodtime and column.IsDay() );
          column             := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime and not column.IsDay() );
    //      info( '-------------------------', column.Name() );
          quantity   := [Number]psdip.Quantity();//四舍五入
          
          factoryrow.Initialize( column, quantity );
          factoryrow.Initialize( daycolumn, quantity );
          allrow.Initialize( column, quantity );
        }
      }
@@ -79,12 +83,16 @@
          ccrow             := table.GetRow( ccunit, product );
          products.Add( product );
          traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.DependentDemandAndSalesDemandQuantity() <> 0 ){
            dayperiodtime   := pispip.Start().Date();
            dayperiodname   := dayperiodtime.Format( "M2/D2/Y" );
            periodtime      := pispip.Start().StartOfMonth().Date();
            periodname      := periodtime.Format( "M2/D2/Y" );
            column          := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
            daycolumn       := selectobject( table, FinancialSalesColumn, column, column.Name() = dayperiodname and column.Period() = dayperiodtime and column.IsDay() );
            column          := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime and not column.IsDay() );
            quantity        := [Number]pispip.DependentDemandAndSalesDemandQuantity();//四舍五入
            
            ccrow.Initialize( column, quantity );//取Total Demand字段按月汇总需求数量
            ccrow.Initialize( daycolumn, quantity );
            allrow.Initialize( column, quantity );
          }
        }
@@ -102,10 +110,13 @@
      if( isdlspline and isccrent ){
        traverse( laneleg, Trip, trip, trip.Arrival() < startofnextyearlead and exists( trip, ProductInTrip, pit, pit.Quantity() <> 0 ) ){
    //      periodtime        := ( trip.Arrival() - FinancialSalesReport::GetDefaultTripLeadingTime() ).StartOfMonth().Date();
          dayperiodtime     := trip.Departure().Date();
          dayperiodname     := dayperiodtime.Format( "M2/D2/Y" );
          periodtime        := trip.Departure().StartOfMonth().Date();
          periodname        := periodtime.Format( "M2/D2/Y" );
          
          column            := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
          daycolumn         := selectobject( table, FinancialSalesColumn, column, column.Name() = dayperiodname and column.Period() = dayperiodtime and column.IsDay() );
          column            := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime and not column.IsDay() );
          if( not isnull( column ) ){
            traverse( trip, ProductInTrip, pit, pit.Quantity() <> 0 ){
              product       := pit.Product_MP();
@@ -113,6 +124,7 @@
              quantity      := [Number]pit.Quantity();//四舍五入
              dlrow         := table.GetRow( dlunit, pit.Product_MP() );
              dlrow.Initialize( column, quantity );//汇总数量
              dlrow.Initialize( daycolumn, quantity );
              
              allrow        := table.GetRow( allunit, pit.Product_MP() );
              allrow.Initialize( column, quantity );
_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_MatrixEditorTable.def
@@ -18,6 +18,7 @@
          Properties:
          [
            DataType: 'FinancialProductionReport'
            FixedFilter: 'not object.FinancialProductionColumn().IsDay()'
            Source: 'DataHolderTable'
            Taborder: 0
            Transformation: 'FinancialProductionColumn.FinancialProductionCell'
@@ -71,6 +72,7 @@
          Properties:
          [
            DataType: 'FinancialProductionReport'
            FixedFilter: 'not object.IsDay()'
            Source: 'DataHolderTable'
            Taborder: 0
            Transformation: 'FinancialProductionColumn'
_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_MatrixEditorTable#623.def
@@ -18,6 +18,7 @@
          Properties:
          [
            DataType: 'FinancialSalesReport'
            FixedFilter: 'not object.FinancialSalesColumn().IsDay()'
            Source: 'DataHolderTable'
            Taborder: 0
            Transformation: 'FinancialSalesColumn.FinancialSalesCell'
@@ -71,6 +72,7 @@
          Properties:
          [
            DataType: 'FinancialSalesReport'
            FixedFilter: 'not object.IsDay()'
            Source: 'DataHolderTable'
            Taborder: 0
            Transformation: 'FinancialSalesColumn'