public void createTaxJournal(AirSalesTable _airSales, AirAmountTable _airAmount, LedgerJournalTable ljt,Amount salesAmount,RefRecId leddim,
Voucher _voucher,DebitCredit _debitCredit ,TaxEngineTaxJournalAccountType accountType ,SAC_IN _sacCode ,Amount _gstBaseAmount,NoYes _gstApplicable,RefRecId _offsetLedgerDim )
{
TaxEngineTaxJournal taxEngineTaxJournal;
TaxEngineTaxJournalLine taxEngineTaxJournalLine;
TaxEngineTaxJournalLineTaxExtensionIN taxEngineTaxJournalLineTaxExtensionIN;
LedgerJournalName ledgerJournalName;
TradeGLSetupParameters tradeGLParameters;
TaxInformation_IN taxInformation_IN;
TaxRuntimeDocComponent taxRuntimeDocComponent;
TransTaxInformation transTaxInformation;
TaxComponentTable_IN taxComponentTable_IN;
TaxRuntimePostingType taxRuntimePostingType;
TaxRuntimeDocTaxType taxRuntimeDocTaxType;
TaxEngineTaxJournalConstructor taxEngineTaxJournalConstructor;
select firstonly SalesTaxJournal,SAC from tradeGLParameters ;
_sacCode = tradeGLParameters.SAC;
select ledgerJournalName where ledgerJournalName.JournalName == tradeGLParameters.SalesTaxJournal
&& ledgerJournalName.DataAreaId == _airSales.CompanyCode;
taxEngineTaxJournal.clear();
taxEngineTaxJournalLine.clear();
taxEngineTaxJournal.initValue();
taxEngineTaxJournal.defaultRow();
//taxEngineTaxJournal.JournalNum = JournalTableData::newTable(taxEngineTaxJournal).nextJournalId();
taxEngineTaxJournal.JournalNum = TaxEngineTaxJournalUtil::getTaxJournalNum();
taxEngineTaxJournal.insert();
//NumberSeq::newGetNum(LedgerParameters::numRefJournalNum()).parmRefTableNum(;
taxEngineTaxJournalLine.TaxEngineTaxJournal = taxEngineTaxJournal.RecId;
taxEngineTaxJournalLine.Purpose = TaxDocumentPurpose::Transaction;
taxEngineTaxJournalLine.TransDate = _airSales.ProcessedDate;
taxEngineTaxJournalLine.Description = _airSales.BookingNo;
taxEngineTaxJournalLine.CurrencyCode = _airSales.CurrencyCode;
taxEngineTaxJournalLine.Triangulation = Currency::triangulation(taxEngineTaxJournalLine.CurrencyCode);
taxEngineTaxJournalLine.ExchRate = ExchangeRateHelper::exchRate(taxEngineTaxJournalLine.CurrencyCode, taxEngineTaxJournalLine.TransDate, Currency::noYes2UnknownNoYes(taxEngineTaxJournalLine.Triangulation));
taxEngineTaxJournalLine.AccountType = TaxEngineTaxJournalAccountType::Tax;
taxEngineTaxJournalLine.LedgerDimension = leddim;
if(_airAmount.TotalCgst != 0)
{
select RecId from taxRuntimeDocComponent where taxRuntimeDocComponent.Name == "CGST";
}
else if(_airAmount.Totaligst != 0)
{
select RecId from taxRuntimeDocComponent where taxRuntimeDocComponent.Name == "IGST" ;
}
if(_airAmount.TotalSgst != 0)
{
select RecId from taxRuntimeDocComponent where taxRuntimeDocComponent.Name == "SGST" ;
}
taxEngineTaxJournalLine.TaxComponent = taxRuntimeDocComponent.RecId;
select firstonly RecId from taxRuntimePostingType where taxRuntimePostingType.Name == "Tax Payable";
taxEngineTaxJournalLine.TaxPostingType = taxRuntimePostingType.RecId;
taxEngineTaxJournalLine.OffsetAccountType = TaxEngineTaxJournalAccountType::Ledger;
taxEngineTaxJournalLine.OffsetLedgerDimension = _offsetLedgerDim;
//taxEngineTaxJournalLine.TaxMeasure =
//TaxEngineTaxJournalUtil::("GST", TaxEngineTaxJournalLine.OffsetTaxComponent);
//taxEngineTaxJournalLine. = _airSales.CompanyCode;
//ledgerJournalTrans.ExchRate = exchRate;
//taxEngineTaxJournalLine.LineNum++;
//ledgerJournalTrans.Voucher = Numberseq::newGetVoucherFromCode(NumberSequenceTable::find(ledgerJournalTable.ledgerJournalName().NumberSequenceTable).NumberSequence).voucher();//bookingTable.MODocNum;
//taxEngineTaxJournalLine.Voucher = _voucher;
//ledgerJournalTrans.DocumentDate = DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone());
if(_debitCredit == DebitCredit::Credit)
{
taxEngineTaxJournalLine.AmountCurCredit = salesAmount;
}
else
{
taxEngineTaxJournalLine.AmountCurDebit = salesAmount;
}
taxEngineTaxJournalLine.insert();
taxEngineTaxJournalConstructor = TaxEngineTaxJournalConstructor::construct(taxEngineTaxJournalLine.TaxEngineTaxJournal().JournalType);
//taxEngineTaxJournalConstructor.(taxEngineTaxJournalLine);
taxEngineTaxJournalLine.update();
//taxEngineTaxJournalLineTaxExtensionIN = taxEngineTaxJournalLine.TaxEngineTaxJournal();
taxEngineTaxJournalLineTaxExtensionIN.TaxEngineTaxJournalLine = taxEngineTaxJournalLine.RecId;
taxEngineTaxJournalLineTaxExtensionIN.insert();
transTaxInformation = TransTaxInformationHelper::findOrCreateTransTaxInformationByRecord(taxEngineTaxJournalLine,true);
transTaxInformation.ServiceAccountingCodeTable = ServiceAccountingCodeTable_IN::findByServiceAccountingCode(_sacCode);
transTaxInformation.update();
//TaxEngineTaxJournalUtil::postTaxJournal(taxEngineTaxJournal);
}