svn commit: r707272 - in /ofbiz/branches/typecheckcleanup200810/applications/accounting: entitydef/entitymodel.xml webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy webapp/accounting/invoice/InvoiceForms.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r707272 - in /ofbiz/branches/typecheckcleanup200810/applications/accounting: entitydef/entitymodel.xml webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy webapp/accounting/invoice/InvoiceForms.xml

lektran
Author: lektran
Date: Wed Oct 22 21:48:41 2008
New Revision: 707272

URL: http://svn.apache.org/viewvc?rev=707272&view=rev
Log:
My first few type clean ups

Modified:
    ofbiz/branches/typecheckcleanup200810/applications/accounting/entitydef/entitymodel.xml
    ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy
    ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml

Modified: ofbiz/branches/typecheckcleanup200810/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/accounting/entitydef/entitymodel.xml?rev=707272&r1=707271&r2=707272&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/accounting/entitydef/entitymodel.xml Wed Oct 22 21:48:41 2008
@@ -1159,7 +1159,7 @@
       <field name="parentInvoiceItemSeqId" type="id"></field>
       <field name="uomId" type="id"></field>
       <field name="taxableFlag" type="indicator"></field>
-      <field name="quantity" type="floating-point"></field>
+      <field name="quantity" type="fixed-point"></field>
       <field name="amount" type="currency-precise"></field>
       <field name="description" type="description"></field>
       <field name="taxAuthPartyId" type="id-ne"/>

Modified: ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy?rev=707272&r1=707271&r2=707272&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy Wed Oct 22 21:48:41 2008
@@ -91,7 +91,7 @@
     invoiceItems = invoice.getRelatedOrderBy("InvoiceItem", ["invoiceItemSeqId"]);
     invoiceItemsConv = FastList.newInstance();
     invoiceItems.each { invoiceItem ->
-      invoiceItem.amount = new Double((invoiceItem.getBigDecimal("amount").multiply(conversionRate).setScale(decimals, rounding)).doubleValue());
+      invoiceItem.amount = invoiceItem.getBigDecimal("amount").multiply(conversionRate).setScale(decimals, rounding);
       invoiceItemsConv.add(invoiceItem);
     }
     

Modified: ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml?rev=707272&r1=707271&r2=707272&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Wed Oct 22 21:48:41 2008
@@ -121,9 +121,10 @@
         <row-actions>
             <set field="total" value="${bsh:
                 import java.text.NumberFormat;
-                if(quantity==null) quantity = 1;
-                if(amount==null) amount = 0;
-                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(quantity*amount));}"/>
+                import java.math.BigDecimal;
+                if(quantity==null) quantity = BigDecimal.ONE;
+                if(amount==null) amount = BigDecimal.ZERO;
+                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(quantity.multiply(amount)));}"/>
         </row-actions>
         <auto-fields-entity entity-name="InvoiceItem" default-field-type="display"/>
         <field name="invoiceId"><hidden/></field>
@@ -293,8 +294,9 @@
        <row-actions>
            <set field="total" value="${bsh:
                import java.text.NumberFormat;
-               if(quantity==null||quantity==0) quantity = 1;
-               return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(quantity*amount));}"/>
+               import java.math.BigDecimal;
+               if(quantity == null || quantity.compareTo(BigDecimal.ZERO) == 0) quantity = BigDecimal.ONE;
+               return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(quantity.multiply(amount)));}"/>
        </row-actions>
        <field name="invoiceId"><hidden/></field>
        <field name="invoiceItemSeqId" widget-style="buttontext"><hyperlink target="listInvoiceItems?invoiceId=${invoiceId}&amp;invoiceItemSeqId=${invoiceItemSeqId}" description="${invoiceItemSeqId}"/></field>