<products> <product id="" xmlns="urn:microsoft-dynamics-nav/api/product/getprice"> <price /> <itemdiscgroup /> <custdiscgroup /> <linediscounts> <linediscount min=""> <discount /> <start /> <end /> </linediscount> </linediscounts> </product> </products>
linediscount - Export::OnPreXMLItem() SLD.RESET; //all customers x item TempSalesLineDiscount.SETRANGE(TempSalesLineDiscount.Type, TempSalesLineDiscount.Type::Item); TempSalesLineDiscount.SETFILTER(TempSalesLineDiscount.Code, Item."No."); TempSalesLineDiscount.SETRANGE(TempSalesLineDiscount."Sales Type", TempSalesLineDiscount."Sales Type"::"All Customers"); TempSalesLineDiscount.SETFILTER(TempSalesLineDiscount."Starting Date", '%1|<=%2', 0D, TODAY); TempSalesLineDiscount.SETFILTER(TempSalesLineDiscount."Ending Date", '%1|>=%2', 0D, TODAY); TempSalesLineDiscount.SETFILTER(TempSalesLineDiscount."Minimum Quantity", '<> 0'); CopySalesDiscToSalesDisc(TempSalesLineDiscount, SLD); //specific customer x item TempSalesLineDiscount.RESET; TempSalesLineDiscount.SETRANGE(TempSalesLineDiscount.Type, TempSalesLineDiscount.Type::Item); TempSalesLineDiscount.SETFILTER(TempSalesLineDiscount.Code, Item."No."); TempSalesLineDiscount.SETRANGE(TempSalesLineDiscount."Sales Type", TempSalesLineDiscount."Sales Type"::Customer); TempSalesLineDiscount.SETRANGE(TempSalesLineDiscount."Sales Code", Customer."No."); TempSalesLineDiscount.SETFILTER(TempSalesLineDiscount."Starting Date", '%1|<=%2', 0D, TODAY); TempSalesLineDiscount.SETFILTER(TempSalesLineDiscount."Ending Date", '%1|>=%2', 0D, TODAY); TempSalesLineDiscount.SETFILTER(TempSalesLineDiscount."Minimum Quantity", '<> 0'); CopySalesDiscToSalesDisc(SLD, TempSalesLineDiscount); CopySalesDiscToSalesDisc(VAR FromSalesLineDisc : Record "Sales Line Discount";VAR ToSalesLineDisc : TEMPORARY Record "Sales Line Discou WITH ToSalesLineDisc DO BEGIN IF FromSalesLineDisc.FINDSET THEN REPEAT IF FromSalesLineDisc."Line Discount %" <> 0 THEN BEGIN ToSalesLineDisc.COPY(FromSalesLineDisc); ToSalesLineDisc.INSERT; END; UNTIL FromSalesLineDisc.NEXT = 0; END;