Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10111 retail sale medicine search optimization #10113

Merged
merged 88 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
adf2d93
Signed-off-by: Dr M H B Ariyaratne <[email protected]>
buddhika75 Jan 6, 2025
0a65a43
9964 staff welfare bug fixes
imexh Jan 7, 2025
7c7b59b
Merge branch 'support_mobitel_sms_middleware_to_send_sms_#9970' into …
buddhika75 Jan 8, 2025
4830098
Signed-off-by: Isuru Ranaweera <[email protected]>
IsuruUdaraRanaweera Jan 9, 2025
574aa75
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
IsuruUdaraRanaweera Jan 9, 2025
8c1aa9d
Signed-off-by: Isuru Ranaweera <[email protected]>
IsuruUdaraRanaweera Jan 9, 2025
4544d67
Signed-off-by: Pubudu-Piyankara <[email protected]>
Pubudu-Piyankara Jan 9, 2025
399e305
Closed #10050
Pubudu-Piyankara Jan 9, 2025
aeed73e
Signed-off-by: Pubudu-Piyankara <[email protected]>
Pubudu-Piyankara Jan 9, 2025
5b554ee
Merge branch '10003-collection-cente-bill-wise-detail-report-bugs' of…
Pubudu-Piyankara Jan 9, 2025
5baa186
Signed-off-by: Pubudu-Piyankara <[email protected]>
Pubudu-Piyankara Jan 9, 2025
0b270d5
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
Pubudu-Piyankara Jan 9, 2025
2ae518e
Signed-off-by: Pubudu-Piyankara <[email protected]>
Pubudu-Piyankara Jan 9, 2025
34025da
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
Pubudu-Piyankara Jan 9, 2025
6bfebab
Closed #10036
Pubudu-Piyankara Jan 9, 2025
9fc821f
Signed-off-by: DamithDeshan <[email protected]>
DamithDeshan Jan 10, 2025
2d370b0
Merge branch 'Issue#10013-Bug_Fix_on_OPD_Card_Can't_Add_Drug' of http…
DamithDeshan Jan 10, 2025
06cc404
closes #10062
DamithDeshan Jan 10, 2025
3a82226
Signed-off-by: DamithDeshan <[email protected]>
DamithDeshan Jan 10, 2025
823f5e8
Signed-off-by: Dr M H B Ariyaratne <[email protected]>
buddhika75 Jan 10, 2025
27d56d0
Merge branch 'coop-prod' of https://github.com/hmislk/hmis.git into 1…
buddhika75 Jan 10, 2025
3df6d2f
Merge branch '10027-export-amp-list' into 10064-refunds-and-cancellat…
buddhika75 Jan 10, 2025
6577c37
Merge branch 'coop-dev' of https://github.com/hmislk/hmis.git into 10…
buddhika75 Jan 10, 2025
463736a
Merge branch '#10036_Grn_report' of https://github.com/hmislk/hmis.gi…
buddhika75 Jan 10, 2025
5212ed2
Merge branch '10062_cannot_admit_opd_cards_without_room_no' of https:…
buddhika75 Jan 10, 2025
faa0e67
Merge branch 'ruhunu-dev' of https://github.com/hmislk/hmis.git into …
buddhika75 Jan 10, 2025
a06e9a5
Merge branch 'refs/heads/development' into 9964-Staff-Welfare-report-…
imexh Jan 10, 2025
7c7b693
9964 staff welfare bug fixes
imexh Jan 10, 2025
86795a4
10034 discount report bug fixes
imexh Jan 10, 2025
27c96b8
changed css file printOnly
IsuruUdaraRanaweera Jan 10, 2025
898ae18
Added a new table to print it without filter boxes
IsuruUdaraRanaweera Jan 10, 2025
514d651
10034 staff welfare report bug fixes
imexh Jan 10, 2025
88dd174
10034 discount report bug fixes
imexh Jan 10, 2025
bc1ea46
Signed-off-by: Sandith Pivithuru <[email protected]>
SandithP2001 Jan 10, 2025
40b8c7f
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
SandithP2001 Jan 10, 2025
14863ad
Signed-off-by: Sandith Pivithuru <[email protected]>
SandithP2001 Jan 10, 2025
cae02d3
Signed-off-by: Sandith Pivithuru <[email protected]>
SandithP2001 Jan 10, 2025
622c514
Signed-off-by: Sandith Pivithuru <[email protected]>
SandithP2001 Jan 10, 2025
29d6e68
Pharmacy purchase order list ui improvement.
ChinthakaPrasad Jan 10, 2025
41b7d7d
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
ChinthakaPrasad Jan 10, 2025
8685fb3
Signed-off-by: DamithDeshan <[email protected]>
DamithDeshan Jan 10, 2025
770be79
Signed-off-by: Dr M H B Ariyaratne <[email protected]>
buddhika75 Jan 10, 2025
93b32f1
Closes #10064
buddhika75 Jan 10, 2025
b939920
Signed-off-by: Dr M H B Ariyaratne <[email protected]>
buddhika75 Jan 10, 2025
8394c82
Merge branch '10064-refunds-and-cancellations-are-not-listed-in-inpat…
buddhika75 Jan 10, 2025
dd6c54b
Signed-off-by: Dr M H B Ariyaratne <[email protected]>
buddhika75 Jan 11, 2025
2ccd3a6
Merge pull request #10063
DamithDeshan Jan 11, 2025
d08d99b
closes #10079
DamithDeshan Jan 11, 2025
f7bf529
closes #10081
DamithDeshan Jan 11, 2025
300fd32
Signed-off-by: DamithDeshan <[email protected]>
DamithDeshan Jan 11, 2025
f245f97
Merge pull request #10085 from hmislk/10044-need-sqeuencial-bill-numb…
buddhika75 Jan 11, 2025
8f168ff
Merge branch '10044-need-sqeuencial-bill-numbers-for-pharmacy-direct-…
buddhika75 Jan 12, 2025
23e8407
Merge branch '10073-refunds-are-not-listed-in-inpatient-medicine-issu…
buddhika75 Jan 12, 2025
c583f52
Merge branch 'coop-dev' of https://github.com/hmislk/hmis.git into 10…
buddhika75 Jan 12, 2025
2d792ee
https://youtu.be/GDWy_tlJ2Gk
buddhika75 Jan 12, 2025
d961be7
Update rh_prod_ci_cd.yml
GSMgeeth Jan 12, 2025
9604797
Merge pull request #10090 from hmislk/10044-need-sqeuencial-bill-numb…
buddhika75 Jan 12, 2025
38553a7
Merge pull request #10091 from hmislk/10044-need-sqeuencial-bill-numb…
buddhika75 Jan 12, 2025
257d999
Merge pull request #10095 from hmislk/development
GSMgeeth Jan 12, 2025
f9d9cc3
Merge branch '10086-retail-bill-search-total-incorrect' into 10077-im…
buddhika75 Jan 12, 2025
dba6ee6
Merge branch 'coop-prod' of https://github.com/hmislk/hmis.git into 1…
buddhika75 Jan 12, 2025
1a1db2d
Signed-off-by: Dr M H B Ariyaratne <[email protected]>
buddhika75 Jan 13, 2025
3d18394
Closes #10097
buddhika75 Jan 13, 2025
b14572d
Merge branch '10088-all-cashier-summary-had-calculated-fund-bills' in…
buddhika75 Jan 13, 2025
027f76c
Merge branch '#10071_microbiology_report_in_lab_module' of https://gi…
buddhika75 Jan 13, 2025
f9b3c31
Merge branch '#10079_improving_microbiology_report_antibiotic_list_an…
buddhika75 Jan 13, 2025
6594242
Merge branch 'ruhunu-dev' of https://github.com/hmislk/hmis.git into …
buddhika75 Jan 14, 2025
e1ec6ac
Merge branch 'ruhunu-prod' of https://github.com/hmislk/hmis.git into…
buddhika75 Jan 14, 2025
c1f00df
Signed-off-by: Buddhika Ariyaratne <[email protected]>
buddhika75 Jan 14, 2025
a4251b3
Signed-off-by: Buddhika Ariyaratne <[email protected]>
buddhika75 Jan 14, 2025
6b33c09
Signed-off-by: Buddhika Ariyaratne <[email protected]>
buddhika75 Jan 14, 2025
358054b
Closes #10077
buddhika75 Jan 14, 2025
2fc2774
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
buddhika75 Jan 14, 2025
9f75c26
Closes with Production persistance.xml
buddhika75 Jan 14, 2025
36d1c24
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
ChinthakaPrasad Jan 15, 2025
dd85ec5
fix: Expenses added to the GRN payment
ChinthakaPrasad Jan 15, 2025
3eacb59
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
ChinthakaPrasad Jan 15, 2025
7a80c6e
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
buddhika75 Jan 15, 2025
a80ec3e
Merge branch '#10081_add_to_option_for_disable_developers_privilege' …
buddhika75 Jan 15, 2025
5a74a96
Merge branch '10034-Discount-Report-bugfixes' of https://github.com/h…
buddhika75 Jan 15, 2025
5868019
Merge branch '10035-slowfastnone-movement-report' of https://github.c…
buddhika75 Jan 15, 2025
1248b80
Merge branch '10052-collection-center-book-wise-detail-report-bugs' o…
buddhika75 Jan 15, 2025
fc2d0e3
Merge branch '10097-remove-type-column-and-replace-truefalse-with-yes…
buddhika75 Jan 15, 2025
2d394d6
Merge branch '6264-add-expences-for-pharmacy-direct-purchase' of http…
buddhika75 Jan 15, 2025
dce7227
Merge branch '9964-Staff-Welfare-report-bugfixes' of https://github.c…
buddhika75 Jan 15, 2025
c534ff0
Closes #10102
buddhika75 Jan 15, 2025
436e9c6
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>
buddhika75 Jan 15, 2025
c75c836
Closes #10111
buddhika75 Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2404,20 +2404,24 @@ public String navigateToCreateShiftEndSummaryBillForHandover() {
shiftPayments.stream()
.forEach(p -> p.setTransientPaymentHandover(PaymentHandover.USER_COLLECTED));
}
System.out.println("shiftPayments = " + shiftPayments);

