Hello Experts,
I have a requirement where i want to show the sum of tax amount of all the order made on a particular customer.
For Example - On Customer US-001 there are total 10 open orders. So i want to show the sum of tax amount of those 10 orders.
Can any one please help on this, Most often i dont get any reply, I appreciate if someone can help me on this.
There a few strange things in your code. For instance, you keep overwriting taxAmount - I guess you want to assign it with +=. You also never use any value from salesLine in the outer while select, therefore summarizing LineAmount there has no effect.
The fields you select from TaxGroupData aren't used either.
Please give us a more detailed description of the problem than mere "that is not working". If you haven't done it yet, use the debugger to find out which part of your code doesn't behave as expected.
tried this code idea was to write a logic in this method and then use this method in my display method which i have created on salestable only.
public static real CheckDraftOrderTax(CurrencyCode _currencycode, CustAccount _custaccount, Noyes _isdraft = NoYes::Yes) { SalesTable salestable; SalesLine salesline; TaxOnItem taxOnItem; TaxGroupData taxGroupData; real taxAmount; TaxValue taxValue; while select CurrencyCode from salestable group by CurrencyCode where salestable.CustAccount == _custaccount && salestable.Draft_CAP == _isdraft join sum(LineAmount) from salesline where salesline.SalesId == salestable.SalesId && salesline.SalesStatus != SalesStatus::Invoiced { while select sum(LineAmount), TaxItemGroup, TaxGroup from salesline join TaxItemGroup from taxOnItem where taxOnItem.TaxItemGroup == salesline.TaxItemGroup join TaxGroup,TaxCode from taxGroupData where taxGroupData.TaxGroup == Salesline.TaxGroup && taxGroupData.TaxCode == TaxOnItem.TaxCode { taxValue = TaxData::find(TaxOnItem.TaxCode, Systemdateget(), 0).taxValue; taxAmount = taxAmount (Salesline.LineAmount * TaxValue) / 100; } } return taxAmount;hello Martin thanks for your reply. I need to use that in a display method which I will display on sales order screen. I have created a boolean on salestable. if that boolean is trut then display method will show sum of tax amount of all the orders of the customer which is marked as that boolean true. I also created one method to use but that is not working
It's not clear what you need from us. Giving you a solution is difficult if you don't give us enough information about your problem.
Do you want to write X++ code to get the value, or do you need a query in a form, or what?
Do you know how to get a tax amount for a single order?
Are you familiar with database queries and aggregation functions?
can someone please help on this?
Any Help on this?
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156