Friday, September 2, 2016

Some Command what may help Openbravo Web POS developers

1. Create New Order

OB.POS.modelterminal.orderList.addNewOrder(true);

2. Logout (Lock Session) from the Web POS

OB.MobileApp.model.lock();

3. Hold Customer as He can not create another order same time.

var sqlblockingCustomer;
          function success(tx) {
            window.console.log(tx);
          }

        function error(tx) {
          window.console.error(tx);
          }
var sqlblockingCustomer = "update c_bpartner set customerBlocking='true' where c_bpartner_id='" + OB.POS.modelterminal.orderList.current.get('bp').get('id') + "'";
          var db = OB.Data.localDB;
          db.transaction(function(tx){
            tx.executeSql(sqlblockingCustomer);
          });

4. Do not able to add order keep the current order Blank.
Location: View > Toolbar Left
if (OB.POS.modelterminal.orderList.current.get('lines').length === 0){
  alert("Please add item current Order First");
  return true;
}
else{

        me.doAddNewOrder();
}