List<Payment> shiftFloats = fetchShiftFloatsFromShiftStartToEnd(startBill, null, sessionController.getLoggedUser());
if (shiftFloats != null) {
shiftFloats.stream()
.forEach(p -> p.setTransientPaymentHandover(PaymentHandover.FLOATS));
}
System.out.println("shiftFloats = " + shiftFloats);

List<Payment> othersPayments = fetchAllPaymentInMyHold(sessionController.getLoggedUser());
List<Payment> othersPayments = fetchAllPaymentInMyHold(startBill, sessionController.getLoggedUser());
if (othersPayments != null) {
othersPayments.stream()
.forEach(p -> p.setTransientPaymentHandover(PaymentHandover.OTHER_USERS_COLLECTED_AND_HANDED_OVER));
}
System.out.println("othersPayments = " + othersPayments);

List<Payment> bankPayments = fetchBankPayments(startBill, null, sessionController.getLoggedUser());
System.out.println("bankPayments = " + bankPayments);

Set<Payment> uniquePaymentSet = new HashSet<>();
if (shiftPayments != null) {
Expand Down Expand Up @@ -2527,7 +2531,7 @@ public String navigateToHandoverCreateBillForCurrentShift() {
.forEach(p -> p.setTransientPaymentHandover(PaymentHandover.FLOATS));
}

List<Payment> othersPayments = fetchAllPaymentInMyHold(sessionController.getLoggedUser());
List<Payment> othersPayments = fetchAllPaymentInMyHold(startBill, sessionController.getLoggedUser());
if (othersPayments != null) {
othersPayments.stream()
.forEach(p -> p.setTransientPaymentHandover(PaymentHandover.OTHER_USERS_COLLECTED_AND_HANDED_OVER));
Expand Down Expand Up @@ -2580,7 +2584,7 @@ public String navigateToHandoverCreateBillForCurrentShift() {
// bundle.aggregateTotalsFromAllChildBundles();
bundle.setDenominationTransactions(denominationTransactionController.createDefaultDenominationTransaction());
bundle.sortByDateInstitutionSiteDepartmentType();

bundle.setPatientDepositsAreConsideredInHandingover(getPatientDepositsAreConsideredInHandingover());
bundle.calculateTotalsByChildBundlesForHandover();
return "/cashier/handover_start_all?faces-redirect=true";
Expand All @@ -2599,7 +2603,7 @@ public void processToHandoverCreateBillForSelectedPeriod() {

List<Payment> shiftPayments = fetchPaymentsFromShiftStartToEndByDateAndDepartment(fromDate, toDate, sessionController.getLoggedUser());
List<Payment> shiftFloats = fetchShiftFloatsFromShiftStartToEnd(fromDate, toDate, sessionController.getLoggedUser());
List<Payment> othersPayments = fetchAllPaymentInMyHold(sessionController.getLoggedUser());
List<Payment> othersPayments = fetchAllPaymentInMyHold(fromDate, toDate, sessionController.getLoggedUser());

Set<Payment> uniquePaymentSet = new HashSet<>();
if (shiftPayments != null) {
Expand Down Expand Up @@ -2654,7 +2658,7 @@ public String navigateToHandoverCreateBillForSelectedShift(Bill startBill) {
.forEach(p -> p.setTransientPaymentHandover(PaymentHandover.FLOATS));
}

List<Payment> othersPayments = fetchAllPaymentInMyHold(sessionController.getLoggedUser());
List<Payment> othersPayments = fetchAllPaymentInMyHold(startBill, sessionController.getLoggedUser());
if (othersPayments != null) {
othersPayments.stream()
.forEach(p -> p.setTransientPaymentHandover(PaymentHandover.OTHER_USERS_COLLECTED_AND_HANDED_OVER));
Expand Down Expand Up @@ -3648,7 +3652,44 @@ public List<Payment> fetchShiftFloatsFromShiftStartToEnd(
return myFloats;
}

public List<Payment> fetchAllPaymentInMyHold(WebUser wu) {
public List<Payment> fetchAllPaymentInMyHold(Bill shiftStartBill, WebUser wu) {
WebUser paymentUser = wu;
StringBuilder jpqlBuilder = new StringBuilder("SELECT p ")
.append("FROM Payment p ")
.append("JOIN p.bill b ")
.append("WHERE p.retired=:pret ")
.append("AND p.currentHolder=:cr ")
.append("AND p.retired=:bret ")
.append("AND p.cancelled=:can ")
.append("AND p.handingOverStarted=:hs ")
.append("ORDER BY p.createdAt, b.department, p.creater");
Map<String, Object> params = new HashMap<>();
params.put("cr", paymentUser);
params.put("pret", false);
params.put("bret", false);
params.put("can", false);
params.put("hs", false);
String jpql = jpqlBuilder.toString();
List<Payment> initialOtherPayments = paymentFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP);
List<Payment> finalOtherPayments = new ArrayList<>();
if (initialOtherPayments != null) {
for (Payment p : initialOtherPayments) {
if (p.getBill() == null) {
continue;
}
if (p.getBill().getBillTypeAtomic() != null && p.getBill().getBillTypeAtomic() == BillTypeAtomic.FUND_TRANSFER_RECEIVED_BILL) {
if (p.getId() > shiftStartBill.getId()) {
finalOtherPayments.add(p);
}
} else {
finalOtherPayments.add(p);
}
}
}
return finalOtherPayments;
}

public List<Payment> fetchAllPaymentInMyHold(Date paramFromDate, Date paramToDate, WebUser wu) {
WebUser paymentUser = wu;
StringBuilder jpqlBuilder = new StringBuilder("SELECT p ")
.append("FROM Payment p ")
Expand All @@ -3666,8 +3707,23 @@ public List<Payment> fetchAllPaymentInMyHold(WebUser wu) {
params.put("can", false);
params.put("hs", false);
String jpql = jpqlBuilder.toString();
List<Payment> othersPayments = paymentFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP);
return othersPayments;
List<Payment> initialOtherPayments = paymentFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP);
List<Payment> finalOtherPayments = new ArrayList<>();
if (initialOtherPayments != null) {
for (Payment p : initialOtherPayments) {
if (p.getBill() == null) {
continue;
}
if (p.getBill().getBillTypeAtomic() != null && p.getBill().getBillTypeAtomic() == BillTypeAtomic.FUND_TRANSFER_RECEIVED_BILL) {
if (p.getCreatedAt().getTime() > paramFromDate.getTime() && p.getCreatedAt().getTime() < paramToDate.getTime()) {
finalOtherPayments.add(p);
}
} else {
finalOtherPayments.add(p);
}
}
}
return finalOtherPayments;
}

public ReportTemplateRowBundle generatePaymentBundleForHandovers(
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/com/divudi/bean/pharmacy/GrnController.java
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,11 @@ public void settle() {
}

saveBill();

getGrnBill().setBillExpenses(billExpenses);
getGrnBill().setExpenseTotal(calExpenses());
calGrossTotal();
getGrnBill().setNetTotal(getGrnBill().getNetTotal() - calExpenses());

Payment p = createPayment(getGrnBill(), getGrnBill().getPaymentMethod());

Expand Down Expand Up @@ -643,10 +648,7 @@ public void settle() {
getGrnBill().setCreater(getSessionController().getLoggedUser());
getGrnBill().setCreatedAt(Calendar.getInstance().getTime());

getGrnBill().setBillExpenses(billExpenses);
getGrnBill().setExpenseTotal(calExpenses());
calGrossTotal();
getGrnBill().setNetTotal(getGrnBill().getNetTotal() - calExpenses());


pharmacyCalculation.calculateRetailSaleValueAndFreeValueAtPurchaseRate(getGrnBill());
updateBalanceForGrn(getGrnBill());
Expand Down
33 changes: 33 additions & 0 deletions src/main/webapp/analytics/payments.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,46 @@
scrollable="true"
scrollWidth="100%">

<p:column
headerText="Payment ID"
sortBy="#{payment.id}"
filterBy="#{payment.id}"
filterMatchMode="contains">
<p:outputLabel value="#{payment.id}" />
</p:column>


<p:column
headerText="Bill ID"
sortBy="#{payment.bill.id}"
filterBy="#{payment.bill.id}"
filterMatchMode="contains">
<p:outputLabel value="#{payment.bill.id}" />
</p:column>

<p:column
headerText="Bill No"
sortBy="#{payment.bill.deptId}"
filterBy="#{payment.bill.deptId}"
filterMatchMode="contains">
<p:outputLabel value="#{payment.bill.deptId}" />
</p:column>

<p:column
headerText="Payment Creator"
sortBy="#{payment.creater.webUserPerson.nameWithTitle}"
filterBy="#{payment.creater.webUserPerson.nameWithTitle}"
filterMatchMode="contains">
<p:outputLabel value="#{payment.creater.webUserPerson.nameWithTitle}" />
</p:column>

<p:column
headerText="CUrrent Holder"
sortBy="#{payment.currentHolder.webUserPerson.nameWithTitle}"
filterBy="#{payment.currentHolder.webUserPerson.nameWithTitle}"
filterMatchMode="contains">
<p:outputLabel value="#{payment.currentHolder.webUserPerson.nameWithTitle}" />
</p:column>

<p:column
headerText="Date"
Expand Down
Loading