Changes to support inclusive of tax in sales and purchase invoice - except rounding changes
authorHari Madhavan <hari.madhavan@promantia.com>
Sat, 16 Jun 2012 22:54:41 +0530
changeset 17335 b3bc0e1a2b76
parent 17334 31774ab78ca6
child 17336 19b95eb2252d
Changes to support inclusive of tax in sales and purchase invoice - except rounding changes
src-db/database/model/triggers/C_ORDERLINE_TRG2.xml
src-db/database/sourcedata/AD_AUXILIARINPUT.xml
src-db/database/sourcedata/AD_CALLOUT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_DATASET.xml
src-db/database/sourcedata/AD_DATASET_COLUMN.xml
src-db/database/sourcedata/AD_DATASET_TABLE.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_EXTENSION_POINTS.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_FIELDGROUP.xml
src-db/database/sourcedata/AD_FORM.xml
src-db/database/sourcedata/AD_MENU.xml
src-db/database/sourcedata/AD_MESSAGE.xml
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
src-db/database/sourcedata/AD_MODEL_OBJECT_PARA.xml
src-db/database/sourcedata/AD_MODULE.xml
src-db/database/sourcedata/AD_MODULE_DBPREFIX.xml
src-db/database/sourcedata/AD_PACKAGE.xml
src-db/database/sourcedata/AD_PREFERENCE.xml
src-db/database/sourcedata/AD_PROCESS.xml
src-db/database/sourcedata/AD_PROCESS_PARA.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_REF_LIST.xml
src-db/database/sourcedata/AD_REF_SEARCH.xml
src-db/database/sourcedata/AD_REF_SEARCH_COLUMN.xml
src-db/database/sourcedata/AD_REF_TABLE.xml
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_TABLE.xml
src-db/database/sourcedata/AD_TEXTINTERFACES.xml
src-db/database/sourcedata/AD_TREENODE.xml
src-db/database/sourcedata/AD_VAL_RULE.xml
src-db/database/sourcedata/AD_WINDOW.xml
src-db/database/sourcedata/OBCLKER_UIDEFINITION.xml
src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
src-db/database/sourcedata/OBUIAPP_PROCESS.xml
src-db/database/sourcedata/OBUIAPP_REF_WINDOW.xml
src-db/database/sourcedata/OBUISEL_SELECTOR.xml
src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml
src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java
src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java
--- a/src-db/database/model/triggers/C_ORDERLINE_TRG2.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/model/triggers/C_ORDERLINE_TRG2.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -244,7 +244,7 @@
     UPDATE C_Order
     SET TotalLines = TotalLines - v_oldLine + v_newLineNetAmt,
         GrandTotal = CASE v_istaxincluded
-                       WHEN 'Y' THEN grandtotal - v_oldgrossamt + v_newgrossamt
+                       WHEN 'Y' THEN round(grandtotal - v_oldgrossamt + v_newgrossamt, 3)
                        ELSE TotalLines - v_oldLine + v_newLineNetAmt + COALESCE(v_taxAmt, 0)
                      END
     --  Updated = SysDate -- Don't update as otherwise it does not save changes
--- a/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,16 +1,5 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
-<!--1--><AD_AUXILIARINPUT>
-<!--1-->  <AD_AUXILIARINPUT_ID><![CDATA[1]]></AD_AUXILIARINPUT_ID>
-<!--1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--1-->  <AD_TAB_ID><![CDATA[187]]></AD_TAB_ID>
-<!--1-->  <NAME><![CDATA[M_PRICELIST_ID]]></NAME>
-<!--1-->  <CODE><![CDATA[@M_PRICELIST_ID@]]></CODE>
-<!--1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--1--></AD_AUXILIARINPUT>
-
 <!--6--><AD_AUXILIARINPUT>
 <!--6-->  <AD_AUXILIARINPUT_ID><![CDATA[6]]></AD_AUXILIARINPUT_ID>
 <!--6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1517,6 +1506,17 @@
 <!--A241041B0E6E402EB8D22417AFA623B9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--A241041B0E6E402EB8D22417AFA623B9--></AD_AUXILIARINPUT>
 
+<!--A30BE76CF53B4365A97DA2B13D23EB5D--><AD_AUXILIARINPUT>
+<!--A30BE76CF53B4365A97DA2B13D23EB5D-->  <AD_AUXILIARINPUT_ID><![CDATA[A30BE76CF53B4365A97DA2B13D23EB5D]]></AD_AUXILIARINPUT_ID>
+<!--A30BE76CF53B4365A97DA2B13D23EB5D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A30BE76CF53B4365A97DA2B13D23EB5D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A30BE76CF53B4365A97DA2B13D23EB5D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A30BE76CF53B4365A97DA2B13D23EB5D-->  <AD_TAB_ID><![CDATA[291]]></AD_TAB_ID>
+<!--A30BE76CF53B4365A97DA2B13D23EB5D-->  <NAME><![CDATA[GROSSPRICE]]></NAME>
+<!--A30BE76CF53B4365A97DA2B13D23EB5D-->  <CODE><![CDATA[@SQL=SELECT istaxincluded from m_pricelist where m_pricelist_id = @M_PRICELIST_ID@]]></CODE>
+<!--A30BE76CF53B4365A97DA2B13D23EB5D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A30BE76CF53B4365A97DA2B13D23EB5D--></AD_AUXILIARINPUT>
+
 <!--A34C13AD479544949B45481A3FD0E578--><AD_AUXILIARINPUT>
 <!--A34C13AD479544949B45481A3FD0E578-->  <AD_AUXILIARINPUT_ID><![CDATA[A34C13AD479544949B45481A3FD0E578]]></AD_AUXILIARINPUT_ID>
 <!--A34C13AD479544949B45481A3FD0E578-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1836,6 +1836,17 @@
 <!--E1DE8CDF77324033B2C21CE99DCB7A59-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--E1DE8CDF77324033B2C21CE99DCB7A59--></AD_AUXILIARINPUT>
 
