1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
| Quintiq file version 2.0
| #parent: #root
| Method Generate (
| MachiningPipelineSearch search,
| Product_MPs products
| )
| {
| TextBody:
| [*
| // 甄兰鸽 Jun-25-2024 (created)
| //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 ) );
| traverse( table, Row, row, productids.Find( row.Name() ) >= 0 ){
| 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() );
| dlassemblyplanqty := sum( daycells, Elements, cell, cell.DLAssemblyPlanQty() );
| dlproductionqty := sum( daycells, Elements, cell, cell.DLProductionQty() );
| dltransferqty := sum( daycells, Elements, cell, cell.DLTransferQty() );
| 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 := maxinventory.CCInventoryQty(),
| DLAssemblyPlanQty := dlassemblyplanqty,
| DLProductionQty := dlproductionqty,
| DLTransferQty := dltransferqty,
| DLInventoryQty := maxinventory.DLInventoryQty() );
| showrow.Cell( relinsert, showcell );
|
| sumcell.Add( showcell );
| }
| }
| rows := selectsortedset( this, Row, row, row.Name(), row.RowNr() );
| i := 0;
| traverse( rows, Elements, e ){
| e.RowNr( i );
| i := i + 1;
| }
| *]
| }
|
|