details: https://code.openbravo.com/erp/devel/pi/rev/ee2305b70862
changeset: 21385:ee2305b70862
user: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at>
openbravo.com>
date: Fri Oct 25 12:15:12 2013 +0530
summary: Fixes issue 0024937: Amounts shown in incorrect columns in Add
Payment
Amounts shown in incorrect columns when adding a GL Item to a payment if Client
has accounting dimensions centrally maintained
diffstat:
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.html
| 112 ++++++++-
1 files changed, 100 insertions(+), 12 deletions(-)
diffs (212 lines):
diff -r a7117f83ff8f -r ee2305b70862
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.html
---
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.html
Fri Oct 25 12:05:24 2013 +0530
+++
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.html
Fri Oct 25 12:15:12 2013 +0530
@@ -12,7 +12,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
*************************************************************************
@@ -328,7 +328,7 @@
cellGLItemDim.appendChild(textNode);
cellGLItemDim.className = 'DataGrid_Body_Cell';
cellCount++;
- } else if
(OB.APRM.APFT_GLItems[i][glAcctDimsDesc[acctDim].replace("Desc", "Displayed")])
{
+ } else if
(OB.APRM.APFT_GLItems[i][glAcctDimsDesc[acctDim].replace("Desc", "Displayed")]
=== 'Y') {
// The Acct. Dimen is displayed and the user has left it empty
cellGLItemDim = row.insertCell(cellCount);
textNode = document.createTextNode("");
@@ -336,6 +336,13 @@
cellGLItemDim.className = 'DataGrid_Body_Cell';
cellCount++;
}
+ if(cellCount < 4 && acctDim === (glAcctDimsDesc.length-1)) {
+ var newElements = glAcctDimsDescnext.slice(0,
(glAcctDimsDesc.length)-(cellCount-1));
+ for(var addElement = 0; addElement < newElements.length;
addElement++) {
+ glAcctDimsDesc.push(newElements[addElement]);
+ }
+ glAcctDimsDescnext =
glAcctDimsDescnext.slice(((glAcctDimsDescnext.length)-(cellCount-1)));
+ }
}
cellGLITemReceivedInAmt = row.insertCell(cellCount);
@@ -390,7 +397,7 @@
cellGLItemDim.appendChild(textNode);
cellGLItemDim.className = 'DataGrid_Body_Cell';
cellCount++;
- } else if
(OB.APRM.APFT_GLItems[i][glAcctDimsDescnext[acctDim].replace("Desc",
"Displayed")]) {
+ } else if
(OB.APRM.APFT_GLItems[i][glAcctDimsDescnext[acctDim].replace("Desc",
"Displayed")] === 'Y') {
// The Acct. Dimen is displayed and the user has left it empty
cellGLItemDim = row.insertCell(cellCount);
textNode = document.createTextNode("");
@@ -681,54 +688,135 @@
displayLogicElement(dimension + '_th', isDisplayed)
}
var displayTitle = false;
+ var table = document.getElementById('sectionGLItemGridHeader');
+ var row = table.rows;
+ var rowLength = row.length;
+ var cellCount = 1, rowCount = 0, lastRow = rowLength-1, lastCell =
(row[lastRow].cells.length)-1;
if (document.frmMain.strElement_BP.value === 'Y' && isDisplayed) {
+ row[rowCount].cells[cellCount].innerHTML = 'Business Partner';
+ row[rowCount].cells[cellCount].id = 'c_bpartner_id_th';
+ cellCount++;
displayLogicDimension('c_bpartner_id', true);
displayTitle = true;
} else {
+ row[lastRow].cells[lastCell].id = 'c_bpartner_id_th';
+ lastCell--;
displayLogicDimension('c_bpartner_id', false);
}
if (document.frmMain.strElement_AY.value === 'Y' && isDisplayed) {
+ row[rowCount].cells[cellCount].innerHTML = 'Activity';
+ row[rowCount].cells[cellCount].id = 'c_activity_id_th';
+ cellCount++;
displayLogicDimension('c_activity_id', true);
displayTitle = true;
} else {
+ row[lastRow].cells[lastCell].id = 'c_activity_id_th';
+ lastCell--;
displayLogicDimension('c_activity_id', false);
}
if (document.frmMain.strElement_PR.value === 'Y' && isDisplayed) {
+ row[rowCount].cells[cellCount].innerHTML = 'Product';
+ row[rowCount].cells[cellCount].id = 'm_product_id_th';
+ cellCount++;
displayLogicDimension('m_product_id', true);
displayTitle = true;
} else {
+ row[lastRow].cells[lastCell].id = 'm_product_id_th';
+ lastCell--;
displayLogicDimension('m_product_id', false);
}
+
if (document.frmMain.strElement_MC.value === 'Y' && isDisplayed) {
+ row[rowCount].cells[cellCount].innerHTML = 'Campaign';
+ row[rowCount].cells[cellCount].id = 'c_campaign_id_th';
+ cellCount++;
displayLogicDimension('c_campaign_id', true);
displayTitle = true;
} else {
+ row[lastRow].cells[lastCell].id = 'c_campaign_id_th';
+ lastCell--;
displayLogicDimension('c_campaign_id', false);
}
+ if(cellCount > 4) {
+ rowCount++;
+ cellCount = 0;
+ }
+
+ if(lastCell < 0) {
+ lastRow --;
+ lastCell = (row[lastRow].cells.length)-4;
+ }
if (document.frmMain.strElement_PJ.value === 'Y' && isDisplayed) {
+ row[rowCount].cells[cellCount].innerHTML = 'Project';
+ row[rowCount].cells[cellCount].id = 'c_project_id_th';
+ cellCount++;
displayLogicDimension('c_project_id', true);
displayTitle = true;
} else {
+ row[lastRow].cells[lastCell].id = 'c_project_id_th';
+ lastCell--;
displayLogicDimension('c_project_id', false);
}
+ if(cellCount > 4) {
+ rowCount++;
+ cellCount = 1;
+ }
+
+ if(lastCell < 0) {
+ lastRow --;
+ lastCell = (row[lastRow].cells.length)-4;
+ }
if (document.frmMain.strElement_CC.value === 'Y' && isDisplayed) {
+ row[rowCount].cells[cellCount].innerHTML = 'Cost Center';
+ row[rowCount].cells[cellCount].id = 'c_costcenter_id_th';
+ cellCount++;
displayLogicDimension('c_costcenter_id', true);
displayTitle = true;
} else {
+ row[lastRow].cells[lastCell].id = 'c_costcenter_id_th';
+ lastCell--;
displayLogicDimension('c_costcenter_id', false);
}
+ if(cellCount > 4) {
+ rowCount++;
+ cellCount = 1;
+ }
+
+ if(lastCell < 0) {
+ lastRow --;
+ lastCell = (row[lastRow].cells.length)-4;
+ }
if (document.frmMain.strElement_U1.value === 'Y' && isDisplayed) {
+ row[rowCount].cells[cellCount].innerHTML = '1st Dimension';
+ row[rowCount].cells[cellCount].id = 'user1_id_th';
+ cellCount++;
displayLogicDimension('user1_id', true);
displayTitle = true;
} else {
+ row[lastRow].cells[lastCell].id = 'user1_id_th';
+ lastCell--;
displayLogicDimension('user1_id', false);
}
+ if(cellCount > 4) {
+ rowCount++;
+ cellCount = 1;
+ }
+
+ if(lastCell < 0) {
+ lastRow --;
+ lastCell = (row[lastRow].cells.length)-4;
+ }
if (document.frmMain.strElement_U2.value === 'Y' && isDisplayed) {
+ row[rowCount].cells[cellCount].innerHTML = '2nd Dimension';
+ row[rowCount].cells[cellCount].id = 'user2_id_th';
+ cellCount++;
displayLogicDimension('user2_id', true);
displayTitle = true;
} else {
+ row[lastRow].cells[lastCell].id = 'user2_id_th';
+ lastCell--;
displayLogicDimension('user2_id', false);
}
@@ -1632,22 +1720,22 @@
</tbody>
</table>
<table cellspacing="0" cellpadding="0" width="100%"
class="DataGrid_Header_Table DataGrid_Body_Table" style="table-layout: auto;"
id="gridGLItem">
- <thead>
+ <thead id="sectionGLItemGridHeader">
<tr class="DataGrid_Body_Row">
<th class="DataGrid_Header_Cell" width="300"
rowspan="2">GL Item</th>
- <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" id="c_bpartner_id_th">Business
Partner</th>
- <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" id="c_activity_id_th">Activity</th>
- <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" id="m_product_id_th">Product</th>
- <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" id="c_campaign_id_th">Campaign</th>
+ <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" ></th>
+ <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" ></th>
+ <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" ></th>
+ <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" ></th>
<th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" rowspan="2">Received In</th>
<th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" rowspan="2">Paid Out</th>
<th class="DataGrid_Header_LineNoCell" width="20"
rowspan="2"></th>
</tr>
<tr class="DataGrid_Body_Row">
- <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" id="c_project_id_th">Project</th>
- <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" id="c_costcenter_id_th">Cost
Center</th>
- <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" id="user1_id_th">1st Dimension</th>
- <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" id="user2_id_th">2nd Dimension</th>
+ <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" ></th>
+ <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" ></th>
+ <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" ></th>
+ <th class="DataGrid_Header_Cell
DataGrid_Header_Cell_Inverse" width="100" ></th>
</tr>
</thead>
<tbody id="sectionGLItemGrid">
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits