![]() |
#7 |
Участник
|
Попробую привести полный пример кода
Код кнопки X++: void clicked() { Args args; SysReportRun reportRun; ; args = new Args(); args.record(CreditTable); args.name(reportstr(ReportGraphLoan)); reportRun = ClassFactory.reportRunClass(args); reportRun.query().interactive(false); reportRun.report().interactive(false); reportRun.setTarget(PrintMedium::Screen); reportRun.run(); } X++: public tmpGraphLoanLines buildLines(CreditTable _ct) { tmpGraphLoanLines tmpLoanLines; int Months; Counter counter; TransDate transDate; Amount summDebet, sumPercent, summResponsible; WW_DateDiff dateDiff = new WW_DateDiff(); ; ct = _ct; Months = (year(ct.DateEnd)*12+mthOfYr(ct.DateEnd)) - (year(ct.DateBegin)*12+mthOfYr(ct.DateBegin)); summDebet = ct.SummCredit / Months; summResponsible = ct.SummCredit; tmpLoanLines.clear(); for(counter = 1; counter <= Months; counter++) { transDate = dateDiff.DateAddMonths(counter, ct.DateBegin); if (counter > 1) summResponsible -= summDebet; sumPercent = summResponsible * ct.Percents / 100 / 12; tmpLoanLines.TransDate = transDate; if(counter == Months) tmpLoanLines.TransDate = ct.DateEnd; tmpLoanLines.SummPayment = summDebet; tmpLoanLines.SumPaymentPercent = sumPercent; tmpLoanLines.SummPaymentTotal = tmpLoanLines.SummPayment + tmpLoanLines.SumPaymentPercent; tmpLoanLines.insert(); } return tmpLoanLines; } X++: public void init() { ; buildGraphLoan = new G_BuildGraphLoan(); ct = element.args().record(); element.query().dataSourceTable(tablenum(CreditTable)).addRange(fieldnum(CreditTable, Cash_CreditId)).value(strfmt('%1', ct.Cash_CreditId)); super(); } X++: public boolean fetch() { boolean ret; this.queryRun().setRecord(buildGraphLoan.buildLines(ct)); ret = super(); return ret; } |
|
|
![]() |
||||
Тема | Ответов | |||
tmpTable mandatory field | 2 | |||
Проблема с LedgerJournalTrans | 14 | |||
Отчеты,fetch | 14 | |||
tmpTable+Cursor= Error.... | 18 | |||
tmpTable | 2 |
Опции темы | Поиск в этой теме |
Опции просмотра | |
|