To find mainaccountId,mainaccount name,dimensions separately to display in ssrs report based on custinvoicejournal voucher
To find mainaccountId,mainaccount name,dimensions separately to display in ssrs report based on custinvoicejournal voucher:
Controller Class:
[SRSReportParameterAttribute(classStr(FCC_SalesInvoiceVoucherContract))]
public class FCC_SalesInvoiceVoucherReportDP extends
SrsReportDataProviderPreProcessTempDB
{
FCC_SalesInvoiceVoucherTmp salesInvoiceVoucherTmp;
FCC_SalesInvoiceVoucherLineTmp
salesInvoiceVoucherLineTmp;
GeneralJournalAccountEntry
generalJournalAccountEntry,generalJournalAccountEntryLoc;
CustInvoiceJour custInvoiceJour;
SalesLine salesLine;
DimensionAttributeValueSet DimensionAttributeValueSet;
DimensionAttributeValueSetItem DimensionAttributeValueSetItem;
DimensionAttributeValue DimensionAttributeValue;
DimensionAttribute DimensionAttribute;
TextBuffer buffer;
str value;
Counter cnt;
[SRSReportDataSetAttribute(tableStr(FCC_SalesInvoiceVoucherTmp))]
public FCC_SalesInvoiceVoucherTmp
getFCC_SalesInvoiceVoucherTmp()
{
select
salesInvoiceVoucherTmp;
return
salesInvoiceVoucherTmp;
}
[SRSReportDataSetAttribute(tableStr(FCC_SalesInvoiceVoucherLineTmp))]
public
FCC_SalesInvoiceVoucherLineTmp getFCC_SalesInvoiceVoucherLineTmp()
{
select
salesInvoiceVoucherLineTmp;
return
salesInvoiceVoucherLineTmp;
}
public void
processReportHeader(Voucher voucher)
{
select
custInvoiceJour where custInvoiceJour.LedgerVoucher ==
voucher;
{
salesInvoiceVoucherTmp.clear();
salesInvoiceVoucherTmp.CompanyLogo
= FormLetter::companyLogo();
salesInvoiceVoucherTmp.InvoiceDate
= custInvoiceJour.InvoiceDate;
salesInvoiceVoucherTmp.LedgerVoucher
= custInvoiceJour.LedgerVoucher;
salesInvoiceVoucherTmp.SalesId
= custInvoiceJour.SalesId;
salesInvoiceVoucherTmp.InvoiceId
= custInvoiceJour.InvoiceId;
salesInvoiceVoucherTmp.CustName
=
CustTable::find(custInvoiceJour.InvoiceAccount).name();
salesInvoiceVoucherTmp.CurrencyCode
= custInvoiceJour.CurrencyCode;
salesInvoiceVoucherTmp.insert();
}
}
public void
processReportLine(RecId recId,DocumentNum
documentNum)
{
while select
generalJournalAccountEntry where
generalJournalAccountEntry.GeneralJournalEntry ==
recId
{
salesInvoiceVoucherLineTmp.clear();
salesInvoiceVoucherLineTmp.MainAccountId =
MainAccount::find(generalJournalAccountEntry.MainAccount).MainAccountId;
salesInvoiceVoucherLineTmp.Name = MainAccount::find(generalJournalAccountEntry.MainAccount).Name;
if(generalJournalAccountEntry.IsCredit == NoYes::Yes)
{
salesInvoiceVoucherLineTmp.TransactionCurrencyAmountCredit =
abs(generalJournalAccountEntry.TransactionCurrencyAmount);
}
else
{
salesInvoiceVoucherLineTmp.TransactionCurrencyAmountDebit =
generalJournalAccountEntry.TransactionCurrencyAmount;
}
salesInvoiceVoucherLineTmp.Text
=
generalJournalAccountEntry.Text;
value =
generalJournalAccountEntry.LedgerAccount;
buffer =
new TextBuffer();
buffer.setText(value);
while
(buffer.nextToken(0, '-'))
{
cnt++;
if(cnt
== 2)
salesInvoiceVoucherLineTmp.DimensionOne = buffer.token();
if(cnt
== 3)
salesInvoiceVoucherLineTmp.DimensionTwo = buffer.token();
if(cnt
== 4)
salesInvoiceVoucherLineTmp.DimensionThree = buffer.token();
}
salesInvoiceVoucherLineTmp.TotalAmountInWords =
FCC_AmountsInWords::numeralsToTxt_QAR(salesInvoiceVoucherLineTmp.TransactionCurrencyAmountCredit);
salesInvoiceVoucherLineTmp.insert();
}
}
public void
processReport()
{
FCC_SalesInvoiceVoucherContract
contract;
DocumentNum documentNum;
RecId recId;
Voucher voucher;
delete_from
salesInvoiceVoucherTmp;
delete_from
salesInvoiceVoucherLineTmp;
contract = this.parmDataContract() as
FCC_SalesInvoiceVoucherContract;
documentNum = contract.parmDocumentNum();
recId = contract.parmRecId();
voucher = contract.parmVoucher();
this.processReportHeader(voucher);
this.processReportLine(recId,documentNum);
}
}
class FCC_SalesInvoiceVoucherController extends
SrsReportRunController
{
public void
prePromptModifyContract()
{
FCC_SalesInvoiceVoucherContract contract;
DocumentNum documentNum;
RecId recId;
Voucher voucher;
GeneralJournalEntry generalJournalEntry;
super();
if(this.parmArgs() && this.parmArgs().record())
{
contract =
this.parmReportContract().parmRdpContract() as FCC_SalesInvoiceVoucherContract;
generalJournalEntry = this.parmArgs().record();
contract.parmDocumentNum(generalJournalEntry.DocumentNumber);
contract.parmRecId(generalJournalEntry.RecId);
contract.parmVoucher(generalJournalEntry.SubledgerVoucher);
}
}
public static
FCC_SalesInvoiceVoucherController construct(Args _args)
{
GeneralJournalEntry
generalJournalEntry;
FCC_SalesInvoiceVoucherController controller = new
FCC_SalesInvoiceVoucherController();
generalJournalEntry = _args.record() as GeneralJournalEntry;
controller.parmArgs(_args);
controller.parmReportName(ssrsReportStr(FCC_SalesInvoiceVoucherReport,Report));
controller.parmShowDialog(false);
return
controller;
}
public static void
main(Args args)
{
FCC_SalesInvoiceVoucherController::construct(args).startOperation();
}
}
Comments
Post a Comment