Author: hansbak
Date: Sun Jul 19 03:36:08 2009 New Revision: 795471 URL: http://svn.apache.org/viewvc?rev=795471&view=rev Log: when a new invoice was created the currency was not set Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml?rev=795471&r1=795470&r2=795471&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml Sun Jul 19 03:36:08 2009 @@ -123,35 +123,30 @@ <now-timestamp field="nowTimestamp"/> <make-value value-field="newEntity" entity-name="Invoice"/> - <set-nonpk-fields map="parameters" value-field="newEntity"/> <!-- call getNextInvoiceId service with the parameters.partyIdFrom when invoice Id is not suplied else use it from the input --> <if-empty field="parameters.invoiceId"> <set field="getNextInvoiceIdMap.partyId" from-field="parameters.partyIdFrom"/> <call-service service-name="getNextInvoiceId" in-map-name="getNextInvoiceIdMap"> - <result-to-field result-name="invoiceId" field="newEntity.invoiceId"/> + <result-to-field result-name="invoiceId" field="parameters.invoiceId"/> </call-service> - <else> - <set field="newEntity.invoiceId" from-field="parameters.invoiceId"/> - </else> </if-empty> - <field-to-result field="newEntity.invoiceId" result-name="invoiceId"/> + <field-to-result field="parameters.invoiceId" result-name="invoiceId"/> + <!-- set the invoice date if not provided --> <if-empty field="parameters.invoiceDate"> - <set from-field="nowTimestamp" field="newEntity.invoiceDate"/> - </if-empty> - <if-empty field="parameters.currencyUomId"> - <!-- if provided set the default currency to the receiving party --> - <entity-one entity-name="Party" value-field="party"/> - <if-not-empty field="party.preferredCurrencyUomId"> - <set field="newEntity.currencyUomId" from-field="party.preferredCurrencyUomId"/> - <else> - <set field="newEntity.currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> - </else> - </if-not-empty> + <set from-field="nowTimestamp" field="parameters.invoiceDate"/> </if-empty> + <!-- use currency of receiving company --> + <entity-one entity-name="Party" value-field="party"/> + <if-not-empty field="party.preferredCurrencyUomId"> + <set field="parameters.currencyUomId" from-field="party.preferredCurrencyUomId"/> + </if-not-empty> + + <set-nonpk-fields map="parameters" value-field="newEntity"/> + <set-pk-fields map="parameters" value-field="newEntity"/> <create-value value-field="newEntity"/> <!-- create new status entry, and set lastStatusUpdate date --> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml?rev=795471&r1=795470&r2=795471&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Sun Jul 19 03:36:08 2009 @@ -229,6 +229,7 @@ <form name="NewSalesInvoice" type="single" target="createInvoice" title="Edit Invoice Header" default-map-name="invoice" header-row-style="header-row" default-table-style="basic-table"> <field name="statusId"><hidden value="INVOICE_IN_PROCESS"/></field> + <field name="currencyUomId"><hidden value="${defaultOrganizationPartyCurrencyUomId}"/></field> <field position="2" name="invoiceTypeId"> <drop-down allow-empty="false" no-current-selected-key="SALES_INVOICE"> <entity-options description="${description}" entity-name="InvoiceType"> @@ -318,7 +319,7 @@ </field> <field position="2" name="billingAccountId"><lookup target-form-name="LookupBillingAccount"/></field> <field position="1" name="currencyUomId"> - <drop-down allow-empty="true" no-current-selected-key="${defaultCurrencyUomId}"> + <drop-down allow-empty="true" no-current-selected-key="${defaultOrganizationPartyCurrencyUomId}"> <entity-options key-field-name="uomId" description="${description} - ${abbreviation}" entity-name="Uom"> <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/> <entity-order-by field-name="description"/> Modified: ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml?rev=795471&r1=795470&r2=795471&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml Sun Jul 19 03:36:08 2009 @@ -144,7 +144,6 @@ <set field="titleProperty" value="PageTitleEditInvoice"/> <set field="tabButtonItem" value="editInvoice"/> <set field="invoiceId" from-field="parameters.invoiceId"/> - <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/> <entity-one entity-name="Invoice" value-field="invoice"/> <entity-one entity-name="InvoiceType" value-field="invoiceType"> <field-map field-name="invoiceTypeId" from-field="invoice.invoiceTypeId"/> |
Free forum by Nabble | Edit this page |