Attached Files | 25473.diff [^] (7,670 bytes) 2014-01-14 18:52 [Show Content] [Hide Content]diff --git a/src/org/openbravo/module/invoicesregisterbook/obirb_actionButton/CreateBookLines.java b/src/org/openbravo/module/invoicesregisterbook/obirb_actionButton/CreateBookLines.java
--- a/src/org/openbravo/module/invoicesregisterbook/obirb_actionButton/CreateBookLines.java
+++ b/src/org/openbravo/module/invoicesregisterbook/obirb_actionButton/CreateBookLines.java
@@ -102,12 +102,12 @@
msg.setMessage("");
}
msg.setType("Warning");
- msg.setTitle(Utility.messageBD(new DalConnectionProvider(), "@Warning@", OBContext
+ msg.setTitle(Utility.messageBD(new DalConnectionProvider(false), "@Warning@", OBContext
.getOBContext().getLanguage().getLanguage()));
for (int i = 0; i < oldTaxes.size(); i++)
msg.setMessage(msg.getMessage()
- + Utility.messageBD(new DalConnectionProvider(),
+ + Utility.messageBD(new DalConnectionProvider(false),
"@OBIRB_OldTax2011@" + oldTaxes.get(i) + "</br>", OBContext.getOBContext()
.getLanguage().getLanguage()));
}
@@ -265,15 +265,15 @@
// final OBError msg = new OBError();
// msg.setType("Error");
// msg.setTitle("Error");
- // msg.setMessage(Utility.messageBD(new DalConnectionProvider(), "OBIRB_PeriodOpened",
+ // msg.setMessage(Utility.messageBD(new DalConnectionProvider(false), "OBIRB_PeriodOpened",
// bundle.getContext().getLanguage())
// + "<br/>"
- // + Utility.messageBD(new DalConnectionProvider(), "Period", bundle.getContext()
+ // + Utility.messageBD(new DalConnectionProvider(false), "Period", bundle.getContext()
// .getLanguage())
// + ": "
// + period.getName()
// + " - "
- // + Utility.messageBD(new DalConnectionProvider(), "Document Type", bundle.getContext()
+ // + Utility.messageBD(new DalConnectionProvider(false), "Document Type", bundle.getContext()
// .getLanguage()) + ": " + docType.getName());
// bundle.setResult(msg);
// return false;
@@ -319,7 +319,7 @@
ConversionRate cR = dao
.getConversionRate(invoice.getInvoiceDate(), invoiceCurrency, EURO);
if (cR == null) {
- throw new ServletException(Utility.messageBD(new DalConnectionProvider(),
+ throw new ServletException(Utility.messageBD(new DalConnectionProvider(false),
"OBIRB_NoConversionFromEuro", lang) + invoiceCurrency.getIdentifier());
} else {
multiplyBy = cR.getMultipleRateBy();
@@ -377,21 +377,21 @@
}
if (bpLocationList.isEmpty()) {
msg.setType("Warning");
- msg.setTitle(Utility.messageBD(new DalConnectionProvider(), "@Warning@", lang));
+ msg.setTitle(Utility.messageBD(new DalConnectionProvider(false), "@Warning@", lang));
msg.setMessage(msg.getMessage()
- + Utility.messageBD(new DalConnectionProvider(), "OBIRB_NoBPLocation" + "</br>",
- lang));
+ + Utility.messageBD(new DalConnectionProvider(false), "OBIRB_NoBPLocation"
+ + "</br>", lang));
} else {
msg.setType("Success");
- msg.setTitle(Utility.messageBD(new DalConnectionProvider(), "Done", lang));
- msg.setMessage(Utility.messageBD(new DalConnectionProvider(), "Success", lang));
+ msg.setTitle(Utility.messageBD(new DalConnectionProvider(false), "Done", lang));
+ msg.setMessage(Utility.messageBD(new DalConnectionProvider(false), "Success", lang));
}
irbl.setCountryCode(countryCode);
if (invoice.getBusinessPartner().getTaxID() == null)
if (invoice.getBusinessPartner().getOBTIKTaxIDKey().equalsIgnoreCase("1")
|| invoice.getBusinessPartner().getOBTIKTaxIDKey().equalsIgnoreCase("2")) {
- throw new ServletException(Utility.messageBD(new DalConnectionProvider(),
+ throw new ServletException(Utility.messageBD(new DalConnectionProvider(false),
"OBIRB_NoBPTaxID", lang) + invoice.getBusinessPartner().getIdentifier());
} else
setCorrectTaxId(irbl, taxIdKey, null, euCountryCodeList);
@@ -683,8 +683,9 @@
log4j.debug("CreateBookLines: removing book line " + deletableLine.getId());
dao.removeObject(deletableLine);
// Necessary to flush here
- dao.flush();
+
}
+ dao.flush();
}
/**
@@ -860,13 +861,13 @@
if (bpLocationList.isEmpty()) {
msg.setType("Warning");
msg.setTitle(msg.getMessage()
- + Utility.messageBD(new DalConnectionProvider(), "@Warning@", lang));
- msg.setMessage(Utility.messageBD(new DalConnectionProvider(), "OBIRB_NoBPLocation" + "</br>",
- lang));
+ + Utility.messageBD(new DalConnectionProvider(false), "@Warning@", lang));
+ msg.setMessage(Utility.messageBD(new DalConnectionProvider(false), "OBIRB_NoBPLocation"
+ + "</br>", lang));
} else {
msg.setType("Success");
- msg.setTitle(Utility.messageBD(new DalConnectionProvider(), "Done", lang));
- msg.setMessage(Utility.messageBD(new DalConnectionProvider(), "Success", lang));
+ msg.setTitle(Utility.messageBD(new DalConnectionProvider(false), "Done", lang));
+ msg.setMessage(Utility.messageBD(new DalConnectionProvider(false), "Success", lang));
}
irbl.setCountryCode(countryCode);
@@ -875,8 +876,8 @@
&& line.getTax().getRate().compareTo(BigDecimal.ZERO) != 0) {
if (invoice.getOrganization().getOrganizationInformationList().size() == 0
|| invoice.getOrganization().getOrganizationInformationList().get(0).getBusinessPartner() == null)
- throw new ServletException(Utility.messageBD(new DalConnectionProvider(), "OBIRB_NoOrgBP",
- lang) + " \"" + invoice.getOrganization().getIdentifier() + "\"");
+ throw new ServletException(Utility.messageBD(new DalConnectionProvider(false),
+ "OBIRB_NoOrgBP", lang) + " \"" + invoice.getOrganization().getIdentifier() + "\"");
else {
irbl.setBusinessPartner(invoice.getOrganization().getOrganizationInformationList().get(0)
.getBusinessPartner());
@@ -897,7 +898,7 @@
if (invoice.getBusinessPartner().getTaxID() == null)
if (invoice.getBusinessPartner().getOBTIKTaxIDKey().equalsIgnoreCase("1")
|| invoice.getBusinessPartner().getOBTIKTaxIDKey().equalsIgnoreCase("2")) {
- throw new ServletException(Utility.messageBD(new DalConnectionProvider(),
+ throw new ServletException(Utility.messageBD(new DalConnectionProvider(false),
"OBIRB_NoBPTaxID", lang) + invoice.getBusinessPartner().getIdentifier());
} else
setCorrectTaxId(irbl, taxIdKey, null, countryCodeList);
diff --git a/src/org/openbravo/module/invoicesregisterbook/obirb_actionButton/CreateBookLinesDao.java b/src/org/openbravo/module/invoicesregisterbook/obirb_actionButton/CreateBookLinesDao.java
--- a/src/org/openbravo/module/invoicesregisterbook/obirb_actionButton/CreateBookLinesDao.java
+++ b/src/org/openbravo/module/invoicesregisterbook/obirb_actionButton/CreateBookLinesDao.java
@@ -345,7 +345,7 @@
try {
OBContext.setAdminMode(true);
// first get a connection
- final Connection connection = OBDal.getInstance().getConnection();
+ final Connection connection = OBDal.getInstance().getConnection(false);
final PreparedStatement ps = connection
.prepareStatement("SELECT OBIRB_GETOPERATIONDATE(?) FROM DUAL");
|