Quintiq file version 2.0
|
#parent: #root
|
Method AddTotalOrdersForExport (
|
String uriitem,
|
String uristocklocation,
|
String urisalessegment,
|
Date uristartdate,
|
Date urienddate,
|
Real quantity,
|
Real revenue
|
)
|
{
|
Description: 'Verify duplicate then append TotalOrders to TotalOrdersCache'
|
TextBody:
|
[*
|
// Use converter to get right date format
|
endDateSCI := ( urienddate - Duration::Days( 1 ) ).Date();
|
stringDate := LibSCIIntegration_Utility::DateToStringISOConverter( endDateSCI );
|
|
// Check if the ActualSales is already existing
|
existingTotalOrders := LibSCITotalOrders::FindLibSCITotalOrdersTypeIndex( uriitem, urisalessegment, uristocklocation, uristartdate, urienddate );
|
if( isnull( existingTotalOrders ) )
|
{
|
this.LibSCITotalOrders( relnew,
|
UriItem := uriitem,
|
UriSalesSegment := urisalessegment,
|
UriStockLocation := uristocklocation,
|
UriStartDate := uristartdate,
|
UriEndDate := urienddate );
|
|
content := construct( Strings );
|
|
content.Add( LibSCIIntegration_Utility::FormatString( uriitem ) ); // item
|
content.Add( LibSCIIntegration_Utility::FormatString( uristocklocation ) ); // salesSegment
|
content.Add( LibSCIIntegration_Utility::FormatString( urisalessegment ) ); // stockLocation
|
content.Add( stringDate ); // date
|
content.Add( [String]quantity ); // quantity
|
content.Add( [String]revenue ); // revenue
|
|
addedvalues := content.ToString( LibSCIIntegration_Utility::Tokenizer() );
|
addedvalues := this.TotalOrdersCache() + String::NewLine() + addedvalues;
|
|
this.TotalOrdersCache( addedvalues );
|
}
|
*]
|
}
|