Hi
I am trying to add a feature to handle Gift Cards in a custom app. So far, regarding Gift Cards, these are the only two related posts I could find -
https://github.com/frappe/erpnext/issues/12789
These are the changes I thought of adding to the custom app for this feature.
- Create custom fields in Item to set the whether Item
is_gift_card
and holdgift_card_value
andgift_card_validity
.- Make Gift Card Items serialized and use
deferred_revenue_account
.
- Make Gift Card Items serialized and use
- Create custom doctype Gift Card that map one-to-one to Serial No. (Or maybe just use Serial No with custom fields.)
- Hook into Serial No after_insert to create Gift Card with
card_amount
.- Stock Entry et al. can be used to receive stock, the standard ERPNExt way.
- Selling Gift Card Item to Customer with Sales Invoice would need no changes as the sale would be registered against the
deferred_revenue_account
. Thecard_validity
would need to be updated though, so hook into on_submit. - Add a Mode of Payment with the account for the company set to the same
deferred_revenue_account
. - Create custom fields in Sales Invoice to select Gift Card, fetch
gift_card_balance
. (Also checkcard_validity
) - When a Sales Invoice is inserted with the Gift Card Mode of Payment, validate
amount
againstgift_card_balance
. - When the Sales Invoice is submitted, the paid
amount
fromdeferred_revenue_account
should move from this account to the proper income account (hopefully with no changes further changes to the code). - Hook into on_submit here, to update the
gift_card_balance
. These might be achieved by one of two ways.- Updating in-place a
card_balance
field in Gift Card. - Maintaining a transaction record, Gift Card Entry, similar to Loyalty Point Entry
- Updating in-place a
My concerns are -
- Will this be achievable?
- Am I allowed to use Deferred Revenue like this?
Any other thoughts would be appreciated.
Regards