details:   /erp/devel/int/rev/8e9fc50c9bd5
changeset: 6451:8e9fc50c9bd5
user:      Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
date:      Thu Feb 18 12:19:28 2010 +0530
summary:   Fixes Issue 12274: The copy lines process on the sales invoice does 
not manage well the organization.

details:   /erp/devel/int/rev/c4f60fa9011b
changeset: 6452:c4f60fa9011b
user:      Balamurugan Ramadoss <balamurugan.ramadoss <at> openbravo.com>
date:      Thu Feb 18 14:55:14 2010 +0530
summary:   Fixes Issue 12072: Create lines from in Settlement doesn't calculate 
properly.

diffstat:

 src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java       |   5 +-
 src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql  |  13 
+++-
 src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Settlement.html |  32 
+++++++--
 3 files changed, 40 insertions(+), 10 deletions(-)

diffs (99 lines):

diff -r 53e2c2b7a0aa -r c4f60fa9011b 
src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java  Wed Feb 
17 16:57:18 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java  Thu Feb 
18 14:55:14 2010 +0530
@@ -79,12 +79,13 @@
       CopyFromInvoiceData[] data = CopyFromInvoiceData.select(conn, this, 
strInvoice, Utility
           .getContext(this, vars, "#User_Client", windowId), 
Utility.getContext(this, vars,
           "#User_Org", windowId));
+      CopyFromInvoiceData[] dataInvoice = 
CopyFromInvoiceData.selectInvoice(conn, this, strKey);
       if (data != null && data.length != 0) {
         for (i = 0; i < data.length; i++) {
           String strSequence = SequenceIdData.getUUID();
           try {
-            CopyFromInvoiceData.insert(conn, this, strSequence, strKey, 
vars.getClient(), vars
-                .getOrg(), vars.getUser(), data[i].cInvoicelineId);
+            CopyFromInvoiceData.insert(conn, this, strSequence, strKey, 
dataInvoice[0].adClientId,
+                dataInvoice[0].adOrgId, vars.getUser(), 
data[i].cInvoicelineId);
           } catch (ServletException ex) {
             myError = Utility.translateError(this, vars, vars.getLanguage(), 
ex.getMessage());
             releaseRollbackConnection(conn);
diff -r 53e2c2b7a0aa -r c4f60fa9011b 
src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql
--- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql     
Wed Feb 17 16:57:18 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql     
Thu Feb 18 14:55:14 2010 +0530
@@ -27,7 +27,7 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
       <![CDATA[
-        SELECT C_InvoiceLine_ID FROM C_InvoiceLine 
+        SELECT C_InvoiceLine_ID, '' AS AD_ORG_ID, '' AS AD_CLIENT_ID FROM 
C_InvoiceLine 
         WHERE C_Invoice_ID = ? 
         AND AD_CLIENT_ID IN ('1') 
         AND AD_ORG_ID IN ('1') 
@@ -65,4 +65,15 @@
     <Parameter name="cInvoicelineId"/>
     <Parameter name="cInvoicelineId"/>
   </SqlMethod>
+  <SqlMethod name="selectInvoice" type="preparedStatement" connection="true" 
return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT AD_ORG_ID,AD_CLIENT_ID FROM C_Invoice 
+        WHERE C_Invoice_ID = ? 
+        AND ISACTIVE = 'Y'
+      ]]>
+    </Sql>
+    <Parameter name="cInvoiceId"/>
+  </SqlMethod>
 </SqlClass>
diff -r 53e2c2b7a0aa -r c4f60fa9011b 
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Settlement.html
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Settlement.html    
Wed Feb 17 16:57:18 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Settlement.html    
Thu Feb 18 14:55:14 2010 +0530
@@ -70,10 +70,18 @@
       if (obj==null) return false;
       var price = document.frmMain.inpTotalPrice;
       var actualValue = Number(eval("document.frmMain.inpPrice" + obj.value + 
".value"));
-
+      var radio = document.frmMain.inpcDebtPaymentId;
+      var flag = true
       if (obj.checked) {
+        for (var i=0;i<radio.length;i++) { 
+           if (!radio[i].checked)
+             flag = false;
+         }
+         if(flag)
+           document.frmMain.inpTodos.checked=true; 
          price.value = round(Number(price.value),2) + actualValue;
       } else {
+       document.frmMain.inpTodos.checked=false;
         price.value = round(Number(price.value),2) - actualValue;
       }
 
@@ -113,12 +121,22 @@
         return submitCommandForm('FIND_SETTLEMENT', true);
       } else {
           var total = radio.length;
-        for (var i=0;i<total;i++) {
-              radio[i].checked=obj.checked;
-              frm.elements["inpwriteoff" + 
radio[i].value].disabled=!obj.checked;
-              frm.elements["inpispaid" + radio[i].value].disabled=!obj.checked;
-              updatePrice(radio[i]);
-        }
+          for (var i=0;i<total;i++) {
+                 if (obj.checked) {
+                    if (!radio[i].checked) {
+                    radio[i].checked=obj.checked;
+                    frm.elements["inpwriteoff" + 
radio[i].value].disabled=!obj.checked;
+                    frm.elements["inpispaid" + 
radio[i].value].disabled=!obj.checked;
+                    updatePrice(radio[i]);
+                    }
+                 }
+                 else {
+                radio[i].checked=obj.checked;
+                frm.elements["inpwriteoff" + 
radio[i].value].disabled=!obj.checked;
+                frm.elements["inpispaid" + 
radio[i].value].disabled=!obj.checked;
+                updatePrice(radio[i]);
+                 }
+          }
       }
       return true;
     }

------------------------------------------------------------------------------
Download Intel&reg; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs 
proactively, and fine-tune applications for parallel performance. 
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to