+<!--E852BFC21B4C468C9E3F22901A6ED75C--><AD_AUXILIARINPUT>
+<!--E852BFC21B4C468C9E3F22901A6ED75C-->  <AD_AUXILIARINPUT_ID><![CDATA[E852BFC21B4C468C9E3F22901A6ED75C]]></AD_AUXILIARINPUT_ID>
+<!--E852BFC21B4C468C9E3F22901A6ED75C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E852BFC21B4C468C9E3F22901A6ED75C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E852BFC21B4C468C9E3F22901A6ED75C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E852BFC21B4C468C9E3F22901A6ED75C-->  <AD_TAB_ID><![CDATA[270]]></AD_TAB_ID>
+<!--E852BFC21B4C468C9E3F22901A6ED75C-->  <NAME><![CDATA[GROSSPRICE]]></NAME>
+<!--E852BFC21B4C468C9E3F22901A6ED75C-->  <CODE><![CDATA[@SQL=SELECT istaxincluded from m_pricelist where m_pricelist_id = @M_PRICELIST_ID@]]></CODE>
+<!--E852BFC21B4C468C9E3F22901A6ED75C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E852BFC21B4C468C9E3F22901A6ED75C--></AD_AUXILIARINPUT>
+
 <!--ED9749CC067E495FA3D369E65B972450--><AD_AUXILIARINPUT>
 <!--ED9749CC067E495FA3D369E65B972450-->  <AD_AUXILIARINPUT_ID><![CDATA[ED9749CC067E495FA3D369E65B972450]]></AD_AUXILIARINPUT_ID>
 <!--ED9749CC067E495FA3D369E65B972450-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1865,7 +1876,7 @@
 <!--F77560579B7E4105A0C8455FCFB1B333-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F77560579B7E4105A0C8455FCFB1B333-->  <AD_TAB_ID><![CDATA[187]]></AD_TAB_ID>
 <!--F77560579B7E4105A0C8455FCFB1B333-->  <NAME><![CDATA[GROSSPRICE]]></NAME>
-<!--F77560579B7E4105A0C8455FCFB1B333-->  <CODE><![CDATA[Y]]></CODE>
+<!--F77560579B7E4105A0C8455FCFB1B333-->  <CODE><![CDATA[@SQL=SELECT istaxincluded from m_pricelist where m_pricelist_id = @M_PRICELIST_ID@]]></CODE>
 <!--F77560579B7E4105A0C8455FCFB1B333-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--F77560579B7E4105A0C8455FCFB1B333--></AD_AUXILIARINPUT>
 
--- a/src-db/database/sourcedata/AD_CALLOUT.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_CALLOUT.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--100--><AD_CALLOUT>
 <!--100-->  <AD_CALLOUT_ID><![CDATA[100]]></AD_CALLOUT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--100--><AD_COLUMN>
 <!--100-->  <AD_COLUMN_ID><![CDATA[100]]></AD_COLUMN_ID>
@@ -62758,7 +62758,7 @@
 <!--3843-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--3843-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
 <!--3843-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
-<!--3843-->  <READONLYLOGIC><![CDATA[@Processed@='Y']]></READONLYLOGIC>
+<!--3843-->  <READONLYLOGIC><![CDATA[@Processed@='Y'|@GROSSPRICE@='Y']]></READONLYLOGIC>
 <!--3843-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
 <!--3843-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
 <!--3843-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -254761,6 +254761,7 @@
 <!--7B0E6024A8EC4EF29BF18AEDC92D4E2C-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
 <!--7B0E6024A8EC4EF29BF18AEDC92D4E2C-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--7B0E6024A8EC4EF29BF18AEDC92D4E2C-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--7B0E6024A8EC4EF29BF18AEDC92D4E2C-->  <AD_CALLOUT_ID><![CDATA[127]]></AD_CALLOUT_ID>
 <!--7B0E6024A8EC4EF29BF18AEDC92D4E2C-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--7B0E6024A8EC4EF29BF18AEDC92D4E2C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--7B0E6024A8EC4EF29BF18AEDC92D4E2C-->  <POSITION><![CDATA[40]]></POSITION>
--- a/src-db/database/sourcedata/AD_DATASET.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_DATASET.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--0--><AD_DATASET>
 <!--0-->  <AD_DATASET_ID><![CDATA[0]]></AD_DATASET_ID>
--- a/src-db/database/sourcedata/AD_DATASET_COLUMN.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_DATASET_COLUMN.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--00F9F94AA5D811DD9010001B388C61A4--><AD_DATASET_COLUMN>
 <!--00F9F94AA5D811DD9010001B388C61A4-->  <AD_DATASET_COLUMN_ID><![CDATA[00F9F94AA5D811DD9010001B388C61A4]]></AD_DATASET_COLUMN_ID>
