Skip to content

PurchaseInvoice

PurchaseInvoice DocType definition.

Attributes:
name: Unique identifier for this PurchaseInvoice.

Source: doctype.py

Field Type Required Description Validators
invoice_number str Supplier Invoice Number maxLen: 50
supplier str Linked Supplier ID -
posting_date date Posting Date -
due_date None Due Date -
supplier_gstin None Supplier GSTIN -
place_of_supply None Place of supply / GST state code -
cgst_amount float CGST Amount -
sgst_amount float SGST Amount -
igst_amount float IGST Amount -
tds_rate float TDS Rate % -
tds_amount float TDS Amount -
items list[InvoiceItem] Invoice Items -
total_qty Decimal Total Quantity -
total_amount Decimal Total Amount before Tax -
tax_amount Decimal Total Tax Amount -
grand_total Decimal Grand Total -
paid_amount Decimal Amount Paid -
outstanding_amount Decimal Amount Outstanding -
status str Status (Draft, Submitted, Paid, Cancelled) -
Role Create Delete Read Write
All
Setting Value
Submittable False
Track Changes True

Controller hooks are implemented in *_controller.py files. Available lifecycle hooks:

  • validate() - Called before save, raise exceptions for validation errors
  • before_insert() - Called before inserting a new document
  • after_insert() - Called after successfully inserting
  • before_save() - Called before saving (insert or update)
  • after_save() - Called after saving
  • before_delete() - Called before deleting
  • after_delete() - Called after deleting