}
/**
- * 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);
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) {
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}" />