Skip to content

Commit

Permalink
fix: fixed the license field data in sales invoice format (#1339)
Browse files Browse the repository at this point in the history
* fix: fixed the license field data in sales invoice format

* fix: fixed the spellling error
  • Loading branch information
nehasacher143 authored Jun 1, 2021
1 parent 4dbede4 commit 740a900
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"doctype": "Print Format",
"font": "Default",
"format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}]",
"html": "{% if doc.license %}\n{% set type = frappe.db.get_value('Compliance Info' ,doc.license, 'license_for' )%}\n{% endif %}\n<div class=\"row\">\n <div class=\"col-md-6\">\n <h2>{{doc.company}}</h2>\n <div class=\"company-address\">\n {% set links = frappe.get_all(\"Dynamic Link\", filters={\"link_doctype\": \"Company\", \"link_name\": doc.company, \"parenttype\": \"Address\"}, fields=[\"parent\"]) %}\n {% if links %}\n <p>{{ frappe.db.get_value(\"Address\", links[0].parent, \"address_line1\")}}, \n {{ frappe.db.get_value(\"Address\", links[0].parent, \"address_line2\") or \" \" }}</p>\n <p>{{ frappe.db.get_value(\"Address\", links[0].parent, \"city\") or \" \" }},\n {{ frappe.db.get_value(\"Address\", links[0].parent, \"state\") or \" \" }},\n {{ frappe.db.get_value(\"Address\", links[0].parent, \"country\") or \" \" }},\n {{ frappe.db.get_value(\"Address\", links[0].parent, \"pincode\") or \" \" }}.\n {% endif %}\n </div>\n <p class=\"license\">License: {{ frappe.db.get_value(\"Company\",doc.company , \"license\") or \" \" }}</p>\n <p class=\"phone\">Phone: {{ frappe.db.get_value(\"Address\", links[0].parent, \"phone\") or \" \" }}.</p>\n </div>\n <div class=\"col-md-6\">\n <h2 class=\"text-right\">Invoice</h2>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <h3>Invoice Number</h3>\n </div>\n <div class=\"col-md-6\">\n <p>{{doc.name}}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <h3>Date</h3>\n </div>\n <div class=\"col-md-6\">\n <p>{{doc.posting_date}}</p>\n </div>\n </div>\n {% if type != \"Retailer\" %}\n <div class=\"row\">\n <div class=\"col-md-6\">\n <h3>Terms</h3>\n </div>\n <div class=\"col-md-6\">\n <p>{{doc.payment_terms_template}}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <h3>Due Date</h3>\n </div>\n <div class=\"col-md-6\">\n <p>{{doc.due_date}}</p>\n </div>\n </div>\n {% endif %}\n </div>\n</div>\n {% if type != \"Retailer\" %}\n<div class=\"row billing_shipping_info\">\n <div class=\"col-md-6\">\n <h3 class=\"bill_to\">Bill To:</h3>\n <p class=\"customer\">{{doc.customer}}</p>\n <p class=\"company_address\">{{doc.address_display or ''}}</p>\n <p class=\"license\">License: {{doc.license or \"\"}}</p>\n <p class=\"license\">A/R Contact: {{doc.contact_person or \"\"}}</p>\n </div>\n <div class=\"col-md-6\">\n <h3>Ship To:</h3>\n <p class=\"customer\">{{doc.customer}}</p>\n <p class=\"comapany_address\">{{doc.shipping_address or \"\"}}</p>\n </div>\n</div>\n{% endif %}\n<div class=\"row\">\n <table>\n <thead>\n <tr>\n <th width=\"50%\">Description</th>\n <th>Quantity</th>\n <th>Unit Price</th>\n <th>Amount</th>\n </tr>\n </thead>\n <tbody>\n {% for item in doc.items %}\n <tr>\n <td>{{item.item_name or \"\"}}</td>\n <td>{{item.qty or \"0\"}}</td>\n <td>{{item.rate or \"0\"}}</td>\n <td>{{item.amount or \"0\"}}</td>\n </tr>\n {% endfor %}\n </tbody>\n </table>\n</div>\n<div class=\"row\">\n <table>\n <thead>\n <tr>\n <th width=\"50%\">Account Head</th>\n <th>Tax</th>\n <th>Rate</th>\n <th>Tax Amount</th>\n </tr>\n </thead>\n <tbody>\n {% for tax in doc.taxes %}\n <tr>\n <td>{{tax.account_head or ''}}</td>\n <td>{{tax.description or ''}}</td>\n <td>{{tax.rate or ''}}</td>\n <td>{{tax.tax_amount or ''}}</td>\n </tr>\n {% endfor %}\n </tbody>\n </table>\n</div>\n<div class=\"row\">\n <table>\n <tbody>\n {% if type != \"Retailer\" %}\n <tr>\n <td colspan=\"3\" class=\"text-right\">Subtotal</td>\n <td class=\"text-right\">{{doc.total}}</td>\n </tr>\n {% endif %}\n <tr>\n <td colspan=\"3\" class=\"text-right\">Discount</td>\n <td class=\"text-right\">{{doc.discount_amount}}</td>\n </tr>\n {% if type != \"Retailer\" %}\n <tr>\n <td colspan=\"3\" class=\"text-right\">Net Total</td>\n <td class=\"text-right\">{{doc.net_total}}</td>\n </tr>\n {% endif %}\n <tr>\n <td colspan=\"3\" class=\"text-right\">Taxes Charged</td>\n <td class=\"text-right\">{{doc.total_taxes_and_charges}}</td>\n </tr>\n <tr>\n <td colspan=\"3\" class=\"text-right\">Grand Total</td>\n <td class=\"text-right\">{{doc.grand_total}}</td>\n </tr>\n <tr>\n <td colspan=\"3\" class=\"text-right\">Mode of Payment</td>\n {% set mode_of_payment = frappe.get_all(\"Payment Entry\",{\"reference_name\": doc.name},\"mode_of_payment\") %}\n <td class=\"text-right\">\n {% for m in mode_of_payment %}\n {{m.mode_of_payment}}\n {% endfor%}\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n",
"html": "{% if doc.license %}\n{% set type = frappe.db.get_value('Compliance Info' ,doc.license, 'license_for' )%}\n{% endif %}\n<div class=\"row\">\n <div class=\"col-md-6\">\n <h2>{{doc.company}}</h2>\n <div class=\"company-address\">\n {% set links = frappe.get_all(\"Dynamic Link\", filters={\"link_doctype\": \"Company\", \"link_name\": doc.company, \"parenttype\": \"Address\"}, fields=[\"parent\"]) %}\n {% if links %}\n <p>{{ frappe.db.get_value(\"Address\", links[0].parent, \"address_line1\")}}, \n {{ frappe.db.get_value(\"Address\", links[0].parent, \"address_line2\") or \" \" }}</p>\n <p>{{ frappe.db.get_value(\"Address\", links[0].parent, \"city\") or \" \" }},\n {{ frappe.db.get_value(\"Address\", links[0].parent, \"state\") or \" \" }},\n {{ frappe.db.get_value(\"Address\", links[0].parent, \"country\") or \" \" }},\n {{ frappe.db.get_value(\"Address\", links[0].parent, \"pincode\") or \" \" }}.\n {% endif %}\n </div>\n <p class=\"license\">License: {{ doc.license or \" \" }}</p>\n <p class=\"phone\">Phone: {{ frappe.db.get_value(\"Address\", links[0].parent, \"phone\") or \" \" }}.</p>\n </div>\n <div class=\"col-md-6\">\n <h2 class=\"text-right\">Invoice</h2>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <h3>Invoice Number</h3>\n </div>\n <div class=\"col-md-6\">\n <p>{{doc.name}}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <h3>Date</h3>\n </div>\n <div class=\"col-md-6\">\n <p>{{doc.posting_date}}</p>\n </div>\n </div>\n {% if type != \"Retailer\" %}\n <div class=\"row\">\n <div class=\"col-md-6\">\n <h3>Payment Terms</h3>\n </div>\n <div class=\"col-md-6\">\n <p>{{doc.payment_terms_template}}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <h3>Due Date</h3>\n </div>\n <div class=\"col-md-6\">\n <p>{{doc.due_date}}</p>\n </div>\n </div>\n {% endif %}\n </div>\n</div>\n {% if type != \"Retailer\" %}\n<div class=\"row billing_shipping_info\">\n <div class=\"col-md-6\">\n <h3 class=\"bill_to\">Bill To:</h3>\n <p class=\"customer\">{{doc.customer}}</p>\n <p class=\"company_address\">{{doc.address_display or ''}}</p>\n <p class=\"license\">License: {{doc.license or \"\"}}</p>\n <p class=\"license\">A/R Contact: {{doc.contact_person or \"\"}}</p>\n </div>\n <div class=\"col-md-6\">\n <h3>Ship To:</h3>\n <p class=\"customer\">{{doc.customer}}</p>\n <p class=\"company_address\">{{doc.shipping_address or \"\"}}</p>\n </div>\n</div>\n{% endif %}\n<div class=\"row\">\n <table>\n <thead>\n <tr>\n <th width=\"50%\">Item Name</th>\n <th>Quantity</th>\n <th>Unit Price</th>\n <th>Amount</th>\n </tr>\n </thead>\n <tbody>\n {% for item in doc.items %}\n <tr>\n <td>{{item.item_name or \"\"}}</td>\n <td>{{item.qty or \"0\"}}</td>\n <td>{{item.rate or \"0\"}}</td>\n <td>{{item.amount or \"0\"}}</td>\n </tr>\n {% endfor %}\n </tbody>\n </table>\n</div>\n<div class=\"row\">\n <table>\n <thead>\n <tr>\n <th width=\"50%\">Account Head</th>\n <th>Tax</th>\n <th>Rate</th>\n <th>Tax Amount</th>\n </tr>\n </thead>\n <tbody>\n {% for tax in doc.taxes %}\n <tr>\n <td>{{tax.account_head or ''}}</td>\n <td>{{tax.description or ''}}</td>\n <td>{{tax.rate or ''}}</td>\n <td>{{tax.tax_amount or ''}}</td>\n </tr>\n {% endfor %}\n </tbody>\n </table>\n</div>\n<div class=\"row\">\n <table>\n <tbody>\n <tr>\n <td colspan=\"3\" class=\"text-right\">Subtotal</td>\n <td class=\"text-right\">{{doc.total}}</td>\n </tr>\n <tr>\n <td colspan=\"3\" class=\"text-right\">Discount</td>\n <td class=\"text-right\">-{{doc.discount_amount}}</td>\n </tr>\n {% if type != \"Retailer\" %}\n <tr>\n <td colspan=\"3\" class=\"text-right\">Net Total</td>\n <td class=\"text-right\">{{doc.net_total}}</td>\n </tr>\n {% endif %}\n <tr>\n <td colspan=\"3\" class=\"text-right\">Taxes Charged</td>\n <td class=\"text-right\">{{doc.total_taxes_and_charges}}</td>\n </tr>\n <tr>\n <td colspan=\"3\" class=\"text-right\">Grand Total</td>\n <td class=\"text-right\">{{doc.grand_total}}</td>\n </tr>\n <tr>\n <td colspan=\"3\" class=\"text-right\">Mode of Payment</td>\n {% set mode_of_payment = frappe.get_all(\"Payment Entry\",{\"reference_name\": doc.name},\"mode_of_payment\") %}\n <td class=\"text-right\">\n {% for m in mode_of_payment %}\n {{m.mode_of_payment}}\n {% endfor%}\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n",
"idx": 0,
"line_breaks": 0,
"modified": "2021-05-06 00:18:12.444557",
"modified": "2021-05-31 23:25:03.224988",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
Expand Down

0 comments on commit 740a900

Please sign in to comment.