--- a/src-db/database/sourcedata/AD_DATASET_TABLE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_DATASET_TABLE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--0004648349C24CBB8BDE8127BBE35C99--><AD_DATASET_TABLE>
 <!--0004648349C24CBB8BDE8127BBE35C99-->  <AD_DATASET_TABLE_ID><![CDATA[0004648349C24CBB8BDE8127BBE35C99]]></AD_DATASET_TABLE_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--102--><AD_ELEMENT>
 <!--102-->  <AD_ELEMENT_ID><![CDATA[102]]></AD_ELEMENT_ID>
@@ -21535,12 +21535,12 @@
 <!--45D99A3B01114FF6A7E21268362338A1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--45D99A3B01114FF6A7E21268362338A1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--45D99A3B01114FF6A7E21268362338A1-->  <COLUMNNAME><![CDATA[Line_Gross_Amount]]></COLUMNNAME>
-<!--45D99A3B01114FF6A7E21268362338A1-->  <NAME><![CDATA[Gross Amount]]></NAME>
-<!--45D99A3B01114FF6A7E21268362338A1-->  <PRINTNAME><![CDATA[Gross Amount]]></PRINTNAME>
+<!--45D99A3B01114FF6A7E21268362338A1-->  <NAME><![CDATA[Line Gross Amount]]></NAME>
+<!--45D99A3B01114FF6A7E21268362338A1-->  <PRINTNAME><![CDATA[Line Gross Amount]]></PRINTNAME>
 <!--45D99A3B01114FF6A7E21268362338A1-->  <DESCRIPTION><![CDATA[Gross Amount for a line]]></DESCRIPTION>
 <!--45D99A3B01114FF6A7E21268362338A1-->  <HELP><![CDATA[This is the total amount against a line ( i.e product price * quantity + taxes ) ]]></HELP>
-<!--45D99A3B01114FF6A7E21268362338A1-->  <PO_NAME><![CDATA[Gross Amount]]></PO_NAME>
-<!--45D99A3B01114FF6A7E21268362338A1-->  <PO_PRINTNAME><![CDATA[Gross Amount]]></PO_PRINTNAME>
+<!--45D99A3B01114FF6A7E21268362338A1-->  <PO_NAME><![CDATA[Line Gross Amount]]></PO_NAME>
+<!--45D99A3B01114FF6A7E21268362338A1-->  <PO_PRINTNAME><![CDATA[Line Gross Amount]]></PO_PRINTNAME>
 <!--45D99A3B01114FF6A7E21268362338A1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--45D99A3B01114FF6A7E21268362338A1-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--45D99A3B01114FF6A7E21268362338A1--></AD_ELEMENT>
--- a/src-db/database/sourcedata/AD_EXTENSION_POINTS.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_EXTENSION_POINTS.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--1117A5F3D17F4B7E85B41838C9F31DE4--><AD_EXTENSION_POINTS>
 <!--1117A5F3D17F4B7E85B41838C9F31DE4-->  <AD_EXTENSION_POINTS_ID><![CDATA[1117A5F3D17F4B7E85B41838C9F31DE4]]></AD_EXTENSION_POINTS_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--100--><AD_FIELD>
 <!--100-->  <AD_FIELD_ID><![CDATA[100]]></AD_FIELD_ID>
@@ -36612,6 +36612,7 @@
 <!--2998-->  <AD_COLUMN_ID><![CDATA[3842]]></AD_COLUMN_ID>
 <!--2998-->  <AD_FIELDGROUP_ID><![CDATA[402880E72F1C15A5012F1C7AA98B00E8]]></AD_FIELDGROUP_ID>
 <!--2998-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--2998-->  <DISPLAYLOGIC><![CDATA[@GROSSPRICE@='N']]></DISPLAYLOGIC>
 <!--2998-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
 <!--2998-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--2998-->  <SEQNO><![CDATA[80]]></SEQNO>
@@ -41418,6 +41419,7 @@
 <!--3373-->  <AD_COLUMN_ID><![CDATA[3842]]></AD_COLUMN_ID>
 <!--3373-->  <AD_FIELDGROUP_ID><![CDATA[402880E72F1C15A5012F1C7AA98B00E8]]></AD_FIELDGROUP_ID>
 <!--3373-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--3373-->  <DISPLAYLOGIC><![CDATA[@GROSSPRICE@='N']]></DISPLAYLOGIC>
 <!--3373-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
 <!--3373-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--3373-->  <SEQNO><![CDATA[80]]></SEQNO>
@@ -169412,6 +169414,35 @@
 <!--0BC36659B639428091471EDF44AECDB3-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--0BC36659B639428091471EDF44AECDB3--></AD_FIELD>
 
