Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

Allocate credit note / debit note to another sales invoice / purchase invoice

Hello,
In my company there is a policy that credit note will be allocated to another invoice. This is the full scenario.

  1. Customer buy and receive sales invoice
  2. Customer wants to return some goods so credit note is released
  3. Previously credit note issued will be allocated to another sales invoice (same with advance payment allocation)

This scenario also aplied in debit note.

How can I do this in ERPNext ?

Thank you

When you make return to related invoices…then debit/credit note is issued for those invoices…
Via payment entry, on receive/pay from/to parties then these credit/debit notes will appear to deduct payable/receivable

Found this in older thread :

Yap, the credit note surely will deduct receivable and ERPNext could to this flawlessly. But in my case the issued credit become the basis for the company to make new invoice. In other words the amount of credit note will become the “advance payment amount” and we can allocate it for another invoice.
Is it possible to do this in ERPNext ?

1 Like

Given the possibilities, I will share these scenarios, and how we are resolving them.

Scenario 1 - Payment to customer in full for total return

  1. Customer buys and receives a sales invoice.
    2.Customer pays and leaves.
  2. A day later customer comes back to return full items
  3. Credit note is issued for invoice.
  4. Payment back to customer is registered against the party Customer

Scenario 1.a - Payment to customer in full for partial return

  1. Customer buys and receives a sales invoice.
  2. Customer pays and leaves.
  3. A day later customer comes back for a partial return of items
  4. Credit note is issued for invoice, for amount of items returned
  5. Payment to customer is registered against the party Customer, for partial amount returned

Scenario 1.b.full - Store credit for total return, credit used in full

  1. Customer buys and receives a sales invoice
  2. Customer pays and leaves
  3. A day later customer comes back to return full items
  4. Credit note is issued for invoice
  5. Customer is issued store credit only, thus no payment to customer is registered
  6. Customer returns to use his credit
  7. New sales invoice is issued for full credit amount. No payment is required against new sales invoice.
  8. No credit remains

Scenario 1.b.partial - Store credit for total return, credit used partially

  1. Customer buys and receives a sales invoice
  2. Customer pays and leaves
  3. A day later customer comes back to return full items
  4. Credit note is issued for invoice.
  5. Customer is issued store credit only, thus no payment to customer is registered.
  6. Customer returns to use his credit, partially
  7. New sales invoice is issued for items, the amount being a partial portion of the available credit amount. No payment is required against new sales invoice
  8. Remaining Credit is pending use by customer.

Scenario 1.c.full - Store credit for partial return, credit used in full

  1. Customer buys and receives a sales invoice
  2. Customer pays and leaves
  3. A day later customer comes back for a partial return of items
  4. Credit note is issued for invoice, for return amount
  5. Customer is issued store credit only, thus no payment to customer is registered
  6. Customer returns to use his credit in full
  7. New sales invoice is issued for full credit amount. No payment is required against new sales invoice.
  8. No credit remains

Scenario 1.c.partial - Store credit for partial return, credit used partially

  1. Customer buys and receives a sales invoice
  2. Customer pays and leaves
  3. A day later customer comes back for a partial return of items
  4. Credit note is issued for invoice, for return amount
  5. Customer is issued store credit only, thus no payment to customer is registered
  6. Customer returns to use his credit, partially
  7. New sales invoice is issued for items, the amount being a partial portion of the available credit amount. No payment is required against new sales invoice
  8. Remaining Credit is pending use by customer.

The problem arises when Scenario 1.b.partial and scenario 1.c.partial occur.

At some point, you must cancel this debt in favor of your customer.

  1. Customer can come to use his remaining credit after one instance of using store credit

  2. Customer never returns

A scenario of the customer never returning can be dealt with in two ways, depending on your company policy:
A. Money is returned to your customer, for which you issue a payment for him in return.
B. A company policy dictates that credit in customer’s favor must be used by end of fiscal year

Thus we are left with scenario B, where customer never returned, repayment is not possible, and you must issue an invoice, in our case, legally required to be linked to a previously generated invoice, and thus we use Debit note to cancel the remaining credit without items sold or services rendered.

All scenarios before “B” can be dealt simply with Sales Invoice, Payment Entry and Credit Note or Sales Invoice Return.

Debit note is also used by us in scenarios where the Sales Invoice was issued with lesser amounts than what were supposed to be charged. Given that this invoice has been electronically signed in our case, it is legally inmutable, and thus a Debit note is issued, linked to the original invoice, for the items or amounts necessary to correct the error. This Debit note ensures accounting is precise.

For any valid invoice, we have added a Debit Note button, so that when pressed, the Sales Invoice is left as valid, and a new “Amended” Sales invoice is created, which changes the numbering series to the pre-configured Debit Note series. A link to the original Sales Invoice is kept, similar to when you use ERPNext’s Cancel>Amend>Save>Validate workflow. The Cancel button has been disabled, so that the only possible routes are to create a Credit Note or Debit Note

I will post the github code later.

7 Likes

@danu @Tropicalrambler

Have same query:

  • Sales invoice raised, items taken
  • Customer returns few days later to swap partial item on invoice
  • Return against delivery note completed
  • Credit note created against original invoice - credit of $79 for item returned
  • new invoice created for replacement item totaling $89 - no advanced payment option to allocate the $79 credit from prior?
  • Payment entry made against new invoice of $10 - states unpaid amount of $79, which I cannot allocate from the credit note…

