# HG changeset patch
# User Rafa Alonso <ral@openbravo.com>
# Date 1445270021 -7200
#      Mon Oct 19 17:53:41 2015 +0200
# Node ID f839e8610313bd27fd2debba2bd0e66b62f1604f
# Parent  ab231bbf7e35f7ed1678ef6cb9c85d148aef59bd
Fixes issue 31113: Allow empty sales representatives when retrying paid receipts

diff -r ab231bbf7e35 -r f839e8610313 src/org/openbravo/retail/posterminal/PaidReceiptProperties.java
--- a/src/org/openbravo/retail/posterminal/PaidReceiptProperties.java	Mon Oct 19 17:44:28 2015 +0200
+++ b/src/org/openbravo/retail/posterminal/PaidReceiptProperties.java	Mon Oct 19 17:53:41 2015 +0200
@@ -37,7 +37,7 @@
         add(new HQLProperty("ord.businessPartner.id", "bp"));
         add(new HQLProperty("ord.partnerAddress.id", "bpLocId"));
         add(new HQLProperty("ord.grandTotalAmount", "totalamount"));
-        add(new HQLProperty("ord.salesRepresentative.name", "salesRepresentative$_identifier"));
+        add(new HQLProperty("salesRepresentative.name", "salesRepresentative$_identifier"));
         add(new HQLProperty("ord.documentType.id", "documentType"));
         add(new HQLProperty("ord.warehouse.id", "warehouse"));
         add(new HQLProperty("ord.description", "description"));
@@ -47,7 +47,7 @@
         add(new HQLProperty("ord.businessPartner.name", "businessPartner$_identifier"));
         add(new HQLProperty("ord.currency.id", "currency"));
         add(new HQLProperty("ord.priceList.id", "priceList"));
-        add(new HQLProperty("ord.salesRepresentative.id", "salesRepresentative"));
+        add(new HQLProperty("salesRepresentative.id", "salesRepresentative"));
         add(new HQLProperty("ord.organization.id", "organization"));
         add(new HQLProperty("ord.client.id", "client"));
         add(new HQLProperty(
diff -r ab231bbf7e35 -r f839e8610313 src/org/openbravo/retail/posterminal/PaidReceipts.java
--- a/src/org/openbravo/retail/posterminal/PaidReceipts.java	Mon Oct 19 17:44:28 2015 +0200
+++ b/src/org/openbravo/retail/posterminal/PaidReceipts.java	Mon Oct 19 17:53:41 2015 +0200
@@ -64,7 +64,7 @@
       // get the orderId
       HQLPropertyList hqlProperties = ModelExtensionUtils.getPropertyExtensions(extensions);
       String hqlPaidReceipts = "select " + hqlProperties.getHqlSelect() + //
-          " from Order as ord LEFT OUTER JOIN ord.obposApplications AS pos" + //
+          " from Order as ord LEFT OUTER JOIN ord.obposApplications AS pos LEFT OUTER JOIN ord.salesRepresentative as salesRepresentative" + //
           " where ord.id = :orderId";
       Query paidReceiptsQuery = OBDal.getInstance().getSession().createQuery(hqlPaidReceipts);
       paidReceiptsQuery.setString("orderId", orderid);
