Skip to content

Commit 6be3c35

Browse files
Merge pull request #11217 from hmislk/development
upto date changes to coop test
2 parents b10e6ec + 75aa279 commit 6be3c35

13 files changed

+753
-618
lines changed

src/main/java/com/divudi/bean/common/ReportsController.java

+29-4
Original file line numberDiff line numberDiff line change
@@ -2829,7 +2829,7 @@ public ReportTemplateRowBundle generateReportBillItems(List<BillTypeAtomic> bts,
28292829

28302830
jpql += "GROUP BY billItem";
28312831

2832-
List<ReportTemplateRow> rs = (List<ReportTemplateRow>) paymentFacade.findLightsByJpql(jpql, parameters, TemporalType.TIMESTAMP);
2832+
List<ReportTemplateRow> rs = (List<ReportTemplateRow>) paymentFacade.findLightsByJpqlWithoutCache(jpql, parameters, TemporalType.TIMESTAMP);
28332833

28342834
ReportTemplateRowBundle b = new ReportTemplateRowBundle();
28352835
b.setReportTemplateRows(rs);
@@ -2905,7 +2905,7 @@ public ReportTemplateRowBundle generateReportBill(List<BillTypeAtomic> bts, List
29052905

29062906
jpql += "GROUP BY bill";
29072907

2908-
List<ReportTemplateRow> rs = (List<ReportTemplateRow>) paymentFacade.findLightsByJpql(jpql, parameters, TemporalType.TIMESTAMP);
2908+
List<ReportTemplateRow> rs = (List<ReportTemplateRow>) paymentFacade.findLightsByJpqlWithoutCache(jpql, parameters, TemporalType.TIMESTAMP);
29092909

29102910
ReportTemplateRowBundle b = new ReportTemplateRowBundle();
29112911
b.setReportTemplateRows(rs);
@@ -3287,6 +3287,7 @@ public void externalLaboratoryWorkloadReport() {
32873287
opdBts.add(BillTypeAtomic.INWARD_SERVICE_BILL_CANCELLATION);
32883288
opdBts.add(BillTypeAtomic.INWARD_FINAL_BILL);
32893289
opdBts.add(BillTypeAtomic.PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE_RETURN);
3290+
opdBts.add(BillTypeAtomic.INWARD_SERVICE_BILL_REFUND);
32903291
}
32913292
if (visitType != null && visitType.equalsIgnoreCase("OP")) {
32923293
opdBts.add(BillTypeAtomic.OPD_BILL_WITH_PAYMENT);
@@ -3302,6 +3303,8 @@ public void externalLaboratoryWorkloadReport() {
33023303
opdBts.add(BillTypeAtomic.PACKAGE_OPD_BILL_CANCELLATION);
33033304
opdBts.add(BillTypeAtomic.OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION);
33043305
opdBts.add(BillTypeAtomic.PACKAGE_OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION);
3306+
opdBts.add(BillTypeAtomic.OPD_BILL_REFUND);
3307+
opdBts.add(BillTypeAtomic.PACKAGE_OPD_BILL_REFUND);
33053308
}
33063309
if (visitType != null && visitType.equalsIgnoreCase("CC")) {
33073310
opdBts.add(BillTypeAtomic.CC_BILL);
@@ -3321,6 +3324,25 @@ public void externalLaboratoryWorkloadReport() {
33213324
}
33223325
}
33233326

3327+
private List<BillTypeAtomic> cancelAndRefundBillTypeAtomics() {
3328+
return Arrays.asList(
3329+
BillTypeAtomic.INWARD_SERVICE_BILL_CANCELLATION,
3330+
BillTypeAtomic.INWARD_SERVICE_BATCH_BILL_CANCELLATION,
3331+
BillTypeAtomic.PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE_RETURN,
3332+
BillTypeAtomic.INWARD_SERVICE_BILL_REFUND,
3333+
BillTypeAtomic.OPD_BILL_CANCELLATION,
3334+
BillTypeAtomic.OPD_BATCH_BILL_CANCELLATION,
3335+
BillTypeAtomic.PACKAGE_OPD_BILL_CANCELLATION,
3336+
BillTypeAtomic.PACKAGE_OPD_BATCH_BILL_CANCELLATION,
3337+
BillTypeAtomic.OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION,
3338+
BillTypeAtomic.PACKAGE_OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION,
3339+
BillTypeAtomic.OPD_BILL_REFUND,
3340+
BillTypeAtomic.PACKAGE_OPD_BILL_REFUND,
3341+
BillTypeAtomic.CC_BILL_CANCELLATION,
3342+
BillTypeAtomic.CC_BILL_REFUND
3343+
);
3344+
}
3345+
33243346
private ReportTemplateRowBundle generateExternalLaboratoryWorkloadBillItems(List<BillTypeAtomic> bts) {
33253347
Map<String, Object> parameters = new HashMap<>();
33263348

@@ -3330,7 +3352,7 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadBillItems(List
33303352
+ "LEFT JOIN PatientInvestigation pi ON pi.billItem = billItem "
33313353
+ "WHERE bill.billTypeAtomic IN :bts "
33323354
+ "AND billItem.item is not null "
3333-
+ "AND billItem.patientInvestigation is not null ";
3355+
+ "AND (pi IS NOT NULL OR bill.billTypeAtomic IN :cancellableTypes)";
33343356
// String jpql = "SELECT new com.divudi.data.ReportTemplateRow(billItem) "
33353357
// + "FROM PatientInvestigation pi "
33363358
// + "JOIN pi.billItem billItem "
@@ -3340,6 +3362,7 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadBillItems(List
33403362
// + " AND bill.retired=false "
33413363
// + " AND bill.billTypeAtomic in :bts ";
33423364

3365+
parameters.put("cancellableTypes", cancelAndRefundBillTypeAtomics());
33433366
parameters.put("bts", bts);
33443367

33453368
if (staff != null) {
@@ -3431,7 +3454,9 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadSummaryBillIte
34313454
+ "WHERE bill.billTypeAtomic IN :bts "
34323455
+ "AND bill.createdAt BETWEEN :fd AND :td "
34333456
+ "AND billItem.item is not null "
3434-
+ "AND billItem.patientInvestigation is not null ";
3457+
+ "AND (pi IS NOT NULL OR bill.billTypeAtomic IN :cancellableTypes)";
3458+
3459+
parameters.put("cancellableTypes", cancelAndRefundBillTypeAtomics());
34353460

34363461
if (staff != null) {
34373462
jpql += "AND billItem.patientInvestigation.barcodeGeneratedBy.webUserPerson.name = :staff ";

src/main/java/com/divudi/bean/pharmacy/PharmacyPurchaseController.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,10 @@ public void settle() {
562562

563563
billItemsTotalQty = 0;
564564
for (BillItem i : getBillItems()) {
565+
566+
double lastPurchaseRate = 0.0;
567+
lastPurchaseRate = getPharmacyBean().getLastPurchaseRate(i.getItem());
568+
565569
if (i.getPharmaceuticalBillItem().getQty() + i.getPharmaceuticalBillItem().getFreeQty() == 0.0) {
566570
continue;
567571
}
@@ -591,7 +595,7 @@ public void settle() {
591595

592596
tmpPh.setItemBatch(itemBatch);
593597
Stock stock = getPharmacyBean().addToStock(tmpPh, Math.abs(addingQty), getSessionController().getDepartment());
594-
598+
tmpPh.setLastPurchaseRate(lastPurchaseRate);
595599
tmpPh.setStock(stock);
596600
getPharmaceuticalBillItemFacade().edit(tmpPh);
597601

src/main/java/com/divudi/bean/pharmacy/PharmacySaleController.java

+6
Original file line numberDiff line numberDiff line change
@@ -1400,10 +1400,16 @@ public void addBillItemMultipleBatches() {
14001400
double thisTimeAddingQty = addBillItemSingleItem();
14011401
addedQty += thisTimeAddingQty;
14021402
remainingQty = remainingQty - thisTimeAddingQty;
1403+
1404+
14031405
if (remainingQty <= 0) {
14041406
return;
14051407
}
14061408
}
1409+
if(addedQty < requestedQty){
1410+
errorMessage = "Quantity is not Enough...!";
1411+
JsfUtil.addErrorMessage("Only " + String.format("%.0f", addedQty) +" is Available form the Requested Quantity");
1412+
}
14071413

14081414
}
14091415

src/main/java/com/divudi/bean/pharmacy/PharmacySaleController1.java

+4
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,10 @@ public void addBillItemMultipleBatches() {
11651165
return;
11661166
}
11671167
}
1168+
if(addedQty < requestedQty){
1169+
errorMessage = "Quantity is not Enough...!";
1170+
JsfUtil.addErrorMessage("Only " + String.format("%.0f", addedQty) +" is Available form the Requested Quantity");
1171+
}
11681172

11691173
}
11701174

src/main/java/com/divudi/bean/pharmacy/PharmacySaleController2.java

+4
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,10 @@ public void addBillItemMultipleBatches() {
11651165
return;
11661166
}
11671167
}
1168+
if(addedQty < requestedQty){
1169+
errorMessage = "Quantity is not Enough...!";
1170+
JsfUtil.addErrorMessage("Only " + String.format("%.0f", addedQty) +" is Available form the Requested Quantity");
1171+
}
11681172

11691173
}
11701174

src/main/java/com/divudi/bean/pharmacy/PharmacySaleController3.java

+4
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,10 @@ public void addBillItemMultipleBatches() {
11651165
return;
11661166
}
11671167
}
1168+
if(addedQty < requestedQty){
1169+
errorMessage = "Quantity is not Enough...!";
1170+
JsfUtil.addErrorMessage("Only " + String.format("%.0f", addedQty) +" is Available form the Requested Quantity");
1171+
}
11681172

11691173
}
11701174

src/main/webapp/channel/manage_booking_by_date.xhtml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@
14351435
<p:outputLabel value="#{bi.feeValue}"/>
14361436
</p:column>
14371437
<p:column headerText="Return Value">
1438-
<p:inputText value="#{bi.tmpChangedValue}" disabled="#{configOptionApplicationController.getBooleanValueByKey('Disallow Modifications to Refund Amounts')}" >
1438+
<p:inputText value="#{bi.tmpChangedValue}" disabled="#{configOptionApplicationController.getBooleanValueByKey('Disallow Modifications to Refund Amounts') or (configOptionApplicationController.getBooleanValueByKey('Channel Booking by date appoinment allow rufund doctor fee only') ? (bi.fee.feeType ne 'Staff' ? true :false) : false)}" >
14391439
<f:ajax execute="@this" render=":#{p:resolveFirstComponentWithId('tot',view).clientId}" event="blur" listener="#{bookingControllerViewScope.calRefundTotal()}"/>
14401440
<f:ajax execute="@this" render=":#{p:resolveFirstComponentWithId('tot',view).clientId} @this" event="blur" listener="#{bookingControllerViewScope.checkRefundTotal()}"/>
14411441
</p:inputText>
@@ -1460,7 +1460,7 @@
14601460
filter="true"
14611461
placeholder="Select or enter a comment"
14621462
filterMatchMode="contains"
1463-
style="float: right; width: 100%"
1463+
style="float: right; width: 75%"
14641464
class="p-2">
14651465
<f:selectItem itemLabel="Select or enter a comment" itemValue="" noSelectionOption="true"/>
14661466
<f:selectItems
@@ -1469,12 +1469,12 @@
14691469
itemLabel="#{option}"
14701470
itemValue="#{option}"/>
14711471
</p:selectOneMenu>
1472-
<p:selectOneMenu class="py-2 mx-2 w-50" id="RefundPs" value="#{bookingControllerViewScope.refundPaymentMethod}">
1472+
<p:selectOneMenu class="py-2 mx-2 w-10" id="RefundPs" value="#{bookingControllerViewScope.refundPaymentMethod}">
14731473
<f:selectItem itemLabel="Select Cancel Payment Method" ></f:selectItem>
14741474
<f:selectItems value="#{enumController.paymentMethodsForChannel}"/>
14751475
</p:selectOneMenu>
14761476

1477-
<p:commandButton id="btnIdRefund" value="Refund Booking" class="ui-button-warning" icon="fas fa-reply" ajax="false"
1477+
<p:commandButton id="btnIdRefund" value="Refund Booking" class="ui-button-warning py-2" icon="fas fa-reply" ajax="false"
14781478
disabled="#{bookingControllerViewScope.billSession.bill.refunded==true
14791479
or bookingControllerViewScope.billSession.bill.cancelled==true or bookingControllerViewScope.disableRefund==true}"
14801480
action="#{bookingControllerViewScope.channelBookingRefund()}">
@@ -1508,7 +1508,7 @@
15081508
rendered="#{webUserController.hasPrivilege('ChannelBookingChange')}">
15091509
<p:panelGrid columns="2" class="w-100">
15101510
<f:facet name="header" >
1511-
<p:outputLabel value="Change Current Patient with a new Patient" ></p:outputLabel>
1511+
<p:outputLabel class="mx-2" value="Change Current Patient with a new Patient" ></p:outputLabel>
15121512
<p:commandButton ajax="false" value="Change Patient" disabled ="#{bookingControllerViewScope.selectedBillSession.bill.creditCompany.institutionCode.equalsIgnoreCase('WEB_DOC990') and (bookingControllerViewScope.selectedBillSession.absent == true or bookingControllerViewScope.selectedBillSession.bill.cancelled == true)}" action="#{bookingControllerViewScope.changePatient()}" ></p:commandButton>
15131513
</f:facet>
15141514
<p:panel header="Current Patient for Booking" >

0 commit comments

Comments
 (0)