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

Issue#9783 consumption report #9837

Merged
merged 47 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1e8ed4b
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
DARKDRAGON-LK Dec 20, 2024
c6996d6
Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>
DamithDeshan Dec 22, 2024
03254e7
Merge branch 'Issue#9776_GRN_Report_Improment' of https://github.com/…
DamithDeshan Dec 22, 2024
4466b83
Merge branch 'Issue#9571_pharmacy_income_report' of https://github.co…
DamithDeshan Dec 22, 2024
e870f9c
Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>
DamithDeshan Dec 22, 2024
821356b
Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>
DamithDeshan Dec 22, 2024
d03218b
Merge branch 'issue##9785_Improvements_Stock_Ledger' of https://githu…
DamithDeshan Dec 22, 2024
46d5417
Closes #9817
buddhika75 Dec 22, 2024
cdf8d9c
Merge branch 'cancel_the_payed_credit_opd_package_bill_#9817' of http…
DamithDeshan Dec 23, 2024
9997181
Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>
DamithDeshan Dec 23, 2024
7f35cae
Merge branch 'cancel_the_payed_credit_opd_package_bill_#9817' of http…
PasinduW99 Dec 23, 2024
b223aea
Merge branch 'issue##9785_Improvements_Stock_Ledger' of https://githu…
PasinduW99 Dec 23, 2024
8bf4e62
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
SandithP2001 Dec 23, 2024
09a5b59
Merge branch 'cancel_the_payed_credit_opd_package_bill_#9817' of http…
SandithP2001 Dec 23, 2024
c95136b
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 23, 2024
40241ca
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 23, 2024
2218825
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
PasinduW99 Dec 23, 2024
3b8d13f
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 23, 2024
72a5c71
Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>
DamithDeshan Dec 23, 2024
11cb827
Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>
DamithDeshan Dec 23, 2024
d1891df
closes #9825
DamithDeshan Dec 23, 2024
882ea82
Signed-off-by: PasinduW99 <pwathsara@gmail.com>
PasinduW99 Dec 23, 2024
83b6ffc
Added Bill Type Atomics to Update Final Bill
DARKDRAGON-LK Dec 23, 2024
eb8a1b7
Added New Methords to get New Credit Company Final Bill Payments
DARKDRAGON-LK Dec 23, 2024
29ff726
Added New Methord to list All the Bills
DARKDRAGON-LK Dec 23, 2024
e96afee
Signed-off-by: Lawan Samarasekara <lawan.chaamindu1234@gmail.com>
DARKDRAGON-LK Dec 23, 2024
1ced9cc
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
DARKDRAGON-LK Dec 23, 2024
3753fbb
Merge branch '#9810_Bill_Type_Atomic_for_Inpatient_Issues_for_Request…
DARKDRAGON-LK Dec 23, 2024
8e37fc4
Merge branch '#9825_Lab_Report_Export' of https://github.com/hmislk/h…
DARKDRAGON-LK Dec 23, 2024
9caa594
Merge branch 'Issue#9820_Cash_is_not_working_for_cc_deposit' of https…
DARKDRAGON-LK Dec 23, 2024
4fadc95
Merge pull request #9829 from hmislk/development
GSMgeeth Dec 23, 2024
bf65eb7
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 23, 2024
bb42ac1
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 23, 2024
7a7b25d
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 23, 2024
cf34149
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 23, 2024
4b3ec95
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 23, 2024
72b5389
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
SandithP2001 Dec 23, 2024
abd906d
Merge branch 'Issue#9775-Baby_Admission' of https://github.com/hmislk…
SandithP2001 Dec 23, 2024
4216376
Merge branch 'dev-ci-cd-setup' of https://github.com/hmislk/hmis.git …
SandithP2001 Dec 23, 2024
59a45b1
Signed-off-by: SandithP2001 <sandithpivithuru@gmail.com>
SandithP2001 Dec 23, 2024
e9c11dd
Signed-off-by: Pubudu-Piyankara <pubudupiyankara.me@gmail.com>
Pubudu-Piyankara Dec 23, 2024
6c72119
Signed-off-by: Pubudu-Piyankara <pubudupiyankara.me@gmail.com>
Pubudu-Piyankara Dec 23, 2024
9e26b69
Signed-off-by: Pubudu-Piyankara <pubudupiyankara.me@gmail.com>
Pubudu-Piyankara Dec 23, 2024
e8acf1b
Signed-off-by: Pubudu-Piyankara <pubudupiyankara.me@gmail.com>
Pubudu-Piyankara Dec 23, 2024
cc02b28
Signed-off-by: Pubudu-Piyankara <pubudupiyankara.me@gmail.com>
Pubudu-Piyankara Dec 23, 2024
e0f4878
Signed-off-by: Pubudu-Piyankara <pubudupiyankara.me@gmail.com>
Pubudu-Piyankara Dec 23, 2024
3c5cb43
Signed-off-by: Pubudu-Piyankara <pubudupiyankara.me@gmail.com>
Pubudu-Piyankara Dec 23, 2024
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
4 changes: 2 additions & 2 deletions src/main/java/com/divudi/bean/common/BillBeanController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2267,9 +2267,9 @@ public void updateInwardDipositList(PatientEncounter patientEncounter, Bill bill
patientEncounter.getFinalBill().setBalance(patientEncounter.getFinalBill().getBalance() - bill.getNetTotal());
patientEncounter.getFinalBill().setPaidAmount(patientEncounter.getFinalBill().getPaidAmount() + bill.getNetTotal());

if(bill.getPaymentMethod() != PaymentMethod.Credit){
if(bill.getBillTypeAtomic() == BillTypeAtomic.INWARD_DEPOSIT){
patientEncounter.getFinalBill().setSettledAmountByPatient(patientEncounter.getFinalBill().getSettledAmountByPatient() + bill.getNetTotal());
}else if(bill.getPaymentMethod() == PaymentMethod.Credit){
}else if(bill.getBillTypeAtomic()== BillTypeAtomic.INPATIENT_CREDIT_COMPANY_PAYMENT_RECEIVED){
patientEncounter.getFinalBill().setSettledAmountBySponsor(patientEncounter.getFinalBill().getSettledAmountBySponsor()+ bill.getNetTotal());
}
getBillFacade().edit(patientEncounter.getFinalBill());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,33 @@ public void setComment(String comment) {
@Inject
private AdmissionController admissionController;

// public void selectInstitutionListenerBht() {
// Institution ins = institution;
// makeNull();
//
// List<Admission> list = getAdmissionController().getCreditBillsBht(ins);
// for (PatientEncounter b : list) {
// getCurrentBillItem().setPatientEncounter(b);
// selectBhtListener();
// addToBht();
// }
// if (billItems != null) {
// selectedBillItems.addAll(billItems);
// }
// calTotal();
// }

public void selectInstitutionListenerBht() {
Institution ins = institution;
makeNull();

List<Admission> list = getAdmissionController().getCreditBillsBht(ins);
for (PatientEncounter b : list) {
getCurrentBillItem().setPatientEncounter(b);
selectBhtListener();
List<Bill> list = getAdmissionController().getCreditPaymentBillsBht(ins);
for (Bill b : list) {
getCurrentBillItem().setPatientEncounter(b.getPatientEncounter());
getCurrentBillItem().setNetValue(b.getNetTotal());
getCurrentBillItem().getPatientEncounter().setCreditCompany(b.getCreditCompany());
getCurrentBillItem().setBill(b);
// selectBhtListener();
addToBht();
}
if (billItems != null) {
Expand Down Expand Up @@ -1034,15 +1053,26 @@ public void settleBillBht() {
getCurrent().setTotal(getCurrent().getNetTotal());

saveBill(BillType.CashRecieveBill, BillTypeAtomic.INPATIENT_CREDIT_COMPANY_PAYMENT_RECEIVED);
updateReferanceBills();
saveBillItemBht();



WebUser wb = getCashTransactionBean().saveBillCashInTransaction(getCurrent(), getSessionController().getLoggedUser());
getSessionController().setLoggedUser(wb);
// savePayments();
JsfUtil.addSuccessMessage("Bill Saved");
printPreview = true;

}

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

public List<Payment> createPayment(Bill bill, PaymentMethod pm) {
List<Payment> ps = new ArrayList<>();
Expand Down Expand Up @@ -1250,6 +1280,7 @@ private void saveBillItemBht() {
getCurrent().getBillItems().add(tmp);
getBillItemFacade().create(tmp);

getBillBean().updateInwardDipositList(tmp.getPatientEncounter(), getCurrent());
updateReferenceBht(tmp);

}
Expand Down
118 changes: 6 additions & 112 deletions src/main/java/com/divudi/bean/common/ReportsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ public class ReportsController implements Serializable {
Map<Integer, Map<String, Map<Integer, Double>>> weeklyDailyBillItemMap7to1;
Map<Integer, Map<String, Map<Integer, Double>>> weeklyDailyBillItemMap1to7;


private boolean showChart;

public String getDischargedStatus() {
Expand Down Expand Up @@ -3495,7 +3494,7 @@ private void groupBills() {
bundle.setGroupedBillItemsByInstitution(billMap);
}

public Double calculateNetAmountSubTotalByBills(List<Bill> bills) {
public Double calculateNetTotalByBills(List<Bill> bills) {
Double netTotal = 0.0;

for (Bill bill : bills) {
Expand All @@ -3505,7 +3504,7 @@ public Double calculateNetAmountSubTotalByBills(List<Bill> bills) {
return netTotal;
}

public Double calculateDiscountSubTotalByBills(List<Bill> bills) {
public Double calculateDiscountByBills(List<Bill> bills) {
Double discount = 0.0;

for (Bill bill : bills) {
Expand All @@ -3516,122 +3515,17 @@ public Double calculateDiscountSubTotalByBills(List<Bill> bills) {
}


public Double calculateNetAmountNetTotal() {
double netAmountNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

netAmountNetTotal += calculateNetAmountSubTotalByBills(bills);
}

return netAmountNetTotal;
}

public Double calculateGrossAmountSubTotalByBills(List<Bill> bills) {
Double billTotal = 0.0;

for (Bill bill : bills) {
billTotal += bill.getBillTotal();
}

return billTotal;
}

public Double calculatePatientShareSubTotalByBills(List<Bill> bills) {
Double settledAmountByPatient = 0.0;

for (Bill bill : bills) {
settledAmountByPatient += bill.getSettledAmountByPatient();
}

return settledAmountByPatient;
}

public Double calculateSponsorShareSubTotalByBills(List<Bill> bills) {
Double settledAmountBySponsor = 0.0;

for (Bill bill : bills) {
settledAmountBySponsor += bill.getSettledAmountBySponsor();
}

return settledAmountBySponsor;
}

public Double calculateDueAmountSubTotalByBills(List<Bill> bills) {
Double balance = 0.0;

for (Bill bill : bills) {
balance += bill.getBalance();
}

return balance;
}

public Double calculateGrossAmountNetTotal() {
double grossAmountNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

grossAmountNetTotal += calculateGrossAmountSubTotalByBills(bills);
}

return grossAmountNetTotal;
}

public Double calculateDiscountNetTotal() {
double discountNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

discountNetTotal += calculateDiscountSubTotalByBills(bills);
}

return discountNetTotal;
}

public Double calculatePatientShareNetTotal() {
double patientShareNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

patientShareNetTotal += calculatePatientShareSubTotalByBills(bills);
}

return patientShareNetTotal;
}

public Double calculateDueAmountNetTotal() {
double dueAmountNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

dueAmountNetTotal += calculateDueAmountSubTotalByBills(bills);
}

return dueAmountNetTotal;
}

public Double calculateSponsorShareNetTotal() {
double sponsorShareNetTotal = 0.0;
public Double calculateSubTotal() {
double subTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

sponsorShareNetTotal += calculateSponsorShareSubTotalByBills(bills);
subTotal += calculateNetTotalByBills(bills);
}

return sponsorShareNetTotal;
return subTotal;
}

public void generateDiscountReport() {
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/divudi/bean/inward/AdmissionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.divudi.facade.RoomFacade;
import com.divudi.bean.common.util.JsfUtil;
import com.divudi.bean.pharmacy.PharmacyRequestForBhtController;
import com.divudi.data.BillTypeAtomic;
import com.divudi.data.clinical.ClinicalFindingValueType;
import com.divudi.entity.Department;
import com.divudi.entity.Staff;
Expand Down Expand Up @@ -362,6 +363,23 @@ public List<Admission> getCreditBillsBht(Institution institution) {

return lst;
}

public List<Bill> getCreditPaymentBillsBht(Institution institution) {
String sql;
HashMap hash = new HashMap();

sql = "select b from Bill b "
+ " where b.retired=false "
+ " and b.creditCompany=:ins"
+ " and b.billTypeAtomic=:bta ";

hash.put("ins", institution);
hash.put("bta", BillTypeAtomic.INWARD_FINAL_BILL_PAYMENT_BY_CREDIT_COMPANY);
// hash.put("pm", PaymentMethod.Credit);
List<Bill> lst = getBillFacade().findByJpql(sql, hash);
System.out.println("lst = " + lst);
return lst;
}

// public List<Admission> completePatientPaymentDue(String qry) {
// String sql = "Select b.patientEncounter From "
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/com/divudi/bean/lab/InvestigationController.java
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,23 @@ public String navigateToEditFormatSingle() {
return investigationItemController.toEditInvestigationFormat();
}

public String navigateExportReoirtFormat() {
if (current == null) {
JsfUtil.addErrorMessage("Please select investigation");
return "";
}
if (current.getId() == null) {
JsfUtil.addErrorMessage("Please save investigation first.");
return "";
}
if (current.getReportedAs() == null) {
current.setReportedAs(current);
}
investigationItemController.setCurrentInvestigation((Investigation) current.getReportedAs());
investigationItemController.listInvestigationItem();
return "/admin/lims/export?faces-redirect=true";
}

public String navigateToEditFormatSinglePastData() {
if (current == null) {
JsfUtil.addErrorMessage("Please select investigation");
Expand Down
Loading