Author: arunpatidar
Date: Sun Jul 9 09:28:35 2017 New Revision: 1801359 URL: http://svn.apache.org/viewvc?rev=1801359&view=rev Log: Added missing file those of part of 1801320, also updated the path in screens. (OFBIZ-6774) Added: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy (with props) ofbiz/ofbiz-framework/trunk/applications/accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl (with props) Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/widget/PaymentScreens.xml Added: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy?rev=1801359&view=auto ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy (added) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy Sun Jul 9 09:28:35 2017 @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.ofbiz.base.util.UtilMisc +import org.apache.ofbiz.entity.condition.EntityCondition +import org.apache.ofbiz.entity.condition.EntityOperator +import org.apache.ofbiz.entity.util.EntityUtil + +invoiceId = parameters.invoiceId +userLoginId = userLogin.userLoginId +userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", userLoginId), false) +userLoginNameView = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", userLogin.get("partyId")), false) +userLoginName = userLoginNameView.getString("firstName") + " " + userLoginNameView.getString("lastName") +dateFormatter = new java.text.SimpleDateFormat("dd MMMMM yyyy") + +invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false) +if (invoice) { + context.invoiceDescription = invoice.get("description") + context.invoiceTypeDescription = invoice.getRelatedOne("InvoiceType", false).get("description") + context.statusDescription = invoice.getRelatedOne("StatusItem", false).get("description") + context.invoiceDate = invoice.get("invoiceDate") + context.referenceNumber = invoice.get("referenceNumber") +} +partyId = null +if ("PURCHASE_INVOICE".equals(invoice.get("invoiceTypeId")) || "PURCHASE_INVOICE".equals(invoice.getRelatedOne("InvoiceType", false).get("parentTypeId"))) { + partyId = invoice.get("partyIdFrom") +} else { + partyId = invoice.get("partyId") +} +partyName = "" +partyNameView = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", partyId), false) +if (partyNameView.get("firstName")) { + partyName += partyNameView.get("firstName") + " " +} +if (partyNameView.get("lastName")) { + partyName += partyNameView.get("lastName") + " " +} +if (partyNameView.get("groupName")) { + partyName += partyNameView.get("groupName") + " " +} + +orderBy = UtilMisc.toList("acctgTransId", "acctgTransEntrySeqId") +conds = [] +conds.add(EntityCondition.makeCondition("invoiceId", EntityOperator.EQUALS, invoiceId)) +conds.add(EntityCondition.makeCondition("paymentId", EntityOperator.EQUALS, null)) +invoiceAcctgTransAndEntries = delegator.findList("AcctgTransAndEntries", EntityCondition.makeCondition(conds), null, orderBy, null, false) +context.invoiceAcctgTransAndEntries = invoiceAcctgTransAndEntries +context.partyName = partyName +context.partyId = partyId \ No newline at end of file Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/ofbiz-framework/trunk/applications/accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl?rev=1801359&view=auto ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl (added) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl Sun Jul 9 09:28:35 2017 @@ -0,0 +1,281 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<#-- +Generates PDF of multiple checks in two styles: one check per page, multiple checks per page +Note that this must be customized to fit specific check layouts. The layout here is copied +by hand from a real template using a ruler. +--> +<#escape x as x?xml> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <#-- define the margins of the check layout here --> + <fo:simple-page-master master-name="checks" page-height="27.9cm" page-width="21.6cm"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="checks"> + <fo:flow flow-name="xsl-region-body"> + <fo:block> + <fo:table> + <fo:table-column column-number="1"/> + <fo:table-column column-number="2"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block> + <fo:table table-layout="fixed" width="100%" margin-top="50px" margin-left="8px"> + <fo:table-column column-width="2in"/> + <fo:table-column column-width="2in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block font-weight="bold" font-size="10px" text-align="right">${uiLabelMap.FormFieldTitle_invoiceId}:</fo:block></fo:table-cell> + <fo:table-cell><fo:block>${parameters.invoiceId!}</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell><fo:block font-weight="bold" font-size="10px" text-align="right" padding-top="2px">${uiLabelMap.CommonDescription}:</fo:block></fo:table-cell> + <fo:table-cell><fo:block font-weight="bold" font-size="10px" text-align="right" padding-top="2px">${invoiceDescription!}</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell><fo:block font-weight="bold" font-size="10px" text-align="right" padding-top="2px">${uiLabelMap.CommonStatus}:</fo:block></fo:table-cell> + <fo:table-cell><fo:block>${statusDescription!}</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell><fo:block font-weight="bold" font-size="10px" text-align="right" padding-top="2px">${uiLabelMap.AccountingReferenceNumber}:</fo:block></fo:table-cell> + <fo:table-cell><fo:block>${referenceNumber!}</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block> + <fo:table table-layout="fixed" width="100%" margin-top="50px" margin-left="8px"> + <fo:table-column column-width="2in"/> + <fo:table-column column-width="2in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block font-weight="bold" font-size="10px" text-align="right">${uiLabelMap.CommonUsername}:</fo:block></fo:table-cell> + <fo:table-cell><fo:block>${userLoginName!}</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell><fo:block font-weight="bold" font-size="10px" text-align="right" padding-top="2px">${uiLabelMap.CommonDate}:</fo:block></fo:table-cell> + <fo:table-cell><fo:block>${invoiceDate?string("dd MMMMM yyyy")}</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell><fo:block font-weight="bold" font-size="10px" text-align="right" padding-top="2px">${uiLabelMap.CommonPartyId}:</fo:block></fo:table-cell> + <fo:table-cell><fo:block>${partyId!}</fo:block></fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell><fo:block font-weight="bold" font-size="10px" text-align="right" padding-top="2px">${uiLabelMap.AccountingPartyName}:</fo:block></fo:table-cell> + <fo:table-cell><fo:block>${partyName!}</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <fo:table table-layout="fixed" margin-left="5pt" margin-top="100px" margin-right="5pt" width="100%"> + <fo:table-column column-width="3cm" border-style="solid" border-width="solid" border-color="black"/> + <fo:table-column column-width="6cm" border-style="solid" border-width="solid" border-color="black"/> + <fo:table-column column-width="3cm" border-style="solid" border-width="solid" border-color="black"/> + <fo:table-column column-width="3cm" border-style="solid" border-width="solid" border-color="black"/> + <fo:table-column column-width="3cm" border-style="solid" border-width="solid" border-color="black"/> + <fo:table-column column-width="3cm" border-style="solid" border-width="solid" border-color="black"/> + <fo:table-header background-color="#BFBFBF" border-style="solid" border-width="solid" border-color="black"> + <fo:table-row> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" padding-top="2mm">${uiLabelMap.FormFieldTitle_accountCode}</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" padding-top="2mm">${uiLabelMap.FormFieldTitle_accountName}</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" padding-top="2mm">${uiLabelMap.AccountingOriginalCurrency}</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" padding-top="2mm">${uiLabelMap.AccountingExchangeRate}</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" padding-top="2mm">${uiLabelMap.AccountingDebitFlag}</fo:block> + </fo:table-cell > + <fo:table-cell> + <fo:block font-weight="bold" text-align="center" padding-top="2mm">${uiLabelMap.AccountingCreditFlag}</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-header> + <fo:table-body> + <#assign debitTotal = 0/> + <#assign creditTotal = 0/> + <#list invoiceAcctgTransAndEntries as invoiceAcctgTransAndEntry> + <fo:table-row border-style="solid" border-width="solid" border-color="black"> + <fo:table-cell><fo:block padding-top="3px">${invoiceAcctgTransAndEntry.accountCode!}</fo:block></fo:table-cell> + <fo:table-cell><fo:block padding-top="3px">${invoiceAcctgTransAndEntry.accountName!}</fo:block></fo:table-cell> + <fo:table-cell><fo:block padding-top="3px">${invoiceAcctgTransAndEntry.origCurrencyUomId!}</fo:block></fo:table-cell> + <fo:table-cell><fo:block padding-top="3px">${invoiceAcctgTransAndEntry.origAmount!}/${invoiceAcctgTransAndEntry.amount!} ${invoiceAcctgTransAndEntry.origCurrencyUomId!}/${invoiceAcctgTransAndEntry.currencyUomId!}</fo:block></fo:table-cell> + <fo:table-cell text-align="center"> + <fo:block> + <#if "D"==invoiceAcctgTransAndEntry.debitCreditFlag> + <#assign debitTotal = debitTotal +invoiceAcctgTransAndEntry.amount> + ${invoiceAcctgTransAndEntry.amount!} + </#if> + </fo:block> + </fo:table-cell> + <fo:table-cell text-align="center"> + <fo:block> + <#if "C"==invoiceAcctgTransAndEntry.debitCreditFlag> + <#assign creditTotal = creditTotal +invoiceAcctgTransAndEntry.amount> + ${invoiceAcctgTransAndEntry.amount!} + </#if> + </fo:block> + </fo:table-cell> + </fo:table-row> + </#list> + <fo:table-row border-style="solid" border-width="solid" border-color="black"> + <fo:table-cell number-columns-spanned="4"> + <fo:block font-weight="bold" padding-top="3px"> + <#if debitTotal == creditTotal> + <#assign baseCurrencyUomId = (delegator.findOne("PartyAcctgPreference", {"partyId" : partyId}, true))!> + <#if baseCurrencyUomId?has_content && "THB" == baseCurrencyUomId.baseCurrencyUomId> + <#assign rule = "%bahts-and-stangs"> + <#assign locale = Static["org.apache.ofbiz.base.util.UtilMisc"].parseLocale("th")!/> + <#else> + <#assign rule = "%dollars-and-cents"> + <#assign locale = Static["org.apache.ofbiz.base.util.UtilMisc"].parseLocale("en_us")!/> + </#if> + <#assign amount = Static["org.apache.ofbiz.base.util.UtilNumber"].formatRuleBasedAmount(debitTotal, rule, locale).toUpperCase()> + ${uiLabelMap.AccountingTotalCapital} : ${amount!} + <#else> + ${uiLabelMap.AccountingDebitNotEqualCredit} + </#if> + </fo:block> + </fo:table-cell> + <fo:table-cell text-align="center"> + <fo:block>${debitTotal!}</fo:block> + </fo:table-cell> + <fo:table-cell text-align="center"><fo:block>${creditTotal!}</fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <fo:table> + <fo:table-column column-number="1"/> + <fo:table-column column-number="2"/> + <fo:table-column column-number="3"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block> + <fo:table table-layout="fixed" width="100%" margin-top="50px" margin-left="8px"> + <fo:table-column column-width="1in"/> + <fo:table-column column-width="1in"/> + <fo:table-column column-width="1in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block font-size="10px" margin-left="5px">${uiLabelMap.AccountingPreparedBy}</fo:block></fo:table-cell> + <fo:table-cell><fo:block ><fo:leader leader-pattern="dots" leader-length="3cm"/></fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block> + <fo:table table-layout="fixed" width="100%" margin-top="50px" margin-left="8px"> + <fo:table-column column-width="1in"/> + <fo:table-column column-width="1in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block font-size="10px" text-align="right">${uiLabelMap.AccountingApprovedBy}</fo:block></fo:table-cell> + <fo:table-cell><fo:block ><fo:leader leader-pattern="dots" leader-length="3cm"/></fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block> + <fo:table table-layout="fixed" width="100%" margin-top="50px" margin-left="8px"> + <fo:table-column column-width="1in"/> + <fo:table-column column-width="1in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block font-size="10px" text-align="right">${uiLabelMap.AccountingReceivedBy}</fo:block></fo:table-cell> + <fo:table-cell><fo:block ><fo:leader leader-pattern="dots" leader-length="3cm"/></fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block> + <fo:table table-layout="fixed" width="100%" margin-top="50px" margin-left="8px"> + <fo:table-column column-width="1in"/> + <fo:table-column column-width="1in"/> + <fo:table-column column-width="1in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block font-size="10px" text-align="right">${uiLabelMap.CommonDate}</fo:block></fo:table-cell> + <fo:table-cell><fo:block ><fo:leader leader-pattern="dots" leader-length="3cm"/></fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block> + <fo:table table-layout="fixed" width="100%" margin-top="50px" margin-left="8px"> + <fo:table-column column-width="1in"/> + <fo:table-column column-width="1in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block font-size="10px" text-align="right">${uiLabelMap.CommonDate}</fo:block></fo:table-cell> + <fo:table-cell><fo:block ><fo:leader leader-pattern="dots" leader-length="3cm"/></fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block> + <fo:table table-layout="fixed" width="100%" margin-top="50px" margin-left="8px"> + <fo:table-column column-width="1in"/> + <fo:table-column column-width="1in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell><fo:block font-size="10px" text-align="right">${uiLabelMap.CommonDate}</fo:block></fo:table-cell> + <fo:table-cell><fo:block ><fo:leader leader-pattern="dots" leader-length="3cm"/></fo:block></fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> +</#escape> \ No newline at end of file Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/widget/PaymentScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/widget/PaymentScreens.xml?rev=1801359&r1=1801358&r2=1801359&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/widget/PaymentScreens.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/widget/PaymentScreens.xml Sun Jul 9 09:28:35 2017 @@ -498,11 +498,11 @@ under the License. <actions> <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/> <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> - <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/InvoiceAcctgTransEntryParameters.groovy"/> + <script location="component://accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy"/> </actions> <widgets> <platform-specific> - <xsl-fo><html-template location="component://accounting/webapp/accounting/payment/InvoiceAcctgTransEntry.fo.ftl"/></xsl-fo> + <xsl-fo><html-template location="component://accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl"/></xsl-fo> </platform-specific> </widgets> </section> |
Free forum by Nabble | Edit this page |