diff -r 4605c8a3d88e src/org/openbravo/retail/posterminal/master/Cashup.java
--- a/src/org/openbravo/retail/posterminal/master/Cashup.java	Tue Jul 24 11:42:39 2018 +0200
+++ b/src/org/openbravo/retail/posterminal/master/Cashup.java	Tue Jul 24 13:05:05 2018 +0200
@@ -38,14 +38,13 @@
 import org.openbravo.retail.posterminal.OBPOSErrors;
 import org.openbravo.retail.posterminal.OBPOSPaymentMethodCashup;
 import org.openbravo.retail.posterminal.OBPOSTaxCashup;
-import org.openbravo.retail.posterminal.ProcessCashClose;
 import org.openbravo.service.importprocess.ImportEntry;
 import org.openbravo.service.json.DataResolvingMode;
 import org.openbravo.service.json.DataToJsonConverter;
 import org.openbravo.service.json.JsonConstants;
 
 public class Cashup extends JSONProcessSimple {
-  private static final Logger log = Logger.getLogger(ProcessCashClose.class);
+  private static final Logger log = Logger.getLogger(Cashup.class);
 
   @Override
   public JSONObject exec(JSONObject jsonsent) throws JSONException, ServletException {
@@ -58,7 +57,11 @@
       String posId = RequestContext.get().getSessionAttribute("POSTerminal").toString();
 
       if (cashupErrorsExistInTerminal(posId)) {
-        result.put(JsonConstants.RESPONSE_ERRORMESSAGE, "There are cashup errors in this terminal");
+        String errorMsg = "There are cashup errors in this terminal";
+        JSONObject jsonError = new JSONObject();
+        jsonError.put("message", errorMsg);
+        result.put(JsonConstants.RESPONSE_ERROR, jsonError);
+        result.put(JsonConstants.RESPONSE_ERRORMESSAGE, errorMsg);
         result.put(JsonConstants.RESPONSE_STATUS, JsonConstants.RPCREQUEST_STATUS_FAILURE);
         return result;
       }
@@ -127,7 +130,13 @@
       return result;
 
     } catch (Exception e) {
-      log.error(e);
+      log.error("Error during exec", e);
+      JSONObject jsonError = new JSONObject();
+      String errorMsg = "Unknow error happened retrieving cashup: " + e.getMessage();
+      jsonError.put("message", errorMsg);
+      result.put(JsonConstants.RESPONSE_ERROR, jsonError);
+      result.put(JsonConstants.RESPONSE_ERRORMESSAGE, errorMsg);
+      result.put(JsonConstants.RESPONSE_STATUS, JsonConstants.RPCREQUEST_STATUS_FAILURE);
       return result;
     } finally {
       OBContext.restorePreviousMode();
@@ -178,16 +187,21 @@
       OBPOSAppPayment paymentAppMethod = (OBPOSAppPayment) paymentAppMethodCriteria.uniqueResult();
       paymentMethodJSON.put("cashup_id", paymentMethodJSON.get("cashUp"));
       paymentMethodJSON.put("searchKey", paymentMethodJSON.get("searchkey"));
-      
+
       // there are several ways of refering to the payment method id in webpos
       // support all of them.
       paymentMethodJSON.put("paymentmethod_id", paymentMethodJSON.get("paymentType"));
       paymentMethodJSON.put("paymentTypeId", paymentMethodJSON.get("paymentType"));
-      
+
       paymentMethodJSON.put("startingCash", paymentMethodJSON.get("startingcash"));
       paymentMethodJSON.put("totalSales", paymentMethodJSON.get("totalsales"));
       paymentMethodJSON.put("totalReturns", paymentMethodJSON.get("totalreturns"));
-      paymentMethodJSON.put("lineNo", paymentAppMethod.get("line"));
+      if (paymentAppMethod != null) {
+        paymentMethodJSON.put("lineNo", paymentAppMethod.getLine());
+      } else {
+        paymentMethodJSON.put("lineNo", 1L);
+      }
+
       respArray.put(paymentMethodJSON);
     }
 
