Merge branch 'hotfix'

This commit is contained in:
Nabin Hait 2017-01-13 14:33:56 +05:30
commit 74c56aff90
17 changed files with 167 additions and 108 deletions

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
__version__ = '7.2.8' __version__ = '7.2.9'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -63,7 +63,7 @@ def validate_expense_against_budget(args):
and frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"}): and frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"}):
if args.project: if args.project:
condition = "and exists(select name from `tabProject` where name=b.project)" condition = "and b.project='%s'" % frappe.db.escape(args.project)
args.budget_against_field = "Project" args.budget_against_field = "Project"
elif args.cost_center: elif args.cost_center:
@ -89,11 +89,12 @@ def validate_expense_against_budget(args):
budget_against_field=frappe.scrub(args.get("budget_against_field"))), budget_against_field=frappe.scrub(args.get("budget_against_field"))),
(args.fiscal_year, args.account), as_dict=True) (args.fiscal_year, args.account), as_dict=True)
validate_budget_records(args, budget_records) if budget_records:
validate_budget_records(args, budget_records)
def validate_budget_records(args, budget_records): def validate_budget_records(args, budget_records):
for budget in budget_records: for budget in budget_records:
if budget.budget_amount: if flt(budget.budget_amount):
yearly_action = budget.action_if_annual_budget_exceeded yearly_action = budget.action_if_annual_budget_exceeded
monthly_action = budget.action_if_accumulated_monthly_budget_exceeded monthly_action = budget.action_if_accumulated_monthly_budget_exceeded

View File

@ -35,7 +35,7 @@ def create_or_update_cheque_print_format(template_name):
</span> </span>
<span style="top:%(date_dist_from_top_edge)s cm; left:%(date_dist_from_left_edge)scm; <span style="top:%(date_dist_from_top_edge)s cm; left:%(date_dist_from_left_edge)scm;
position: absolute;"> position: absolute;">
{{doc.reference_date or '' }} {{ frappe.utils.formatdate(doc.reference_date) or '' }}
</span> </span>
<span style="top:%(acc_no_dist_from_top_edge)scm;left:%(acc_no_dist_from_left_edge)scm; <span style="top:%(acc_no_dist_from_top_edge)scm;left:%(acc_no_dist_from_left_edge)scm;
position: absolute;"> position: absolute;">

View File