+<!--0BDCD34070C249D0BE6FF9667BCF58FB--><AD_FIELD>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <AD_FIELD_ID><![CDATA[0BDCD34070C249D0BE6FF9667BCF58FB]]></AD_FIELD_ID>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <NAME><![CDATA[Line Gross Amount]]></NAME>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <DESCRIPTION><![CDATA[Gross Amount for a line]]></DESCRIPTION>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <HELP><![CDATA[This is the total amount against a line ( i.e product price * quantity + taxes ) ]]></HELP>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <AD_TAB_ID><![CDATA[270]]></AD_TAB_ID>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <AD_COLUMN_ID><![CDATA[D497AE1E0F9948519C7E82464AD6A114]]></AD_COLUMN_ID>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <DISPLAYLOGIC><![CDATA[@GROSSPRICE@='Y']]></DISPLAYLOGIC>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <SEQNO><![CDATA[65]]></SEQNO>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <GRID_SEQNO><![CDATA[65]]></GRID_SEQNO>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--0BDCD34070C249D0BE6FF9667BCF58FB--></AD_FIELD>
+
 <!--0BF4F820661743B392304DC6FFA7317D--><AD_FIELD>
 <!--0BF4F820661743B392304DC6FFA7317D-->  <AD_FIELD_ID><![CDATA[0BF4F820661743B392304DC6FFA7317D]]></AD_FIELD_ID>
 <!--0BF4F820661743B392304DC6FFA7317D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -174873,6 +174904,35 @@
 <!--37A1B7DCC626476482EF8F0B30BB4660-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--37A1B7DCC626476482EF8F0B30BB4660--></AD_FIELD>
 
+<!--37B6D63D1F604009AA3E59DB7FA81D01--><AD_FIELD>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <AD_FIELD_ID><![CDATA[37B6D63D1F604009AA3E59DB7FA81D01]]></AD_FIELD_ID>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <NAME><![CDATA[Gross Unit Price]]></NAME>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <DESCRIPTION><![CDATA[Price inclusive of taxes]]></DESCRIPTION>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <HELP><![CDATA[This is the price that is provided when the price is inclusive of taxes. ]]></HELP>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <AD_TAB_ID><![CDATA[270]]></AD_TAB_ID>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <AD_COLUMN_ID><![CDATA[7B0E6024A8EC4EF29BF18AEDC92D4E2C]]></AD_COLUMN_ID>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <DISPLAYLOGIC><![CDATA[@GROSSPRICE@='Y']]></DISPLAYLOGIC>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <SEQNO><![CDATA[55]]></SEQNO>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <GRID_SEQNO><![CDATA[55]]></GRID_SEQNO>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--37B6D63D1F604009AA3E59DB7FA81D01-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--37B6D63D1F604009AA3E59DB7FA81D01--></AD_FIELD>
+
 <!--37CB520066824462B975F7293A547925--><AD_FIELD>
 <!--37CB520066824462B975F7293A547925-->  <AD_FIELD_ID><![CDATA[37CB520066824462B975F7293A547925]]></AD_FIELD_ID>
 <!--37CB520066824462B975F7293A547925-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -176276,7 +176336,7 @@
 <!--44023AE71D154D9DBE06532EDA193069-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--44023AE71D154D9DBE06532EDA193069-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--44023AE71D154D9DBE06532EDA193069-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--44023AE71D154D9DBE06532EDA193069-->  <NAME><![CDATA[Gross Amount]]></NAME>
+<!--44023AE71D154D9DBE06532EDA193069-->  <NAME><![CDATA[Line Gross Amount]]></NAME>
 <!--44023AE71D154D9DBE06532EDA193069-->  <DESCRIPTION><![CDATA[Gross Amount for a line]]></DESCRIPTION>
 <!--44023AE71D154D9DBE06532EDA193069-->  <HELP><![CDATA[This is the total amount against a line ( i.e product price * quantity + taxes ) ]]></HELP>
 <!--44023AE71D154D9DBE06532EDA193069-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
@@ -176415,7 +176475,7 @@
 <!--453A06D8F77F487A86A1A2238C7F575B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--453A06D8F77F487A86A1A2238C7F575B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--453A06D8F77F487A86A1A2238C7F575B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--453A06D8F77F487A86A1A2238C7F575B-->  <NAME><![CDATA[Gross Amount]]></NAME>
+<!--453A06D8F77F487A86A1A2238C7F575B-->  <NAME><![CDATA[Line Gross Amount]]></NAME>
 <!--453A06D8F77F487A86A1A2238C7F575B-->  <DESCRIPTION><![CDATA[Gross Amount for a line]]></DESCRIPTION>
 <!--453A06D8F77F487A86A1A2238C7F575B-->  <HELP><![CDATA[This is the total amount against a line ( i.e product price * quantity + taxes ) ]]></HELP>
 <!--453A06D8F77F487A86A1A2238C7F575B-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
@@ -222007,6 +222067,35 @@
 <!--D663220F1B004AE7A1668659C144F827-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--D663220F1B004AE7A1668659C144F827--></AD_FIELD>
 
