[RTL] Merge from pi
authorDavid Baz Fayos <david.baz@openbravo.com>
Wed, 02 May 2012 21:54:26 +0200
changeset 16363 5313a2151b32
parent 16362 25d660a6694f (current diff)
parent 16274 24bd7476eeff (diff)
child 16364 4a98ad8c57f0
[RTL] Merge from pi
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-tab.js	Wed May 02 21:44:37 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-tab.js	Wed May 02 21:54:26 2012 +0200
@@ -491,6 +491,12 @@
       }
     } else if (this.state === isc.OBStandardView.STATE_BOTTOM_MAX) {
       this.setState(isc.OBStandardView.STATE_MID);
+    } else if (this.state === isc.OBStandardView.STATE_MID) {
+      if (this.parentTabSet) {
+        this.parentTabSet.setState(isc.OBStandardView.STATE_MID);
+      } else {
+        this.parentContainer.setHalfSplit();
+      }
     } else if (this.state === isc.OBStandardView.STATE_TOP_MAX) {
       this.doHandleDoubleClick();
     }
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Wed May 02 21:44:37 2012 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Wed May 02 21:54:26 2012 +0200
@@ -19701,6 +19701,17 @@
 <!--DCF9CB4AB20E4C12ACB0495FB42DBC82-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--DCF9CB4AB20E4C12ACB0495FB42DBC82--></AD_MESSAGE>
 
+<!--DD2F799E54F4462F89762F794BEF3A12--><AD_MESSAGE>
+<!--DD2F799E54F4462F89762F794BEF3A12-->  <AD_MESSAGE_ID><![CDATA[DD2F799E54F4462F89762F794BEF3A12]]></AD_MESSAGE_ID>
+<!--DD2F799E54F4462F89762F794BEF3A12-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DD2F799E54F4462F89762F794BEF3A12-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DD2F799E54F4462F89762F794BEF3A12-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DD2F799E54F4462F89762F794BEF3A12-->  <VALUE><![CDATA[NoTaxRequisition]]></VALUE>
+<!--DD2F799E54F4462F89762F794BEF3A12-->  <MSGTEXT><![CDATA[No tax defined for line %s to requisition number: %s]]></MSGTEXT>
+<!--DD2F799E54F4462F89762F794BEF3A12-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--DD2F799E54F4462F89762F794BEF3A12-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DD2F799E54F4462F89762F794BEF3A12--></AD_MESSAGE>
+
 <!--DD486C2E01F64B2F989DE923C43D41DB--><AD_MESSAGE>
 <!--DD486C2E01F64B2F989DE923C43D41DB-->  <AD_MESSAGE_ID><![CDATA[DD486C2E01F64B2F989DE923C43D41DB]]></AD_MESSAGE_ID>
 <!--DD486C2E01F64B2F989DE923C43D41DB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.html	Wed May 02 21:44:37 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.html	Wed May 02 21:54:26 2012 +0200
@@ -80,11 +80,11 @@
 
     function enableLocalShortcuts(){
       keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, null, '../info/BusinessPartner.html', 'SELECTOR_BUSINESS', true, 'frmMain', 'inpcBpartnerId', 'inpBpartnerId_DES', document.frmMain.inpBpartnerId_DES.value, 'Command', 'KEY');", "inpBpartnerId_DES", "null");
-      keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorId', 'inpmLocatorId_DES', document.frmMain.inpmLocatorId_DES.value, 'Command', 'KEY', 'WindowID', 'CreateFrom_Shipment');", "inpmLocatorId_DES", "null");
+      keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorId', 'inpmLocatorId_DES', document.frmMain.inpmLocatorId_DES.value, 'Command', 'KEY', 'WindowID', document.frmMain.inpWindowId.value);", "inpmLocatorId_DES", "null");
 }
 
 function enableLocatorShortcut(id) {
-  keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorId"+id+"', 'inpmLocatorId_DES"+id+"', document.frmMain.inpmLocatorId_DES"+id+".value, 'Command', 'KEY', 'WindowID', 'CreateFrom_Shipment');", "inpmLocatorId_DES"+id, "null");
+  keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorId"+id+"', 'inpmLocatorId_DES"+id+"', document.frmMain.inpmLocatorId_DES"+id+".value, 'Command', 'KEY', 'WindowID', document.frmMain.inpWindowId.value);", "inpmLocatorId_DES"+id, "null");
   activeElementFocus();
 }
 
