public void clicked()
{
VendTrans vendTransLoc;
VendTable vendTable;
DirPartyTable dirPartyTable;
DaxLedgerTrailBalance daxLedgerTrailBalanceloc,daxLedgerTrailBalanceloc1;
FormDateControl StartDateloc = this.formRun().design().controlName("StartDate") as FormDateControl;
FormDateControl EndDateloc = this.formRun().design().controlName("EndDate") as FormDateControl;
FormComboBoxControl Typeloc = this.formRun().design().controlName("Type") as FormComboBoxControl;
super();
if(Typeloc.selectionChange() == Type::Vendors)
{
while select * from vendTransLoc
where vendTransLoc.TransDate >= StartDateloc.dateValue()
&& vendTransLoc.TransDate <= EndDateloc.dateValue()
{
if(vendTransLoc.ReportingCurrencyAmount <0)
{
daxLedgerTrailBalanceloc.AmountDebit = vendTransLoc.ReportingCurrencyAmount;
}
if(vendTransLoc.ReportingCurrencyAmount > 0)
{
daxLedgerTrailBalanceloc.AmountCredit = vendTransLoc.ReportingCurrencyAmount;
}
daxLedgerTrailBalanceloc.OpeningBalance = vendTransLoc.AmountMST;
daxLedgerTrailBalanceloc.MainAccountCategory = vendTransLoc.AccountNum;
daxLedgerTrailBalanceloc.EndingBalance = (daxLedgerTrailBalanceloc.OpeningBalance + daxLedgerTrailBalanceloc.AmountDebit)-daxLedgerTrailBalanceloc.AmountCredit;
vendTable.Party = vendTable::find(vendTransLoc.AccountNum).Party;
dirPartyTable.Name = dirPartyTable::findRec(vendTable.Party).Name;
daxLedgerTrailBalanceloc.PrimaryFocusDescription = dirPartyTable.Name;
daxLedgerTrailBalanceloc.insert();
}
}
}
No comments:
Post a Comment