details: https://code.openbravo.com/erp/devel/pi/rev/b5aa430c988e changeset: 16270:b5aa430c988e user: David Miguelez <david.miguelez <at> openbravo.com> date: Mon Apr 30 18:37:47 2012 +0200 summary: Fixes issue 0020380: Changed the call to the javascript function. Now the WindowId parameter is set correctly.
details: https://code.openbravo.com/erp/devel/pi/rev/9e671a86b6e9 changeset: 16271:9e671a86b6e9 user: Sandra Huguet <sandra.huguet <at> openbravo.com> date: Wed Apr 25 15:19:49 2012 +0200 summary: Fixed bug 19981 Add validations in requisition to order Add validations in the requisition order to avoid messages from the database as "c_tax_id" violates not-null constrain and "c_bpartner_id" violates not-null constraint details: https://code.openbravo.com/erp/devel/pi/rev/611cd2d97fe7 changeset: 16272:611cd2d97fe7 user: Mikel Irurita <mikel.irurita <at> openbravo.com> date: Wed May 02 16:44:34 2012 +0200 summary: Related to issue 19981: code review. improve translation diffstat: src-db/database/sourcedata/AD_MESSAGE.xml | 11 +++++ src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.html | 8 ++-- src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java | 19 ++++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) diffs (118 lines): diff -r 21e30409f813 -r 611cd2d97fe7 src-db/database/sourcedata/AD_MESSAGE.xml --- a/src-db/database/sourcedata/AD_MESSAGE.xml Wed May 02 13:39:34 2012 +0200 +++ b/src-db/database/sourcedata/AD_MESSAGE.xml Wed May 02 16:44:34 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> diff -r 21e30409f813 -r 611cd2d97fe7 src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.html --- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.html Wed May 02 13:39:34 2012 +0200 +++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.html Wed May 02 16:44:34 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> diff -r 21e30409f813 -r 611cd2d97fe7 src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java --- a/src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java Wed May 02 13:39:34 2012 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java Wed May 02 16:44:34 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(); ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