@@ -417,7 +417,7 @@
                       <input type="text" class="dojoValidateValid TextBox_btn_TwoCells_width" maxlength="22" name="inpmLocatorId_DES" id="paramM_Locator_ID_DES" value=""></input>
                     </td>
                     <td class="FieldButton_ContentCell">
-                      <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Locator'; return true;" onblur=" window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorId', 'inpmLocatorId_DES', document.frmMain.inpmLocatorId_DES.value, 'WindowID', 'CreateFrom_Shipment');return false;" >
+                      <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Locator'; return true;" onblur=" window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorId', 'inpmLocatorId_DES', document.frmMain.inpmLocatorId_DES.value, 'WindowID', document.frmMain.inpWindowId.value);return false;" >
                         <table class="FieldButton"onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Locator';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
                           <tr>
                             <td class="FieldButton_bg">
@@ -486,7 +486,7 @@
 						<input type="text" onfocus="enableLocatorShortcut('xx');" class="dojoValidateValid TextBox_btn_TwoCells_width" required="false" maxlength="22" name="inpmLocatorId_DESxx" id="fieldM_Locator_ID_DES"></input>
 						</td>
 						<td>
-						<a id="fieldLocatorDES" class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Locator'; return true;" onblur=" window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorIdyyy', 'inpmLocatorId_DESvvv', document.frmMain.inpmLocatorId_DESxxx.value, 'WindowID', 'CreateFrom_Shipment');return false;" >
+						<a id="fieldLocatorDES" class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Locator'; return true;" onblur=" window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorIdyyy', 'inpmLocatorId_DESvvv', document.frmMain.inpmLocatorId_DESxxx.value, 'WindowID', document.frmMain.inpWindowId.value);return false;" >
                         <table class="FieldButton"onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Locator';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
                             <td class="FieldButton_bg">
                               <img alt="Locator" class="FieldButton_Icon FieldButton_Icon_Locator" title="Locator" src="../../../../../web/images/blank.gif" border="0" id="buttonLocator"></img>
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java	Wed May 02 21:44:37 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java	Wed May 02 21:54:26 2012 +0200
@@ -28,7 +28,6 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.hibernate.criterion.Restrictions;
-import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.OBContext;
@@ -40,6 +39,7 @@
 import org.openbravo.erpCommon.businessUtility.TreeData;
 import org.openbravo.erpCommon.utility.DateTimeData;
 import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.SequenceIdData;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.financialmgmt.tax.TaxRegisterTypeLines;
@@ -371,7 +371,7 @@
     if (obCriteria.list().size() > 0) {
       myMessage.setTitle("Error");
       myMessage.setType("Error");
-      myMessage.setMessage(FIN_Utility.messageBD("DocumentTypeInTaxRegisterType"));
+      myMessage.setMessage(OBMessageUtils.messageBD("DocumentTypeInTaxRegisterType"));
       return myMessage;
     }
     return null;
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Locator_Activate.java	Wed May 02 21:44:37 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Locator_Activate.java	Wed May 02 21:54:26 2012 +0200
@@ -24,11 +24,11 @@
 
 import javax.servlet.ServletException;
 
-import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.model.common.enterprise.Locator;
 import org.openbravo.model.common.enterprise.Warehouse;
 import org.openbravo.model.materialmgmt.onhandquantity.StorageDetail;
