Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -154,10 +154,6 @@ public String navigateToPaymentSchemeDiscountOpdByDepartment() {
return "/admin/pricing/payment_scheme_discount_opd_by_department?faces-redirect=true";
}

public String navigateToPaymentSchemeDiscountforCreditCompany() {
return "/admin/pricing/payment_scheme_discount_for_credit_company?faces-redirect=true";
}

public String navigateToPaymentSchemeDiscountOpdBySite() {
return "/admin/pricing/payment_scheme_discount_opd_by_site?faces-redirect=true";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,68 +122,6 @@ public void saveSelectedDepartmentPaymentScheme() {

}

public void saveSelectedCompanyPaymentScheme() {
if (paymentScheme == null) {
JsfUtil.addErrorMessage("Please select a Payment Scheme");
return;
}
if (selectedCreditCompany == null) {
JsfUtil.addErrorMessage("Please select a CreditCompany.");
return;
}

if (margin > 100.0 || margin < 0.0) {
JsfUtil.addErrorMessage("Margin is Invalid.");
return;
}

// Create new PriceMatrix
PriceMatrix a = new PaymentSchemeDiscount();
a.setPaymentScheme(paymentScheme);
a.setCreditCompany(selectedCreditCompany);
a.setDiscountPercent(margin);
a.setPaymentMethod(PaymentMethod.Credit);
a.setCreatedAt(new Date());
a.setCreater(sessionController.getLoggedUser());
getFacade().create(a);

System.out.println("New PriceMatrix Saved Successfully (" + a.getId() + ")");
JsfUtil.addSuccessMessage("Saved Successfully");

// Reload PriceMatrix
fillCompanyPaymentSchemes();

// Clear Values
selectedCreditCompany = null;
margin = 0.0;
company = null;

}

public void fillCompanyPaymentSchemes() {
if (paymentScheme == null) {
JsfUtil.addErrorMessage("Please select a Payment Scheme");
return;
}

String sql;
HashMap hm = new HashMap();
sql = "select a from PaymentSchemeDiscount a "
+ " where a.retired=false"
+ " and a.paymentScheme=:pm "
+ " and a.category is null "
+ " and a.creditCompany is not null ";

if (company != null) {
sql += " and a.creditCompany =:cmb";
hm.put("cmb", company);
}
sql += " order by a.paymentScheme.name, a.creditCompany.name";

hm.put("pm", paymentScheme);
items = getFacade().findByJpql(sql, hm);
}

public void saveSelectedSitePaymentScheme() {
PriceMatrix a = new PaymentSchemeDiscount();
saveSite(a);
Expand Down Expand Up @@ -1092,23 +1030,9 @@ public void createItemsCategoryPharmacyPaymentMethod() {
}

public void onEdit(PriceMatrix tmp) {
if (tmp.getPaymentScheme() == null) {
JsfUtil.addErrorMessage("Please select a Payment Scheme");
return;
}
if (tmp.getCreditCompany() == null) {
JsfUtil.addErrorMessage("Please select a CreditCompany.");
return;
}

if (tmp.getDiscountPercent() > 100.0 || tmp.getDiscountPercent() < 0.0) {
JsfUtil.addErrorMessage("Margin is Invalid.");
return;
}
getFacade().edit(tmp);
JsfUtil.addSuccessMessage("Update Successfully");
clearInstanceVars();

}

public Category getRoomLocation() {
Expand Down

This file was deleted.

Loading