Skip to content

Commit 0c6c87b

Browse files
committed
Merge branch 'staging' into production
2 parents eeee9dd + 24407df commit 0c6c87b

74 files changed

Lines changed: 2888 additions & 212 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

erpnext/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from frappe.utils import getdate
77

88
__erpnext_version__ = '12.10.1'
9-
__version__ = '2.2.2'
9+
__version__ = '2.3.0'
1010

1111
def get_default_company(user=None):
1212
'''Get default company for user'''

erpnext/accounts/doctype/coupon_code/coupon_code.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"editable_grid": 1,
88
"engine": "InnoDB",
99
"field_order": [
10+
"enabled",
1011
"coupon_name",
1112
"coupon_type",
1213
"customer",
@@ -136,9 +137,16 @@
136137
"fieldtype": "Link",
137138
"label": "Customer Group",
138139
"options": "Customer Group"
140+
},
141+
{
142+
"default": "1",
143+
"fieldname": "enabled",
144+
"fieldtype": "Check",
145+
"in_list_view": 1,
146+
"label": "Enabled"
139147
}
140148
],
141-
"modified": "2020-12-17 00:02:05.148366",
149+
"modified": "2021-06-08 09:44:21.974315",
142150
"modified_by": "forellana@digithinkit.com",
143151
"module": "Accounts",
144152
"name": "Coupon Code",

erpnext/accounts/print_format/sales_invoice/sales_invoice.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"doctype": "Print Format",
1010
"font": "Default",
1111
"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\"}]",
12-
"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>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=\"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%\">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",
12+
"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",
1313
"idx": 0,
1414
"line_breaks": 0,
15-
"modified": "2021-05-20 05:25:16.166402",
15+
"modified": "2021-05-31 23:25:03.224988",
1616
"modified_by": "Administrator",
1717
"module": "Accounts",
1818
"name": "Sales Invoice",

erpnext/buying/report/procurement_tracker/procurement_tracker.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,20 @@ def get_columns(filters):
136136
"fieldtype": "Date",
137137
"width": 140
138138
},
139+
{
140+
"label": _("Batch No"),
141+
"fieldname": "batch_no",
142+
"fieldtype": "Link",
143+
"options": "Batch",
144+
"width": 140
145+
},
146+
{
147+
"label": _("Package Tag"),
148+
"fieldname": "package_tag",
149+
"fieldtype": "Link",
150+
"options": "Package Tag",
151+
"width": 140
152+
}
139153
]
140154
return columns
141155

@@ -168,6 +182,13 @@ def get_data(filters):
168182
if procurement_record_against_mr:
169183
procurement_record += procurement_record_against_mr
170184
for po in purchase_order_entry:
185+
# get batch and package tag related information form purchase receipt.
186+
posting_date, batch_no, package_tag = None, None, None
187+
if pr_records.get(po.name):
188+
posting_date = pr_records.get(po.name).get('posting_date')
189+
batch_no = pr_records.get(po.name).get('batch_no')
190+
package_tag = pr_records.get(po.name).get('package_tag')
191+
171192
# fetch material records linked to the purchase order item
172193
mr_record = mr_records.get(po.material_request_item, [{}])[0]
173194
procurement_detail = {
@@ -189,7 +210,9 @@ def get_data(filters):
189210
"purchase_order_amt": flt(po.amount),
190211
"purchase_order_amt_in_company_currency": flt(po.base_amount),
191212
"expected_delivery_date": po.schedule_date,
192-
"actual_delivery_date": pr_records.get(po.name)
213+
"actual_delivery_date": posting_date,
214+
"batch_no": batch_no,
215+
"package_tag": package_tag
193216
}
194217
procurement_record.append(procurement_detail)
195218
return procurement_record
@@ -252,17 +275,21 @@ def get_mapped_pi_records():
252275
"""))
253276

254277
def get_mapped_pr_records():
255-
return frappe._dict(frappe.db.sql("""
278+
pr_records = frappe.db.sql("""
256279
SELECT
257280
pr_item.purchase_order_item,
258-
pr.posting_date
281+
pr.posting_date,
282+
pr_item.batch_no,
283+
pr_item.package_tag
259284
FROM `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item
260285
WHERE
261286
pr.docstatus=1
262287
AND pr.name=pr_item.parent
263288
AND pr_item.purchase_order_item IS NOT NULL
264289
AND pr.status not in ("Closed","Completed","Cancelled")
265-
"""))
290+
""", as_dict=1)
291+
pr_records_dict = {item['purchase_order_item']:item for item in pr_records}
292+
return pr_records_dict
266293

267294
def get_po_entries(conditions):
268295
return frappe.db.sql("""

erpnext/config/desktop.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,13 @@ def get_data():
208208
'standard': 1,
209209
"description": "Publish items to other ERPNext users."
210210
},
211+
{
212+
"module_name": "Reports",
213+
"category": "Modules",
214+
"label": _("Reports"),
215+
"color": "#3498db",
216+
"icon": "octicon octicon-repo",
217+
"type": "module",
218+
"description": "Accounts, billing, payments, cost center and budgeting."
219+
}
211220
]

0 commit comments

Comments
 (0)