Attached Files | diffIssue23473.diff [^] (10,017 bytes) 2013-04-05 16:52 [Show Content] [Hide Content]diff -r cc3d3a29d570 src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Tue Apr 02 10:46:24 2013 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Fri Apr 05 16:52:14 2013 +0200
@@ -4018,6 +4018,17 @@
<!--F591FBE4497948BE86EA9C7596C818EF--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
<!--F591FBE4497948BE86EA9C7596C818EF--></AD_MESSAGE>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--><AD_MESSAGE>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--> <AD_MESSAGE_ID><![CDATA[F5BBBB3B430B417380FA145AA1A8DB4B]]></AD_MESSAGE_ID>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--> <VALUE><![CDATA[OBPOS_paidReturn]]></VALUE>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--> <MSGTEXT><![CDATA[Returned]]></MSGTEXT>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--> <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--F5BBBB3B430B417380FA145AA1A8DB4B--></AD_MESSAGE>
+
<!--F6372FCDDAC14C6493EA461B340F7698--><AD_MESSAGE>
<!--F6372FCDDAC14C6493EA461B340F7698--> <AD_MESSAGE_ID><![CDATA[F6372FCDDAC14C6493EA461B340F7698]]></AD_MESSAGE_ID>
<!--F6372FCDDAC14C6493EA461B340F7698--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r cc3d3a29d570 src/org/openbravo/retail/posterminal/PaidReceipts.java
--- a/src/org/openbravo/retail/posterminal/PaidReceipts.java Tue Apr 02 10:46:24 2013 +0200
+++ b/src/org/openbravo/retail/posterminal/PaidReceipts.java Fri Apr 05 16:52:14 2013 +0200
@@ -35,11 +35,11 @@
String hqlPaidReceipts = "select ord.id as id, ord.documentNo as documentNo, ord.orderDate as orderDate, "
+ "ord.businessPartner.id as businessPartner, ord.grandTotalAmount as totalamount, "
- + "ord.salesRepresentative.name as salesRepresentative_identifier, ord.documentType.name as documenttype, "
+ + "ord.salesRepresentative.name as salesRepresentative_identifier, ord.documentType.name as documenttype, "
+ "ord.warehouse.id as warehouse, ord.currency.iSOCode as currency, ord.obposApplications.name as posterminalidentifier, "
+ "ord.businessPartner.name as businessPartner_identifier, ord.currency.id as currency, ord.priceList.id as priceList, "
+ "ord.salesRepresentative.id as salesRepresentative, ord.organization.id as organization, ord.obposApplications.id as obposApplications, "
- + "ord.client.id as client, ord.documentType.id as documentTypeId, ord.obposApplications.obposTerminaltype.documentTypeForQuotations.id as docTypeQuotation, ord.summedLineAmount as totalNetAmount, ord.deliveryStatus as deliveryStatus, ord.priceList.priceIncludesTax as priceIncludesTax from Order as ord where ord.id=? and ord.obposApplications is not null";
+ + "ord.client.id as client, ord.documentType.id as documenttypeid, ord.obposApplications.obposTerminaltype.documentTypeForQuotations.id as docTypeQuotation, ord.summedLineAmount as totalNetAmount, ord.deliveryStatus as deliveryStatus, ord.priceList.priceIncludesTax as priceIncludesTax from Order as ord where ord.id=? and ord.obposApplications is not null";
Query paidReceiptsQuery = OBDal.getInstance().getSession().createQuery(hqlPaidReceipts);
paidReceiptsQuery.setString(0, orderid);
@@ -54,6 +54,7 @@
paidReceipt.put("totalamount", objpaidReceipts[4]);
paidReceipt.put("salesrepresentative_identifier", objpaidReceipts[5]);
paidReceipt.put("documenttype", objpaidReceipts[6]);
+ paidReceipt.put("documenttypeid", objpaidReceipts[17]);
paidReceipt.put("warehouse", objpaidReceipts[7]);
paidReceipt.put("currency_identifier", objpaidReceipts[8]);
paidReceipt.put("posterminalidentifier", objpaidReceipts[9]);
diff -r cc3d3a29d570 src/org/openbravo/retail/posterminal/PaidReceiptsHeader.java
--- a/src/org/openbravo/retail/posterminal/PaidReceiptsHeader.java Tue Apr 02 10:46:24 2013 +0200
+++ b/src/org/openbravo/retail/posterminal/PaidReceiptsHeader.java Fri Apr 05 16:52:14 2013 +0200
@@ -11,6 +11,7 @@
import java.util.Arrays;
import java.util.List;
+import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.openbravo.dal.core.OBContext;
@@ -34,8 +35,16 @@
+ "%' or upper(ord.businessPartner.name) like upper('%" + json.getString("filterText")
+ "%')) ";
}
- if (!json.getString("documentType").isEmpty()) {
- hqlPaidReceipts += " and ord.documentType.id='" + json.getString("documentType") + "'";
+ if (!json.isNull("documentType")) {
+ JSONArray docTypes = json.getJSONArray("documentType");
+ hqlPaidReceipts += " and ( ";
+ for (int docType_i = 0; docType_i < docTypes.length(); docType_i++) {
+ hqlPaidReceipts += "ord.documentType.id='" + docTypes.getString(docType_i) + "'";
+ if (docType_i != docTypes.length() - 1) {
+ hqlPaidReceipts += " or ";
+ }
+ }
+ hqlPaidReceipts += " )";
}
if (!json.getString("docstatus").isEmpty() && !json.getString("docstatus").equals("null")) {
hqlPaidReceipts += " and ord.documentStatus='" + json.getString("docstatus") + "'";
diff -r cc3d3a29d570 web/org.openbravo.retail.posterminal/js/components/modalpaidreceipts.js
--- a/web/org.openbravo.retail.posterminal/js/components/modalpaidreceipts.js Tue Apr 02 10:46:24 2013 +0200
+++ b/web/org.openbravo.retail.posterminal/js/components/modalpaidreceipts.js Fri Apr 05 16:52:14 2013 +0200
@@ -155,7 +155,7 @@
this.$.endDate.removeClass("error");
}
this.filters = {
- documentType: params.isQuotation ? (OB.POS.modelterminal.get('terminal').terminalType.documentTypeForQuotations) : (OB.POS.modelterminal.get('terminal').terminalType.documentType),
+ documentType: params.isQuotation ? ([OB.POS.modelterminal.get('terminal').terminalType.documentTypeForQuotations]) : ([OB.POS.modelterminal.get('terminal').terminalType.documentType, OB.POS.modelterminal.get('terminal').terminalType.documentTypeForReturns]),
docstatus: params.isQuotation ? 'UE' : null,
isQuotation: params.isQuotation ? true : false,
isLayaway: params.isLayaway ? true : false,
diff -r cc3d3a29d570 web/org.openbravo.retail.posterminal/js/components/order.js
--- a/web/org.openbravo.retail.posterminal/js/components/order.js Tue Apr 02 10:46:24 2013 +0200
+++ b/web/org.openbravo.retail.posterminal/js/components/order.js Fri Apr 05 16:52:14 2013 +0200
@@ -337,12 +337,16 @@
this.order.on('change:isPaid change:isQuotation', function (model) {
if (model.get('isPaid') === true && !model.get('isQuotation')) {
this.$.divText.addStyles('width: 50%; color: #f8941d;');
- this.$.divText.setContent(OB.I18N.getLabel('OBPOS_paid'));
+ if (model.get('documentType') === OB.POS.modelterminal.get('terminal').terminalType.documentTypeForReturns) {
+ this.$.divText.setContent(OB.I18N.getLabel('OBPOS_paidReturn'));
+ } else {
+ this.$.divText.setContent(OB.I18N.getLabel('OBPOS_paid'));
+ }
this.$.divText.show();
this.$.listPaymentLines.show();
this.$.paymentBreakdown.show();
//We have to ensure that there is not another handler showing this div
- } else if (this.$.divText.content === OB.I18N.getLabel('OBPOS_paid')) {
+ } else if (this.$.divText.content === OB.I18N.getLabel('OBPOS_paid') || this.$.divText.content === OB.I18N.getLabel('OBPOS_paidReturn')) {
this.$.divText.hide();
this.$.listPaymentLines.hide();
this.$.paymentBreakdown.hide();
diff -r cc3d3a29d570 web/org.openbravo.retail.posterminal/js/model/order.js
--- a/web/org.openbravo.retail.posterminal/js/model/order.js Tue Apr 02 10:46:24 2013 +0200
+++ b/web/org.openbravo.retail.posterminal/js/model/order.js Fri Apr 05 16:52:14 2013 +0200
@@ -491,6 +491,9 @@
clearWith: function (_order) {
var me = this,
undf;
+ //we need this data when IsPaid, IsLayaway changes are triggered
+ this.set('documentType', _order.get('documentType'));
+
this.set('isPaid', _order.get('isPaid'));
this.set('isLayaway', _order.get('isLayaway'));
if (!_order.get('isEditable')) {
@@ -1169,13 +1172,13 @@
order.set('isLayaway', true);
order.set('id', model.orderid);
order.set('createdBy', OB.POS.terminal.terminal.usermodel.id);
- order.set('documentType', model.documenttype);
+ order.set('documentType', model.documenttypeid);
order.set('hasbeenpaid', 'N');
order.set('session', OB.POS.modelterminal.get('session'));
} else {
order.set('isPaid', true);
order.set('id', model.orderid);
- order.set('documentType', model.documenttype);
+ order.set('documentType', model.documenttypeid);
}
diff -r cc3d3a29d570 web/org.openbravo.retail.posterminal/res/printclosedreceipt.xml
--- a/web/org.openbravo.retail.posterminal/res/printclosedreceipt.xml Tue Apr 02 10:46:24 2013 +0200
+++ b/web/org.openbravo.retail.posterminal/res/printclosedreceipt.xml Fri Apr 05 16:52:14 2013 +0200
@@ -36,6 +36,12 @@
<text><%= OB.UTIL.encodeXMLComponent(order.get('posTerminal'+OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER)) %></text>
</line>
<line></line>
+ <line size="1">
+ <%if (order.get('isReturn')){%>
+ <text align="center" length="42"><%= OB.UTIL.encodeXMLComponent(OB.I18N.getLabel('OBPOS_paidReturn')) %></text>
+ <% } %>
+ </line>
+ <line></line>
<line>
<text align ="left" length="21"><%= OB.UTIL.encodeXMLComponent(OB.I18N.getLabel('OBPOS_LineItem'))%></text>
<text align ="center" length="5">#</text>
|