svn commit: r547894 - in /ofbiz/branches/release4.0/applications/accounting: src/org/ofbiz/accounting/invoice/InvoiceServices.java 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: r547894 - in /ofbiz/branches/release4.0/applications/accounting: src/org/ofbiz/accounting/invoice/InvoiceServices.java webapp/accounting/invoice/InvoiceForms.xml

lektran
Author: lektran
Date: Sat Jun 16 02:22:19 2007
New Revision: 547894

URL: http://svn.apache.org/viewvc?view=rev&rev=547894
Log:
Applied fix from trunk for revision: 545590

Modified:
    ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
    ofbiz/branches/release4.0/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml

Modified: ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?view=diff&rev=547894&r1=547893&r2=547894
==============================================================================
--- ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Sat Jun 16 02:22:19 2007
@@ -2438,9 +2438,7 @@
                 if (invoiceItem == null) {
                     errorMessageList.add(UtilProperties.getMessage(resource,"AccountingInvoiceItemNotFound",UtilMisc.toMap("invoiceId",invoiceId,"invoiceItemSeqId",invoiceItemSeqId),locale));
                 } else {
-                    if (invoiceItem.get("uomId") != null && payment.get("currencyUomId") != null && !invoiceItem.getString("uomId").equals(payment.getString("currencyUomId"))) {
-                        errorMessageList.add(UtilProperties.getMessage(resource,"AccountingInvoiceItemPaymentCurrencyProblem",UtilMisc.toMap("paymentCurrencyId",payment.getString("currencyUomId"),"itemCurrency",invoiceItem.getString("uomId")) ,locale));
-                    } else if (invoice.get("currencyUomId") != null && payment.get("currencyUomId") != null && !invoice.getString("currencyUomId").equals(payment.getString("currencyUomId"))) {
+                    if (invoice.get("currencyUomId") != null && payment.get("currencyUomId") != null && !invoice.getString("currencyUomId").equals(payment.getString("currencyUomId"))) {
                         errorMessageList.add(UtilProperties.getMessage(resource,"AccountingInvoicePaymentCurrencyProblem",UtilMisc.toMap("paymentCurrencyId",payment.getString("currencyUomId"),"itemCurrency",invoice.getString("currencyUomId")) ,locale));
                     }
                     
@@ -2457,13 +2455,7 @@
                     if (paymentApplicationId == null && amountApplied.compareTo(invoiceItemApplyAvailable) > 0) {
                         // new record
                         errorMessageList.add("Invoice(" + invoiceId + ") item(" + invoiceItemSeqId + ") has  " + invoiceItemApplyAvailable + " to apply but " + amountApplied + " is requested\n");
-                        String uomId = null;
-                        if (invoiceItem.getString("uomId") != null) {
-                            uomId = invoiceItem.getString("uomId");
-                        }
-                        else {
-                            uomId = invoice.getString("currencyUomId");
-                        }
+                        String uomId = invoice.getString("currencyUomId");
                         errorMessageList.add(UtilProperties.getMessage(resource, "AccountingInvoiceItemLessRequested",
                                 UtilMisc.toMap("invoiceId",invoiceId, "invoiceItemSeqId", invoiceItemSeqId,
                                             "invoiceItemApplyAvailable",invoiceItemApplyAvailable,
@@ -2781,9 +2773,7 @@
 
                         // create application payment record but check currency
                         // first if supplied
-                        if (invoiceItem.get("uomId") != null && payment.get("currencyUomId") != null && !invoiceItem.getString("uomId").equals(payment.getString("currencyUomId"))) {
-                            errorMessageList.add("Payment currency (" + payment.getString("currencyUomId") + ") and invoice Item(" + invoiceItem.getString("invoiceItemSeqId") + ") currency(" + invoiceItem.getString("uomId") + ") not the same\n");
-                        } else if (invoice.get("currencyUomId") != null && payment.get("currencyUomId") != null && !invoice.getString("currencyUomId").equals( payment.getString("currencyUomId"))) {
+                        if (invoice.get("currencyUomId") != null && payment.get("currencyUomId") != null && !invoice.getString("currencyUomId").equals( payment.getString("currencyUomId"))) {
                             errorMessageList.add("Payment currency (" + payment.getString("currencyUomId") + ") and invoice currency(" + invoice.getString("currencyUomId") + ") not the same\n");
                         } else {
                             paymentApplication.set("paymentApplicationId", null);

Modified: ofbiz/branches/release4.0/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml?view=diff&rev=547894&r1=547893&r2=547894
==============================================================================
--- ofbiz/branches/release4.0/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml (original)
+++ ofbiz/branches/release4.0/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Sat Jun 16 02:22:19 2007
@@ -131,14 +131,10 @@
         <field name="invoiceItemTypeId"><display-entity description="${description}" entity-name="InvoiceItemType"/></field>
         <field name="inventoryItemId" widget-area-style="align-text"><display/></field>
         <field name="quantity" widget-area-style="align-text"><display/></field>
-        <field name="amount" widget-area-style="align-text" use-when="uomId!=null"><display type="currency" currency="${uomId}"/></field>
-        <field name="amount" widget-area-style="align-text" use-when="uomId==null"><display type="currency" currency="${invoice.currencyUomId}"/></field>
-        <field name="total" use-when="uomId!=null"><display type="currency" currency="${uomId}"/></field>  <!-- this should not look like something you can modify, hence "tabletext" -->
-        <field name="total" use-when="uomId==null"><display type="currency" currency="${invoice.currencyUomId}"/></field>  <!-- this should not look like something you can modify, hence "tabletext" -->
+        <field name="amount" title="${uiLabelMap.AccountingUnitPrice}" widget-area-style="align-text"><display type="currency" currency="${invoice.currencyUomId}"/></field>
+        <field name="total"><display type="currency" currency="${invoice.currencyUomId}"/></field>
         <field name="productId" widget-style="linktext"><hyperlink target="/catalog/control/EditProduct?productId=${productId}" target-type="inter-app" description="${productId}"/></field>
         <field name="overrideGlAccountId" widget-area-style="align-text"><hyperlink target="GlAccountNavigate?glAccountId=${overrideGlAccountId}" description="${overrideGlAccountId}"/></field>
-        <field name="overrideGlAccountId"><hidden/></field>
-        <field name="uomId"><hidden/></field>
     </form>
     
     <form name="invoiceRoles" type="list" use-row-submit="true" title="" list-name="invoiceRoles" paginate-target="invoiceRoles">
@@ -242,9 +238,8 @@
        <field name="productId"><lookup target-form-name="LookupProduct" size="20"/></field>
        <field name="description"><text size="30"/></field>
        <!--field name="overrideGlAccountId"><text size="10"/></field-->
-       <field name="amount"><text size="7"/></field>
-       <field name="total" widget-area-style="align-text" use-when="uomId!=null"><display type="currency" currency="${uomId}"/></field>  <!-- this should not look like something you can modify, hence "tabletext" -->
-       <field name="total" widget-area-style="align-text" use-when="uomId==null"><display type="currency" currency="${invoice.currencyUomId}"/></field>  <!-- this should not look like something you can modify, hence "tabletext" -->
+       <field name="amount" title="${uiLabelMap.AccountingUnitPrice}"><text size="7"/></field>
+       <field name="total" widget-area-style="align-text"><display type="currency" currency="${invoice.currencyUomId}"/></field>  <!-- this should not look like something you can modify, hence "tabletext" -->
        <field name="uomId"><hidden/></field>
        <field name="taxableFlag"><hidden/></field>
        <field name="updateButton" title="${uiLabelMap.CommonUpdate}" widget-style="buttontext" ><submit button-type="text-link"/></field>
@@ -272,14 +267,14 @@
             <lookup target-form-name="LookupProductFeature"/>
         </field>
         <field position="1" name="quantity"><text size="10"/></field>
-        <field position="2" name="uomId"><!-- currency -->
-            <drop-down allow-empty="true" current="selected" no-current-selected-key="${invoice.currencyUomId}">
+        <field position="2" name="uomId">
+            <drop-down allow-empty="true">
                 <entity-options key-field-name="uomId" description="${abbreviation} - ${description}" entity-name="Uom">
                     <entity-order-by field-name="description"/>
                 </entity-options>            
             </drop-down>
         </field>
-        <field position="1" name="amount"><text size="10"/></field>
+        <field position="1" name="amount" title="${uiLabelMap.AccountingUnitPrice}"><text size="10"/></field>
         <field position="2" name="taxableFlag">
         <drop-down allow-empty="false" current="selected">
             <option key="Y" description="Yes"/>
@@ -306,8 +301,7 @@
         <field name="invoiceItemSeqId"><display/></field>
         <field name="productId"><display/></field>
         <field name="description"><display/></field>
-        <field name="total" use-when="uomId!=null"><display type="currency" currency="${uomId}"/></field>
-        <field name="total" use-when="uomId==null"><display type="currency" currency="${invoice.currencyUomId}"/></field>
+        <field name="total"><display type="currency" currency="${invoice.currencyUomId}"/></field>
         <field name="invoiceId"><hidden/></field>
         <field name="paymentId"><lookup target-form-name="LookupPayment"/></field>
         <field name="billingAccountId"><hidden/></field>