+<!--D675A1322C8543CEB95A6D9E39813E38--><AD_FIELD>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <AD_FIELD_ID><![CDATA[D675A1322C8543CEB95A6D9E39813E38]]></AD_FIELD_ID>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <NAME><![CDATA[Line Gross Amount]]></NAME>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <DESCRIPTION><![CDATA[Gross Amount for a line]]></DESCRIPTION>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <HELP><![CDATA[This is the total amount against a line ( i.e product price * quantity + taxes ) ]]></HELP>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <AD_TAB_ID><![CDATA[291]]></AD_TAB_ID>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <AD_COLUMN_ID><![CDATA[D497AE1E0F9948519C7E82464AD6A114]]></AD_COLUMN_ID>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <DISPLAYLOGIC><![CDATA[@GROSSPRICE@='Y']]></DISPLAYLOGIC>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <SEQNO><![CDATA[65]]></SEQNO>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <GRID_SEQNO><![CDATA[65]]></GRID_SEQNO>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D675A1322C8543CEB95A6D9E39813E38-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D675A1322C8543CEB95A6D9E39813E38--></AD_FIELD>
+
 <!--D6B4EF28BC2E4DEABEE1A9AE75982035--><AD_FIELD>
 <!--D6B4EF28BC2E4DEABEE1A9AE75982035-->  <AD_FIELD_ID><![CDATA[D6B4EF28BC2E4DEABEE1A9AE75982035]]></AD_FIELD_ID>
 <!--D6B4EF28BC2E4DEABEE1A9AE75982035-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -225471,6 +225560,35 @@
 <!--F8F0D579F02B46A4AFF647C1C9D04BA5-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--F8F0D579F02B46A4AFF647C1C9D04BA5--></AD_FIELD>
 
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2--><AD_FIELD>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <AD_FIELD_ID><![CDATA[F8F7E13646FE4C6283B40E0C0CF46AA2]]></AD_FIELD_ID>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <NAME><![CDATA[Gross Unit Price]]></NAME>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <DESCRIPTION><![CDATA[Price inclusive of taxes]]></DESCRIPTION>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <HELP><![CDATA[This is the price that is provided when the price is inclusive of taxes. ]]></HELP>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <AD_TAB_ID><![CDATA[291]]></AD_TAB_ID>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <AD_COLUMN_ID><![CDATA[7B0E6024A8EC4EF29BF18AEDC92D4E2C]]></AD_COLUMN_ID>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <DISPLAYLOGIC><![CDATA[@GROSSPRICE@='Y']]></DISPLAYLOGIC>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <SEQNO><![CDATA[55]]></SEQNO>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <GRID_SEQNO><![CDATA[55]]></GRID_SEQNO>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--F8F7E13646FE4C6283B40E0C0CF46AA2--></AD_FIELD>
+
 <!--F95616DC2EBB419293C98848BAE2A6CB--><AD_FIELD>
 <!--F95616DC2EBB419293C98848BAE2A6CB-->  <AD_FIELD_ID><![CDATA[F95616DC2EBB419293C98848BAE2A6CB]]></AD_FIELD_ID>
 <!--F95616DC2EBB419293C98848BAE2A6CB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELDGROUP.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_FIELDGROUP.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--101--><AD_FIELDGROUP>
 <!--101-->  <AD_FIELDGROUP_ID><![CDATA[101]]></AD_FIELDGROUP_ID>
--- a/src-db/database/sourcedata/AD_FORM.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_FORM.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--100--><AD_FORM>
 <!--100-->  <AD_FORM_ID><![CDATA[100]]></AD_FORM_ID>
--- a/src-db/database/sourcedata/AD_MENU.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_MENU.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--102--><AD_MENU>
 <!--102-->  <AD_MENU_ID><![CDATA[102]]></AD_MENU_ID>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--101--><AD_MESSAGE>
 <!--101-->  <AD_MESSAGE_ID><![CDATA[101]]></AD_MESSAGE_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--576--><AD_MODEL_OBJECT>
 <!--576-->  <AD_MODEL_OBJECT_ID><![CDATA[576]]></AD_MODEL_OBJECT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--1524--><AD_MODEL_OBJECT_MAPPING>
 <!--1524-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[1524]]></AD_MODEL_OBJECT_MAPPING_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_PARA.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_PARA.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--19E4495DEA8B482ABC0042327F303BBE--><AD_MODEL_OBJECT_PARA>
 <!--19E4495DEA8B482ABC0042327F303BBE-->  <AD_MODEL_OBJECT_PARA_ID><![CDATA[19E4495DEA8B482ABC0042327F303BBE]]></AD_MODEL_OBJECT_PARA_ID>
--- a/src-db/database/sourcedata/AD_MODULE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_MODULE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--0--><AD_MODULE>
 <!--0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
--- a/src-db/database/sourcedata/AD_MODULE_DBPREFIX.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_MODULE_DBPREFIX.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--00834104948711DDA17E001B388C61A4--><AD_MODULE_DBPREFIX>
 <!--00834104948711DDA17E001B388C61A4-->  <AD_MODULE_DBPREFIX_ID><![CDATA[00834104948711DDA17E001B388C61A4]]></AD_MODULE_DBPREFIX_ID>
--- a/src-db/database/sourcedata/AD_PACKAGE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_PACKAGE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--5A3ED54AB1C84B84E040007F01006125--><AD_PACKAGE>
 <!--5A3ED54AB1C84B84E040007F01006125-->  <AD_PACKAGE_ID><![CDATA[5A3ED54AB1C84B84E040007F01006125]]></AD_PACKAGE_ID>
--- a/src-db/database/sourcedata/AD_PREFERENCE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_PREFERENCE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--3C42AC69917D411999A63E214B4A1E77--><AD_PREFERENCE>
 <!--3C42AC69917D411999A63E214B4A1E77-->  <AD_PREFERENCE_ID><![CDATA[3C42AC69917D411999A63E214B4A1E77]]></AD_PREFERENCE_ID>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--100--><AD_PROCESS>
 <!--100-->  <AD_PROCESS_ID><![CDATA[100]]></AD_PROCESS_ID>
--- a/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--123--><AD_PROCESS_PARA>
 <!--123-->  <AD_PROCESS_PARA_ID><![CDATA[123]]></AD_PROCESS_PARA_ID>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--1--><AD_REFERENCE>
 <!--1-->  <AD_REFERENCE_ID><![CDATA[1]]></AD_REFERENCE_ID>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--51--><AD_REF_LIST>
 <!--51-->  <AD_REF_LIST_ID><![CDATA[51]]></AD_REF_LIST_ID>
