How can I get the Sales Tax /Sales Tax Totals:
Or
Getting actual amount without tax from ledgerjournaltrans table:
ledgerJournalEngine.taxAmountJournal(_ledgerJournalTrans); // this will calculate the tax if you have ledgerjournaltrans line with you.
example for customer payment journal(LedgerJournalType::CustPayment) ;
LedgerJournalEngine ledgerJournalEngine = LedgerJournalEngine::construct(LedgerJournalType::CustPayment);
LedgerJournalTrans _ledgerJournalTrans = LedgerJournalTrans::findRecId(5637290372,false);
TaxAmountJournal TaxAmountJournal = ledgerJournalEngine.taxAmountJournal(_ledgerJournalTrans);
getting GST calculations eith sales and purchase lines:
salesLine = SalesLine::find(custConfirmTrans.SalesId, custConfirmTrans.LineNum);
Tax::calcTaxAmount(salesLine.TaxGroup, salesLine.TaxItemGroup, Systemdateget(), salesLine.CurrencyCode, salesLine.LineAmount, TaxModuleType::Sales);