@ -39,14 +39,17 @@ def get_pos_data():
'pricing_rules': get_pricing_rule_data(doc), 'pricing_rules': get_pricing_rule_data(doc),
'print_template': print_template, 'print_template': print_template,
'pos_profile': pos_profile, 'pos_profile': pos_profile,
'meta': { 'meta': get_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')
}
} }
def get_meta():
doctype_meta = {'customer': frappe.get_meta('Customer')}
for row in frappe.get_all('DocField', fields = ['fieldname', 'options'],
filters = {'parent': 'Sales Invoice', 'fieldtype': 'Table'}):
doctype_meta[row.fieldname] = frappe.get_meta(row.options)
return doctype_meta
def get_company_data(company): def get_company_data(company):
return frappe.get_all('Company', fields = ["*"], filters= {'name': company})[0] return frappe.get_all('Company', fields = ["*"], filters= {'name': company})[0]
@ -75,6 +78,8 @@ def update_pos_profile_data(doc, pos_profile, company_data):
doc.apply_discount_on = pos_profile.get('apply_discount_on') if pos_profile.get('apply_discount') else '' doc.apply_discount_on = pos_profile.get('apply_discount_on') if pos_profile.get('apply_discount') else ''
doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group') doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group')
doc.territory = pos_profile.get('territory') or get_root('Territory') doc.territory = pos_profile.get('territory') or get_root('Territory')
if pos_profile.get('tc_name'):
doc.terms = frappe.db.get_value('Terms and Conditions', pos_profile.get('tc_name'), 'terms')
def get_root(table): def get_root(table):
root = frappe.db.sql(""" select name from `tab%(table)s` having root = frappe.db.sql(""" select name from `tab%(table)s` having

View File

@ -651,32 +651,34 @@ class SalesInvoice(SellingController):
def make_pos_gl_entries(self, gl_entries): def make_pos_gl_entries(self, gl_entries):
if cint(self.is_pos): if cint(self.is_pos):
for payment_mode in self.payments: for payment_mode in self.payments:
# POS, make payment entries if payment_mode.amount:
gl_entries.append( # POS, make payment entries
self.get_gl_dict({ gl_entries.append(
"account": self.debit_to, self.get_gl_dict({
"party_type": "Customer", "account": self.debit_to,
"party": self.customer, "party_type": "Customer",
"against": payment_mode.account, "party": self.customer,
"credit": payment_mode.base_amount, "against": payment_mode.account,
"credit_in_account_currency": payment_mode.base_amount \ "credit": payment_mode.base_amount,
if self.party_account_currency==self.company_currency \ "credit_in_account_currency": payment_mode.base_amount \
else payment_mode.amount, if self.party_account_currency==self.company_currency \
"against_voucher": self.return_against if cint(self.is_return) else self.name, else payment_mode.amount,
"against_voucher_type": self.doctype, "against_voucher": self.return_against if cint(self.is_return) else self.name,
}, self.party_account_currency) "against_voucher_type": self.doctype,
) }, self.party_account_currency)
)
payment_mode_account_currency = get_account_currency(payment_mode.account) payment_mode_account_currency = get_account_currency(payment_mode.account)
gl_entries.append( gl_entries.append(
self.get_gl_dict({ self.get_gl_dict({
"account": payment_mode.account, "account": payment_mode.account,
"against": self.customer, "against": self.customer,
"debit": payment_mode.base_amount, "debit": payment_mode.base_amount,
"debit_in_account_currency": payment_mode.base_amount \ "debit_in_account_currency": payment_mode.base_amount \
if payment_mode_account_currency==self.company_currency else payment_mode.amount if payment_mode_account_currency==self.company_currency \
}, payment_mode_account_currency) else payment_mode.amount
) }, payment_mode_account_currency)
)
def make_gle_for_change_amount(self, gl_entries): def make_gle_for_change_amount(self, gl_entries):
if cint(self.is_pos) and self.change_amount: if cint(self.is_pos) and self.change_amount:

View File

@ -7,10 +7,10 @@
"docstatus": 0, "docstatus": 0,
"doctype": "Print Format", "doctype": "Print Format",
"font": "Default", "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\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>", "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>{{ terms }}</p>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
"idx": 0, "idx": 0,
"line_breaks": 0, "line_breaks": 0,
"modified": "2016-12-27 17:22:17.391673", "modified": "2017-01-12 14:56:12.571032",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Point of Sale", "name": "Point of Sale",

View File

@ -206,9 +206,12 @@ def get_count_on(account, fieldname, date):
@frappe.whitelist() @frappe.whitelist()
def add_ac(args=None): def add_ac(args=None):
from frappe.desk.treeview import make_tree_args
if not args: if not args:
args = frappe.local.form_dict args = frappe.local.form_dict
args.pop("cmd")
args = make_tree_args(**args)
ac = frappe.new_doc("Account") ac = frappe.new_doc("Account")
@ -233,9 +236,12 @@ def add_ac(args=None):
@frappe.whitelist() @frappe.whitelist()
def add_cc(args=None): def add_cc(args=None):
from frappe.desk.treeview import make_tree_args
if not args: if not args:
args = frappe.local.form_dict args = frappe.local.form_dict
args.pop("cmd")
args = make_tree_args(**args)
cc = frappe.new_doc("Cost Center") cc = frappe.new_doc("Cost Center")
cc.update(args) cc.update(args)

View File

@ -103,6 +103,8 @@ class StatusUpdater(Document):
def set_status(self, update=False, status=None, update_modified=True): def set_status(self, update=False, status=None, update_modified=True):
if self.is_new(): if self.is_new():
if self.get('amended_from'):
self.status = 'Draft'
return return
if self.doctype in status_map: if self.doctype in status_map:

View File

@ -10,11 +10,13 @@
"doctype": "DocType", "doctype": "DocType",
"document_type": "Document", "document_type": "Document",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB",
"fields": [ "fields": [
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "item_code", "fieldname": "item_code",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -32,6 +34,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 1, "search_index": 1,
@ -42,6 +45,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "item_name", "fieldname": "item_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
@ -58,6 +62,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 1, "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
@ -68,8 +73,9 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Data", "fieldtype": "Text Editor",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
@ -85,6 +91,7 @@
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"print_width": "300px", "print_width": "300px",
"read_only": 1, "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
@ -96,6 +103,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "schedule_details", "fieldname": "schedule_details",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@ -110,6 +118,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
@ -120,6 +129,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "start_date", "fieldname": "start_date",
"fieldtype": "Date", "fieldtype": "Date",
"hidden": 0, "hidden": 0,
@ -136,6 +146,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 1, "search_index": 1,
@ -146,6 +157,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "end_date", "fieldname": "end_date",
"fieldtype": "Date", "fieldtype": "Date",
"hidden": 0, "hidden": 0,
@ -162,6 +174,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 1, "search_index": 1,
@ -172,6 +185,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "periodicity", "fieldname": "periodicity",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0, "hidden": 0,
@ -189,6 +203,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
@ -199,6 +214,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "no_of_visits", "fieldname": "no_of_visits",
"fieldtype": "Int", "fieldtype": "Int",
"hidden": 0, "hidden": 0,
@ -215,6 +231,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 0, "search_index": 0,
@ -225,6 +242,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "sales_person", "fieldname": "sales_person",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -242,6 +260,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 0, "search_index": 0,
@ -252,6 +271,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "reference", "fieldname": "reference",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@ -266,6 +286,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
@ -276,6 +297,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "serial_no", "fieldname": "serial_no",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"hidden": 0, "hidden": 0,
@ -292,6 +314,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
@ -302,6 +325,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "sales_order", "fieldname": "sales_order",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -320,6 +344,7 @@
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"print_width": "150px", "print_width": "150px",
"read_only": 1, "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
"search_index": 1, "search_index": 1,
@ -338,7 +363,7 @@
"issingle": 0, "issingle": 0,
"istable": 1, "istable": 1,
"max_attachments": 0, "max_attachments": 0,
"modified": "2016-07-11 03:28:02.260189", "modified": "2017-01-11 12:02:38.449129",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Maintenance", "module": "Maintenance",
"name": "Maintenance Schedule Item", "name": "Maintenance Schedule Item",

View File

@ -360,3 +360,5 @@ erpnext.patches.v7_1.set_sales_person_status
erpnext.patches.v7_1.repost_stock_for_deleted_bins_for_merging_items erpnext.patches.v7_1.repost_stock_for_deleted_bins_for_merging_items
execute:frappe.delete_doc('Desktop Icon', {'module_name': 'Profit and Loss Statment'}) execute:frappe.delete_doc('Desktop Icon', {'module_name': 'Profit and Loss Statment'})
erpnext.patches.v7_2.update_website_for_variant erpnext.patches.v7_2.update_website_for_variant
erpnext.patches.v7_2.update_doctype_status
erpnext.patches.v7_2.update_salary_slips

View File

@ -0,0 +1,11 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
doctypes = ["Opportunity", "Quotation", "Sales Order", "Sales Invoice", "Purchase Invoice", "Purchase Order", "Delivery Note", "Purchase Receipt"]
for doctype in doctypes:
frappe.db.sql(""" update `tab{doctype}` set status = 'Draft'
where status = 'Cancelled' and docstatus = 0 """.format(doctype = doctype))

View File

@ -0,0 +1,16 @@
import frappe
from erpnext.hr.doctype.process_payroll.process_payroll import get_month_details
def execute():
salary_slips = frappe.db.sql("""select fiscal_year, month, name from `tabSalary Slip`
where (month is not null and month != '')
and (fiscal_year is not null and fiscal_year != '') and
(start_date is null or start_date = '') and
(end_date is null or end_date = '') and docstatus != 2""")
for salary_slip in salary_slips:
get_start_end_date = get_month_details(salary_slip.fiscal_year, salary_slip.month)
start_date = get_start_end_date['month_start_date']
end_date = get_start_end_date['month_end_date']
frappe.db.sql("""update `tabSalary Slip` set start_date = %s, end_date = %s where name = %s""",
(start_date, end_date, salary_slip.name))

View File

@ -10,6 +10,7 @@
"doctype": "DocType", "doctype": "DocType",
"document_type": "Setup", "document_type": "Setup",
"editable_grid": 0, "editable_grid": 0,
"engine": "InnoDB",
"fields": [ "fields": [
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
@ -24,7 +25,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Project Name", "label": "Project Name",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -53,7 +53,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 1,
"label": "Status", "label": "Status",
"length": 0, "length": 0,
"no_copy": 1, "no_copy": 1,
@ -83,7 +82,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 1,
"label": "Project Type", "label": "Project Type",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -113,7 +111,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 1,
"label": "Is Active", "label": "Is Active",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -144,7 +141,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "% Complete Method", "label": "% Complete Method",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -173,7 +169,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
@ -200,7 +195,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 1,
"label": "Priority", "label": "Priority",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -230,7 +224,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Expected Start Date", "label": "Expected Start Date",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -259,7 +252,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Expected End Date", "label": "Expected End Date",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -288,7 +280,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "% Completed", "label": "% Completed",
"length": 0, "length": 0,
"no_copy": 1, "no_copy": 1,
@ -315,7 +306,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer Details", "label": "Customer Details",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -344,7 +334,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer", "label": "Customer",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -374,7 +363,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
@ -401,7 +389,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Sales Order", "label": "Sales Order",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -430,7 +417,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Users", "label": "Users",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -459,7 +445,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Users", "label": "Users",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -488,7 +473,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Tasks", "label": "Tasks",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -517,7 +501,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Tasks", "label": "Tasks",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -546,7 +529,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Notes", "label": "Notes",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -575,7 +557,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Notes", "label": "Notes",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -604,7 +585,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Start and End Dates", "label": "Start and End Dates",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -632,7 +612,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Actual Start Date", "label": "Actual Start Date",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -660,7 +639,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Actual Time (in Hours)", "label": "Actual Time (in Hours)",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -688,7 +666,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
@ -715,7 +692,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Actual End Date", "label": "Actual End Date",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -744,7 +720,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Costing and Billing", "label": "Costing and Billing",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -773,7 +748,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0,
"label": "Estimated Cost", "label": "Estimated Cost",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -804,7 +778,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Costing Amount (via Time Logs)", "label": "Total Costing Amount (via Time Logs)",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -833,7 +806,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Expense Claim (via Expense Claims)", "label": "Total Expense Claim (via Expense Claims)",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -861,7 +833,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Company", "label": "Company",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -889,7 +860,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Cost Center", "label": "Default Cost Center",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -917,7 +887,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
@ -945,7 +914,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Billing Amount (via Time Logs)", "label": "Total Billing Amount (via Time Logs)",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -973,7 +941,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Purchase Cost (via Purchase Invoice)", "label": "Total Purchase Cost (via Purchase Invoice)",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -1001,7 +968,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Margin", "label": "Margin",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -1030,7 +996,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Gross Margin", "label": "Gross Margin",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -1060,7 +1025,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
@ -1087,7 +1051,6 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"in_standard_filter": 0,
"label": "Gross Margin %", "label": "Gross Margin %",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
@ -1117,7 +1080,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 4, "max_attachments": 4,
"modified": "2016-11-07 05:55:56.179455", "modified": "2017-01-10 16:33:54.691885",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Projects", "module": "Projects",
"name": "Project", "name": "Project",
@ -1164,6 +1127,27 @@
"share": 0, "share": 0,
"submit": 0, "submit": 0,
"write": 0 "write": 0
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Projects Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
} }
], ],
"quick_entry": 1, "quick_entry": 1,

View File

@ -2,7 +2,7 @@
<div class="col-xs-5"><h6>{%= item_code || "" %}{%= item_name || "" %}</h6></div> <div class="col-xs-5"><h6>{%= item_code || "" %}{%= item_name || "" %}</h6></div>
<div class="col-xs-4"> <div class="col-xs-4">
<div class="row pos-qty-row"> <div class="row pos-qty-row">
<div class="col-xs-2 text-center pos-qty-btn" data-action="decrease-qty"><i class="fa fa-minus-sign text-muted"></i></div> <div class="col-xs-2 text-center pos-qty-btn" data-action="decrease-qty"><i class="fa fa-minus text-muted" style="font-size:12px"></i></div>
<div class="col-xs-8"> <div class="col-xs-8">
<div> <div>
<input type="text" value="{%= qty %}" class="form-control input-sm pos-item-qty text-right"> <input type="text" value="{%= qty %}" class="form-control input-sm pos-item-qty text-right">
@ -13,7 +13,7 @@
</div> </div>
{% } %} {% } %}
</div> </div>
<div class="col-xs-2 text-center pos-qty-btn" data-action="increase-qty"><i class="fa fa-plus-sign text-muted"></i></div> <div class="col-xs-2 text-center pos-qty-btn" data-action="increase-qty"><i class="fa fa-plus text-muted" style="font-size:12px"></i></div>
</div> </div>
</div> </div>
<div class="col-xs-3 text-right"> <div class="col-xs-3 text-right">

