Ending Date has not been enterted on the sales price. so where there is new line with new start date I’d like to enter a ending date for the old sales price. This will enable the std nav funct. to select the correct sales price against orders.
Sales Price Table Sample.
Item No. Sales Type Sales Code Starting Date Ending Date Unit Price
197764 Customer Price Group FRANCHISE 08/06/2010 13.04
197764 Retail Price Group ALL 08/06/2010 16.66
197764 Retail Price Group ALL 11/11/2010 20.83
197764 Retail Price Group EIRE 08/06/2010 19.83
197764 Retail Price Group SHOW 01/04/2011 12.49
therefore order should pick up £20.83 rather than £16.66.
I tried the following…
SalesPrice.SETRANGE(“Item No.”,“Item No.”);
SalesPrice.SETRANGE(“Sales Type”,“Sales Type”);
SalesPrice.SETRANGE(“Sales Code”,“Sales Code”);
IF SalesPrice.COUNT > 1 THEN
REPEAT
IF SalesPrice.“Ending Date” = 0D THEN
TmpSalesPrice := SalesPrice;
TmpSalesPrice.INSERT;
UNTIL SalesPrice.NEXT = 0;
//CLEAR(SalesPrice);
SalesPrice.LOCKTABLE;
Expdate := ‘1Y’;
//TmpSalesPrice.RESET;
IF TmpSalesPrice.FINDSET THEN
REPEAT
// SalesPrice := TmpSalesPrice;
Refdate := “Starting Date”;
SalesPrice.“Ending Date”:= CALCDATE(Expdate, Refdate);
SalesPrice.MODIFY(FALSE);
UNTIL TmpSalesPrice.NEXT = 0;