Recently i came across a requirement, where i needs to print TDS and TCS (Withholding Tax) values of a Journal before posting it.
Here i am sharing the code to get TDS or TDS value from Journal.
General Ledger >> General Journal >> Lines >> Withholding Tax
For Open Journals :
For Posted Journals :
Or if you want to get posted journal TDS/TCS (Withholding Tax) Value then you can get it from below code.
info(strFmt("TDS %1",objTaxWithholdTrans_IN.TaxWithholdAmount ));
info(strFmt("TCS %1",objTaxWithholdTrans_IN.TaxWithholdAmount ));
Here i am sharing the code to get TDS or TDS value from Journal.
For Open Journals :
\Data Dictionary\Tables\TaxWithholdUncommitted_IN\Methods\getActualTaxAmountForVoucher
LedgerJournalTable objLedgerJournalTable;
LedgerJournalTable objLedgerJournalTable;
LedgerJournalTrans objLedgerJournalTrans;
TaxWithholdUncommitted_IN objtaxWithholdUncommitted;
TaxWithholdTrans_IN objTaxWithholdTrans_IN;
TaxWithholdTrans_IN objTaxWithholdTrans_IN;
While Select
* from objLedgerJournalTable where
objLedgerJournalTable.JournalNum== 'XXXXXX'
join
* from objLedgerJournalTrans where
objLedgerJournalTrans.JournalNum==objLedgerJournalTable.JournalNum
{
objtaxWithholdUncommitted.clear();
select
* from objtaxWithholdUncommitted
where
objtaxWithholdUncommitted.HeadingRecId == objLedgerJournalTable.RecId
&&
objtaxWithholdUncommitted.HeadingTableId == tableNum(LedgerJournalTable)
&&
objtaxWithholdUncommitted.Voucher == objLedgerJournalTrans.Voucher
&&
objtaxWithholdUncommitted.InvoiceId == objLedgerJournalTrans.Invoice;
if(objLedgerJournalTrans.TDSGROUP_IN!="")
{
info(strFmt("TDS %1",taxWithholdUncommitted.TaxAmountCur));
}
else
if(objLedgerJournalTrans.TCSGroup_IN!="")
{
info(strFmt("TCS %1",taxWithholdUncommitted.TaxAmountCur));
}
}
For Posted Journals :
Or if you want to get posted journal TDS/TCS (Withholding Tax) Value then you can get it from below code.
objTaxWithholdTrans_IN.clear();
Select
* from objTaxWithholdTrans_IN where
objTaxWithholdTrans_IN.JournalNum==objLedgerJournalTrans.JournalNum
&&
objTaxWithholdTrans_IN.Voucher==objLedgerJournalTrans.Voucher
&&
objTaxWithholdTrans_IN.TransDate==objLedgerJournalTrans.TransDate;
if(objLedgerJournalTrans.TDSGROUP_IN!="")
{
}
else
if(objLedgerJournalTrans.TCSGroup_IN!="")
{
}
EmoticonEmoticon