mntechnique/kiratplastics_erpnext

Add Invoice type (Sale Invoice / Supplementary Invoice / Invoice for Sample / Challan) with different series. If Supplementaty Invoice or Sample, do not update stock).

Closed this issue · 2 comments

Requirement Number : 5
Project Module : Invoice
Type : Customization
Description : Add Invoice type (Sale Invoice / Supplementary Invoice / Invoice for Sample / Challan) with different series. If Supplementaty Invoice or Sample, do not update stock).
Note : Custom Field : Invoice Type, Code for updating stock conditionally.

Developer Reference:

  • Find the Custom Field list and add a new custom field named "Kirat Invoice Type" to the Sales Invoice doctype. In the Options textbox, add Sales Invoice, Supplementary Invoice, Invoice for Sample and Challan, each on a new line.
  • The new field's database name must be "kirat_invoice_type", but the word Kirat should not be seen in the field name on the Sales Invoice form
  • Ensure that the new field appears above the Series field.
  • The new field should be a mandatory field.
  • Use the Naming Series feature of ERPNext to add options SINV-SUP, SINV-SMP, SINV-CHL under SINV-RET. DO NOT modify the existing options. Update the Naming Series form when done.
  • Use Custom Script to set the naming_series value to
    • SINV-SUP when invoice type is Supplementary Invoice
    • SINV-SMP when invoice type is Sample Invoice
    • SINV-CHL when sample type is challan.
      (Hint: Use frm.set_value("field_name", value); )
  • Use a Custom script to mark the kirat_invoice_type field read-only after saving an invoice.
    (Refer to Client Scripting on frappe's github wiki.
    Hint: Use "frappe.ui.form.on(... " instead of "cur_frm.cscript.custom_refresh = ...")

Invoice Type, Naming Series: 8394231

Hide Update Stock checkbox: 0f8404e