--- a/src-db/database/sourcedata/AD_REF_SEARCH.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_REF_SEARCH.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--800000--><AD_REF_SEARCH>
 <!--800000-->  <AD_REF_SEARCH_ID><![CDATA[800000]]></AD_REF_SEARCH_ID>
--- a/src-db/database/sourcedata/AD_REF_SEARCH_COLUMN.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_REF_SEARCH_COLUMN.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--800000--><AD_REF_SEARCH_COLUMN>
 <!--800000-->  <AD_REF_SEARCH_COLUMN_ID><![CDATA[800000]]></AD_REF_SEARCH_COLUMN_ID>
--- a/src-db/database/sourcedata/AD_REF_TABLE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_REF_TABLE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--1--><AD_REF_TABLE>
 <!--1-->  <AD_REFERENCE_ID><![CDATA[1]]></AD_REFERENCE_ID>
--- a/src-db/database/sourcedata/AD_TAB.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_TAB.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--100--><AD_TAB>
 <!--100-->  <AD_TAB_ID><![CDATA[100]]></AD_TAB_ID>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--100--><AD_TABLE>
 <!--100-->  <AD_TABLE_ID><![CDATA[100]]></AD_TABLE_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--800007--><AD_TEXTINTERFACES>
 <!--800007-->  <AD_TEXTINTERFACES_ID><![CDATA[800007]]></AD_TEXTINTERFACES_ID>
--- a/src-db/database/sourcedata/AD_TREENODE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_TREENODE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--29C956E61F0811DE98DB8F290236BC17--><AD_TREENODE>
 <!--29C956E61F0811DE98DB8F290236BC17-->  <AD_TREENODE_ID><![CDATA[29C956E61F0811DE98DB8F290236BC17]]></AD_TREENODE_ID>
--- a/src-db/database/sourcedata/AD_VAL_RULE.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_VAL_RULE.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--100--><AD_VAL_RULE>
 <!--100-->  <AD_VAL_RULE_ID><![CDATA[100]]></AD_VAL_RULE_ID>
--- a/src-db/database/sourcedata/AD_WINDOW.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/AD_WINDOW.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--100--><AD_WINDOW>
 <!--100-->  <AD_WINDOW_ID><![CDATA[100]]></AD_WINDOW_ID>
--- a/src-db/database/sourcedata/OBCLKER_UIDEFINITION.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/OBCLKER_UIDEFINITION.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--5689322B3F104A19A15ACDB331052991--><OBCLKER_UIDEFINITION>
 <!--5689322B3F104A19A15ACDB331052991-->  <OBCLKER_UIDEFINITION_ID><![CDATA[5689322B3F104A19A15ACDB331052991]]></OBCLKER_UIDEFINITION_ID>
--- a/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--5B14DD5B00AD445F93281640C6385BA4--><OBUIAPP_PARAMETER>
 <!--5B14DD5B00AD445F93281640C6385BA4-->  <OBUIAPP_PARAMETER_ID><![CDATA[5B14DD5B00AD445F93281640C6385BA4]]></OBUIAPP_PARAMETER_ID>
--- a/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--4AD70293357245AB96E59C2CDB43A35D--><OBUIAPP_PROCESS>
 <!--4AD70293357245AB96E59C2CDB43A35D-->  <OBUIAPP_PROCESS_ID><![CDATA[4AD70293357245AB96E59C2CDB43A35D]]></OBUIAPP_PROCESS_ID>
--- a/src-db/database/sourcedata/OBUIAPP_REF_WINDOW.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/OBUIAPP_REF_WINDOW.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--0866490047484A12A58A5D09A7157C80--><OBUIAPP_REF_WINDOW>
 <!--0866490047484A12A58A5D09A7157C80-->  <OBUIAPP_REF_WINDOW_ID><![CDATA[0866490047484A12A58A5D09A7157C80]]></OBUIAPP_REF_WINDOW_ID>
--- a/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--2E64F551C7C4470C80C29DBA24B34A5F--><OBUISEL_SELECTOR>
 <!--2E64F551C7C4470C80C29DBA24B34A5F-->  <OBUISEL_SELECTOR_ID><![CDATA[2E64F551C7C4470C80C29DBA24B34A5F]]></OBUISEL_SELECTOR_ID>
--- a/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml	Sat Jun 16 18:59:18 2012 +0530
+++ b/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml	Sat Jun 16 22:54:41 2012 +0530
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <data>
 <!--01C1FF0DFB3643EEA2AF93128A057BEF--><OBUISEL_SELECTOR_FIELD>
 <!--01C1FF0DFB3643EEA2AF93128A057BEF-->  <OBUISEL_SELECTOR_FIELD_ID><![CDATA[01C1FF0DFB3643EEA2AF93128A057BEF]]></OBUISEL_SELECTOR_FIELD_ID>
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java	Sat Jun 16 18:59:18 2012 +0530
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java	Sat Jun 16 22:54:41 2012 +0530
@@ -22,6 +22,8 @@
 import java.io.PrintWriter;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
@@ -30,7 +32,10 @@
 
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.model.common.invoice.Invoice;
+import org.openbravo.service.db.CallStoredProcedure;
 import org.openbravo.utils.FormatUtilities;
 import org.openbravo.xmlEngine.XmlDocument;
 
