-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add bill print * feat: add print receipt * fix address
- Loading branch information
Showing
10 changed files
with
68 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import frappe | ||
from frappe import utils | ||
|
||
|
||
def extended_bil_extra_data(invoice): | ||
|
||
tax_name = frappe.db.get_single_value("Inn Hotels Setting", "tax_name_pos_receipt", True) | ||
|
||
address = frappe.get_all("Dynamic Link", filters={"link_doctype": "Company", "link_name": invoice.company,"parenttype":"Address"}, fields=["parent"]) | ||
if address: | ||
address = frappe.get_value("Address", filters=address[0].parent, fieldname="address_line1", as_dict=True) | ||
|
||
order_id = frappe.get_value("Inn POS Usage", filters={"pos_invoice": invoice.name}, fieldname="name", as_dict=True) | ||
|
||
total_tax = 0 | ||
for tax in invoice.taxes: | ||
total_tax += tax.tax_amount | ||
total_tax = utils.fmt_money(total_tax, 2, "Rp") | ||
|
||
remarks = frappe.db.get_single_value("Inn Hotels Setting", "pos_receipt_remarks", True) | ||
|
||
return { | ||
"address": address.address_line1, | ||
"order_id": order_id.name, | ||
"tax": { | ||
"name": tax_name, | ||
"total": total_tax | ||
}, | ||
"remarks": remarks | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.