Skip to content

Commit

Permalink
New changes to coop staging application (#10472)
Browse files Browse the repository at this point in the history
* 9681 improvements in supplier payment management (#10385)

* Hotfix multiple payment not display and not update in pharmacy income report (#10394)

* 10388 opd credit cogs report   wireframe (#10395)

* 10390 bht issue cogs report   wireframe (#10396)

* bugfixes (#10405)

* 9752 there must be facility to enable label printing (#10399)

* 10392 opd sale cogs report   wireframe (#10406)

* 10260 after grn is canceled it must be removed from the suppler payment list (#10407)

* Issue#10373 Improvements in BHT Pharmacy Issue Report (#10424)

* Create development_pr_validation.yml

* Update development_pr_validation.yml (#10427)

* Gs mgeeth patch 1 (#10428)

* Update development_pr_validation.yml

* Update development_pr_validation.yml

* Update development_pr_validation.yml (#10429)

* Update .gitignore

* 9679 need grn details for supplier payment voucher (#10408)

* Coop test (#10442)

* Closes #10386 (#10443)

* fact: add expense section to direct purchase and update bill with net total

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* fact:improve purchase bill adding expenses and ui improvements.

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Closes #10116
Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Closes #10187
Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Closes #10176

* add department wise filter for inward pharmacy issue summery

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Closes #10191
Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Update mp_prod_ci_cd.yml

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* fix: pharmacy tranfer bill improvement done.

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Payment Approval Basics Completed

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #10291
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #10259

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #10259

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* GRN No, Invoice No added
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #9986
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #9939
Also adds Supplier Payment Preperation Bill

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #10334
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #7830
now can search supplier credit bills
Make sure you select the option "Approveal necessary is required for Supplier Payments" as false
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #10337
But need to fix pharmacy summery reports, cashier summary as seperate issues

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #3832

For Institutions where GRN payment approval is NOT necessary
(Make the configuration)

Payments Menu > SUpplier Payment > Settle Bills by SUpplier

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Improved supplier payment management where Approval is necessary
Need to improve UIs, navigations,
have to check GRN Returns, not checked
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #9681
Improved supplier payment management where Approval is necessary
Need to improve UIs, navigations,
have to check GRN Returns, not checked
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #9681
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Closes #10260
Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Closes #9676

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Closes #9679
Signed-off-by: Dr M H B Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #10386
New report is filtered by the admission type
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

---------

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>
Signed-off-by: Dr M H B Ariyaratne <[email protected]>
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>
Co-authored-by: Chinthaka Prasad Wijerathna <[email protected]>
Co-authored-by: Geeth Sandaru Madhushan <[email protected]>

* Closes #10387 (#10444)

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>
Co-authored-by: Geeth Sandaru Madhushan <[email protected]>

* 10397 improvements in pharmacy transfer issue report (#10455)

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Issue#9847 Inward Payment by Company (#10456)

* Added New View For Credit Company Payments

Signed-off-by: Lawan Samarasekara <[email protected]>

* Added Fetch Method to get Credit Company Payment Bill

Signed-off-by: Lawan Samarasekara <[email protected]>

* Added New Methods to Facilitate New Credit Company Payments

Signed-off-by: Lawan Samarasekara <[email protected]>

* Fixed #9847
Signed-off-by: Lawan Samarasekara <[email protected]>

---------

Signed-off-by: Lawan Samarasekara <[email protected]>
Co-authored-by: Geeth Sandaru Madhushan <[email protected]>

* Fixed #10404 (#10457)

* 10257 only bills related to the login department should be displayed in search inpatient direct issue by bill item (#10448)

* fix:only show logged department bill items when search inpatient direct issues by bill item

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

---------

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>
Co-authored-by: Geeth Sandaru Madhushan <[email protected]>

---------

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>
Signed-off-by: Dr M H B Ariyaratne <[email protected]>
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>
Signed-off-by: Lawan Samarasekara <[email protected]>
Co-authored-by: Dr. M H B Ariyaratne <[email protected]>
Co-authored-by: Sandith Pivithuru <[email protected]>
Co-authored-by: Imesh Ranawella <[email protected]>
Co-authored-by: Lawan Chaamindu Jayalath Samarasekara <[email protected]>
Co-authored-by: Geeth Sandaru Madhushan <[email protected]>
  • Loading branch information
6 people authored Feb 10, 2025
1 parent 05b1d8b commit 292ec76
Show file tree
Hide file tree
Showing 14 changed files with 601 additions and 32 deletions.
34 changes: 34 additions & 0 deletions src/main/java/com/divudi/bean/common/BillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,40 @@ public List<Bill> completeOpdCreditBatchBill(String qry) {
}
return a;
}

public List<Bill> completeInwardCreditCompanyPaymentBill(String qry) {
System.out.println("completeInwardCreditCompanyPaymentBill");
List<Bill> a = null;
String jpql;
HashMap params = new HashMap();
if (qry != null) {
jpql = "select c from BilledBill c "
+ " where abs(c.netTotal)-abs(c.paidAmount)>:val "
+ " and c.billTypeAtomic in :btas "
+ " and c.paymentMethod= :pm "
+ " and c.cancelledBill is null "
+ " and c.refundedBill is null "
+ " and c.retired=false "
+ " and ((c.deptId) like :q or"
+ " (c.patient.person.name) like :q "
+ " or (c.creditCompany.name) like :q ) "
+ " order by c.creditCompany.name";
List<BillTypeAtomic> btas = new ArrayList<>();
btas.add(BillTypeAtomic.INWARD_FINAL_BILL_PAYMENT_BY_CREDIT_COMPANY);
params.put("btas", btas);
params.put("pm", PaymentMethod.Credit);
params.put("val", 0.1);
params.put("q", "%" + qry.toUpperCase() + "%");
a = getFacade().findByJpql(jpql, params);
System.out.println("jpql = " + jpql);
System.out.println("params = " + params);
System.out.println("a = " + a);
}
if (a == null) {
a = new ArrayList<>();
}
return a;
}

public List<Bill> completePharmacyCreditBill(String qry) {
List<Bill> a = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,12 @@ public void addToBill() {
if (errorCheckForAdding()) {
return;
}
if (getCurrent().getCreditCompany() == null){
getCurrent().setCreditCompany(getCurrentBillItem().getReferenceBill().getCreditCompany());
}
getCurrent().setFromInstitution(getCurrentBillItem().getReferenceBill().getCreditCompany());
getCurrentBillItem().setBill(getCurrentBillItem().getReferenceBill());
getCurrentBillItem().setPatientEncounter(getCurrentBillItem().getReferenceBill().getPatientEncounter());
getCurrentBillItem().setSearialNo(getBillItems().size());
getSelectedBillItems().add(getCurrentBillItem());
getBillItems().add(getCurrentBillItem());
Expand Down Expand Up @@ -544,6 +549,14 @@ public void calulateTotalForSettlingCreditForOpdBatchBills() {
}
getCurrent().setNetTotal(n);
}

public void calulateTotalForSettlingCreditForInwardCreditCompanyPaymentBills() {
double n = 0.0;
for (BillItem b : selectedBillItems) {
n += b.getNetValue();
}
getCurrent().setNetTotal(n);
}

public void calTotalForVoucher() {
double n = 0.0;
Expand Down Expand Up @@ -874,6 +887,70 @@ public void settleBill() {
printPreview = true;

}

public void settleCreditForInwardCreditCompanyPaymentBills() {
if (getSelectedBillItems().isEmpty()) {
JsfUtil.addErrorMessage("No Bill Item ");
return;
}
if (getCurrent().getFromInstitution() == null) {
JsfUtil.addErrorMessage("Select Credit Company");
return;
}
for (BillItem item : getBillItems()) {
if (!Objects.equals(item.getReferenceBill().getCreditCompany().getId(), getCurrent().getFromInstitution().getId())) {
JsfUtil.addErrorMessage("All Bills Settling Should be from a one single company.");
return;
}
}
if (getCurrent().getPaymentMethod() == null) {
return;
}
if (getPaymentSchemeController().checkPaymentMethodError(getCurrent().getPaymentMethod(), getPaymentMethodData())) {
return;
}
String deptId = billNumberBean.departmentBillNumberGeneratorYearly(sessionController.getDepartment(), BillTypeAtomic.INPATIENT_CREDIT_COMPANY_PAYMENT_RECEIVED);
calulateTotalForSettlingCreditForInwardCreditCompanyPaymentBills();
getBillBean().setPaymentMethodData(getCurrent(), getCurrent().getPaymentMethod(), getPaymentMethodData());
getCurrent().setTotal(getCurrent().getNetTotal());
getCurrent().setInsId(deptId);
getCurrent().setDeptId(deptId);
getCurrent().setBillType(BillType.CashRecieveBill);
getCurrent().setBillTypeAtomic(BillTypeAtomic.INPATIENT_CREDIT_COMPANY_PAYMENT_RECEIVED);
getCurrent().setDepartment(getSessionController().getLoggedUser().getDepartment());
getCurrent().setInstitution(getSessionController().getLoggedUser().getDepartment().getInstitution());
getCurrent().setComments(comment);
getCurrent().setBillDate(new Date());
getCurrent().setBillTime(new Date());
getCurrent().setCreatedAt(new Date());
getCurrent().setCreater(getSessionController().getLoggedUser());
getCurrent().setNetTotal(getCurrent().getNetTotal());
if (getCurrent().getId() == null) {
getBillFacade().create(getCurrent());
} else {
getBillFacade().edit(getCurrent());
}

updateReferanceBills();

for (BillItem savingBillItem : getBillItems()) {
savingBillItem.setCreatedAt(new Date());
savingBillItem.setCreater(getSessionController().getLoggedUser());
savingBillItem.setBill(getCurrent());
savingBillItem.setGrossValue(savingBillItem.getNetValue());
getCurrent().getBillItems().add(savingBillItem);
if (savingBillItem.getId() == null) {
getBillItemFacade().create(savingBillItem);
} else {
getBillItemFacade().edit(savingBillItem);
}
getBillBean().updateInwardDipositList(savingBillItem.getPatientEncounter(), getCurrent());
updateReferenceBht(savingBillItem);
}
paymentService.createPayment(current, getPaymentMethodData());
JsfUtil.addSuccessMessage("Bill Saved");
printPreview = true;
}

public void settleBillViaVoucher() {
Date startTime = new Date();
Expand Down Expand Up @@ -1067,11 +1144,11 @@ public void settleBillBht() {
}

public void updateReferanceBills(){
for(BillItem b : getSelectedBillItems()){
b.getBill().setPaid(true);
b.getBill().setPaidAmount(b.getNetValue());
b.getBill().setPaidBill(getCurrent());
billFacade.edit(b.getBill());
for(BillItem b : getBillItems()){
b.getReferenceBill().setPaid(true);
b.getReferenceBill().setPaidAmount(b.getReferenceBill().getPaidAmount() + b.getNetValue());
b.getReferenceBill().setPaidBill(getCurrent());
billFacade.edit(b.getReferenceBill());
}
}

Expand Down Expand Up @@ -1332,8 +1409,8 @@ private void updateSettlingCreditBillSettledValues(BillItem billItemWithReferanc
private void updateReferenceBht(BillItem tmp) {
double dbl = getCreditBean().getPaidAmount(tmp.getPatientEncounter(), BillType.CashRecieveBill);

tmp.getPatientEncounter().setCreditPaidAmount(0 - dbl);
getPatientEncounterFacade().edit(tmp.getPatientEncounter());
tmp.getReferenceBill().getPatientEncounter().setCreditPaidAmount(0 - dbl);
getPatientEncounterFacade().edit(tmp.getReferenceBill().getPatientEncounter());
}

// private void updateReferenceBill(BillItem tmp) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/divudi/bean/common/PatientController.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import com.divudi.entity.CancelledBill;
import com.divudi.entity.Department;
import com.divudi.entity.PatientDeposit;
import com.divudi.entity.inward.PatientRoom;
import com.divudi.java.CommonFunctions;
import com.google.protobuf.Descriptors;
import java.io.ByteArrayInputStream;
Expand Down Expand Up @@ -855,6 +856,7 @@ public String navigatePatientAdmit() {
admissionController.setCurrent(ad);
admissionController.setPrintPreview(false);
admissionController.setAdmittingProcessStarted(false);
admissionController.setPatientRoom(new PatientRoom());
return "/inward/inward_admission?faces-redirect=true;";

}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/divudi/bean/common/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4534,12 +4534,18 @@ public void createBillItemTableBht(BillType btp) {
m.put("bType", btp);
m.put("ins", getSessionController().getInstitution());
m.put("class", PreBill.class);


sql = "select bi from BillItem bi"
+ " where type(bi.bill)=:class "
+ " and bi.bill.institution=:ins"
+ " and bi.bill.billType=:bType and "
+ " bi.createdAt between :fromDate and :toDate ";

if (getSearchKeyword().getFrmDepartment() != null) {
sql += " and bi.bill.department=:dep";
m.put("dep", getSearchKeyword().getFrmDepartment());
}

if (getSearchKeyword().getPatientName() != null && !getSearchKeyword().getPatientName().trim().equals("")) {
sql += " and ((bi.bill.patient.person.name) like :patientName )";
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/divudi/bean/pharmacy/ReportsTransfer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,15 @@ public void fillDepartmentTransfersRecieveByBill() {

jpql.append(" order by b.id");
transferBills = getBillFacade().findByJpql(jpql.toString(), params, TemporalType.TIMESTAMP);

totalsValue = 0.0;
discountsValue = 0.0;
netTotalValues = 0.0;
for (Bill b : transferBills) {
totalsValue = totalsValue + (b.getTotal());
discountsValue = discountsValue + b.getDiscount();
netTotalValues = netTotalValues + b.getNetTotal();
}
}

public void fillTheaterTransfersReceiveWithBHTIssue() {
Expand Down
Loading

0 comments on commit 292ec76

Please sign in to comment.