Merge pull request #4831 from neilLasrado/typos
Typo fixes in Accounts Module
diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
index b60561c..fb95731 100644
--- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
+++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
@@ -7,6 +7,10 @@
from frappe import msgprint, _
from frappe.model.document import Document
+form_grid_templates = {
+ "journal_entries": "templates/form_grid/bank_reconciliation_grid.html"
+}
+
class BankReconciliation(Document):
def get_details(self):
if not (self.bank_account and self.from_date and self.to_date):
diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json
index d770a93..fc3c3b6 100644
--- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json
+++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json
@@ -235,29 +235,6 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "data_10",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
}
],
"hide_heading": 0,
@@ -270,13 +247,12 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-01-19 12:06:17.568428",
+ "modified": "2016-02-17 06:50:40.074578",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation Detail",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
- "read_only_onload": 0,
- "version": 0
-}
+ "read_only_onload": 0
+}
\ No newline at end of file
diff --git a/erpnext/config/docs.py b/erpnext/config/docs.py
index 9c9c4c7..82cb1fb 100644
--- a/erpnext/config/docs.py
+++ b/erpnext/config/docs.py
@@ -23,5 +23,5 @@
context.top_bar_items = [
{"label": "User Manual", "url": context.docs_base_url + "/user/manual", "right": 1},
{"label": "Videos", "url": context.docs_base_url + "/user/videos", "right": 1},
- {"label": "Developer Docs", "url": context.docs_base_url + "/current", "right": 1}
+ {"label": "API Documentation", "url": context.docs_base_url + "/current", "right": 1}
]
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 9916613..77572a8 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -239,7 +239,7 @@
if self.doctype not in ["Journal Entry", "Period Closing Voucher"]:
self.validate_account_currency(gl_dict.account, account_currency)
- self.set_balance_in_account_currency(gl_dict, account_currency)
+ set_balance_in_account_currency(gl_dict, account_currency, self.get("conversion_rate"), self.get("company_currency"))
return gl_dict
@@ -252,23 +252,6 @@
frappe.throw(_("Account {0} is invalid. Account Currency must be {1}")
.format(account, _(" or ").join(valid_currency)))
- def set_balance_in_account_currency(self, gl_dict, account_currency=None):
- if (not self.get("conversion_rate") and account_currency!=self.company_currency):
- frappe.throw(_("Account: {0} with currency: {1} can not be selected")
- .format(gl_dict.account, account_currency))
-
- gl_dict["account_currency"] = self.company_currency if account_currency==self.company_currency \
- else account_currency
-
- # set debit/credit in account currency if not provided
- if flt(gl_dict.debit) and not flt(gl_dict.debit_in_account_currency):
- gl_dict.debit_in_account_currency = gl_dict.debit if account_currency==self.company_currency \
- else flt(gl_dict.debit / (self.get("conversion_rate")), 2)
-
- if flt(gl_dict.credit) and not flt(gl_dict.credit_in_account_currency):
- gl_dict.credit_in_account_currency = gl_dict.credit if account_currency==self.company_currency \
- else flt(gl_dict.credit / (self.get("conversion_rate")), 2)
-
def clear_unallocated_advances(self, childtype, parentfield):
self.set(parentfield, self.get(parentfield, {"allocated_amount": ["not in", [0, None, ""]]}))
@@ -541,3 +524,20 @@
_on_previous_row_error("1 - %d" % (tax.row_id,))
elif tax.get("category") == "Valuation":
frappe.throw(_("Valuation type charges can not marked as Inclusive"))
+
+def set_balance_in_account_currency(gl_dict, account_currency=None, conversion_rate=None, company_currency=None):
+ if (not conversion_rate) and (account_currency!=company_currency):
+ frappe.throw(_("Account: {0} with currency: {1} can not be selected")
+ .format(gl_dict.account, account_currency))
+
+ gl_dict["account_currency"] = company_currency if account_currency==company_currency \
+ else account_currency
+
+ # set debit/credit in account currency if not provided
+ if flt(gl_dict.debit) and not flt(gl_dict.debit_in_account_currency):
+ gl_dict.debit_in_account_currency = gl_dict.debit if account_currency==company_currency \
+ else flt(gl_dict.debit / conversion_rate, 2)
+
+ if flt(gl_dict.credit) and not flt(gl_dict.credit_in_account_currency):
+ gl_dict.credit_in_account_currency = gl_dict.credit if account_currency==company_currency \
+ else flt(gl_dict.credit / conversion_rate, 2)
diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py
index 9e0dee8..ac8a5df 100644
--- a/erpnext/controllers/sales_and_purchase_return.py
+++ b/erpnext/controllers/sales_and_purchase_return.py
@@ -67,6 +67,9 @@
already_returned_items = get_already_returned_items(doc)
+ # ( not mandatory when it is Purchase Invoice or a Sales Invoice without Update Stock )
+ warehouse_mandatory = not (doc.doctype=="Purchase Invoice" or (doc.doctype=="Sales Invoice" and not doc.update_stock))
+
items_returned = False
for d in doc.get("items"):
if flt(d.qty) < 0:
@@ -96,8 +99,8 @@
if s not in ref_serial_nos:
frappe.throw(_("Row # {0}: Serial No {1} does not match with {2} {3}")
.format(d.idx, s, doc.doctype, doc.return_against))
-
- if doc.doctype != "Purchase Invoice" and not d.get("warehouse"):
+
+ if warehouse_mandatory and not d.get("warehouse"):
frappe.throw(_("Warehouse is mandatory"))
items_returned = True
diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py
index d7787b5..fe11406 100644
--- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py
+++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py
@@ -27,7 +27,7 @@
total_p = total_a = 0.0
for day in range(filters["total_days_in_month"]):
status = att_map.get(emp).get(day + 1, "None")
- status_map = {"Present": "P", "Absent": "A", "Half Day": "H", "None":" "}
+ status_map = {"Present": "P", "Absent": "A", "Half Day": "H", "None": ""}
row.append(status_map[status])
if status == "Present":
@@ -39,7 +39,6 @@
total_a += 0.5
row += [total_p, total_a]
-
data.append(row)
return columns, data
@@ -97,8 +96,7 @@
emp_map = frappe._dict()
for d in frappe.db.sql("""select name, employee_name, designation,
department, branch, company
- from tabEmployee where docstatus < 2
- and status = 'Active'""", as_dict=1):
+ from tabEmployee""", as_dict=1):
emp_map.setdefault(d.name, d)
return emp_map
diff --git a/erpnext/templates/form_grid/bank_reconciliation_grid.html b/erpnext/templates/form_grid/bank_reconciliation_grid.html
new file mode 100644
index 0000000..363ae33
--- /dev/null
+++ b/erpnext/templates/form_grid/bank_reconciliation_grid.html
@@ -0,0 +1,28 @@
+{% if(!doc) { %}
+ <div class="row">
+ <div class="col-sm-4 col-xs-4">{{ __("Journal Entry") }}</div>
+ <div class="col-sm-2 col-xs-4 text-right">{{ __("Amount") }}</div>
+ <div class="col-sm-2 hidden-xs text-right">{{ __(row.grid.get_docfield("cheque_number").label) }}</div>
+ <div class="col-sm-2 hidden-xs text-right">{{ __("Posting Date") }}</div>
+ <div class="col-sm-2 col-xs-4 text-right">{{ __("Clearance Date") }}</div>
+ </div>
+{% } else { %}
+ <div class="row">
+ <div class="col-sm-4 col-xs-4">
+ {{ doc.get_formatted("voucher_id") }}
+ {{ doc.get_formatted("against_account") }}
+ </div>
+ <div class="col-sm-2 col-xs-4 text-right">
+ {{ doc.debit ? doc.get_formatted("debit") : doc.get_formatted("credit") }} {{ doc.debit ? __("Dr") : __("Cr") }}
+ </div>
+ <div class="col-sm-2 hidden-xs text-right">
+ {{ doc.get_formatted("cheque_number") }}
+ </div>
+ <div class="col-sm-2 hidden-xs text-right">
+ {{ doc.get_formatted("posting_date") }}
+ </div>
+ <div class="col-sm-2 col-xs-4 text-right">
+ {{ doc.get_formatted("clearance_date") }}
+ </div>
+ </div>
+{% } %}