gross weight and volume on sales order document

zzz458zzz458 Member Posts: 11
Hello again,
I also want to show the total gross weight and volume of the order in the sales order document. This information is available in the F9 statistics of teh sales order But I couldn't show it in my report
How can it be done?
Thanks

Comments

  • krikikriki Member, Moderator Posts: 9,118
    Put some code like this:

    decTotalGrossWeight := 0;
    decTotalVolume := 0;

    recSalesLine.RESET;
    recSalesLine.SETCURRENTKEY("Document Type","Document No.","Line No.");
    recSalesLine.SETRANGE("Document Type",recSalesHeader."Document Type");
    recSalesLine.SETRANGE("Document No.",recSalesHeader."No.");
    IF recSalesLine.FIND('-') THEN
    REPEAT
    decTotalGrossWeight += recSalesLine.Quantity * recSalesLine."Gross Weight";
    decTotalVolume += recSalesLine.Quantity * recSalesLine."Unit Volume";
    UNTIL recSalesLine.NEXT = 0;

    Some remarks:
    -SETCURRENTKEY is not necessary but always putting RESET-SETCURRENTKEY-SETRANGE/SETFILTER is a good programming practice
    -the filters on the salesline come from the header whose totals you want
    -recSalesLine.Quantity : this quantity or another quantity-field depending on which data you want
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • zzz458zzz458 Member Posts: 11
    Thank you very much
Sign In or Register to comment.