View File

@ -269,26 +269,13 @@ def get_children():
@frappe.whitelist() @frappe.whitelist()
def add_node(): def add_node():
doctype = frappe.form_dict.get('doctype') from frappe.desk.treeview import make_tree_args
company = frappe.form_dict.get('company') args = make_tree_args(**frappe.form_dict)
parent_field = 'parent_' + doctype.lower().replace(' ', '_')
name_field = doctype.lower().replace(' ', '_') + '_name'
doc = frappe.new_doc(doctype) if cint(args.is_root):
args.parent_warehouse = None
parent = frappe.form_dict['parent'] frappe.get_doc(args).insert()
if cint(frappe.form_dict['is_root']):
parent = None
doc.update({
name_field: frappe.form_dict['warehouse_name'],
parent_field: parent,
"is_group": frappe.form_dict['is_group'],
"company": company
})
doc.save()
@frappe.whitelist() @frappe.whitelist()
def convert_to_group_or_ledger(): def convert_to_group_or_ledger():

View File

@ -42,9 +42,6 @@ def get_item_details(args):
get_party_item_code(args, item_doc, out) get_party_item_code(args, item_doc, out)
if out.get("warehouse"):
out.update(get_bin_details(args.item_code, out.warehouse))
if frappe.db.exists("Product Bundle", args.item_code): if frappe.db.exists("Product Bundle", args.item_code):
valuation_rate = 0.0 valuation_rate = 0.0
bundled_items = frappe.get_doc("Product Bundle", args.item_code) bundled_items = frappe.get_doc("Product Bundle", args.item_code)
@ -66,6 +63,9 @@ def get_item_details(args):
if args.customer and cint(args.is_pos): if args.customer and cint(args.is_pos):
out.update(get_pos_profile_item_details(args.company, args)) out.update(get_pos_profile_item_details(args.company, args))
if out.get("warehouse"):
out.update(get_bin_details(args.item_code, out.warehouse))
# update args with out, if key or value not exists # update args with out, if key or value not exists
for key, value in out.iteritems(): for key, value in out.iteritems():
if args.get(key) is None: if args.get(key) is None:

View File

@ -102,7 +102,7 @@ def get_item_warehouse_map(filters):
"in_qty": 0.0, "in_val": 0.0, "in_qty": 0.0, "in_val": 0.0,
"out_qty": 0.0, "out_val": 0.0, "out_qty": 0.0, "out_val": 0.0,
"bal_qty": 0.0, "bal_val": 0.0, "bal_qty": 0.0, "bal_val": 0.0,
"val_rate": 0.0, "uom": None "val_rate": 0.0
}) })
qty_dict = iwb_map[(d.company, d.item_code, d.warehouse)] qty_dict = iwb_map[(d.company, d.item_code, d.warehouse)]
@ -130,6 +130,24 @@ def get_item_warehouse_map(filters):
qty_dict.bal_qty += qty_diff qty_dict.bal_qty += qty_diff
qty_dict.bal_val += value_diff qty_dict.bal_val += value_diff
iwb_map = filter_items_with_no_transactions(iwb_map)
return iwb_map
def filter_items_with_no_transactions(iwb_map):
for (company, item, warehouse) in sorted(iwb_map):
qty_dict = iwb_map[(company, item, warehouse)]
no_transactions = True
for key, val in qty_dict.items():
val = flt(val, 3)
qty_dict[key] = val
if key != "val_rate" and val:
no_transactions = False
if no_transactions:
iwb_map.pop((company, item, warehouse))
return iwb_map return iwb_map
def get_item_details(filters): def get_item_details(filters):