Skip to content

Commit

Permalink
10593 iou should support for supplier payments (#10608)
Browse files Browse the repository at this point in the history
  • Loading branch information
buddhika75 authored Feb 18, 2025
1 parent 01da623 commit 98e65c4
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 18 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/divudi/bean/common/EnumController.java
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,15 @@ public PaymentMethod[] getPaymentMethodsWithoutCredit() {
PaymentMethod.ewallet};
return p;
}

public PaymentMethod[] getPaymentMethodsForSupplierPayments() {
PaymentMethod[] p = {PaymentMethod.Cash,
PaymentMethod.Card,
PaymentMethod.Cheque,
PaymentMethod.Slip,
PaymentMethod.IOU};
return p;
}

public PaymentMethod[] getPaymentMethodsForIwardDeposit() {
PaymentMethod[] p = {PaymentMethod.Cash,
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/divudi/entity/Payment.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ public class Payment implements Serializable, RetirableEntity {
private Institution fromInstitution;
@ManyToOne
private Institution toInstitution;

private Staff toStaff;



public Payment() {
cashbookEntryStated = false;
Expand Down Expand Up @@ -956,4 +960,12 @@ public void setCreditCompany(Institution creditCompany) {
this.creditCompany = creditCompany;
}

public Staff getToStaff() {
return toStaff;
}

public void setToStaff(Staff toStaff) {
this.toStaff = toStaff;
}

}
6 changes: 6 additions & 0 deletions src/main/java/com/divudi/service/PaymentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ private void populatePaymentDetails(Payment payment, PaymentMethod paymentMethod
payment.setPaidValue(paymentMethodData.getStaffCredit().getTotalValue());
payment.setComments(paymentMethodData.getStaffCredit().getComment());
break;
case IOU:
payment.setReferenceNo(paymentMethodData.getIou().getReferenceNo());
payment.setChequeDate(paymentMethodData.getIou().getDate());
payment.setToStaff(paymentMethodData.getIou().getToStaff());
payment.setComments(paymentMethodData.getIou().getComment());
break;
default:
break;
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/META-INF/.LCKpersistence.xml~

This file was deleted.

15 changes: 10 additions & 5 deletions src/main/webapp/dealerPayment/dealor_due.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -179,20 +179,25 @@
</f:facet>
</p:column>

<p:column headerText="Actions" >
<p:column headerText="Actions" >
<p:commandButton
value="View"
title="View"
icon="fa fa-eye"
styleClass="ui-button-secondary mx-1"
action="#{supplierPaymentController.navigateToViewProcurementBill(b)}"
ajax="false" >
ajax="false">
</p:commandButton>
<p:commandButton
value="Pay"
title="Pay"
icon="fa fa-money-bill-wave"
styleClass="ui-button-success mx-1"
action="#{supplierPaymentController.navigateToStartSupplierPayment(b)}"
ajax="false"
disabled="#{b.referenceBill.billTypeAtomic eq 'SUPPLIER_PAYMENT' or b.paidAmount ne 0.0}" >
disabled="#{b.referenceBill.billTypeAtomic eq 'SUPPLIER_PAYMENT' or b.paidAmount ne 0.0}">
</p:commandButton>



</p:column>
</p:dataTable>

Expand Down
22 changes: 15 additions & 7 deletions src/main/webapp/dealerPayment/pay_supplier.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,34 @@

<h:outputLabel value="Payment Method" />
<p:selectOneMenu id="cmbPs" value="#{supplierPaymentController.current.paymentMethod}">
<f:selectItems value="#{enumController.paymentMethodsWithoutCredit}" />
<f:selectItems value="#{enumController.paymentMethodsForSupplierPayments}" />
<p:ajax
process="cmbPs"
update="gpPaymentMethodDetails"
event="change" />
</p:selectOneMenu>

<h:outputLabel value="Payment Details" />


<h:panelGroup id="gpPaymentMethodDetails" >
<h:panelGroup id="creditCard" style="display: #{supplierPaymentController.current.paymentMethod ne 'Card' ? 'none' : 'block'} ; ">
<pa:creditCardDetailsAsOnlyPayment paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
<h:panelGroup id="creditCard" rendered="#{supplierPaymentController.current.paymentMethod eq 'Card'}">
<pa:creditCard paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
</h:panelGroup>

<h:panelGroup id="cheque" rendered="#{supplierPaymentController.current.paymentMethod eq 'Cheque'}" >
<pa:cheque paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
</h:panelGroup>

<h:panelGroup id="cheque" style="display: #{supplierPaymentController.current.paymentMethod ne 'Cheque' ? 'none' : 'block'} ; " >
<pa:chequeDetailsAsOnlyPayment paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
<h:panelGroup id="slip" rendered="#{supplierPaymentController.current.paymentMethod eq 'Slip'}">
<pa:slip paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
</h:panelGroup>

<h:panelGroup id="slip" style="display: #{supplierPaymentController.current.paymentMethod ne 'Slip' ? 'none' : 'block'} ;">
<pa:slipDetailsAsOnlyPayment paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>

<h:panelGroup id="iou" rendered="#{supplierPaymentController.current.paymentMethod eq 'IOU'}">
<pa:iou valueRequired="false" paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
</h:panelGroup>

</h:panelGroup>


Expand Down
14 changes: 10 additions & 4 deletions src/main/webapp/dealerPayment/settle_supplier_payment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<h:outputLabel value="Payment Method" />
<p:selectOneMenu id="cmbPs" value="#{supplierPaymentController.current.paymentMethod}">
<f:selectItems value="#{enumController.paymentMethodsWithoutCredit}" />
<f:selectItems value="#{enumController.paymentMethodsForSupplierPayments}" />
<p:ajax
process="cmbPs"
update="gpPaymentMethodDetails"
Expand All @@ -44,17 +44,23 @@

<h:outputLabel value="Payment Details" />
<h:panelGroup id="gpPaymentMethodDetails" >
<h:panelGroup id="creditCard" style="display: #{supplierPaymentController.current.paymentMethod ne 'Card' ? 'none' : 'block'} ; ">
<h:panelGroup id="creditCard" rendered="#{supplierPaymentController.current.paymentMethod eq 'Card'}">
<pa:creditCard paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
</h:panelGroup>

<h:panelGroup id="cheque" style="display: #{supplierPaymentController.current.paymentMethod ne 'Cheque' ? 'none' : 'block'} ; " >
<h:panelGroup id="cheque" rendered="#{supplierPaymentController.current.paymentMethod eq 'Cheque'}" >
<pa:cheque paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
</h:panelGroup>

<h:panelGroup id="slip" style="display: #{supplierPaymentController.current.paymentMethod ne 'Slip' ? 'none' : 'block'} ;">
<h:panelGroup id="slip" rendered="#{supplierPaymentController.current.paymentMethod eq 'Slip'}">
<pa:slip paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
</h:panelGroup>


<h:panelGroup id="iou" rendered="#{supplierPaymentController.current.paymentMethod eq 'IOU'}">
<pa:iou valueRequired="false" paymentMethodData="#{supplierPaymentController.paymentMethodData}"/>
</h:panelGroup>

</h:panelGroup>

<p:outputLabel value="Total" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
Expand Down
61 changes: 61 additions & 0 deletions src/main/webapp/resources/paymentMethod/iou.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:cc="http://xmlns.jcp.org/jsf/composite"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">

<!-- INTERFACE -->
<cc:interface>
<cc:attribute name="paymentMethodData" type="com.divudi.data.dataStructure.PaymentMethodData" />
<cc:attribute name="valueRequired" type="boolean" default="true"/>
</cc:interface>

<!-- IMPLEMENTATION -->
<cc:implementation>

<h:panelGrid columns="2" class="w-100">
<h:panelGroup rendered="#{cc.attrs.valueRequired}" class="" layout="block" >
<h:outputLabel value="Value" ></h:outputLabel>
</h:panelGroup>
<h:panelGroup rendered="#{cc.attrs.valueRequired}" class="" layout="block" >
<p:inputText
autocomplete="off"
onfocus="this.select();"
value="#{cc.attrs.paymentMethodData.slip.totalValue}"
style="width: 6em;"
id="txtVal" >
<p:ajax process="@this" ></p:ajax>
<f:convertNumber pattern="#,##0.00" />
</p:inputText>
</h:panelGroup>
<h:outputLabel value="Staff" ></h:outputLabel>
<p:autoComplete forceSelection="true" id="staff"
value="#{cc.attrs.paymentMethodData.iou.toStaff}"
completeMethod="#{staffController.completeStaff}"
var="mys" class="w-100" inputStyleClass="w-100"
itemLabel="#{mys.person.nameWithTitle}"
itemValue="#{mys}"
>
</p:autoComplete>

<h:outputLabel value="Date" ></h:outputLabel>
<p:calendar
value="#{cc.attrs.paymentMethodData.iou.date}"
placeholder="Select date" pattern="#{sessionController.applicationPreference.longDateFormat}" id="date">
<p:ajax process="@this" ></p:ajax>
</p:calendar>

<h:outputLabel value="Referance" ></h:outputLabel>
<p:inputText value="#{cc.attrs.paymentMethodData.iou.referenceNo}"
placeholder="Referance No" class="w-100" ></p:inputText>

<h:outputLabel value="Comments" ></h:outputLabel>
<p:inputTextarea value="#{cc.attrs.paymentMethodData.iou.comment}" placeholder="Comments" class="w-100" ></p:inputTextarea>

</h:panelGrid>


</cc:implementation>
</html>

0 comments on commit 98e65c4

Please sign in to comment.