@@ -58,20 +58,20 @@
 
       if (tab.equals(STORAGEBIN_TAB)) {
         if (storageIsNotEmpty(strLocator)) {
-          info.addResult("MESSAGE", FIN_Utility.messageBD("M_STORAGE_ACTIVE_CHECK_FULL"));
+          info.addResult("MESSAGE", OBMessageUtils.messageBD("M_STORAGE_ACTIVE_CHECK_FULL"));
         } else {
           Locator locator = OBDal.getInstance().get(Locator.class, strLocator);
           if (numberOfActiveStorageBins(locator.getWarehouse()) == 1 && locator.isActive()) {
             // This means that the warehouse has only one active storage bin and it is this one
-            info.addResult("MESSAGE", FIN_Utility.messageBD("M_STORAGE_ACTIVE_CHECK_LAST"));
+            info.addResult("MESSAGE", OBMessageUtils.messageBD("M_STORAGE_ACTIVE_CHECK_LAST"));
           }
         }
       } else if (tab.equals(WAREHOUSE_TAB)) {
         Warehouse warehouse = OBDal.getInstance().get(Warehouse.class, strWarehouse);
         if (numberOfActiveStorageBins(warehouse) > 0) {
-          info.addResult("MESSAGE", FIN_Utility.messageBD("M_WAREHOUSE_ACTIVE_CHECK_ACTIVES"));
+          info.addResult("MESSAGE", OBMessageUtils.messageBD("M_WAREHOUSE_ACTIVE_CHECK_ACTIVES"));
         } else if (warehouseWithPendingReceipts(warehouse.getId())) {
-          info.addResult("MESSAGE", FIN_Utility.messageBD("M_WAREHOUSE_ACTIVE_CHECK_ENTRIES"));
+          info.addResult("MESSAGE", OBMessageUtils.messageBD("M_WAREHOUSE_ACTIVE_CHECK_ENTRIES"));
         }
       }
 
--- a/src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java	Wed May 02 21:44:37 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java	Wed May 02 21:54:26 2012 +0200
@@ -32,6 +32,7 @@
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.businessUtility.Preferences;
 import org.openbravo.erpCommon.businessUtility.Tree;
 import org.openbravo.erpCommon.businessUtility.WindowTabs;
@@ -42,11 +43,13 @@
 import org.openbravo.erpCommon.utility.LeftTabsBar;
 import org.openbravo.erpCommon.utility.NavigationBar;
 import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.PropertyException;
 import org.openbravo.erpCommon.utility.PropertyNotFoundException;
 import org.openbravo.erpCommon.utility.SequenceIdData;
 import org.openbravo.erpCommon.utility.ToolBar;
 import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.model.procurement.RequisitionLine;
 import org.openbravo.utils.Replace;
 import org.openbravo.xmlEngine.XmlDocument;
 
@@ -461,6 +464,11 @@
       myMessage.setMessage(Utility.messageBD(this, "VendorWithNoPaymentTerm", vars.getLanguage()));
       return myMessage;
     }
+    if ("".equals(RequisitionToOrderData.cBPartnerLocationId(this, strVendor))) {
+      myMessage.setType("Error");
+      myMessage.setMessage(Utility.messageBD(this, "NoBPLocation", vars.getLanguage()));
+      return myMessage;
+    }
 
     try {
       conn = getTransactionConnection();
@@ -515,6 +523,16 @@
               : RequisitionToOrderData.billto(this, strVendor), RequisitionToOrderData
               .cBPartnerLocationId(this, strVendor), strPriceListVersionId, strSelected);
       for (int i = 0; lines != null && i < lines.length; i++) {
+        if ("".equals(lines[i].tax)) {
+          RequisitionLine rl = OBDal.getInstance().get(RequisitionLine.class,
+              lines[i].mRequisitionlineId);
+          myMessage.setType("Error");
+          myMessage.setMessage(String.format(OBMessageUtils.messageBD("NoTaxRequisition"),
+              rl.getLineNo(), rl.getRequisition().getDocumentNo()));
+          releaseRollbackConnection(conn);
+          return myMessage;
+        }
+
         if (i == 0)
           strCOrderlineID = SequenceIdData.getUUID();
         if (i == lines.length - 1) {
@@ -559,6 +577,7 @@
           strCOrderlineID = SequenceIdData.getUUID();
         }
       }
+
       unlockRequisitionLines(vars, strSelected);
       for (int i = 0; lines != null && i < lines.length; i++) {
         String strRequisitionOrderId = SequenceIdData.getUUID();