Here is the Webapplica CONTRIBUTION for OFBiz Financials module.
Create a check register report that showed check number, payment id,
payment date, payment amount, party paid to, reference number, gl account
with begin and ending report parameters.
Here are the needed ftl files: all the files are in the hot-deploy/financials root folder
folder: webapp/financials/includes/
findChecks.ftl - The freemarker code for the report parameters
ListChecksTabBar.ftl - the freemarker code for a tab bar for the filter page of the report
folder: webapp/financials/payables/
payables.ftl - the main page of the payables screen (add a link to the report)
CODE: <li class="tabletext"><a href="<@ofbizUrl>findChecks</@ofbizUrl>">${uiLabelMap.FinancialsCheckRegister}</a>
PrintCheckList.fo.ftl - The fo template for the check register report
printPaymentApplicationsListChecks.fo.ftl - The fo template for the payment applications used on the check register
folder: webapp/WEB_INF/
controller.xml - add these lines:
<request-map uri="printCheckList">
<security https="true" auth="true"/>
<response name="success" type="view" value="PrintCheckList"/>
</request-map>
<request-map uri="findChecks">
<security https="true" auth="true"/>
<response name="success" type="view" value="findChecks"/>
<response name="error" type="view" value="findChecks"/>
</request-map>
<view-map name="PrintCheckList" type="screenfop" page="component://financials/widget/financials/screens/payables/PayablesScreens.xml#PrintCheckList" content-type="application/pdf"/>
<view-map name="findChecks" type="screen" page="component://financials/widget/financials/screens/payables/PayablesScreens.xml#FindChecks"/>
folder: webapp/WEB_INF/actions
includes/findChecks.bsh - the bsh script for the report filter page
payables/printCheckList.bsh - the bsh script to create the check list used in the report
folder: widget/financials/forms/payables
PayablesForm.xml - Add these lines:
<form name="ListChecks" type="multi" list-name="checkList" title="${uiLabelMap.FinancialsOutstandingChecks}" paginate-target="${paginateSortTarget}"
paginate-size-field="checksSize" paginate-index-field="checksIndex"
default-title-style="boxhead" default-tooltip-style="tabletext" default-widget-style="tabletext" header-row-style="boxtop"
default-table-style="listTable" even-row-style="viewManyTR2" odd-row-style="viewManyTR1" separate-columns="true" >
<field name="paymentId" widget-style="buttontext">
<hyperlink target="viewPayment?paymentId=${paymentId}" description="${paymentId}"/>
</field>
<field name="paymentMethodTypeId" title="${uiLabelMap.AccountingPaymentMethodType}">
<display-entity description="${description} (${paymentMethodTypeId})" entity-name="PaymentMethodType"/>
</field>
<field name="paymentRefNum" title="${uiLabelMap.FinancialsPaymentRefNum}"><display/></field>
<field name="effectiveDate"><display /></field>
<field name="statusId" title="${uiLabelMap.FinancialsStatusId}" widget-style="tabletext">
<display-entity entity-name="StatusItem"/>
</field>
<field name="partyIdTo" title="${uiLabelMap.FinancialsPayToParty}">
<display-entity description="${firstName} ${middleName} ${lastName} ${groupName}" entity-name="PartyNameView" key-field-name="partyId"/>
</field>
<field name="amount" widget-area-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field>
</form>
folder: widget/financials/screens/payables
PayablesScreens.xml - Add these lines:
<screen name="FindChecks">
<section>
<actions>
<set field="title" value="${uiLabelMap.FinancialsCheckRegister}"/>
<set field="organizationPartyId" from-field="parameters.organizationPartyId" />
<property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD" />
<script location="component://financials/webapp/financials/WEB-INF/actions/includes/findChecks.bsh"/>
<set field="headerItem" from-field="parameters.headerItem"/>
<set field="partyId" from-field="parameters.headerItem"/>
<set field="paginateSortTarget" value="findChecks"/>
<script location="component://financials/webapp/financials/WEB-INF/actions/includes/pagination.bsh"/>
</actions>
<widgets>
<decorator-screen name="main-section-decorator">
<decorator-section name="section-body">
<container style="screenlet">
<platform-specific>
<html><html-template location="component://financials/webapp/financials/includes/ListChecksTabBar.ftl"/></html>
</platform-specific>
<platform-specific><html>
<html-template location="component://financials/webapp/financials/reports/findChecks.ftl"/></html>
</platform-specific>
</container>
<include-form name="ListChecks" location="component://financials/widget/financials/forms/payables/PayablesForm.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="PrintCheckList">
<section>
<actions>
<!-- pass in paymentId to print one check, otherwise use multi form input -->
<set field="paymentId" from-field="parameters.paymentId" />
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="FinancialsUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
<script location="component://financials/webapp/financials/WEB-INF/actions/payables/printCheckList.bsh"/>
</actions>
<widgets>
<platform-specific>
<html><html-template location="component://financials/webapp/financials/payables/PrintCheckList.fo.ftl"/></html>
</platform-specific>
</widgets>
</section>
</screen>
All the needed files were attached on this post
Best Regards
Jackson da Cruz
Webapplica Inc. Team
Zip File with needed files
Logged In: YES
user_id=1326275
Originator: NO
Hi Jackson, SF mangled these lines a lot. I was wondering if you could attach a zip of either the entire component so I can make a diff, or could you make a diff using svn diff? That would be very useful. :)