From 1416622ccad797dc3602b6672ca59137bab49c7e Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期四, 31 十月 2024 17:12:30 +0800
Subject: [PATCH] 机加管线报表库存值逻辑修改
---
_Main/BL/Type_MachiningPipelineReport/Method_Generate.qbl | 69 ++++++++++++++++++++++++----------
1 files changed, 49 insertions(+), 20 deletions(-)
diff --git a/_Main/BL/Type_MachiningPipelineReport/Method_Generate.qbl b/_Main/BL/Type_MachiningPipelineReport/Method_Generate.qbl
index ceb56aa..9822d5e 100644
--- a/_Main/BL/Type_MachiningPipelineReport/Method_Generate.qbl
+++ b/_Main/BL/Type_MachiningPipelineReport/Method_Generate.qbl
@@ -8,31 +8,60 @@
TextBody:
[*
// 鐢勫叞楦� Jun-25-2024 (created)
- table := selectobject( this, Source.Report, report, not report.IsShow() );
+ startyearmonth := search.MacroPlan().StartOfPlanning().StartOfMonth().Date();
+ table := selectobject( this, Source.Report, report, not report.IsShow() );
//娓呯┖涔嬪墠瀛樺偍鐨勬樉绀烘暟鎹�
this.Clear( search.TimeUnit(), search.StartDate(), search.EndDate() );
//杩囨护鍚庣殑浜у搧id
- productids := selectuniquevalues( products, Elements, product, true, product.ID() );
- sumrow := this.Row( relnew, Name := 'SUM', RowNr := table.Row( relsize ) );
+ productids := selectuniquevalues( products, Elements, product, true, product.ID() );
+ sumrow := this.Row( relnew, Name := 'SUM', RowNr := table.Row( relsize ) );
traverse( table, Row, row, productids.Find( row.Name() ) >= 0 ){
- showrow := this.Row( relnew, Name := row.Name(), RowNr := row.RowNr() );
-
- traverse( row, Cell, cell, cell.Column().TimeUnit() = search.TimeUnit() ){
- column := selectobject( this, Column, column, column.StartDate() = cell.Column().StartDate() and column.TimeUnit() = search.TimeUnit() );
-
- if( not isnull( column ) ){
- sumcell := selectobject( column, Cell, c, c.Row() = sumrow );
- if( isnull( sumcell ) ){
- sumcell := MachiningPipelineCell::Initialize( column );
- sumrow.Cell( relinsert, sumcell );
- }
-
- showcell := cell.Copy( column );
- showrow.Cell( relinsert, showcell );
-
- sumcell.Add( cell );
-
+ showrow := this.Row( relnew, Name := row.Name(), RowNr := row.RowNr() );
+ traverse( this, Column, column ){
+ daycells := selectset( row, Cell, cell, cell.Column().TimeUnit() = Translations::MP_GlobalParameters_Day() and
+ cell.Column().StartDate() >= column.StartDate() and
+ cell.Column().StartDate() <= column.EndDate() );
+ maxinventory := maxobject( daycells, Elements, e, e.Column().StartDate() );
+ ccassemblyplanqty := sum( daycells, Elements, cell, cell.CCAssemblyPlanQty() );
+ ccproductionqty := sum( daycells, Elements, cell, cell.CCProductionQty() );
+ cctransferqty := sum( daycells, Elements, cell, cell.CCTransferQty() );
+ ccinventoryqty := 0.0;
+ dlassemblyplanqty := sum( daycells, Elements, cell, cell.DLAssemblyPlanQty() );
+ dlproductionqty := sum( daycells, Elements, cell, cell.DLProductionQty() );
+ dltransferqty := sum( daycells, Elements, cell, cell.DLTransferQty() );
+ dlinventoryqty := 0.0;
+ if( column.StartDate() = startyearmonth ){//褰撴棩鏈熸槸璁″垝寮�濮嬬涓�涓湀鏃讹紝璁$畻搴撳瓨鏄疄闄呭簱瀛�
+ ccinventoryqty := row.CCInventoryQty() + maxinventory.CCProductionQty() - maxinventory.CCToDLDepartureQty() + maxinventory.DLToCCArrivalQty() - maxinventory.CCAssemblyPlanQty();
+ dlinventoryqty := row.DLInventoryQty() + maxinventory.DLProductionQty() - maxinventory.DLToCCDepartureQty() + maxinventory.CCToDLArrivalQty() - maxinventory.DLAssemblyPlanQty();
+ }else{
+ beforecolumn := column.PreviousColumn();
+ beforeinventory := selectobject( showrow, Cell, c, c.Column() = beforecolumn );
+ ccinventoryqty := beforeinventory.CCInventoryQty() + maxinventory.CCProductionQty() - maxinventory.CCToDLDepartureQty() + maxinventory.DLToCCArrivalQty() - maxinventory.CCAssemblyPlanQty();
+ ccinventoryqty := beforeinventory.DLInventoryQty() + maxinventory.DLProductionQty() - maxinventory.DLToCCDepartureQty() + maxinventory.DLToCCDepartureQty() - maxinventory.DLAssemblyPlanQty();
}
+ sumcell := selectobject( column, Cell, c, c.Row() = sumrow );
+ if( isnull( sumcell ) ){
+ sumcell := column.Cell( relnew, CCAssemblyPlanQty := 0,
+ CCProductionQty := 0,
+ CCTransferQty := 0,
+ CCInventoryQty := 0,
+ DLAssemblyPlanQty := 0,
+ DLProductionQty := 0,
+ DLTransferQty := 0,
+ DLInventoryQty := 0 );
+ sumrow.Cell( relinsert, sumcell );
+ }
+ showcell := column.Cell( relnew, CCAssemblyPlanQty := ccassemblyplanqty,
+ CCProductionQty := ccproductionqty,
+ CCTransferQty := cctransferqty,
+ CCInventoryQty := ccinventoryqty,
+ DLAssemblyPlanQty := dlassemblyplanqty,
+ DLProductionQty := dlproductionqty,
+ DLTransferQty := dltransferqty,
+ DLInventoryQty := dlinventoryqty );
+ showrow.Cell( relinsert, showcell );
+
+ sumcell.Add( showcell );
}
}
*]
--
Gitblit v1.9.3