Topic: Refunds...

Hi Guys,


Please, I need a help and advise on how to implement sale refunds (Credit Note) as I tried without any success.


Please see the attached sample file:

Post's attachments

Attachment icon CR and DB - Refunds.zip 16.77 kb, 382 downloads since 2016-12-11 

Adam
God... please help me become the person my dog thinks I am.

Re: Refunds...

Hello,


Please provide more details, what exactly you can't do?

Dmitry.

Re: Refunds...

Hi Dmitry,


I'm trying to do:

1. Select an invoice on Form1 / Sale Invoices tab and click on "Refund Selected Invoice" button to display selected invoice details on "frmCR_SaleRefund"


2. If required edit (partial refund ) and save the data displayed on "frmCR_SaleRefund" to "crSaleInvRefund" / "crSaleInvRefundItems"


3. Change the color or add some indication to the original invoice on Form1 / Sale Invoices tab on save of the refunds so  that  invoice has a refund indication.


I have commented out script lines produced errors and I couldn't correct..


Please see the updated sample project.

Post's attachments

Attachment icon CR and DB - Refunds2.zip 19.35 kb, 412 downloads since 2016-12-14 

Adam
God... please help me become the person my dog thinks I am.

Re: Refunds...

AD1408
Unfortunately I can't help you with these questions, to solve all these issues would require too much time. Usually I can only help with specific questions.

Dmitry.

Re: Refunds...

I understand Dmitry... Thank you for the reply.


It'd be nice to hear from other guys who has some experience/thoughts about implementing invoice refunds. Perhaps, there is a simpler/easier approach.


Derek, If you are around I'd love to hear your ingenious suggestions...

Adam
God... please help me become the person my dog thinks I am.

Re: Refunds...

Adam,
Is it a requirement to have refunds in separate tables? A solution could be to incorporate your refund fields in the invoice and invoice items tables. You could still have a tablegrid of invoices filtered on refunds on a separate form, like you have, in order to show just your refunds. Just a thought.


You could do it in separate tables, but thinking off the top of my head I believe it could get a little involved. You would need to connect the refund tables to invoices by setting up relationships between them and then prepopulate the refund tables through script with invoice data upon a refund. And if the user cancels the refund, then you would need to delete the refund records. Also, for partial refunds, if a specific line item does not get refunded, it probably should be removed from the refund item table. As you can see, it can be a bit involved. Nothing is impossible though.

Re: Refunds...

Hello Adam, EHW,
I'd been thinking about a similar approach and totally agree with EHW.  I might try
1.  deleting the CRSALEINVREFUND and CRSALEINVREFUNDITEM tables
2.  renaming (for clarity) SALEINV to TRANSACTIONHEADER and SALEINVITEM to TRANSACTIONITEM
This would simplify the structure greatly
3.  add a DB(debit)/CR(credit) indicator for each TRANSACTIONITEM record (with DB as the default)
4.  optionally add a 'REASON CODE' indicator (faulty, damaged, not required etc etc)
4.  use 2 tablegrids, filtered on the DB/CR indicator
With this approach,
5.  if the CR relates to an invoice, you simply add it as a new line to the existing invoice.
6.  if the CR is a general credit, it can be added as a totally new transaction unrelated to any invoice.
7.  from a reporting aspect, you could, for example, print out just the CR transactions if you need to issue a defacto Credit Note.
This option gives you greater flexibility but with simplicity - transactions that are wholly DB items, wholly CR items or a mix of DB and CR items - all using the same tables.
From a credit control point of view, it might also be useful to have an indicator against each TRANSACTIONITEM record to show if it's been paid, credit issued, in dispute etc etc (although in my experience, if one transaction item is in dispute, the entire transaction gets disputed - or maybe that's just how it works in the UK).
If I get a spare hour, I'll mock something up, as much for my own interest, to see how it might look.
Regards,
Derek.

8 (edited by AD1408 2016-12-16 18:48:14)

Re: Refunds...

Hi ehwagner and Derek.


Thank you very much for your suggestions guys......


In line of ehwagner's simple approach suggestion, I altered the project and put together something. I used boolean checkboxes as a filter. I don't know if it's done correctly though.


However, I have one issue with it.
On Form1 / Invoices tab / Refund Selected Invoice button (button14)  used as show records action to get selected invoice details on "frmCR_SaleRefund" form.
It does the job but it causes to load both "frmSaleInv" and "frmCR_SaleRefund" at same time when double clicked  on a record on Form1 / Invoices tab /  "Refund Selected Invoice" (button14)
I'm thinking putting double click event for "tgSearchSaleInv" or onclick event for the button "Refund Selected Invoice" (button14) needed and I couldn't do either of them.


Derek, I look forward to your version implementation.


Please see updated sample project.

Post's attachments

Attachment icon CR and DB - Refunds 3.zip 18.81 kb, 474 downloads since 2016-12-16 

Adam
God... please help me become the person my dog thinks I am.

Re: Refunds...

Hi Adam, EHW and anyone else,
Please find attached one option for handling refunds (using just one table to hold both DB and CR transactions, as outlined by EHW). 
It's a clone of an old project so it doesn't look too much like yours but the principle of using either different tablegrids to split off invoices and credit notes (refunds) or (as I've done in this example) using the same tablegrid with a real-time filter, is basically the same. 
I prefer this way because it's quick and easy to set up and also means you can see ALL transactions, just DB transactions or just CR transactions all on the same grid - but you could choose to show 3 discrete grids all on the same screen if you wanted.
It's just 'play data' but it should work - the script is a bit messy but most of it is just for cosmetic reasons or better ease of use for users.
Hope this gives you some ideas.
Derek.

Post's attachments

Attachment icon adh refunds.zip 406.1 kb, 426 downloads since 2016-12-17 

10 (edited by AD1408 2016-12-17 21:27:06)

Re: Refunds...

Hi Derek,


Thanks a lot for the example... Appreciated...


I posted the below on a separate topic but if you are around could you please answer:

procedure Form1_tgSearchSaleInv_OnCellDoubleClick (Sender: string; ACol, ARow: Integer);
begin
     //Script for replacing double click action on a tGrid record with show records button action please....

end;

If the above is not doable then disabling tGrid CellDoubleClick or DoubleClick (whichever is the correct one) could do the job.
Therefore in this situation I'd be just using Edit button for editing selected inv.



I used two form for adding inv and Redund and two edit buttons on same form1/Sale Inv / tGrid. Buttons work OK but double click on a record on tGrid launches both forms.

Adam
God... please help me become the person my dog thinks I am.