';
out += '| In Words | ';
diff --git a/accounts/report/accounts_receivable/accounts_receivable.py b/accounts/report/accounts_receivable/accounts_receivable.py
index 40f4d2af8e9..ad0d92523bc 100644
--- a/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/accounts/report/accounts_receivable/accounts_receivable.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
@@ -19,12 +19,13 @@ class AccountsReceivableReport(object):
def get_columns(self):
return [
- "Posting Date:Date:80", "Account:Link/Account:150", "Customer::150",
- "Voucher Type::110", "Voucher No::120", "Remarks::150",
- "Due Date:Date:80", "Territory:Link/Territory:80",
+ "Posting Date:Date:80", "Account:Link/Account:150",
+ "Voucher Type::110", "Voucher No::120", "::30",
+ "Due Date:Date:80",
"Invoiced Amount:Currency:100", "Payment Received:Currency:100",
"Outstanding Amount:Currency:100", "Age:Int:50", "0-30:Currency:100",
- "30-60:Currency:100", "60-90:Currency:100", "90-Above:Currency:100"
+ "30-60:Currency:100", "60-90:Currency:100", "90-Above:Currency:100",
+ "Customer:Link/Customer:200", "Territory:Link/Territory:80", "Remarks::200"
]
def get_data(self):
@@ -37,14 +38,20 @@ class AccountsReceivableReport(object):
due_date = self.get_due_date(gle)
invoiced_amount = gle.debit if (gle.debit > 0) else 0
payment_received = invoiced_amount - outstanding_amount
- row = [gle.posting_date, gle.account, self.get_customer(gle.account),
- gle.voucher_type, gle.voucher_no, gle.remarks, due_date,
- self.get_territory(gle.account), invoiced_amount, payment_received,
+ row = [gle.posting_date, gle.account,
+ gle.voucher_type, gle.voucher_no, due_date,
+ invoiced_amount, payment_received,
outstanding_amount]
entry_date = due_date if self.filters.ageing_based_on=="Due Date" \
else gle.posting_date
row += get_ageing_data(self.age_as_on, entry_date, outstanding_amount)
+ row += [self.get_customer(gle.account), self.get_territory(gle.account), gle.remarks]
data.append(row)
+
+ for i in range(0,len(data)):
+ data[i].insert(4, """""" \
+ % ("/".join(["#Form", data[i][2], data[i][3]]),))
+
return data
def get_entries_after(self, report_date):
@@ -157,4 +164,4 @@ def get_ageing_data(age_as_on, entry_date, outstanding_amount):
if index is None: index = 3
outstanding_range[index] = outstanding_amount
- return [age] + outstanding_range
\ No newline at end of file
+ return [age] + outstanding_range
diff --git a/accounts/report/budget_variance_report/budget_variance_report.py b/accounts/report/budget_variance_report/budget_variance_report.py
index 1f426c0135a..2cbbd622e60 100644
--- a/accounts/report/budget_variance_report/budget_variance_report.py
+++ b/accounts/report/budget_variance_report/budget_variance_report.py
@@ -73,10 +73,10 @@ def get_costcenter_target_details(filters):
def get_target_distribution_details(filters):
target_details = {}
- for d in webnotes.conn.sql("""select bd.name, bdd.month, bdd.percentage_allocation \
+ for d in webnotes.conn.sql("""select bd.name, bdd.month, bdd.percentage_allocation
from `tabBudget Distribution Detail` bdd, `tabBudget Distribution` bd
where bdd.parent=bd.name and bd.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
- target_details.setdefault(d.name, {}).setdefault(d.month, d.percentage_allocation)
+ target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
return target_details
@@ -113,10 +113,11 @@ def get_costcenter_account_month_map(filters):
}))
tav_dict = cam_map[ccd.name][ccd.account][month]
- month_percentage = ccd.distribution_id and \
- tdd.get(ccd.distribution_id, {}).get(month, 0) or 100.0/12
+
+ month_percentage = tdd.get(ccd.distribution_id, {}).get(month, 0) \
+ if ccd.distribution_id else 100.0/12
- tav_dict.target = flt(ccd.budget_allocated) * month_percentage /100
+ tav_dict.target = flt(ccd.budget_allocated) * month_percentage / 100
for ad in actual_details.get(ccd.name, {}).get(ccd.account, []):
if ad.month_name == month:
diff --git a/buying/doctype/purchase_order/purchase_order.js b/buying/doctype/purchase_order/purchase_order.js
index a0bac3fc01c..dad2864ab24 100644
--- a/buying/doctype/purchase_order/purchase_order.js
+++ b/buying/doctype/purchase_order/purchase_order.js
@@ -23,8 +23,8 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
cur_frm.dashboard.add_progress(cint(doc.per_billed) + wn._("% Billed"),
doc.per_billed);
+ cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
- cur_frm.appframe.add_button(wn._('Send SMS'), cur_frm.cscript['Send SMS'], "icon-mobile-phone");
if(flt(doc.per_received, 2) < 100)
cur_frm.add_custom_button(wn._('Make Purchase Receipt'), this.make_purchase_receipt);
if(flt(doc.per_billed, 2) < 100)
diff --git a/buying/doctype/supplier/supplier.py b/buying/doctype/supplier/supplier.py
index 46abe899fc3..f60d4dd191f 100644
--- a/buying/doctype/supplier/supplier.py
+++ b/buying/doctype/supplier/supplier.py
@@ -148,29 +148,21 @@ class DocType(TransactionBase):
self.delete_supplier_contact()
self.delete_supplier_account()
- def on_rename(self, new, old, merge=False):
+ def after_rename(self, old, new, merge=False):
#update supplier_name if not naming series
if webnotes.defaults.get_global_default('supp_master_name') == 'Supplier Name':
- update_fields = [
- ('Supplier', 'name'),
- ('Address', 'supplier'),
- ('Contact', 'supplier'),
- ('Purchase Invoice', 'supplier'),
- ('Purchase Order', 'supplier'),
- ('Purchase Receipt', 'supplier'),
- ('Serial No', 'supplier')]
- for rec in update_fields:
- webnotes.conn.sql("update `tab%s` set supplier_name = %s where `%s` = %s" % \
- (rec[0], '%s', rec[1], '%s'), (new, old))
+ webnotes.conn.set(self.doc, "supplier_name", new)
for account in webnotes.conn.sql("""select name, account_name from
tabAccount where master_name=%s and master_type='Supplier'""", old, as_dict=1):
if account.account_name != new:
- webnotes.rename_doc("Account", account.name, new, merge=merge)
+ merge_account = True if merge and webnotes.conn.get_value("Account",
+ {"master_name": new, "master_type": "Supplier"}) else False
+ webnotes.rename_doc("Account", account.name, new, merge=merge_account)
#update master_name in doctype account
webnotes.conn.sql("""update `tabAccount` set master_name = %s,
- master_type = 'Supplier' where master_name = %s""" , (new,old))
+ master_type = 'Supplier' where master_name = %s""" , (new, old))
@webnotes.whitelist()
def get_dashboard_info(supplier):
diff --git a/buying/utils.py b/buying/utils.py
index a0c150d2213..0d9c8fa8385 100644
--- a/buying/utils.py
+++ b/buying/utils.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint, _
-from webnotes.utils import getdate, flt, add_days
+from webnotes.utils import getdate, flt, add_days, cstr
import json
@webnotes.whitelist()
@@ -94,7 +94,6 @@ def _get_price_list_rate(args, item_bean, meta):
(args.buying_price_list, args.item_code), as_dict=1)
if price_list_rate:
- from utilities.transaction_base import validate_currency
validate_currency(args, item_bean.doc, meta)
out.import_ref_rate = flt(price_list_rate[0].ref_rate) * \
@@ -132,7 +131,7 @@ def _validate_item_details(args, item):
_("Please select a sub-contracted item or do not sub-contract the transaction."),
raise_exception=True)
-def get_last_purchase_details(item_code, doc_name, conversion_rate=1.0):
+def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0):
"""returns last purchase details in stock uom"""
# get last purchase order item details
last_purchase_order = webnotes.conn.sql("""\
@@ -143,7 +142,7 @@ def get_last_purchase_details(item_code, doc_name, conversion_rate=1.0):
where po.docstatus = 1 and po_item.item_code = %s and po.name != %s and
po.name = po_item.parent
order by po.transaction_date desc, po.name desc
- limit 1""", (item_code, doc_name), as_dict=1)
+ limit 1""", (item_code, cstr(doc_name)), as_dict=1)
# get last purchase receipt item details
last_purchase_receipt = webnotes.conn.sql("""\
@@ -154,7 +153,7 @@ def get_last_purchase_details(item_code, doc_name, conversion_rate=1.0):
where pr.docstatus = 1 and pr_item.item_code = %s and pr.name != %s and
pr.name = pr_item.parent
order by pr.posting_date desc, pr.posting_time desc, pr.name desc
- limit 1""", (item_code, doc_name), as_dict=1)
+ limit 1""", (item_code, cstr(doc_name)), as_dict=1)
purchase_order_date = getdate(last_purchase_order and last_purchase_order[0].transaction_date \
or "1900-01-01")
diff --git a/controllers/stock_controller.py b/controllers/stock_controller.py
index 1e3f3ae2e67..8a4a4029901 100644
--- a/controllers/stock_controller.py
+++ b/controllers/stock_controller.py
@@ -48,7 +48,7 @@ class StockController(AccountsController):
"against": detail.expense_account,
"cost_center": detail.cost_center,
"remarks": self.doc.remarks or "Accounting Entry for Stock",
- "debit": sle.stock_value_difference
+ "debit": flt(sle.stock_value_difference, 2)
}))
# to target warehouse / expense account
@@ -57,7 +57,7 @@ class StockController(AccountsController):
"against": warehouse_account[sle.warehouse],
"cost_center": detail.cost_center,
"remarks": self.doc.remarks or "Accounting Entry for Stock",
- "credit": sle.stock_value_difference
+ "credit": flt(sle.stock_value_difference, 2)
}))
elif sle.warehouse not in warehouse_with_no_account:
warehouse_with_no_account.append(sle.warehouse)
diff --git a/hr/doctype/job_applicant/get_job_applications.py b/hr/doctype/job_applicant/get_job_applications.py
index 213a78a1405..33e1261bc44 100644
--- a/hr/doctype/job_applicant/get_job_applications.py
+++ b/hr/doctype/job_applicant/get_job_applications.py
@@ -36,7 +36,7 @@ class JobsMailbox(POP3Mailbox):
mail.save_attachments_in_doc(applicant.doc)
- make(content=mail.content, sender=mail.from_email,
+ make(content=mail.content, sender=mail.from_email, subject=mail.subject or "No Subject",
doctype="Job Applicant", name=applicant.doc.name, sent_or_received="Received")
def get_job_applications():
diff --git a/patches/1311/p04_update_comments.py b/patches/1311/p04_update_comments.py
new file mode 100644
index 00000000000..aefb7e7b245
--- /dev/null
+++ b/patches/1311/p04_update_comments.py
@@ -0,0 +1,8 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+def execute():
+ import webnotes
+ for name in webnotes.conn.sql_list("""select name from tabComment"""):
+ webnotes.get_obj("Comment", name).update_comment_in_doc()
+
\ No newline at end of file
diff --git a/patches/1311/p05_website_brand_html.py b/patches/1311/p05_website_brand_html.py
new file mode 100644
index 00000000000..04d2f83aaf2
--- /dev/null
+++ b/patches/1311/p05_website_brand_html.py
@@ -0,0 +1,16 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def execute():
+ bean = webnotes.bean("Website Settings")
+ for company in webnotes.conn.sql_list("select name from `tabCompany`"):
+ if bean.doc.banner_html == ("""""" + company + ""):
+ bean.doc.banner_html = None
+ if not bean.doc.brand_html:
+ bean.doc.brand_html = company
+
+ bean.save()
+ break
\ No newline at end of file
diff --git a/patches/october_2013/p01_fix_serial_no_status.py b/patches/october_2013/p01_fix_serial_no_status.py
index f523845ad03..4f00b27882d 100644
--- a/patches/october_2013/p01_fix_serial_no_status.py
+++ b/patches/october_2013/p01_fix_serial_no_status.py
@@ -11,7 +11,6 @@ def execute():
try:
sr_bean = webnotes.bean("Serial No", sr[0])
sr_bean.make_controller().via_stock_ledger = True
- sr_bean.run_method("validate")
sr_bean.save()
webnotes.conn.commit()
except:
diff --git a/patches/patch_list.py b/patches/patch_list.py
index abe96f9a3cc..d09cec1f409 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -245,10 +245,12 @@ patch_list = [
"execute:webnotes.reload_doc('core', 'doctype', 'comment') #2013-11-15",
"patches.1311.p02_index_singles",
"patches.1311.p01_make_gl_entries_for_si",
- "patches.1311.p03_update_reqd_report_fields",
+ "patches.1311.p03_update_reqd_report_fields",
"execute:webnotes.reload_doc('website', 'doctype', 'website_sitemap_config') #2013-11-20",
"execute:webnotes.reload_doc('website', 'doctype', 'website_sitemap') #2013-11-20",
"execute:webnotes.bean('Style Settings').save() #2013-11-20",
"execute:webnotes.get_module('website.doctype.website_sitemap_config.website_sitemap_config').rebuild_website_sitemap_config()",
"patches.1311.p04_update_year_end_date_of_fiscal_year",
+ "patches.1311.p04_update_comments",
+ "patches.1311.p05_website_brand_html",
]
\ No newline at end of file
diff --git a/portal/templates/includes/footer.html b/portal/templates/includes/footer.html
index 6963175d913..cd75fd16f63 100644
--- a/portal/templates/includes/footer.html
+++ b/portal/templates/includes/footer.html
@@ -1,16 +1,18 @@
{% extends "lib/website/templates/includes/footer.html" %}
-{% block powered %}ERPNext Powered{% endblock %}
+{% block powered %}ERPNext Powered{% endblock %}
{% block extension %}
-
-
|