I was able to create a journal entry per below, with party being the customer with credit, which allows the figure to be used in Advanced Payment - however not certain if this is the correct thing to do. Only thing I can see which might be an issue is the cost center is used against the credit entry…

Anyone able to advise?

Seems there was a Github issue created to sort this credit note > advanced payment issue out by @umair https://github.com/frappe/erpnext/issues/12846




Hello,

I have a similar problem: my clients purchase stock and we issue sales invoice, the invoice is then paid and closed (with the payment entry it appears with status Paid in green), then some part of the stock is returned to us and we issue credit note to the invoice related to this purchase. It is essential that the credit note is linked to its related invoice in the system because it is required by the local legislation.The customer then buys stock again and we issue the next sales invoice. However the payment that we receive is for the amount of the second invoice and the credit note related to the first invoice NET.

How is it possible to link the second payment to the second invoice and the credit note?
My objective is to show that all balances are closed and that the credit note is linked to the first invoice and that the second payment closes the second invoice together with the credit note in order to have a reliable trade receivables report (for aging analysis).

I tried to do use JE but I am not able to change the status of the invoices to Paid with it.

Thank you all for the help

Yes, that is my issue as well - how to apply this “credit” to the customer’s account to pay an invoice. Customer invoice total is $100. We issue a $10 credit to them. We go to payment entry and receive $90 check plus try to pull in the JV for the $10 credit and it won’t allow us. :frowning:

What to do?

I believe this issue will be solved in upcoming V11 as we can issue stand alone debit/credit note

1 Like

You can apply any open credit/payment to any open invoice in the “Match Payments with Invoices” screen. You can then go to Payment Entry to create a payment document for the remaining amount.

Thank you so much! This worked just like we wanted.

Seems strange that you have to go to another screen to do this when it could just be pulled in to the payment entry at time of entering payment like a credit really should but thank you for your help as this solved the issue!

Hi Oneritch, still can not understand why no one claims the issue that shows github, since a big problem not being able to do anything with the credit of the credit notes.

I have to be missing something, how are you doing for customers can use the credit as a down payment?

Hi @charlie-cook @DBoobis, I don’t quite understand if they could use the credit of a credit note for the customer’s account in any way.

Regards

So if there’s an outstanding credit on the customer’s account and then there’s an open invoice, you go to the match payments and you apply that credit to their invoice. That’s how I do it.

My issue is that there’s really no way to tell the credit has been used or unused - when looking at the Journal entry>credit note. I would have to go to each customer’s account to do that so it’s painful. This is most definitely a process that could use some major help!

Beats me @federico_calvo however seems with the new credit / debit node in v11 this should be fixed up…

At present I have to create the journal entry (as above) against the debtors account with the credit being an ‘Is Advance’ for it to show up under Advance Payment within the invoice. Does this work for you?

Anyone has accomplished the challenge of utilizing the Credit note balance at Cart/checkout page making sure that if payment is accomplished from the balance with dues becoming 0 then it doesn’t move to Payment gateway processing but creates a payment entry nevertheless.

Is it possible that the Credit Note have its own naming series? And every time the sales invoice is returned, the name of the doctype will be credit note? so that it is easier to look and identify the voucher types at the general ledger? Same with the debit note.

Create multiple naming series under the sales invoice

and add following custom script

frappe.ui.form.on(“Sales Invoice”, {
“is_return”: function(frm) {
if (frm.doc.is_return==‘1’) {
(frm.set_value(‘naming_series’, ‘CNI-.abbr.-.YY.-’));
}
if (frm.doc.is_return==‘0’) {
(frm.set_value(‘naming_series’, ‘SIN-.abbr.-.YY.-’));
}

}
});

Hi @Aadhil_P_M Thank you for suggestion. I tried to encode it to the custom scripts and gave me a syntax error. This is the first script for sales invoice.

I used the same scripts and just changed the naming series.

frappe.ui.form.on(‘Sales Invoice’, {
“is_return”: function(frm) {
if (frm.doc.is_return==‘1’) {
(frm.set_value(‘naming_series’, ‘CN-.YYYY.-’));
}
if (frm.doc.is_return==‘0’) {
(frm.set_value(‘naming_series’, ‘ACC-SINV-.YYYY.-’));
}

}
});

  frappe.ui.form.on('Sales Invoice', {
    "is_return": function(frm) {
            if (frm.doc.is_return=='1') {
              (frm.set_value('naming_series', 'CN-.YYYY.-'));
            }
            if (frm.doc.is_return=='0') {
              (frm.set_value('naming_series', 'ACC-SINV-.YYYY.-'));
            }
            
    }
    });

Hi @Aadhil_P_M this worked. Thank you so much. It worked for creating a new sales invoice and enabling the “is return” check button.

However, can you also help me to make it auto select if the credit note was created from the sales invoice?

I tried creating the credit note from: Opening the sales invoice to be return > click create button > click return/credit note. But the naming series was still the sales invoice naming series. I need to disable and enable the checkbutton of “is return” so that it will be selected.