Hi,
I have following doubts about return on order paid using billing account. *case 1:* I create a billing account for the customer and the payment was done using the billing account (no deposits available that can be directly added as payment received in payment preference) Now what action should be done for the return on the given billing account Either it should credit the full amount to the billing account to be used by other orders or it should fulfill the original order invoice with new created payment to billing account and close that invoice Currently its doing nothing of above. *case 2:* In case if part of the billing account payment for the order is captured from the billing account then in that case its looks its not doing wt it should do eg; Order total 500 Payment from billing account deposit 100 Outstanding payment from billing account 400 Now refund of this order is resulting in following actions: Create return invoice with order total amount Apply already paid amount to the return invoice+billing account Apply already paid amount to the billing account (as supposed to be used to be other order) also sets paymentPreference id Apply already paid amount + order total amount to the return invoice+billing account Apply already paid amount + order total amount to the return billing account (as supposed to be used to be other order) also sets paymentPreference id Both of the above payments are not usable because order payment preference id is set. Should not it do the process as following Apply already paid from billing account deposit amount to the billing account credit to be consumed by other order (by not setting orderPaymentPreferenceId or by other way) Apply not paid billing account amount to the original order invoice to close that invoice. |
I am using ofbiz 11.04
On Thu, Apr 26, 2012 at 10:10 AM, Anil Savani <[hidden email]> wrote: > Hi, > > I have following doubts about return on order paid using billing account. > > *case 1:* > I create a billing account for the customer and the payment was done using > the billing account > (no deposits available that can be directly added as payment received in > payment preference) > > Now what action should be done for the return on the given billing account > Either it should credit the full amount to the billing account to be used > by other orders > or it should fulfill the original order invoice with new created payment > to billing account and close that invoice > > Currently its doing nothing of above. > > > *case 2:* > In case if part of the billing account payment for the order is captured > from the billing account then in that case its looks > its not doing wt it should do > eg; > Order total 500 > Payment from billing account deposit 100 > Outstanding payment from billing account 400 > > Now refund of this order is resulting in following actions: > > Create return invoice with order total amount > Apply already paid amount to the return invoice+billing account > Apply already paid amount to the billing account (as supposed to be > used to be other order) also sets paymentPreference id > > Apply already paid amount + order total amount to the return > invoice+billing account > Apply already paid amount + order total amount to the return billing > account (as supposed to be used to be other order) also sets > paymentPreference id > > Both of the above payments are not usable because order payment preference > id is set. > > Should not it do the process as following > Apply already paid from billing account deposit amount to the billing > account credit to be consumed by other order (by not setting > orderPaymentPreferenceId or by other way) > Apply not paid billing account amount to the original order invoice to > close that invoice. > > |
In reply to this post by Anil Savani
I noted a bug with this long time ago but couldn't contribute it back. Check the method getBillingAccountBalance() on BillingAccountWorker class & look specifically at the code.
[snip] List<GenericValue> paymentAppls = delegator.findByAnd("PaymentApplication", UtilMisc.toMap("billingAccountId", billingAccountId)); // TODO: cancelled payments? for (Iterator<GenericValue> pAi = paymentAppls.iterator(); pAi.hasNext();) { GenericValue paymentAppl = pAi.next(); if (paymentAppl.getString("invoiceId") == null) { BigDecimal amountApplied = paymentAppl.getBigDecimal("amountApplied"); balance = balance.add(amountApplied); } } [snip] The return invoice should be excluded from the check // if (paymentAppl.getString("invoiceId") == null) and doing so the balance on billing account should correctly populate. Regards Vikas On Apr 26, 2012, at 10:10 AM, Anil Savani wrote: > Now what action should be done for the return on the given billing account > Either it should credit the full amount to the billing account to be used > by other orders |
This bug has been registered as a JIRA issue?
Op 26 april 2012 11:42 schreef Vikas Mayur <[hidden email]> het volgende: > I noted a bug with this long time ago but couldn't contribute it back. > Check the method getBillingAccountBalance() on BillingAccountWorker class & > look specifically at the code. > > [snip] > List<GenericValue> paymentAppls = > delegator.findByAnd("PaymentApplication", > UtilMisc.toMap("billingAccountId", billingAccountId)); > // TODO: cancelled payments? > for (Iterator<GenericValue> pAi = paymentAppls.iterator(); > pAi.hasNext();) { > GenericValue paymentAppl = pAi.next(); > if (paymentAppl.getString("invoiceId") == null) { > BigDecimal amountApplied = > paymentAppl.getBigDecimal("amountApplied"); > balance = balance.add(amountApplied); > } > } > [snip] > > The return invoice should be excluded from the check // if > (paymentAppl.getString("invoiceId") == null) and doing so the balance on > billing account should correctly populate. > > Regards > Vikas > > On Apr 26, 2012, at 10:10 AM, Anil Savani wrote: > > > Now what action should be done for the return on the given billing > account > > Either it should credit the full amount to the billing account to be used > > by other orders > > |
No, its not. I would try to fix it, possibly along with a test case to verify.
Regards Vikas On Apr 26, 2012, at 3:23 PM, Pierre Smits wrote: > This bug has been registered as a JIRA issue? > > Op 26 april 2012 11:42 schreef Vikas Mayur <[hidden email]> het > volgende: > >> I noted a bug with this long time ago but couldn't contribute it back. >> Check the method getBillingAccountBalance() on BillingAccountWorker class & >> look specifically at the code. >> >> [snip] >> List<GenericValue> paymentAppls = >> delegator.findByAnd("PaymentApplication", >> UtilMisc.toMap("billingAccountId", billingAccountId)); >> // TODO: cancelled payments? >> for (Iterator<GenericValue> pAi = paymentAppls.iterator(); >> pAi.hasNext();) { >> GenericValue paymentAppl = pAi.next(); >> if (paymentAppl.getString("invoiceId") == null) { >> BigDecimal amountApplied = >> paymentAppl.getBigDecimal("amountApplied"); >> balance = balance.add(amountApplied); >> } >> } >> [snip] >> >> The return invoice should be excluded from the check // if >> (paymentAppl.getString("invoiceId") == null) and doing so the balance on >> billing account should correctly populate. >> >> Regards >> Vikas >> >> On Apr 26, 2012, at 10:10 AM, Anil Savani wrote: >> >>> Now what action should be done for the return on the given billing >> account >>> Either it should credit the full amount to the billing account to be used >>> by other orders >> >> |
Free forum by Nabble | Edit this page |