@@ -61,10 +66,13 @@
       String strPriceStd = vars.getNumericParameter("inppricestd");
       String strLineNetAmt = vars.getNumericParameter("inplinenetamt");
       String strTaxId = vars.getStringParameter("inpcTaxId");
+      String strGrossUnitPrice = vars.getNumericParameter("inpgrossUnitPrice");
+      String strtaxbaseamt = vars.getNumericParameter("inptaxbaseamt");
 
       try {
         printPage(response, vars, strChanged, strQtyInvoice, strPriceActual, strInvoiceId,
-            strProduct, strPriceLimit, strTabId, strPriceList, strPriceStd, strLineNetAmt, strTaxId);
+            strProduct, strPriceLimit, strTabId, strPriceList, strPriceStd, strLineNetAmt,
+            strTaxId, strGrossUnitPrice, strtaxbaseamt);
       } catch (ServletException ex) {
         pageErrorCallOut(response);
       }
@@ -75,7 +83,8 @@
   void printPage(HttpServletResponse response, VariablesSecureApp vars, String strChanged,
       String strQtyInvoice, String strPriceActual, String strInvoiceId, String strProduct,
       String strPriceLimit, String strTabId, String strPriceList, String strPriceStd,
-      String strLineNetAmt, String strTaxId) throws IOException, ServletException {
+      String strLineNetAmt, String strTaxId, String strGrossUnitPrice, String strTaxBaseAmt)
+      throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
     XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
@@ -107,7 +116,7 @@
     if (log4j.isDebugEnabled())
       log4j.debug("taxRate: " + taxRate);
 
-    BigDecimal qtyInvoice, priceActual, LineNetAmt, priceLimit, priceStd;
+    BigDecimal qtyInvoice, priceActual, LineNetAmt, priceLimit, priceStd, taxBaseAmt;
 
     qtyInvoice = (!Utility.isBigDecimal(strQtyInvoice) ? ZERO : new BigDecimal(strQtyInvoice));
     priceStd = (!Utility.isBigDecimal(strPriceStd) ? ZERO : new BigDecimal(strPriceStd));
@@ -116,7 +125,8 @@
     priceLimit = (!Utility.isBigDecimal(strPriceLimit) ? ZERO : (new BigDecimal(strPriceLimit)))
         .setScale(PricePrecision, BigDecimal.ROUND_HALF_UP);
     LineNetAmt = (!Utility.isBigDecimal(strLineNetAmt) ? ZERO : new BigDecimal(strLineNetAmt));
-
+    taxBaseAmt = (strTaxBaseAmt.equals("") ? ZERO : (new BigDecimal(strTaxBaseAmt))).setScale(
+        +PricePrecision, BigDecimal.ROUND_HALF_UP);
     StringBuffer resultado = new StringBuffer();
 
     resultado.append("var calloutName='SL_Invoice_Amt';\n\n");
@@ -143,6 +153,7 @@
           dataInvoice[0].dateinvoiced, qtyInvoice.toString(), dataInvoice[0].mPricelistId,
           dataInvoice[0].id));
       resultado.append("new Array(\"inppricestd\", " + priceStd.toString() + "),");
+      resultado.append("new Array(\"inptaxbaseamt\", " + priceActual.multiply(qtyInvoice) + "),");
     }
 
     // If quantity changes, recalculates unit price (actual price) applying
@@ -156,8 +167,50 @@
           qtyInvoice.toString(), dataInvoice[0].mPricelistId, dataInvoice[0].id));
       if (priceActual.scale() > PricePrecision)
         priceActual = priceActual.setScale(PricePrecision, BigDecimal.ROUND_HALF_UP);
+      // invoiced qty multiply with gross price
+      BigDecimal grossAmount = new BigDecimal(strGrossUnitPrice.trim()).multiply(new BigDecimal(
+          strQtyInvoice.trim()));
+      resultado.append("new Array(\"inplineGrossAmount\", " + grossAmount.toString() + "),");
     }
