Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev
| | |
| | | // 甄兰鸽 Jun-25-2024 (created) |
| | | this.Column( relflush ); |
| | | this.Row( relflush ); |
| | | this.Column( relnew, Name := '', TimeUnit := timeunit ); |
| | | this.Column( relnew, Name := '', TimeUnit := timeunit ); |
| | | //this.Column( relnew, Name := '', TimeUnit := timeunit ); |
| | | //this.Column( relnew, Name := '', TimeUnit := timeunit ); |
| | | this.GenerateColumn( this.Source().MacroPlan(), timeunit, startdate, enddate ); |
| | | *] |
| | | } |
| | |
| | | [* |
| | | // 甄兰鸽 Jul-11-2024 (created) |
| | | row := table.Row( relnew, Name := name, RowNr := rownr, Product := product, Demand := demand ); |
| | | traverse( table, Column, column ){ |
| | | cell := column.CellValue( relnew, Value := '0' ); |
| | | row.CellValue( relinsert, cell ); |
| | | } |
| | | //traverse( table, Column, column ){ |
| | | // cell := column.CellValue( relnew, Value := '0' ); |
| | | // row.CellValue( relinsert, cell ); |
| | | //} |
| | | return row; |
| | | *] |
| | | } |
| | |
| | | searchcolumnelement.AppendChild( searchmlbmqlcellElement ); |
| | | } |
| | | |
| | | for( i := searchtotal; i < table.FinancialProductionRow( relsize ); i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement ); |
| | | } |
| | | |
| | | minindex := min( table, FinancialProductionColumn, column, not column.IsDay(), column.Index() ); |
| | | traverse ( table, FinancialProductionColumn, column, not column.IsDay() ) { |
| | | columnelement := xmlDOM.CreateElement( "column" ); |
| | |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", row.Unit() ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | if( cells.Size() > searchtotal ){ |
| | | for( i := searchtotal; i < cells.Size(); i := i + 1 ){ |
| | | searchcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement1.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement1 ); |
| | | } |
| | | } |
| | | } |
| | | cellElement := xmlDOM.CreateElement( "cell" ); |
| | | cellElement.SetAttribute( "value", c.Value() ); |
| | | columnelement.AppendChild( cellElement ); |
| | | } |
| | | if( cells.Size() < searchtotal ){ |
| | | for( i := cells.Size(); i < searchtotal; i := i + 1 ){ |
| | | searchcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement1.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement1 ); |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | columnelement.AppendChild( searchcellElement ); |
| | | |
| | | if( column.Index() = minindex ){ |
| | | productcellElement := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement.SetAttribute( "value", '' ); |
| | | productcolumnelement.AppendChild( productcellElement ); |
| | | //Unit |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", '' ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | } |
| | | } |
| | | tableElement.AppendChild( columnelement ); |
| | | } |
| | | |
| | | xmlString := xmlDOMI.CreateSerializer().WriteToString( xmlDOM ) |
| | | |
| | | //info( xmlString ); |
| | | |
| | | tableGroupHandle := TableGroupHandle::Create( FinancialProductionReport::GetDefaultName() ); |
| | | tableHandle := TableHandle::ImportXML( BinaryValue::Construct( xmlString ) ); |
| | |
| | | searchmlbmqlcellElement.SetAttribute( "value", mlbmql.MLBMQB() ); |
| | | searchcolumnelement.AppendChild( searchmlbmqlcellElement ); |
| | | } |
| | | |
| | | for( i := searchtotal; i < table.FinancialSalesRow( relsize ); i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement ); |
| | | } |
| | | |
| | | minindex := min( table, FinancialSalesColumn, column, not column.IsDay(), column.Index() ); |
| | | traverse ( table, FinancialSalesColumn, column, not column.IsDay() ) { |
| | | columnelement := xmlDOM.CreateElement( "column" ); |
| | |
| | | cellElement.SetAttribute( "value", c.Value() ); |
| | | columnelement.AppendChild( cellElement ); |
| | | } |
| | | if( cells.Size() < searchtotal ){ |
| | | for( i := cells.Size(); i < searchtotal; i := i + 1 ){ |
| | | searchcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement1.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement1 ); |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | columnelement.AppendChild( searchcellElement ); |
| | | |
| | | if( column.Index() = minindex ){ |
| | | productcellElement := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement.SetAttribute( "value", '' ); |
| | | productcolumnelement.AppendChild( productcellElement ); |
| | | //Unit |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", '' ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | } |
| | | } |
| | | tableElement.AppendChild( columnelement ); |
| | | } |
| | | |
| | | xmlString := xmlDOMI.CreateSerializer().WriteToString( xmlDOM ); |
| | | |
| | | //info( xmlString ); |
| | | |
| | | tableGroupHandle := TableGroupHandle::Create( FinancialSalesReport::GetDefaultName() ); |
| | | tableHandle := TableHandle::ImportXML( BinaryValue::Construct( xmlString ) ); |
| | |
| | | searchenddatecellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchenddatecellElement.SetAttribute( "value", search.EndDate().Format( 'M2/D2/Y' ) ); |
| | | searchcolumnelement.AppendChild( searchenddatecellElement ); |
| | | searchcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement1.SetAttribute( "value", 'Periods' ); |
| | | searchcolumnelement.AppendChild( searchcellElement1 ); |
| | | searchcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement1.SetAttribute( "value", search.Category() ); |
| | | searchcolumnelement.AppendChild( searchcellElement1 ); |
| | | searchperiodElement := xmlDOM.CreateElement( "cell" ); |
| | | searchperiodElement.SetAttribute( "value", 'Periods' ); |
| | | searchcolumnelement.AppendChild( searchperiodElement ); |
| | | searchperiodcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchperiodcellElement.SetAttribute( "value", search.Category() ); |
| | | searchcolumnelement.AppendChild( searchperiodcellElement ); |
| | | |
| | | for( i := searchtotal; i < table.InventroySummaryRow( relsize ) * 4; i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement ); |
| | | } |
| | | |
| | | traverse ( table, InventorySummaryColumn, column ) { |
| | | columnelement := xmlDOM.CreateElement( "column" ); |
| | | nameelement := xmlDOM.CreateElement( "name" ); |
| | |
| | | avecellElement.SetAttribute( "value", '平均库存' );//AverageInventory |
| | | attricolumnelement.AppendChild( avecellElement ); |
| | | |
| | | if( cells.Size() > searchtotal ){ |
| | | for( i := searchtotal; i < cells.Size(); i := i + 1 ){ |
| | | searchcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement1.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement1 ); |
| | | } |
| | | } |
| | | } |
| | | //期末库存 |
| | | endcellElement := xmlDOM.CreateElement( "cell" ); |
| | |
| | | avecellElement.SetAttribute( "value", [String]c.AverageInventory() ); |
| | | columnelement.AppendChild( avecellElement ); |
| | | } |
| | | if( cells.Size() < searchtotal ){ |
| | | for( i := cells.Size(); i < searchtotal; i := i + 1 ){ |
| | | searchcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement1.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement1 ); |
| | | for( i := cells.Size() * 4; i < searchtotal; i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | columnelement.AppendChild( searchcellElement ); |
| | | if( column.Index() = 0 ){ |
| | | productcellElement := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement.SetAttribute( "value", '' ); |
| | | productcolumnelement.AppendChild( productcellElement ); |
| | | |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", '' ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | |
| | | endcellElement := xmlDOM.CreateElement( "cell" ); |
| | | endcellElement.SetAttribute( "value", '' );//EndingInventory |
| | | attricolumnelement.AppendChild( endcellElement ); |
| | | |
| | | } |
| | | } |
| | | tableElement.AppendChild( columnelement ); |
| | | } |
| | | |
| | | xmlString := xmlDOMI.CreateSerializer().WriteToString( xmlDOM ); |
| | | |
| | | //info( xmlString ); |
| | | |
| | | tableGroupHandle := TableGroupHandle::Create( InventorySummaryReport::GetDefaultName() ); |
| | | tableHandle := TableHandle::ImportXML( BinaryValue::Construct( xmlString ) ); |
| | |
| | | // 运输成本参数 |
| | | 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() = "大连工厂", "大连外租库", "长春外租库" ) ); |
| | | tempLCT.Origin() = ifexpr( mlcrr.Category() = "AGW", "DL AGW", ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库" ) and |
| | | tempLCT.Destination() = ifexpr( mlcrr.Category() = "AGW", "CC AGW库房", ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "线边库" ) ); |
| | | |
| | | // 当前月末最后一天日期 |
| | | lastDayOfThisMonth := mlcrc.StartDate().StartOfNextMonth() - 1; |
| | |
| | | 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.TransferCost( [Number] ( [Number] ( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) ) / guard( lct.LoadingCapacity(), 1 ) ) * guard( lct.TransportPrice(), 1 ) ); |
| | | |
| | | // 外租库入库费用(入库量[包装量] / 包装容量 * 入库单价) |
| | | cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) ); |
| | |
| | | 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.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID() = ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "线边库" and |
| | | tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库", |
| | | tempPIT.Quantity() |
| | | ); |
| | | cell.ExternalRentalWarehouseTransportationCosts( transportationQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct1.LoadingCapacity(), 1 ) * guard( lct1.TransportPrice(), 1 ) ); |
| | | transportationQuantity := 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() = ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库" and |
| | | tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "线边库", |
| | | tempPIT.Quantity() |
| | | ); |
| | | |
| | | cell.ExternalRentalWarehouseTransportationCosts( transportationQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) ); |
| | | |
| | | // 外租库仓储费用:仓储数量/包装容量*仓储单价 |
| | | plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP, |
| | |
| | | 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.ProductInStockingPoint_MP().StockingPointID() = ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库", |
| | | tempPISPIP.PlannedInventoryLevelEnd() ); |
| | | cell.RentalWarehouseStorageFees( plannedInventory / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.StoragePrice(), 1 ) ); |
| | | |
| | | // 预计总费用 |
| | | cell.EstimatedTotalCost( cell.PackingCharges() + cell.UnpackingCost() + cell.BufferPaperCost() + cell.WoodenCrateCost() + cell.TransferCost() + |
| | | cell.StorageFeesForRentedWarehouses() + cell.OutboundExpensesForRentedWarehouses() + cell.ExternalRentalWarehouseTransportationCosts() + |
| | | cell.RentalWarehouseStorageFees() ); |
| | | |
| | | // 系数 |
| | | cell.Coefficient( 1.05 ); |
| | | |
| | | // 总费用 |
| | | cell.TotalCost( cell.EstimatedTotalCost() * cell.Coefficient() ); |
| | | |
| | | cell.MachineLogisticsCostReportColumn( relset, mlcrc ); |
| | | } |
| | | } |
| | |
| | | AttributeRepresentation PackagingInventory |
| | | { |
| | | AttributeKey: '[413988.0.1393320143]' |
| | | Synonym: 'Packaged' |
| | | Synonym: 'Packaged inventory' |
| | | } |
| | | AttributeRepresentation TransferIn |
| | | { |
| | |
| | | AttributeRepresentation UnpackagedInventory |
| | | { |
| | | AttributeKey: '[413988.0.1393320130]' |
| | | Synonym: 'Unpackaged' |
| | | Synonym: 'Unpackaged inventory' |
| | | } |
| | | AttributeRepresentation Unpacking |
| | | { |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | Legend: 'ShowName' |
| | | Legend: 'Name' |
| | | SortCriteria: 'RowNr' |
| | | Taborder: 1 |
| | | ] |