]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Don't cherry-pick:
authorRoland Häder <roland@mxchange.org>
Mon, 1 Jun 2020 13:37:44 +0000 (15:37 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 1 Jun 2020 13:37:44 +0000 (15:37 +0200)
- renderReceipt() does now require a second parameter showReceiptPaymentType
  which can be used to include or exclude the payment type in views. For all
  selection boxes, this feature has been disabled (in views) or else the
  selection box becomes very wide

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/beans/helper/receipt/FinancialsWebViewReceiptHelperBean.java
web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl
web/admin/financial/receipt_item/admin_receipt_item_list.xhtml

index 8f6e12285f0ff5b71ca593acf6cc64d4546121f7..fa5d40843ca570ef8c2548109bdafe6c8ddc9c84 100644 (file)
@@ -45,13 +45,15 @@ public class FinancialsWebViewReceiptHelperBean extends BaseFinancialsBean imple
        }
 
        /**
-        * Returns the receipt number and more. If null is provided, an empty string is returned.
+        * Returns the receipt number and more. If null is provided, an empty string
+        * is returned.
         * <p>
-        * @param receipt Receipt instance
+        * @param receipt                Receipt instance
+        * @param showReceiptPaymentType Whether the payment type should be shown
         * <p>
         * @return Receipt number and more
         */
-       public String renderReceipt (final BillableReceipt receipt) {
+       public String renderReceipt (final BillableReceipt receipt, final Boolean showReceiptPaymentType) {
                // Default is empty string, so let's get started
                final StringBuilder sb = new StringBuilder(50);
 
@@ -59,9 +61,14 @@ public class FinancialsWebViewReceiptHelperBean extends BaseFinancialsBean imple
                if (receipt instanceof BillableReceipt) {
                        // Add relevant data
                        sb.append(this.getMessageFromBundle("RECEIPT_ISSUED")).append(" "); //NOI18N
-                       sb.append(DateFormat.getInstance().format(receipt.getReceiptIssued())).append(", "); //NOI18N
-                       sb.append(this.getMessageFromBundle("PAYMENT_TYPE")).append(" "); //NOI18N
-                       sb.append(this.getMessageFromBundle(receipt.getReceiptPaymentType().getMessageKey()));
+                       sb.append(DateFormat.getInstance().format(receipt.getReceiptIssued()));
+
+                       // Is payment type to be shown?
+                       if (showReceiptPaymentType) {
+                               // Add payment type
+                               sb.append(", ").append(this.getMessageFromBundle("PAYMENT_TYPE")).append(" "); //NOI18N
+                               sb.append(this.getMessageFromBundle(receipt.getReceiptPaymentType().getMessageKey()));
+                       }
 
                        // Is receipt number included?
                        if (receipt.getReceiptNumber() != null) {
index 2f4e8eec5aa33a0c13e876e83932f48a4a84454d..e2905d42fbee67e973dd82c75c032426180497f9 100644 (file)
                                        value="#{receiptListController.allReceipts}"
                                        var="receipt"
                                        itemValue="#{receipt}"
-                                       itemLabel="#{receiptBeanHelper.renderReceipt(receipt)}"
+                                       itemLabel="#{receiptBeanHelper.renderReceipt(receipt, false)}"
                                        />
                        </p:selectOneMenu>
 
index 546c4669565cb44f1d837d9e4222cb791834b0e9..9e32401ea617965abb92e6d8541899433a89e940 100644 (file)
                                                                value="#{receiptListController.allReceipts}"
                                                                var="receipt"
                                                                itemValue="#{receipt}"
-                                                               itemLabel="#{receiptBeanHelper.renderReceipt(receipt)}"
+                                                               itemLabel="#{receiptBeanHelper.renderReceipt(receipt, false)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
                                        <p:link
                                                outcome="admin_show_receipt"
-                                               value="#{receiptBeanHelper.renderReceipt(receiptItem.itemReceipt)}"
+                                               value="#{receiptBeanHelper.renderReceipt(receiptItem.itemReceipt, false)}"
                                                title="#{project.ADMIN_LINK_SHOW_RECEIPT_TITLE}"
                                                >
                                                <f:param name="receiptId" value="#{receiptItem.itemReceipt.receiptId}" />
                                                <p:outputLabel value="#{product.GENERIC_PRODUCT_I18N_KEY_HEADER}" title="#{product.GENERIC_PRODUCT_I18N_KEY_TITLE}" />
                                                <p:link
                                                        outcome="admin_show_generic_product"
-                                                       value="#{local[receiptItemListController.selectedReceiptItem.itemProduct.productI18nKey]}"
+                                                       value="#{productBeanHelper.renderGenericProduct(receiptItemListController.selectedReceiptItem.itemProduct)}"
                                                        title="#{project.ADMIN_LINK_SHOW_RECEIPT_ITEM_PRODUCT_TITLE}"
                                                        >
                                                        <f:param name="productId" value="#{receiptItemListController.selectedReceiptItem.itemProduct.productId}" />
                                                        title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
                                                        rendered="#{not empty receiptItemListController.selectedReceiptItem.itemManufacturer}"
                                                        >
-                                                       <h:outputFormat value="#{msg.BASIC_DATA_LINK_MASK}">
-                                                               <f:param value="#{receiptItemListController.selectedReceiptItem.itemManufacturer.companyName}" />
-                                                               <f:param value="#{receiptItemListController.selectedReceiptItem.itemManufacturer.basicDataId}" />
-                                                       </h:outputFormat>
-                                                       <f:param name="basicDataId" value="#{receiptItemListController.selectedReceiptItem.itemManufacturer.basicDataId}" />
+                                                       <h:outputText value="#{beanHelper.renderBasicData(receiptItemListController.selectedReceiptItem.itemManufacturer, false, true)}" />
                                                </p:link>
                                                <h:outputText value="#{project.RECEIPT_ITEM_HAS_NO_MANUFACTURER_ASSIGNED}" rendered="#{empty receiptItemListController.selectedReceiptItem.itemManufacturer}" />
 
                                                <p:outputLabel value="#{project.ASSIGNED_RECEIPT_HEADER}" title="#{project.RECEIPT_ITEM_ASSIGNED_RECEIPT_TITLE}" />
                                                <p:link
                                                        outcome="admin_show_receipt"
-                                                       value="#{receiptBeanHelper.renderReceipt(receiptItemListController.selectedReceiptItem.itemReceipt)}"
+                                                       value="#{receiptBeanHelper.renderReceipt(receiptItemListController.selectedReceiptItem.itemReceipt, true)}"
                                                        title="#{project.ADMIN_LINK_SHOW_RECEIPT_TITLE}"
                                                        >
                                                        <f:param name="receiptId" value="#{receiptItemListController.selectedReceiptItem.itemReceipt.receiptId}" />