+    // if taxRate field is changed
+    if (strChanged.equals("inpcTaxId")) {
+      BigDecimal grossUnitPrice = new BigDecimal(0);
+      BigDecimal unitPrice = new BigDecimal(0);
+      grossUnitPrice = new BigDecimal(strGrossUnitPrice.trim());
+      unitPrice = new BigDecimal(strPriceActual.trim());
+      if (isPriceTaxInclusive(strInvoiceId)) {
+        // todo - Alternate Amount
+        unitPrice = calculateNetFromGross(strTaxId, strGrossUnitPrice, strPrecision, taxBaseAmt,
+            strQtyInvoice);
+        priceActual = unitPrice;
+        priceStd = unitPrice;
+        BigDecimal priceInclusive = new BigDecimal(strGrossUnitPrice.trim());
+        BigDecimal grossPrice = priceInclusive.multiply(new BigDecimal(strQtyInvoice.trim()));
 
+        resultado.append("new Array(\"inppriceactual\",\"" + unitPrice + "\"),");
+        resultado.append("new Array(\"inppricelist\", \"" + unitPrice + "\"),");
+        resultado.append("new Array(\"inppricelimit\", \"" + unitPrice + "\"),");
+        resultado.append("new Array(\"inppricestd\", \"" + unitPrice + "\"),");
+        resultado.append("new Array(\"inplineGrossAmount\",\"" + grossPrice + "\"),");
+
+      }
+
+    }
+    // if taxinclusive field is changed then modify net unit price and gross price
+    if (strChanged.equals("inpgrossUnitPrice")) {
+      BigDecimal priceInclusive = new BigDecimal(strGrossUnitPrice.trim());
+      final BigDecimal lineUnitAmount = calculateNetFromGross(strTaxId, strGrossUnitPrice,
+          strPrecision, taxBaseAmt, strQtyInvoice);
+      BigDecimal grossPrice = priceInclusive.multiply(new BigDecimal(strQtyInvoice.trim()));
+      priceActual = lineUnitAmount;
+      priceStd = lineUnitAmount;
+
+      resultado.append("new Array(\"inplineGrossAmount\",\"" + grossPrice + "\"),");
+      resultado.append("new Array(\"inppriceactual\",\"" + lineUnitAmount + "\"),");
+      resultado.append("new Array(\"inppricelist\",\"" + lineUnitAmount + "\"),");
+      resultado.append("new Array(\"inppricelimit\", \"" + lineUnitAmount + "\"),");
+      resultado.append("new Array(\"inppricestd\",\"" + lineUnitAmount + "\"),");
+    }
     if (!strChanged.equals("inplinenetamt"))
       // Net amount of a line equals quantity x unit price (actual price)
       LineNetAmt = qtyInvoice.multiply(priceActual);
@@ -209,7 +262,36 @@
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
     out.println(xmlDocument.print());
-
     out.close();
   }
+
+  private BigDecimal calculateNetFromGross(String strTaxId, String strGrossUnitPrice,
+      String strPrecision, BigDecimal alternateAmount, String strQtyOrdered) {
+    BigDecimal grossUnitPrice = new BigDecimal(strGrossUnitPrice.trim());
+    if (grossUnitPrice.compareTo(BigDecimal.ZERO) == 0)
+      return BigDecimal.ZERO;
+    final List parameters = new ArrayList();
+    parameters.add(strTaxId);
+    parameters.add(grossUnitPrice);
+
+    // TODO: Alternate Base Amount
+    parameters.add(alternateAmount);
+    parameters.add(new BigDecimal(strPrecision));
+    // Initial value of zero
+    parameters.add(new BigDecimal("0.0"));
+    parameters.add(new BigDecimal(strQtyOrdered));
+
+    final String procedureName = "c_tax_net_from_gross";
+    final BigDecimal lineUnitAmount = (BigDecimal) CallStoredProcedure.getInstance().call(
+        procedureName, parameters, null);
+    return lineUnitAmount;
+  }
+
+  private boolean isPriceTaxInclusive(String orderId) {
+    if (OBDal.getInstance().get(Invoice.class, orderId).getPriceList().isPriceIncludesTax())
+      return true;
+    else
+      return false;
+
+  }
 }
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java	Sat Jun 16 18:59:18 2012 +0530
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java	Sat Jun 16 22:54:41 2012 +0530
@@ -38,6 +38,7 @@
 import org.openbravo.erpCommon.utility.ComboTableData;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.common.enterprise.Organization;
+import org.openbravo.model.common.invoice.Invoice;
 import org.openbravo.utils.FormatUtilities;
 import org.openbravo.xmlEngine.XmlDocument;
 
@@ -129,14 +130,22 @@
     resultado.append("var calloutName='SL_Invoice_Product';\n\n");
     resultado.append("var respuesta = new Array(");
     resultado.append("new Array(\"inpcUomId\", \"" + strUOM + "\"),");
+    if (isPriceTaxInclusive(strCInvoiceID)) {
+      resultado.append("new Array(\"inpgrossUnitPrice\", "
+          + (strPriceActual.equals("") ? "0" : strPriceActual) + "),");
+
+    } else {
+      resultado.append("new Array(\"inppricestd\", "
+          + (strPriceStd.equals("") ? "\"\"" : strPriceStd) + "),");
+      resultado.append("new Array(\"inppriceactual\", "
+          + (strPriceActual.equals("") ? "\"\"" : strPriceActual) + "),");
+
+    }
+
     resultado.append("new Array(\"inppricelist\", "
         + (strPriceList.equals("") ? "\"\"" : strPriceList) + "),");
     resultado.append("new Array(\"inppricelimit\", "
         + (strPriceLimit.equals("") ? "\"\"" : strPriceLimit) + "),");
-    resultado.append("new Array(\"inppricestd\", "
-        + (strPriceStd.equals("") ? "\"\"" : strPriceStd) + "),");
-    resultado.append("new Array(\"inppriceactual\", "
-        + (strPriceActual.equals("") ? "\"\"" : strPriceActual) + "),");
     PAttributeSetData[] dataPAttr = PAttributeSetData.selectProductAttr(this, strMProductID);
     if (dataPAttr != null && dataPAttr.length > 0 && dataPAttr[0].attrsetvaluetype.equals("D")) {
       PAttributeSetData[] data2 = PAttributeSetData.select(this, dataPAttr[0].mAttributesetId);
@@ -212,4 +221,13 @@
     out.println(xmlDocument.print());
     out.close();
   }
+
+  private boolean isPriceTaxInclusive(String invoiceId) {
+    if (OBDal.getInstance().get(Invoice.class, invoiceId).getPriceList().isPriceIncludesTax())
+      return true;
+    else
+      return false;
+
+  }
+
 }