Re: svn commit: r692339 - in /ofbiz/trunk/specialpurpose/mypage: webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy widget/MyPageScreens.xml

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

Re: svn commit: r692339 - in /ofbiz/trunk/specialpurpose/mypage: webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy widget/MyPageScreens.xml

Jacopo Cappellato-3
Hi Hans,

just out of curiosity: is it legal/allowed to distribute the same  
invoice in different currencies?

Cheers,

Jacopo


On Sep 5, 2008, at 11:11 AM, [hidden email] wrote:

> Author: hansbak
> Date: Thu Sep  4 22:41:52 2008
> New Revision: 692339
>
> URL: http://svn.apache.org/viewvc?rev=692339&view=rev
> Log:
> show invoice in foreign currency properly
>
> Modified:
>    ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/
> ConvertInvoiceCurrency.groovy
>    ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml
>
> Modified: ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/
> actions/ConvertInvoiceCurrency.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy?rev=692339&r1=692338&r2=692339&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/
> ConvertInvoiceCurrency.groovy (original)
> +++ ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/
> ConvertInvoiceCurrency.groovy Thu Sep  4 22:41:52 2008
> @@ -38,7 +38,8 @@
>   } else {
>     otherCurrency = delegator.findByPrimaryKey("Party", ["partyId" :  
> fromPartyId]).preferredCurrencyUomId;
>   }
> -  if (otherCurrency && currencyUomId && !
> otherCurrency.equals(currencyUomId)) {
> +  // check if conversion required
> +  if (currencyUomId && otherCurrency != currencyUomId && !
> otherCurrency.equals(currencyUomId)) {
>     result = dispatcher.runSync("convertUom", [uomId : currencyUomId,
>                                                uomIdTo :  
> otherCurrency,
>                                                originalValue : new  
> Double("1.00"),
> @@ -49,4 +50,7 @@
>         context.amountToApply =  
> org
> .ofbiz
> .accounting
> .invoice
> .InvoiceWorker
> .getInvoiceNotApplied(delegator,invoiceId).multiply(new  
> BigDecimal(result.convertedValue.toString())).setScale(decimals,  
> rounding);
>         context.currencyUomId = otherCurrency;
>     }
> +  } else {
> +      context.total =  
> (org
> .ofbiz
> .accounting
> .invoice.InvoiceWorker.getInvoiceTotalBd(delegator,invoiceId));
> +      context.amountToApply =  
> org
> .ofbiz
> .accounting
> .invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId);
>   }
>
> Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml?rev=692339&r1=692338&r2=692339&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml  
> (original)
> +++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml Thu  
> Sep  4 22:41:52 2008
> @@ -468,12 +468,13 @@
>                     <condition-list combine="and">
>                         <condition-expr field-name="partyId"  
> operator="equals" env-name="myCompanyId"/>
>                         <condition-list combine="or">
> -                            <condition-expr field-name="statusId"  
> operator="equals" value="APPROVED"/>
> -                            <condition-expr field-name="statusId"  
> operator="equals" value="SEND"/>
> -                            <condition-expr field-name="statusId"  
> operator="equals" value="READY"/>
> -                            <condition-expr field-name="statusId"  
> operator="equals" value="PAID"/>
> +                            <condition-expr field-name="statusId"  
> operator="equals" value="INVOICE_APPROVED"/>
> +                            <condition-expr field-name="statusId"  
> operator="equals" value="INVOICE_SEND"/>
> +                            <condition-expr field-name="statusId"  
> operator="equals" value="INVOICE_READY"/>
> +                            <condition-expr field-name="statusId"  
> operator="equals" value="INVOICE_PAID"/>
>                         </condition-list>
>                     </condition-list>
> +                    <order-by field-name="invoiceDate DESC"/>
>                 </entity-condition>
>             </actions>
>             <widgets>
>
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r692339 - in /ofbiz/trunk/specialpurpose/mypage: webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy widget/MyPageScreens.xml

hans_bakker
To be honest, i try to service my customer as good as i can....
and sending an invoice to the US in Thai baht gives us many problems
because not accepted by that customer.

legally allowed? a tough question....legal in which country?

We do all our accounting in Baht but send invoices to the customer in
their local currency....and convert them back to Thai baht when the
payment comes in

in this case everybody happy....because the local government requires us
to change the thai invoice according the incoming payment anyway...

Let me emphasize that all these conversion activities do not affect the
system when the sending and receiving party have the same currency or
have their currency not set in the party record.


On Fri, 2008-09-05 at 11:23 +0530, Jacopo Cappellato wrote:

> Hi Hans,
>
> just out of curiosity: is it legal/allowed to distribute the same  
> invoice in different currencies?
>
> Cheers,
>
> Jacopo
>
>
> On Sep 5, 2008, at 11:11 AM, [hidden email] wrote:
>
> > Author: hansbak
> > Date: Thu Sep  4 22:41:52 2008
> > New Revision: 692339
> >
> > URL: http://svn.apache.org/viewvc?rev=692339&view=rev
> > Log:
> > show invoice in foreign currency properly
> >
> > Modified:
> >    ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/
> > ConvertInvoiceCurrency.groovy
> >    ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml
> >
> > Modified: ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/
> > actions/ConvertInvoiceCurrency.groovy
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy?rev=692339&r1=692338&r2=692339&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/
> > ConvertInvoiceCurrency.groovy (original)
> > +++ ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/
> > ConvertInvoiceCurrency.groovy Thu Sep  4 22:41:52 2008
> > @@ -38,7 +38,8 @@
> >   } else {
> >     otherCurrency = delegator.findByPrimaryKey("Party", ["partyId" :  
> > fromPartyId]).preferredCurrencyUomId;
> >   }
> > -  if (otherCurrency && currencyUomId && !
> > otherCurrency.equals(currencyUomId)) {
> > +  // check if conversion required
> > +  if (currencyUomId && otherCurrency != currencyUomId && !
> > otherCurrency.equals(currencyUomId)) {
> >     result = dispatcher.runSync("convertUom", [uomId : currencyUomId,
> >                                                uomIdTo :  
> > otherCurrency,
> >                                                originalValue : new  
> > Double("1.00"),
> > @@ -49,4 +50,7 @@
> >         context.amountToApply =  
> > org
> > .ofbiz
> > .accounting
> > .invoice
> > .InvoiceWorker
> > .getInvoiceNotApplied(delegator,invoiceId).multiply(new  
> > BigDecimal(result.convertedValue.toString())).setScale(decimals,  
> > rounding);
> >         context.currencyUomId = otherCurrency;
> >     }
> > +  } else {
> > +      context.total =  
> > (org
> > .ofbiz
> > .accounting
> > .invoice.InvoiceWorker.getInvoiceTotalBd(delegator,invoiceId));
> > +      context.amountToApply =  
> > org
> > .ofbiz
> > .accounting
> > .invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId);
> >   }
> >
> > Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml?rev=692339&r1=692338&r2=692339&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml  
> > (original)
> > +++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml Thu  
> > Sep  4 22:41:52 2008
> > @@ -468,12 +468,13 @@
> >                     <condition-list combine="and">
> >                         <condition-expr field-name="partyId"  
> > operator="equals" env-name="myCompanyId"/>
> >                         <condition-list combine="or">
> > -                            <condition-expr field-name="statusId"  
> > operator="equals" value="APPROVED"/>
> > -                            <condition-expr field-name="statusId"  
> > operator="equals" value="SEND"/>
> > -                            <condition-expr field-name="statusId"  
> > operator="equals" value="READY"/>
> > -                            <condition-expr field-name="statusId"  
> > operator="equals" value="PAID"/>
> > +                            <condition-expr field-name="statusId"  
> > operator="equals" value="INVOICE_APPROVED"/>
> > +                            <condition-expr field-name="statusId"  
> > operator="equals" value="INVOICE_SEND"/>
> > +                            <condition-expr field-name="statusId"  
> > operator="equals" value="INVOICE_READY"/>
> > +                            <condition-expr field-name="statusId"  
> > operator="equals" value="INVOICE_PAID"/>
> >                         </condition-list>
> >                     </condition-list>
> > +                    <order-by field-name="invoiceDate DESC"/>
> >                 </entity-condition>
> >             </actions>
> >             <widgets>
> >
> >
>
--
Antwebsystems.com: Quality OFBiz services for competitive prices

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r692339 - in /ofbiz/trunk/specialpurpose/mypage: webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy widget/MyPageScreens.xml

Jacopo Cappellato-3

On Sep 5, 2008, at 12:49 PM, Hans Bakker wrote:

>
> Let me emphasize that all these conversion activities do not affect  
> the
> system when the sending and receiving party have the same currency or
> have their currency not set in the party record.

IMO we should not automatically do the conversion even if the  
currencies are different... at least it should be a manual/explicit  
action from the user.

Jacopo


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r692339 - in /ofbiz/trunk/specialpurpose/mypage: webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy widget/MyPageScreens.xml

hans_bakker
The conversion to the foreign currency is not automatic...you have to
manually enter it....

On Fri, 2008-09-05 at 14:40 +0530, Jacopo Cappellato wrote:

> On Sep 5, 2008, at 12:49 PM, Hans Bakker wrote:
>
> >
> > Let me emphasize that all these conversion activities do not affect  
> > the
> > system when the sending and receiving party have the same currency or
> > have their currency not set in the party record.
>
> IMO we should not automatically do the conversion even if the  
> currencies are different... at least it should be a manual/explicit  
> action from the user.
>
> Jacopo
>
--
Antwebsystems.com: Quality OFBiz services for competitive prices