Skip to content

Commit

Permalink
Merge pull request #33 from navariltd/meter-reading
Browse files Browse the repository at this point in the history
Meter reading
  • Loading branch information
muruthigitau authored Nov 16, 2024
2 parents b63b6ec + b6a1c38 commit 375e72e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"engine": "InnoDB",
"field_order": [
"sales_order_creation_state",
"sales_invoice_creation_state",
"column_break_moce",
"individual_invoices_for_multiple_sales_orders"
],
Expand All @@ -25,13 +26,20 @@
"default": "0",
"fieldname": "individual_invoices_for_multiple_sales_orders",
"fieldtype": "Check",
"label": "Individual Invoices for Multiple Sales Orders"
"label": "Create single invoice for multiple sales orders per customer"
},
{
"default": "Draft",
"fieldname": "sales_invoice_creation_state",
"fieldtype": "Select",
"label": "Sales Invoice Creation State",
"options": "Draft\nSubmitted"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-10-21 13:51:14.215274",
"modified": "2024-11-16 19:13:25.929144",
"modified_by": "Administrator",
"module": "Utility Billing",
"name": "Utility Billing Settings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,15 @@ def merge_documents(doclist):

def finalize_invoice(invoice):
"""Calculate totals and save the invoice."""
invoice.update_stock = 1
invoice.run_method("calculate_taxes_and_totals")
invoice.run_method("set_payment_schedule")
invoice.save()
auto_submit_sales_invoice = frappe.db.get_single_value(
"Utility Billing Settings", "sales_invoice_creation_state"
)
if auto_submit_sales_invoice != "Draft":
invoice.submit()


def add_invoice_items(target_invoice, doc):
Expand Down

0 comments on commit 375e72e

Please sign in to comment.