📄 customervendoraging.bsh
字号:
/* * Copyright (C) 2006 Open Source Strategies, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *//* * Accounts receivables and payable balances report. * * @author Si Chen */import com.opensourcestrategies.financials.accounts.AccountsHelper;import org.ofbiz.base.util.UtilDateTime;import org.ofbiz.base.util.UtilMisc;// get the form data from the helper scriptorganizationPartyId = context.get("organizationPartyId");glFiscalTypeId = context.get("glFiscalTypeId");asOfDate = context.get("asOfDate");if (asOfDate == null) return;daysOutstandingBreakPoints = UtilMisc.toList(new Integer(30), new Integer(60), new Integer(90));// this is a hack to get the the invoices over the last break point (ie, 90+ invoices)maximumDSOBreakPoint = new Integer(9999);breakPointParams = new LinkedList();breakPointParams.addAll(daysOutstandingBreakPoints);breakPointParams.add(maximumDSOBreakPoint);reportType = context.get("reportType");if (reportType.equals("ACCOUNTS_PAYABLE")) { invoicesByDSO = AccountsHelper.getUnpaidInvoicesForVendors(organizationPartyId, breakPointParams, asOfDate, delegator);} else if (reportType.equals("ACCOUNTS_RECEIVABLE")) { invoicesByDSO = AccountsHelper.getUnpaidInvoicesForCustomers(organizationPartyId, breakPointParams, asOfDate, delegator);}context.put("invoicesByDSO", invoicesByDSO);context.put("daysOutstandingBreakPoints", daysOutstandingBreakPoints); // must be this one which are the users' break pointscontext.put("olderThanMaxDSOInvoices", invoicesByDSO.get(maximumDSOBreakPoint)); // these are invoices older than the maximum DSO from the userscontext.put("asOfDate", asOfDate);// helpful debugging code - going to lug it around a little longer/*for (kit = invoicesByDSO.keySet().iterator(); kit.hasNext(); ) { nextKey = kit.next(); invoices = invoicesByDSO.get(nextKey); for (it = invoices.iterator(); it.hasNext(); ) { invoice = it.next(); print(invoice.invoice.get("invoiceId") + ": " + invoice.amount + "(" + invoice.isPastDue() + ")"); }}*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -