Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21544ca978 | ||
|
|
2bb9093b9a | ||
|
|
f0c41b5709 | ||
|
|
1839fcca11 | ||
|
|
d1eb237909 | ||
|
|
a9b9edd9bc | ||
|
|
07b524ee50 | ||
|
|
802b4359b5 | ||
|
|
f65e8de5a5 | ||
|
|
34e34ed1e8 | ||
|
|
6734c4ad5c | ||
|
|
91621639e8 | ||
|
|
a3e7c38734 | ||
|
|
0dab40f4a1 | ||
|
|
202bcc09d5 | ||
|
|
0e8361d1de | ||
|
|
1d88c65be4 | ||
|
|
c657cceffc | ||
|
|
1ecf613c3c | ||
|
|
ceea71bcfc | ||
|
|
b0e329b803 | ||
|
|
506120936a | ||
|
|
7fc18f359c | ||
|
|
92254d3930 | ||
|
|
5a383e5cdd | ||
|
|
06966e8e1d | ||
|
|
5594050104 | ||
|
|
cdbacf5398 | ||
|
|
6bbed0297b | ||
|
|
3cae3a5190 | ||
|
|
edb99f8750 | ||
|
|
4de4b56c60 | ||
|
|
585448b225 | ||
|
|
257ecf71ac | ||
|
|
5105b1e789 | ||
|
|
dc0a277085 | ||
|
|
fa2feae314 | ||
|
|
494a4d9ba1 | ||
|
|
7b29dc7208 | ||
|
|
9646be1d5d | ||
|
|
5c82e9ef8b | ||
|
|
ae25e0da88 | ||
|
|
3d98d23e22 | ||
|
|
11bde0ba14 | ||
|
|
bef185c404 | ||
|
|
94c4d7014d | ||
|
|
249bc6167f | ||
|
|
aa9b8603b9 | ||
|
|
fe7a5b305f | ||
|
|
8c9c9cfc5f | ||
|
|
a6be7c71ed | ||
|
|
89c8b4d6ae | ||
|
|
e5f5017973 | ||
|
|
174c3478a1 | ||
|
|
c2690425e3 | ||
|
|
bcf63a2a8f |
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
__version__ = '7.2.1'
|
||||
__version__ = '7.2.7'
|
||||
|
||||
def get_default_company(user=None):
|
||||
'''Get default company for user'''
|
||||
|
||||
@@ -9,11 +9,13 @@
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -30,6 +32,7 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
@@ -40,6 +43,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "budget_amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@@ -50,11 +54,13 @@
|
||||
"label": "Budget Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
@@ -72,7 +78,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-07-11 03:27:58.705376",
|
||||
"modified": "2017-01-02 17:02:53.339420",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget Account",
|
||||
|
||||
@@ -326,10 +326,12 @@ class JournalEntry(AccountsController):
|
||||
if d.account_currency == self.company_currency:
|
||||
d.exchange_rate = 1
|
||||
elif not d.exchange_rate or d.exchange_rate == 1 or \
|
||||
(d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name and d.posting_date):
|
||||
(d.reference_type in ("Sales Invoice", "Purchase Invoice")
|
||||
and d.reference_name and self.posting_date):
|
||||
|
||||
# Modified to include the posting date for which to retreive the exchange rate
|
||||
d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency, self.company,
|
||||
d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
|
||||
d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency,
|
||||
self.company, d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
|
||||
|
||||
if not d.exchange_rate:
|
||||
frappe.throw(_("Row {0}: Exchange Rate is mandatory").format(d.idx))
|
||||
@@ -651,7 +653,8 @@ def get_payment_entry(ref_doc, args):
|
||||
if args.get("party_account"):
|
||||
# Modified to include the posting date for which the exchange rate is required.
|
||||
# Assumed to be the posting date in the reference document
|
||||
exchange_rate = get_exchange_rate(ref_doc.posting_date, args.get("party_account"), args.get("party_account_currency"),
|
||||
exchange_rate = get_exchange_rate(ref_doc.get("posting_date") or ref_doc.get("transaction_date"),
|
||||
args.get("party_account"), args.get("party_account_currency"),
|
||||
ref_doc.company, ref_doc.doctype, ref_doc.name)
|
||||
|
||||
je = frappe.new_doc("Journal Entry")
|
||||
@@ -686,7 +689,8 @@ def get_payment_entry(ref_doc, args):
|
||||
bank_row.update(bank_account)
|
||||
# Modified to include the posting date for which the exchange rate is required.
|
||||
# Assumed to be the posting date of the reference date
|
||||
bank_row.exchange_rate = get_exchange_rate(ref_doc.posting_date, bank_account["account"],
|
||||
bank_row.exchange_rate = get_exchange_rate(ref_doc.get("posting_date")
|
||||
or ref_doc.get("transaction_date"), bank_account["account"],
|
||||
bank_account["account_currency"], ref_doc.company)
|
||||
|
||||
bank_row.cost_center = cost_center
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Applicable for User",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -52,7 +51,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Series",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -84,7 +82,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Update Stock",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -112,7 +109,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Warehouse",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -142,7 +138,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Campaign",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -159,34 +154,6 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "ignore_pricing_rule",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Ignore Pricing Rule",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -199,7 +166,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -226,7 +192,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Customer",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -256,7 +221,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -286,7 +250,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -304,6 +267,33 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "ignore_pricing_rule",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Ignore Pricing Rule",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -316,7 +306,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Allow Delete",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -332,6 +321,33 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "allow_user_to_edit_rate",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Allow user to edit Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -344,7 +360,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -371,7 +386,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Sales Invoice Payment",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -400,7 +414,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -427,7 +440,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Groups",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -456,7 +468,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -483,7 +494,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Customer Groups",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -512,7 +522,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -540,7 +549,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Print Format",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -569,7 +577,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Letter Head",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -599,7 +606,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Print Heading",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -629,7 +635,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Terms and Conditions",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -659,7 +664,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Column Break",
|
||||
@@ -687,7 +691,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Territory",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -717,7 +720,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Price List",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -747,7 +749,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Apply Discount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -777,7 +778,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Apply Discount On",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -806,7 +806,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -834,7 +833,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Write Off Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -863,7 +861,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Write Off Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -892,7 +889,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Account for Change Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -921,7 +917,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Taxes and Charges",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -951,7 +946,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -978,7 +972,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Income Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1009,7 +1002,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Expense Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1037,7 +1029,6 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1067,8 +1058,8 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-12-12 17:02:22.323006",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2016-12-28 15:14:59.411457",
|
||||
"modified_by": "rohit@erpnext.com",
|
||||
"module": "Accounts",
|
||||
"name": "POS Profile",
|
||||
"owner": "Administrator",
|
||||
|
||||
@@ -109,12 +109,16 @@ def apply_pricing_rule(args):
|
||||
|
||||
item_list = args.get("items")
|
||||
args.pop("items")
|
||||
|
||||
set_serial_nos_based_on_fifo = frappe.db.get_single_value("Stock Settings",
|
||||
"automatically_set_serial_nos_based_on_fifo")
|
||||
|
||||
for item in item_list:
|
||||
args_copy = copy.deepcopy(args)
|
||||
args_copy.update(item)
|
||||
out.append(get_pricing_rule_for_item(args_copy))
|
||||
out.append(get_serial_no_for_item(args_copy))
|
||||
if set_serial_nos_based_on_fifo:
|
||||
out.append(get_serial_no_for_item(args_copy))
|
||||
return out
|
||||
|
||||
def get_serial_no_for_item(args):
|
||||
|
||||
@@ -41,6 +41,7 @@ def get_pos_data():
|
||||
'pos_profile': pos_profile,
|
||||
'meta': {
|
||||
'invoice': frappe.get_meta('Sales Invoice'),
|
||||
'customer': frappe.get_meta('Customer'),
|
||||
'items': frappe.get_meta('Sales Invoice Item'),
|
||||
'taxes': frappe.get_meta('Sales Taxes and Charges')
|
||||
}
|
||||
|
||||
@@ -270,6 +270,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
});
|
||||
}
|
||||
}
|
||||
else this.frm.trigger("refresh")
|
||||
},
|
||||
|
||||
amount: function(){
|
||||
|
||||
@@ -325,6 +325,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
$.each(this.meta, function(i, data){
|
||||
frappe.meta.sync(data)
|
||||
locals["DocType"][data.name] = data;
|
||||
})
|
||||
|
||||
this.print_template_data = frappe.render_template("print_template",
|
||||
@@ -412,21 +413,26 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
autoFocus: true,
|
||||
source: function (request, response) {
|
||||
me.customer_data = me.get_customers(request.term)
|
||||
me.add_customer();
|
||||
|
||||
response($.map(me.customer_data, function(data){
|
||||
return {label: data.name, value: data.name,
|
||||
customer_group: data.customer_group, territory: data.territory}
|
||||
return {label: data.name, customer_name: data.name, customer_group: data.customer_group,
|
||||
territory: data.territory, onclick: data.onclick}
|
||||
}))
|
||||
},
|
||||
change: function(event, ui){
|
||||
if(ui.item){
|
||||
me.frm.doc.customer = ui.item.label;
|
||||
me.frm.doc.customer_name = ui.item.customer_name;
|
||||
me.frm.doc.customer_group = ui.item.customer_group;
|
||||
me.frm.doc.territory = ui.item.territory;
|
||||
}else{
|
||||
me.frm.doc.customer = me.party_field.$input.val();
|
||||
select: function(event, ui){
|
||||
if(ui.item.onclick) {
|
||||
ui.item.value = ""
|
||||
ui.item.onclick(me);
|
||||
}else if(ui.item) {
|
||||
me.update_customer_data(ui.item)
|
||||
}
|
||||
me.refresh();
|
||||
},
|
||||
change: function(event, ui) {
|
||||
if(!ui.item) {
|
||||
me.frm.doc.customer = $(this).val();
|
||||
}
|
||||
}
|
||||
}).on("focus", function(){
|
||||
setTimeout(function() {
|
||||
@@ -434,7 +440,43 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
me.party_field.$input.autocomplete( "search", " " );
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
}).autocomplete(this.party_field).data('ui-autocomplete')._renderItem = function(ul, d){
|
||||
var html = "<span>" + __(d.label) + "</span>";
|
||||
return $('<li></li>')
|
||||
.data('item.autocomplete', d)
|
||||
.html('<a><p>' + html + '</p></a>')
|
||||
.appendTo(ul);
|
||||
}
|
||||
},
|
||||
|
||||
add_customer: function() {
|
||||
var me = this;
|
||||
if(this.connection_status) {
|
||||
this.customer_data.push({
|
||||
name: "<span class='text-primary link-option'>"
|
||||
+ "<i class='fa fa-plus' style='margin-right: 5px;'></i> "
|
||||
+ __("Create a new Customer")
|
||||
+ "</span>",
|
||||
onclick: me.new_customer
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
new_customer: function(obj) {
|
||||
var me = obj;
|
||||
frappe.ui.form.quick_entry('Customer', function(doc){
|
||||
me.customers.push(doc)
|
||||
me.party_field.$input.val(doc.name);
|
||||
me.update_customer_data(doc)
|
||||
})
|
||||
},
|
||||
|
||||
update_customer_data: function(doc) {
|
||||
var me = this;
|
||||
this.frm.doc.customer = doc.label || doc.name;
|
||||
this.frm.doc.customer_name = doc.customer_name;
|
||||
this.frm.doc.customer_group = doc.customer_group;
|
||||
this.frm.doc.territory = doc.territory;
|
||||
},
|
||||
|
||||
get_customers: function(key){
|
||||
@@ -593,7 +635,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
this.remove_item = []
|
||||
$.each(this.frm.doc["items"] || [], function(i, d) {
|
||||
if(d.serial_no){
|
||||
if(d.serial_no && field == 'qty'){
|
||||
me.validate_serial_no_qty(d, item_code, field, value)
|
||||
}
|
||||
|
||||
@@ -764,6 +806,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
actual_qty: me.actual_qty_dict[d.item_code] || 0,
|
||||
projected_qty: d.projected_qty,
|
||||
rate: format_number(d.rate, me.frm.doc.currency),
|
||||
enabled: me.pos_profile_data["allow_user_to_edit_rate"] ? true: false,
|
||||
amount: format_currency(d.amount, me.frm.doc.currency)
|
||||
})).appendTo($items);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"align_labels_left": 0,
|
||||
"creation": "2016-05-05 17:16:18.564460",
|
||||
"custom_format": 1,
|
||||
"disabled": 0,
|
||||
@@ -6,13 +7,16 @@
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"font": "Default",
|
||||
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{ __(\"POS No : \") }}{{offline_pos_name}}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
|
||||
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{ __(\"POS No : \") }}{{offline_pos_name}}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
|
||||
"idx": 0,
|
||||
"modified": "2016-09-05 08:28:42.308782",
|
||||
"line_breaks": 0,
|
||||
"modified": "2016-12-27 17:22:17.391673",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Point of Sale",
|
||||
"owner": "Administrator",
|
||||
"print_format_builder": 0,
|
||||
"print_format_type": "Js",
|
||||
"show_section_headings": 0,
|
||||
"standard": "Yes"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.query_reports["Delivered Items To Be Billed"] = {
|
||||
"filters": [
|
||||
|
||||
]
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2016-08-18 14:29:50.680329",
|
||||
"modified": "2017-01-02 16:13:27.369266",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Delivered Items To Be Billed",
|
||||
@@ -15,5 +15,5 @@
|
||||
"query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`customer_name` as \"Customer Name::150\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`base_amount` - `tabDelivery Note Item`.`billed_amt`*ifnull(`tabDelivery Note`.conversion_rate, 1)) as \"Pending Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\",\n\t`tabDelivery Note`.`company` as \"Company:Link/Company:\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere \n `tabDelivery Note`.name = `tabDelivery Note Item`.parent \n and `tabDelivery Note`.docstatus = 1 \n and `tabDelivery Note`.`status` not in (\"Stopped\", \"Closed\") \n and `tabDelivery Note Item`.amount > 0\n and `tabDelivery Note Item`.billed_amt < `tabDelivery Note Item`.amount\norder by `tabDelivery Note`.`name` desc",
|
||||
"ref_doctype": "Sales Invoice",
|
||||
"report_name": "Delivered Items To Be Billed",
|
||||
"report_type": "Query Report"
|
||||
"report_type": "Script Report"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data
|
||||
|
||||
def execute(filters=None):
|
||||
columns = get_column()
|
||||
args = get_args()
|
||||
data = get_ordered_to_be_billed_data(args)
|
||||
return columns, data
|
||||
|
||||
def get_column():
|
||||
return [
|
||||
_("Delivery Note") + ":Link/Delivery Note:120", _("Date") + ":Date:100",
|
||||
_("Suplier") + ":Link/Customer:120", _("Customer Name") + "::120",
|
||||
_("Project") + ":Link/Project:120", _("Item Code") + ":Link/Item:120",
|
||||
_("Amount") + ":Currency:100", _("Billed Amount") + ":Currency:100", _("Pending Amount") + ":Currency:100",
|
||||
_("Item Name") + "::120", _("Description") + "::120", _("Company") + ":Link/Company:120",
|
||||
]
|
||||
|
||||
def get_args():
|
||||
return {'doctype': 'Delivery Note', 'party': 'customer',
|
||||
'date': 'posting_date', 'order': 'name', 'order_by': 'desc'}
|
||||
38
erpnext/accounts/report/non_billed_report.py
Normal file
38
erpnext/accounts/report/non_billed_report.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from erpnext import get_default_currency
|
||||
from frappe.model.meta import get_field_precision
|
||||
|
||||
def get_ordered_to_be_billed_data(args):
|
||||
doctype, party = args.get('doctype'), args.get('party')
|
||||
child_tab = doctype + " Item"
|
||||
precision = get_field_precision(frappe.get_meta(child_tab).get_field("billed_amt"),
|
||||
currency=get_default_currency()) or 2
|
||||
|
||||
project_field = get_project_field(doctype, party)
|
||||
|
||||
return frappe.db.sql("""
|
||||
Select
|
||||
`{parent_tab}`.name, `{parent_tab}`.{date_field}, `{parent_tab}`.{party}, `{parent_tab}`.{party}_name,
|
||||
{project_field}, `{child_tab}`.item_code, `{child_tab}`.base_amount,
|
||||
(`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1)),
|
||||
(`{child_tab}`.base_amount - (`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1))),
|
||||
`{child_tab}`.item_name, `{child_tab}`.description, `{parent_tab}`.company
|
||||
from
|
||||
`{parent_tab}`, `{child_tab}`
|
||||
where
|
||||
`{parent_tab}`.name = `{child_tab}`.parent and `{parent_tab}`.docstatus = 1 and `{parent_tab}`.status != 'Closed'
|
||||
and `{child_tab}`.amount > 0 and round(`{child_tab}`.billed_amt *
|
||||
ifnull(`{parent_tab}`.conversion_rate, 1), {precision}) < `{child_tab}`.base_amount
|
||||
order by
|
||||
`{parent_tab}`.{order} {order_by}
|
||||
""".format(parent_tab = 'tab' + doctype, child_tab = 'tab' + child_tab, precision= precision, party = party,
|
||||
date_field = args.get('date'), project_field = project_field, order= args.get('order'), order_by = args.get('order_by')))
|
||||
|
||||
def get_project_field(doctype, party):
|
||||
if party == "supplier": doctype = doctype + ' Item'
|
||||
return "`tab%s`.project"%(doctype)
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.query_reports["Ordered Items To Be Billed"] = {
|
||||
"filters": [
|
||||
|
||||
]
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2016-08-18 14:29:50.680329",
|
||||
"modified": "2017-01-02 14:53:06.277319",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Ordered Items To Be Billed",
|
||||
@@ -15,5 +15,5 @@
|
||||
"query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`customer_name` as \"Customer Name:150\",\n`tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.base_amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (`tabSales Order Item`.base_amount - (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order`.`company` as \"Company:Link/Company:\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Closed\"\n and `tabSales Order Item`.amount > 0\n and `tabSales Order Item`.billed_amt < `tabSales Order Item`.amount\norder by `tabSales Order`.transaction_date asc",
|
||||
"ref_doctype": "Sales Invoice",
|
||||
"report_name": "Ordered Items To Be Billed",
|
||||
"report_type": "Query Report"
|
||||
"report_type": "Script Report"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data
|
||||
|
||||
def execute(filters=None):
|
||||
columns = get_column()
|
||||
args = get_args()
|
||||
data = get_ordered_to_be_billed_data(args)
|
||||
return columns, data
|
||||
|
||||
def get_column():
|
||||
return [
|
||||
_("Sales Order") + ":Link/Sales Order:120", _("Date") + ":Date:100",
|
||||
_("Suplier") + ":Link/Customer:120", _("Customer Name") + "::120",
|
||||
_("Project") + ":Link/Project:120", _("Item Code") + ":Link/Item:120",
|
||||
_("Amount") + ":Currency:100", _("Billed Amount") + ":Currency:100", _("Pending Amount") + ":Currency:100",
|
||||
_("Item Name") + "::120", _("Description") + "::120", _("Company") + ":Link/Company:120",
|
||||
]
|
||||
|
||||
def get_args():
|
||||
return {'doctype': 'Sales Order', 'party': 'customer',
|
||||
'date': 'transaction_date', 'order': 'transaction_date', 'order_by': 'asc'}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.query_reports["Purchase Order Items To Be Billed"] = {
|
||||
"filters": [
|
||||
|
||||
]
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2016-08-18 15:46:45.789536",
|
||||
"modified": "2017-01-02 12:08:36.400900",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Order Items To Be Billed",
|
||||
@@ -15,5 +15,5 @@
|
||||
"query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n `tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order`.`supplier_name` as \"Supplier Name::150\",\n\t`tabPurchase Order Item`.`project` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.base_amount as \"Amount:Currency:100\",\n\t(`tabPurchase Order Item`.billed_amt * ifnull(`tabPurchase Order`.conversion_rate, 1)) as \"Billed Amount:Currency:100\", \n\t(`tabPurchase Order Item`.base_amount - (`tabPurchase Order Item`.billed_amt * ifnull(`tabPurchase Order`.conversion_rate, 1))) as \"Amount to Bill:Currency:100\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\",\n\t`tabPurchase Order`.company as \"Company:Link/Company:\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status != \"Closed\"\n and `tabPurchase Order Item`.amount > 0\n\tand (`tabPurchase Order Item`.billed_amt * ifnull(`tabPurchase Order`.conversion_rate, 1)) < `tabPurchase Order Item`.base_amount\norder by `tabPurchase Order`.transaction_date asc",
|
||||
"ref_doctype": "Purchase Invoice",
|
||||
"report_name": "Purchase Order Items To Be Billed",
|
||||
"report_type": "Query Report"
|
||||
"report_type": "Script Report"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data
|
||||
|
||||
def execute(filters=None):
|
||||
columns = get_column()
|
||||
args = get_args()
|
||||
data = get_ordered_to_be_billed_data(args)
|
||||
return columns, data
|
||||
|
||||
def get_column():
|
||||
return [
|
||||
_("Purchase Order") + ":Link/Purchase Order:120", _("Date") + ":Date:100",
|
||||
_("Suplier") + ":Link/Supplier:120", _("Suplier Name") + "::120",
|
||||
_("Project") + ":Link/Project:120", _("Item Code") + ":Link/Item:120",
|
||||
_("Amount") + ":Currency:100", _("Billed Amount") + ":Currency:100", _("Amount to Bill") + ":Currency:100",
|
||||
_("Item Name") + "::120", _("Description") + "::120", _("Company") + ":Link/Company:120",
|
||||
]
|
||||
|
||||
def get_args():
|
||||
return {'doctype': 'Purchase Order', 'party': 'supplier',
|
||||
'date': 'transaction_date', 'order': 'transaction_date', 'order_by': 'asc'}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.query_reports["Received Items To Be Billed"] = {
|
||||
"filters": [
|
||||
|
||||
]
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2016-08-18 14:32:20.965816",
|
||||
"modified": "2017-01-02 16:05:01.929390",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Received Items To Be Billed",
|
||||
@@ -15,5 +15,5 @@
|
||||
"query": "select\n `tabPurchase Receipt`.`name` as \"Purchase Receipt:Link/Purchase Receipt:120\",\n `tabPurchase Receipt`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Receipt`.`supplier_name` as \"Supplier Name::150\",\n\t`tabPurchase Receipt`.`posting_date` as \"Date:Date\",\n\t`tabPurchase Receipt Item`.`project` as \"Project\",\n\t`tabPurchase Receipt Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabPurchase Receipt Item`.`base_amount` - `tabPurchase Receipt Item`.`billed_amt`*ifnull(`tabPurchase Receipt`.conversion_rate, 1)) as \"Pending Amount:Currency:110\",\n\t`tabPurchase Receipt Item`.`item_name` as \"Item Name::150\",\n\t`tabPurchase Receipt Item`.`description` as \"Description::200\",\n\t`tabPurchase Receipt`.`company` as \"Company:Link/Company:\"\nfrom `tabPurchase Receipt`, `tabPurchase Receipt Item`\nwhere\n `tabPurchase Receipt`.name = `tabPurchase Receipt Item`.parent \n and `tabPurchase Receipt`.docstatus = 1 \n and `tabPurchase Receipt`.status != \"Closed\" \n and `tabPurchase Receipt Item`.amount > 0\n and `tabPurchase Receipt Item`.billed_amt < `tabPurchase Receipt Item`.amount\norder by `tabPurchase Receipt`.`name` desc",
|
||||
"ref_doctype": "Purchase Invoice",
|
||||
"report_name": "Received Items To Be Billed",
|
||||
"report_type": "Query Report"
|
||||
"report_type": "Script Report"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data
|
||||
|
||||
def execute(filters=None):
|
||||
columns = get_column()
|
||||
args = get_args()
|
||||
data = get_ordered_to_be_billed_data(args)
|
||||
return columns, data
|
||||
|
||||
def get_column():
|
||||
return [
|
||||
_("Purchase Receipt") + ":Link/Purchase Receipt:120", _("Date") + ":Date:100",
|
||||
_("Suplier") + ":Link/Supplier:120", _("Suplier Name") + "::120",
|
||||
_("Project") + ":Link/Project:120", _("Item Code") + ":Link/Item:120",
|
||||
_("Amount") + ":Currency:100", _("Billed Amount") + ":Currency:100", _("Amount to Bill") + ":Currency:100",
|
||||
_("Item Name") + "::120", _("Description") + "::120", _("Company") + ":Link/Company:120",
|
||||
]
|
||||
|
||||
def get_args():
|
||||
return {'doctype': 'Purchase Receipt', 'party': 'supplier',
|
||||
'date': 'posting_date', 'order': 'name', 'order_by': 'desc'}
|
||||
@@ -2212,7 +2212,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Status",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -2360,7 +2360,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "% Billed",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -3062,7 +3062,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-07 06:01:00.233621",
|
||||
"modified": "2017-01-06 12:51:56.556331",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Purchase Order",
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from erpnext.setup.utils import get_exchange_rate
|
||||
from frappe.utils import flt, cint
|
||||
import frappe
|
||||
|
||||
def execute(filters=None):
|
||||
@@ -20,6 +21,7 @@ def get_quote_list(item, qty_list):
|
||||
price_data = []
|
||||
suppliers = []
|
||||
company_currency = frappe.db.get_default("currency")
|
||||
float_precision = cint(frappe.db.get_default("float_precision")) or 2
|
||||
# Get the list of suppliers
|
||||
for root in frappe.db.sql("""select parent, qty, rate from `tabSupplier Quotation Item` where item_code=%s and docstatus < 2""", item, as_dict=1):
|
||||
for splr in frappe.db.sql("""SELECT supplier from `tabSupplier Quotation` where name =%s and docstatus < 2""", root.parent, as_dict=1):
|
||||
@@ -46,7 +48,7 @@ def get_quote_list(item, qty_list):
|
||||
# Get the quantity for this row
|
||||
for item_price in price_data:
|
||||
if str(item_price.qty) == col.key and item_price.supplier == root:
|
||||
row[col.key] = item_price.rate * exchange_rate
|
||||
row[col.key] = flt(item_price.rate * exchange_rate, float_precision)
|
||||
row[col.key + "QUOTE"] = item_price.parent
|
||||
break
|
||||
else:
|
||||
|
||||
@@ -217,7 +217,7 @@ class LeaveApplication(Document):
|
||||
|
||||
def validate_attendance(self):
|
||||
attendance = frappe.db.sql("""select name from `tabAttendance` where employee = %s and (att_date between %s and %s)
|
||||
and docstatus = 1""",
|
||||
and status = "Present" and docstatus = 1""",
|
||||
(self.employee, self.from_date, self.to_date))
|
||||
if attendance:
|
||||
frappe.throw(_("Attendance for employee {0} is already marked for this day").format(self.employee),
|
||||
|
||||
@@ -4,19 +4,18 @@
|
||||
frappe.query_reports["Monthly Salary Register"] = {
|
||||
"filters": [
|
||||
{
|
||||
"fieldname":"month",
|
||||
"label": __("Month"),
|
||||
"fieldtype": "Select",
|
||||
"options": "\nJan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
|
||||
"default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
|
||||
"Dec"][frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth()],
|
||||
"fieldname":"from_date",
|
||||
"label": __("From"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"fiscal_year",
|
||||
"label": __("Fiscal Year"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Fiscal Year",
|
||||
"default": sys_defaults.fiscal_year,
|
||||
"fieldname":"to_date",
|
||||
"label": __("To"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.get_today(),
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"employee",
|
||||
|
||||
@@ -18,7 +18,7 @@ def execute(filters=None):
|
||||
data = []
|
||||
for ss in salary_slips:
|
||||
row = [ss.name, ss.employee, ss.employee_name, ss.branch, ss.department, ss.designation,
|
||||
ss.company, ss.month, ss.leave_withut_pay, ss.payment_days]
|
||||
ss.company, ss.start_date, ss.end_date, ss.leave_withut_pay, ss.payment_days]
|
||||
|
||||
for e in earning_types:
|
||||
row.append(ss_earning_map.get(ss.name, {}).get(e))
|
||||
@@ -38,7 +38,7 @@ def get_columns(salary_slips):
|
||||
columns = [
|
||||
_("Salary Slip ID") + ":Link/Salary Slip:150",_("Employee") + ":Link/Employee:120", _("Employee Name") + "::140", _("Branch") + ":Link/Branch:120",
|
||||
_("Department") + ":Link/Department:120", _("Designation") + ":Link/Designation:120",
|
||||
_("Company") + ":Link/Company:120", _("Month") + "::80", _("Leave Without Pay") + ":Float:130",
|
||||
_("Company") + ":Link/Company:120", _("Start Date") + "::80", _("End Date") + "::80", _("Leave Without Pay") + ":Float:130",
|
||||
_("Payment Days") + ":Float:120"
|
||||
]
|
||||
|
||||
@@ -60,23 +60,18 @@ def get_columns(salary_slips):
|
||||
def get_salary_slips(filters):
|
||||
conditions, filters = get_conditions(filters)
|
||||
salary_slips = frappe.db.sql("""select * from `tabSalary Slip` where docstatus = 1 %s
|
||||
order by employee, month""" % conditions, filters, as_dict=1)
|
||||
order by employee""" % conditions, filters, as_dict=1)
|
||||
|
||||
if not salary_slips:
|
||||
frappe.throw(_("No salary slip found for month {0} and year {1}").format(
|
||||
filters.get("month"), filters.get("fiscal_year")))
|
||||
frappe.throw(_("No salary slip found between {0} and {1}").format(
|
||||
filters.get("from_date"), filters.get("to_date")))
|
||||
|
||||
return salary_slips
|
||||
|
||||
def get_conditions(filters):
|
||||
conditions = ""
|
||||
if filters.get("month"):
|
||||
month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
|
||||
"Dec"].index(filters["month"]) + 1
|
||||
filters["month"] = month
|
||||
conditions += " and month = %(month)s"
|
||||
|
||||
if filters.get("fiscal_year"): conditions += " and fiscal_year = %(fiscal_year)s"
|
||||
if filters.get("from_date"): conditions += " and start_date >= %(from_date)s"
|
||||
if filters.get("to_date"): conditions += " and end_date <= %(to_date)s"
|
||||
if filters.get("company"): conditions += " and company = %(company)s"
|
||||
if filters.get("employee"): conditions += " and employee = %(employee)s"
|
||||
|
||||
|
||||
@@ -359,3 +359,4 @@ erpnext.patches.v7_1.set_currency_exchange_date
|
||||
erpnext.patches.v7_1.set_sales_person_status
|
||||
erpnext.patches.v7_1.repost_stock_for_deleted_bins_for_merging_items
|
||||
execute:frappe.delete_doc('Desktop Icon', {'module_name': 'Profit and Loss Statment'})
|
||||
erpnext.patches.v7_2.update_website_for_variant
|
||||
|
||||
@@ -2,5 +2,5 @@ import frappe
|
||||
import erpnext.setup.install
|
||||
|
||||
def execute():
|
||||
frappe.reload_doc("website", "doctype", "web_form_field", force=True)
|
||||
frappe.reload_doc("website", "doctype", "web_form_field", force=True, reset_permissions=True)
|
||||
#erpnext.setup.install.add_web_forms()
|
||||
|
||||
@@ -3,5 +3,13 @@ import frappe
|
||||
|
||||
def execute():
|
||||
stock_settings = frappe.get_doc('Stock Settings')
|
||||
|
||||
if stock_settings.default_warehouse \
|
||||
and not frappe.db.exists("Warehouse", stock_settings.default_warehouse):
|
||||
stock_settings.default_warehouse = None
|
||||
|
||||
if stock_settings.stock_uom and not frappe.db.exists("UOM", stock_settings.stock_uom):
|
||||
stock_settings.stock_uom = None
|
||||
|
||||
stock_settings.flags.ignore_mandatory = True
|
||||
stock_settings.save()
|
||||
|
||||
0
erpnext/patches/v7_2/__init__.py
Normal file
0
erpnext/patches/v7_2/__init__.py
Normal file
12
erpnext/patches/v7_2/update_website_for_variant.py
Normal file
12
erpnext/patches/v7_2/update_website_for_variant.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
# variant must have show_in_website = 0
|
||||
frappe.reload_doctype('Item')
|
||||
frappe.db.sql('''
|
||||
update tabItem set
|
||||
show_variant_in_website = 1,
|
||||
show_in_website = 0
|
||||
where
|
||||
show_in_website=1
|
||||
and ifnull(variant_of, "")!=""''')
|
||||
@@ -55,7 +55,8 @@ class Task(Document):
|
||||
def update_depends_on(self):
|
||||
depends_on_tasks = ""
|
||||
for d in self.depends_on:
|
||||
depends_on_tasks += d.task + ","
|
||||
if d.task:
|
||||
depends_on_tasks += d.task + ","
|
||||
self.depends_on_tasks = depends_on_tasks
|
||||
|
||||
def on_update(self):
|
||||
|
||||
@@ -349,7 +349,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
me.frm.set_value("letter_head", company_doc.default_letter_head);
|
||||
}
|
||||
}
|
||||
if (company_doc.default_terms && me.frm.doc.doctype != "Purchase Invoice") {
|
||||
if (company_doc.default_terms && me.frm.doc.doctype != "Purchase Invoice" && frappe.meta.has_field(me.frm.doc.doctype, "tc_name")) {
|
||||
me.frm.set_value("tc_name", company_doc.default_terms);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 text-right">
|
||||
<div class="text-muted" style="margin-top: 5px;"><input type="text" value="{%= rate %}" class="form-control input-sm pos-item-rate text-right"></div>
|
||||
<div class="text-muted" style="margin-top: 5px;">
|
||||
{% if(enabled) { %}
|
||||
<input type="text" value="{%= rate %}" class="form-control input-sm pos-item-rate text-right">
|
||||
{% } else { %}
|
||||
<h6>{%= format_currency(rate) %}</h6>
|
||||
{% } %}
|
||||
</div>
|
||||
<p><h6>{%= amount %}</h6></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -153,22 +153,37 @@ erpnext.utils.map_current_doc = function(opts) {
|
||||
frappe.get_meta(items_doctype).fields.forEach(function(d) {
|
||||
if(d.options===opts.source_doctype) link_fieldname = d.fieldname; });
|
||||
|
||||
// search in existing items if the source_name is already set
|
||||
// search in existing items if the source_name is already set and full qty fetched
|
||||
var already_set = false;
|
||||
|
||||
var item_qty_map = {};
|
||||
|
||||
$.each(cur_frm.doc.items, function(i, d) {
|
||||
if(d[link_fieldname]==opts.source_name) {
|
||||
already_set = true;
|
||||
return false;
|
||||
if (item_qty_map[d.item_code])
|
||||
item_qty_map[d.item_code] += flt(d.qty);
|
||||
else
|
||||
item_qty_map[d.item_code] = flt(d.qty);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if(already_set) {
|
||||
frappe.msgprint(__("You have already selected items from {0} {1}",
|
||||
[opts.source_doctype, opts.source_name]));
|
||||
return;
|
||||
}
|
||||
frappe.model.with_doc(opts.source_doctype, opts.source_name, function(r) {
|
||||
var source_doc = frappe.model.get_doc(opts.source_doctype, opts.source_name);
|
||||
$.each(source_doc.items || [], function(i, row) {
|
||||
if(row.qty > flt(item_qty_map[row.item_code])) {
|
||||
already_set = false;
|
||||
return false;
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
if(already_set) {
|
||||
frappe.msgprint(__("You have already selected items from {0} {1}",
|
||||
[opts.source_doctype, opts.source_name]));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import get_datetime
|
||||
from frappe.utils import getdate
|
||||
from frappe.model.document import Document
|
||||
|
||||
class AcademicTerm(Document):
|
||||
@@ -18,16 +18,18 @@ class AcademicTerm(Document):
|
||||
self.title = self.academic_year + " ({})".format(self.term_name) if self.term_name else ""
|
||||
|
||||
#Check that start of academic year is earlier than end of academic year
|
||||
if self.term_start_date and self.term_end_date and self.term_start_date > self.term_end_date:
|
||||
if self.term_start_date and self.term_end_date \
|
||||
and getdate(self.term_start_date) > getdate(self.term_end_date):
|
||||
frappe.throw(_("The Term End Date cannot be earlier than the Term Start Date. Please correct the dates and try again."))
|
||||
|
||||
"""Check that the start of the term is not before the start of the academic year and end of term is not after
|
||||
the end of the academic year"""
|
||||
# Check that the start of the term is not before the start of the academic year
|
||||
# and end of term is not after the end of the academic year"""
|
||||
|
||||
year = frappe.get_doc("Academic Year",self.academic_year)
|
||||
if self.term_start_date and get_datetime(year.year_start_date) and (self.term_start_date < get_datetime(year.year_start_date)):
|
||||
if self.term_start_date and getdate(year.year_start_date) and (getdate(self.term_start_date) < getdate(year.year_start_date)):
|
||||
frappe.throw(_("The Term Start Date cannot be earlier than the Year Start Date of the Academic Year to which the term is linked (Academic Year {}). Please correct the dates and try again.").format(self.academic_year))
|
||||
|
||||
if self.term_end_date and get_datetime(year.year_end_date) and (self.term_end_date > get_datetime(year.year_end_date)):
|
||||
if self.term_end_date and getdate(year.year_end_date) and (getdate(self.term_end_date) > getdate(year.year_end_date)):
|
||||
frappe.throw(_("The Term End Date cannot be later than the Year End Date of the Academic Year to which the term is linked (Academic Year {}). Please correct the dates and try again.").format(self.academic_year))
|
||||
|
||||
|
||||
|
||||
@@ -2580,7 +2580,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Delivery Status",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -2610,7 +2610,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "% Delivered",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -2668,7 +2668,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "% Amount Billed",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -2698,7 +2698,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Billing Status",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -3369,7 +3369,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-16 04:06:28.675876",
|
||||
"modified": "2017-01-06 12:51:17.847227",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Sales Order",
|
||||
@@ -3383,7 +3383,7 @@
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 0,
|
||||
"if_owner": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
|
||||
@@ -78,6 +78,8 @@ class Company(Document):
|
||||
|
||||
if not frappe.local.flags.ignore_chart_of_accounts:
|
||||
self.set_default_accounts()
|
||||
if self.default_cash_account:
|
||||
self.mode_of_payment()
|
||||
|
||||
if self.default_currency:
|
||||
frappe.db.set_value("Currency", self.default_currency, "enabled", 1)
|
||||
@@ -162,6 +164,16 @@ class Company(Document):
|
||||
if account:
|
||||
self.db_set(fieldname, account)
|
||||
|
||||
def mode_of_payment(self):
|
||||
cash = frappe.db.get_value('Mode of Payment', {'type': 'Cash'}, 'name')
|
||||
if cash and not frappe.db.get_value('Mode of Payment Account', {'company': self.name}):
|
||||
mode_of_payment = frappe.get_doc('Mode of Payment', cash)
|
||||
mode_of_payment.append('accounts', {
|
||||
'company': self.name,
|
||||
'default_account': self.default_cash_account
|
||||
})
|
||||
mode_of_payment.save(ignore_permissions=True)
|
||||
|
||||
def create_default_cost_center(self):
|
||||
cc_list = [
|
||||
{
|
||||
|
||||
@@ -40,9 +40,10 @@ class TestCompany(unittest.TestCase):
|
||||
acc = frappe.get_doc("Account", account)
|
||||
for prop, val in acc_property.items():
|
||||
self.assertEqual(acc.get(prop), val)
|
||||
|
||||
|
||||
self.delete_mode_of_payment("COA from Existing Company")
|
||||
frappe.delete_doc("Company", "COA from Existing Company")
|
||||
|
||||
|
||||
def test_coa_based_on_country_template(self):
|
||||
countries = ["India", "Brazil", "United Arab Emirates", "Canada", "Germany", "France",
|
||||
"Guatemala", "Indonesia", "Mexico", "Nicaragua", "Netherlands", "Singapore"]
|
||||
@@ -78,4 +79,9 @@ class TestCompany(unittest.TestCase):
|
||||
|
||||
self.assertTrue(frappe.get_all("Account", filters))
|
||||
finally:
|
||||
frappe.delete_doc("Company", template)
|
||||
self.delete_mode_of_payment(template)
|
||||
frappe.delete_doc("Company", template)
|
||||
|
||||
def delete_mode_of_payment(self, company):
|
||||
frappe.db.sql(""" delete from `tabMode of Payment Account`
|
||||
where company =%s """, (company))
|
||||
|
||||
@@ -134,7 +134,7 @@ class NamingSeries(Document):
|
||||
"""get series current"""
|
||||
if self.prefix:
|
||||
self.current_value = frappe.db.get_value("Series",
|
||||
self.prefix.split('.')[0], "current")
|
||||
self.prefix.split('.')[0], "current", order_by = "name")
|
||||
|
||||
def insert_series(self, series):
|
||||
"""insert series if missing"""
|
||||
|
||||
@@ -77,7 +77,7 @@ def send_via_gateway(arg):
|
||||
for d in arg.get('receiver_list'):
|
||||
args[ss.receiver_parameter] = d
|
||||
status = send_request(ss.sms_gateway_url, args)
|
||||
if status > 200 and status < 300:
|
||||
if status >= 200 and status < 300:
|
||||
success_list.append(d)
|
||||
|
||||
if len(success_list) > 0:
|
||||
|
||||
@@ -9,7 +9,8 @@ from frappe.utils.jinja import validate_template
|
||||
|
||||
class TermsandConditions(Document):
|
||||
def validate(self):
|
||||
validate_template(self.terms)
|
||||
if self.terms:
|
||||
validate_template(self.terms)
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_terms_and_conditions(template_name, doc):
|
||||
@@ -17,4 +18,6 @@ def get_terms_and_conditions(template_name, doc):
|
||||
doc = json.loads(doc)
|
||||
|
||||
terms_and_conditions = frappe.get_doc("Terms and Conditions", template_name)
|
||||
return frappe.render_template(terms_and_conditions.terms, doc)
|
||||
|
||||
if terms_and_conditions.terms:
|
||||
return frappe.render_template(terms_and_conditions.terms, doc)
|
||||
@@ -2705,7 +2705,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Status",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -3120,7 +3120,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-12-16 03:56:08.745185",
|
||||
"modified": "2017-01-06 12:52:48.960308",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delivery Note",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,6 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
import erpnext
|
||||
import json
|
||||
import urllib
|
||||
import itertools
|
||||
from frappe import msgprint, _
|
||||
from frappe.utils import cstr, flt, cint, getdate, now_datetime, formatdate, strip
|
||||
@@ -238,19 +237,12 @@ class Item(WebsiteGenerator):
|
||||
def get_context(self, context):
|
||||
context.show_search=True
|
||||
context.search_link = '/product_search'
|
||||
if self.variant_of:
|
||||
# redirect to template page!
|
||||
template_item = frappe.get_doc("Item", self.variant_of)
|
||||
frappe.flags.redirect_location = template_item.route + "?variant=" + urllib.quote(self.name)
|
||||
raise frappe.Redirect
|
||||
|
||||
context.parent_groups = get_parent_item_groups(self.item_group) + \
|
||||
[{"name": self.name}]
|
||||
|
||||
self.set_variant_context(context)
|
||||
|
||||
self.set_attribute_context(context)
|
||||
|
||||
self.set_disabled_attributes(context)
|
||||
|
||||
context.parents = self.get_parents(context)
|
||||
@@ -264,7 +256,8 @@ class Item(WebsiteGenerator):
|
||||
# load variants
|
||||
# also used in set_attribute_context
|
||||
context.variants = frappe.get_all("Item",
|
||||
filters={"variant_of": self.name, "show_in_website": 1}, order_by="name asc")
|
||||
filters={"variant_of": self.name, "show_variant_in_website": 1},
|
||||
order_by="name asc")
|
||||
|
||||
variant = frappe.form_dict.variant
|
||||
if not variant and context.variants:
|
||||
@@ -565,12 +558,12 @@ class Item(WebsiteGenerator):
|
||||
existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock")
|
||||
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1)
|
||||
|
||||
repost_stock_for_warehouses = frappe.db.sql_list("""select distinct warehouse
|
||||
repost_stock_for_warehouses = frappe.db.sql_list("""select distinct warehouse
|
||||
from tabBin where item_code=%s""", new_name)
|
||||
|
||||
|
||||
# Delete all existing bins to avoid duplicate bins for the same item and warehouse
|
||||
frappe.db.sql("delete from `tabBin` where item_code=%s", new_name)
|
||||
|
||||
|
||||
for warehouse in repost_stock_for_warehouses:
|
||||
repost_stock(new_name, warehouse)
|
||||
|
||||
@@ -597,6 +590,11 @@ class Item(WebsiteGenerator):
|
||||
def update_template_item(self):
|
||||
"""Set Show in Website for Template Item if True for its Variant"""
|
||||
if self.variant_of and self.show_in_website:
|
||||
self.show_variant_in_website = 1
|
||||
self.show_in_website = 0
|
||||
|
||||
if self.show_variant_in_website:
|
||||
# show template
|
||||
template_item = frappe.get_doc("Item", self.variant_of)
|
||||
|
||||
if not template_item.show_in_website:
|
||||
|
||||
@@ -9,7 +9,7 @@ cur_frm.fields_dict['item_code'].get_query = function(doc, cdt, cdn) {
|
||||
return {
|
||||
query: "erpnext.stock.doctype.quality_inspection.quality_inspection.item_query",
|
||||
filters: {
|
||||
"from": doc.reference_type,
|
||||
"from": doc.reference_type + " Item",
|
||||
"parent": doc.reference_name
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ class StockReconciliation(StockController):
|
||||
elif not frappe.db.sql("""select name from `tabStock Ledger Entry` limit 1"""):
|
||||
if frappe.db.get_value("Account", self.expense_account, "report_type") == "Profit and Loss":
|
||||
frappe.throw(_("Difference Account must be a Asset/Liability type account, since this Stock Reconciliation is an Opening Entry"), OpeningEntryAccountError)
|
||||
|
||||
|
||||
def set_total_qty_and_amount(self):
|
||||
for d in self.get("items"):
|
||||
d.amount = flt(d.qty) * flt(d.valuation_rate)
|
||||
@@ -267,7 +267,8 @@ def get_items(warehouse, posting_date, posting_time):
|
||||
items = frappe.get_list("Bin", fields=["item_code"], filters={"warehouse": warehouse}, as_list=1)
|
||||
|
||||
items += frappe.get_list("Item", fields=["name"], filters= {"is_stock_item": 1, "has_serial_no": 0,
|
||||
"has_batch_no": 0, "has_variants": 0, "disabled": 0, "default_warehouse": warehouse}, as_list=1)
|
||||
"has_batch_no": 0, "has_variants": 0, "disabled": 0, "default_warehouse": warehouse},
|
||||
as_list=1)
|
||||
|
||||
res = []
|
||||
for item in set(items):
|
||||
@@ -280,6 +281,7 @@ def get_items(warehouse, posting_date, posting_time):
|
||||
"item_code": item[0],
|
||||
"warehouse": warehouse,
|
||||
"qty": stock_bal[0],
|
||||
"item_name": frappe.db.get_value('Item', item[0], 'item_name'),
|
||||
"valuation_rate": stock_bal[1],
|
||||
"current_qty": stock_bal[0],
|
||||
"current_valuation_rate": stock_bal[1]
|
||||
|
||||
@@ -143,7 +143,7 @@ def get_basic_details(args, item):
|
||||
user_default_warehouse = user_default_warehouse_list[0] \
|
||||
if len(user_default_warehouse_list)==1 else ""
|
||||
|
||||
warehouse = user_default_warehouse or args.warehouse or item.default_warehouse
|
||||
warehouse = user_default_warehouse or item.default_warehouse or args.warehouse
|
||||
|
||||
out = frappe._dict({
|
||||
"item_code": item.name,
|
||||
|
||||
Reference in New Issue
Block a user