mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
Merge branch 'develop' into payment-terms
This commit is contained in:
@@ -4,7 +4,7 @@ import inspect
|
|||||||
import frappe
|
import frappe
|
||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
|
|
||||||
__version__ = '9.0.0'
|
__version__ = '9.0.3'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
|||||||
@@ -1023,7 +1023,7 @@
|
|||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "2",
|
"precision": "",
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
@@ -1284,7 +1284,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-08-31 16:34:41.614743",
|
"modified": "2017-09-27 08:31:38.432574",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Pricing Rule",
|
"name": "Pricing Rule",
|
||||||
|
|||||||
@@ -699,7 +699,7 @@
|
|||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "2",
|
"precision": "",
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
@@ -2166,7 +2166,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-07-17 17:54:48.246507",
|
"modified": "2017-09-27 08:31:37.827893",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice Item",
|
"name": "Sales Invoice Item",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from frappe import _
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.utils import cstr, cint
|
from frappe.utils import cstr, cint
|
||||||
from frappe.contacts.doctype.address.address import get_default_address
|
from frappe.contacts.doctype.address.address import get_default_address
|
||||||
|
from frappe.utils.nestedset import get_root_of
|
||||||
from erpnext.setup.doctype.customer_group.customer_group import get_parent_customer_groups
|
from erpnext.setup.doctype.customer_group.customer_group import get_parent_customer_groups
|
||||||
|
|
||||||
class IncorrectCustomerGroup(frappe.ValidationError): pass
|
class IncorrectCustomerGroup(frappe.ValidationError): pass
|
||||||
@@ -136,7 +137,7 @@ def get_tax_template(posting_date, args):
|
|||||||
if key=="use_for_shopping_cart":
|
if key=="use_for_shopping_cart":
|
||||||
conditions.append("use_for_shopping_cart = {0}".format(1 if value else 0))
|
conditions.append("use_for_shopping_cart = {0}".format(1 if value else 0))
|
||||||
if key == 'customer_group':
|
if key == 'customer_group':
|
||||||
if not value: value = _("All Customer Groups")
|
if not value: value = get_root_of("Customer Group")
|
||||||
customer_group_condition = get_customer_group_condition(value)
|
customer_group_condition = get_customer_group_condition(value)
|
||||||
conditions.append("ifnull({0}, '') in ('', {1})".format(key, customer_group_condition))
|
conditions.append("ifnull({0}, '') in ('', {1})".format(key, customer_group_condition))
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -2,29 +2,29 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.query_reports["Quoted Item Comparison"] = {
|
frappe.query_reports["Quoted Item Comparison"] = {
|
||||||
"filters": [
|
filters: [
|
||||||
{
|
{
|
||||||
"fieldname": "supplier_quotation",
|
fieldtype: "Link",
|
||||||
"label": __("Supplier Quotation"),
|
label: __("Supplier Quotation"),
|
||||||
"fieldtype": "Link",
|
options: "Supplier Quotation",
|
||||||
"options": "Supplier Quotation",
|
fieldname: "supplier_quotation",
|
||||||
"default": "",
|
default: "",
|
||||||
"get_query": function () {
|
get_query: () => {
|
||||||
return { filters: { "docstatus": ["<", 2] } }
|
return { filters: { "docstatus": ["<", 2] } }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "item",
|
reqd: 1,
|
||||||
"label": __("Item"),
|
default: "",
|
||||||
"fieldtype": "Link",
|
options: "Item",
|
||||||
"options": "Item",
|
label: __("Item"),
|
||||||
"default": "",
|
fieldname: "item",
|
||||||
"reqd": 1,
|
fieldtype: "Link",
|
||||||
"get_query": function () {
|
get_query: () => {
|
||||||
var quote = frappe.query_report_filters_by_name.supplier_quotation.get_value();
|
let quote = frappe.query_report_filters_by_name.supplier_quotation.get_value();
|
||||||
if (quote != "") {
|
if (quote != "") {
|
||||||
return {
|
return {
|
||||||
query: "erpnext.buying.doctype.quality_inspection.quality_inspection.item_query",
|
query: "erpnext.stock.doctype.quality_inspection.quality_inspection.item_query",
|
||||||
filters: {
|
filters: {
|
||||||
"from": "Supplier Quotation Item",
|
"from": "Supplier Quotation Item",
|
||||||
"parent": quote
|
"parent": quote
|
||||||
@@ -39,47 +39,50 @@ frappe.query_reports["Quoted Item Comparison"] = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
onload: function (report) {
|
onload: (report) => {
|
||||||
// Create a button for setting the default supplier
|
// Create a button for setting the default supplier
|
||||||
report.page.add_inner_button(__("Select Default Supplier"), function () {
|
report.page.add_inner_button(__("Select Default Supplier"), () => {
|
||||||
|
let reporter = frappe.query_reports["Quoted Item Comparison"];
|
||||||
var reporter = frappe.query_reports["Quoted Item Comparison"];
|
|
||||||
|
|
||||||
//Always make a new one so that the latest values get updated
|
//Always make a new one so that the latest values get updated
|
||||||
reporter.make_default_supplier_dialog(report);
|
reporter.make_default_supplier_dialog(report);
|
||||||
report.dialog.show();
|
|
||||||
setTimeout(function () { report.dialog.input.focus(); }, 1000);
|
|
||||||
|
|
||||||
}, 'Tools');
|
}, 'Tools');
|
||||||
|
|
||||||
},
|
},
|
||||||
"make_default_supplier_dialog": function (report) {
|
make_default_supplier_dialog: (report) => {
|
||||||
// Get the name of the item to change
|
// Get the name of the item to change
|
||||||
var filters = report.get_values();
|
if(!report.data) return;
|
||||||
var item_code = filters.item;
|
|
||||||
|
let filters = report.get_values();
|
||||||
|
let item_code = filters.item;
|
||||||
|
|
||||||
// Get a list of the suppliers (with a blank as well) for the user to select
|
// Get a list of the suppliers (with a blank as well) for the user to select
|
||||||
var select_options = "";
|
let suppliers = $.map(report.data, (row, idx)=>{ return row.supplier_name })
|
||||||
for (let supplier of report.data) {
|
|
||||||
select_options += supplier.supplier_name + '\n'
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a dialog window for the user to pick their supplier
|
// Create a dialog window for the user to pick their supplier
|
||||||
var d = new frappe.ui.Dialog({
|
let dialog = new frappe.ui.Dialog({
|
||||||
title: __('Select Default Supplier'),
|
title: __('Select Default Supplier'),
|
||||||
fields: [
|
fields: [
|
||||||
{ fieldname: 'supplier', fieldtype: 'Select', label: 'Supplier', reqd: 1, options: select_options },
|
{
|
||||||
{ fieldname: 'ok_button', fieldtype: 'Button', label: 'Set Default Supplier' },
|
reqd: 1,
|
||||||
|
label: 'Supplier',
|
||||||
|
fieldtype: 'Link',
|
||||||
|
options: 'Supplier',
|
||||||
|
fieldname: 'supplier',
|
||||||
|
get_query: () => {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
'name': ['in', suppliers]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
// On the user clicking the ok button
|
dialog.set_primary_action("Set Default Supplier", () => {
|
||||||
d.fields_dict.ok_button.input.onclick = function () {
|
let values = dialog.get_values();
|
||||||
var btn = d.fields_dict.ok_button.input;
|
if(values) {
|
||||||
var v = report.dialog.get_values();
|
|
||||||
if (v) {
|
|
||||||
$(btn).set_working();
|
|
||||||
|
|
||||||
// Set the default_supplier field of the appropriate Item to the selected supplier
|
// Set the default_supplier field of the appropriate Item to the selected supplier
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "frappe.client.set_value",
|
method: "frappe.client.set_value",
|
||||||
@@ -87,17 +90,17 @@ frappe.query_reports["Quoted Item Comparison"] = {
|
|||||||
doctype: "Item",
|
doctype: "Item",
|
||||||
name: item_code,
|
name: item_code,
|
||||||
fieldname: "default_supplier",
|
fieldname: "default_supplier",
|
||||||
value: v.supplier,
|
value: values.supplier,
|
||||||
},
|
},
|
||||||
callback: function (r) {
|
freeze: true,
|
||||||
$(btn).done_working();
|
callback: (r) => {
|
||||||
frappe.msgprint("Successfully Set Supplier");
|
frappe.msgprint("Successfully Set Supplier");
|
||||||
report.dialog.hide();
|
dialog.hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
report.dialog = d;
|
dialog.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,53 +8,55 @@ import frappe
|
|||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
qty_list = get_quantity_list(filters.item)
|
qty_list = get_quantity_list(filters.item)
|
||||||
|
|
||||||
data = get_quote_list(filters.item, qty_list)
|
data = get_quote_list(filters.item, qty_list)
|
||||||
|
|
||||||
columns = get_columns(qty_list)
|
columns = get_columns(qty_list)
|
||||||
|
|
||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
def get_quote_list(item, qty_list):
|
def get_quote_list(item, qty_list):
|
||||||
out = []
|
out = []
|
||||||
if item:
|
if not item:
|
||||||
price_data = []
|
return []
|
||||||
suppliers = []
|
|
||||||
company_currency = frappe.db.get_default("currency")
|
suppliers = []
|
||||||
float_precision = cint(frappe.db.get_default("float_precision")) or 2
|
price_data = []
|
||||||
# Get the list of suppliers
|
company_currency = frappe.db.get_default("currency")
|
||||||
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):
|
float_precision = cint(frappe.db.get_default("float_precision")) or 2
|
||||||
for splr in frappe.db.sql("""SELECT supplier from `tabSupplier Quotation` where name =%s and docstatus < 2""", root.parent, as_dict=1):
|
# Get the list of suppliers
|
||||||
ip = frappe._dict({
|
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):
|
||||||
|
ip = frappe._dict({
|
||||||
"supplier": splr.supplier,
|
"supplier": splr.supplier,
|
||||||
"qty": root.qty,
|
"qty": root.qty,
|
||||||
"parent": root.parent,
|
"parent": root.parent,
|
||||||
"rate": root.rate})
|
"rate": root.rate
|
||||||
price_data.append(ip)
|
|
||||||
suppliers.append(splr.supplier)
|
|
||||||
|
|
||||||
#Add a row for each supplier
|
|
||||||
for root in set(suppliers):
|
|
||||||
supplier_currency = frappe.db.get_value("Supplier", root, "default_currency")
|
|
||||||
if supplier_currency:
|
|
||||||
exchange_rate = get_exchange_rate(supplier_currency, company_currency)
|
|
||||||
else:
|
|
||||||
exchange_rate = 1
|
|
||||||
|
|
||||||
row = frappe._dict({
|
|
||||||
"supplier_name": root
|
|
||||||
})
|
})
|
||||||
for col in qty_list:
|
price_data.append(ip)
|
||||||
# Get the quantity for this row
|
suppliers.append(splr.supplier)
|
||||||
for item_price in price_data:
|
|
||||||
if str(item_price.qty) == col.key and item_price.supplier == root:
|
#Add a row for each supplier
|
||||||
row[col.key] = flt(item_price.rate * exchange_rate, float_precision)
|
for root in set(suppliers):
|
||||||
row[col.key + "QUOTE"] = item_price.parent
|
supplier_currency = frappe.db.get_value("Supplier", root, "default_currency")
|
||||||
break
|
if supplier_currency:
|
||||||
else:
|
exchange_rate = get_exchange_rate(supplier_currency, company_currency)
|
||||||
row[col.key] = ""
|
else:
|
||||||
row[col.key + "QUOTE"] = ""
|
exchange_rate = 1
|
||||||
out.append(row)
|
|
||||||
|
row = frappe._dict({
|
||||||
|
"supplier_name": root
|
||||||
|
})
|
||||||
|
for col in 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] = flt(item_price.rate * exchange_rate, float_precision)
|
||||||
|
row[col.key + "QUOTE"] = item_price.parent
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
row[col.key] = ""
|
||||||
|
row[col.key + "QUOTE"] = ""
|
||||||
|
out.append(row)
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
@@ -62,7 +64,8 @@ def get_quantity_list(item):
|
|||||||
out = []
|
out = []
|
||||||
|
|
||||||
if item:
|
if item:
|
||||||
qty_list = frappe.db.sql("""select distinct qty from `tabSupplier Quotation Item` where ifnull(item_code,'')=%s and docstatus < 2""", item, as_dict=1)
|
qty_list = frappe.db.sql("""select distinct qty from `tabSupplier Quotation Item`
|
||||||
|
where ifnull(item_code,'')=%s and docstatus < 2""", item, as_dict=1)
|
||||||
qty_list.sort(reverse=False)
|
qty_list.sort(reverse=False)
|
||||||
for qt in qty_list:
|
for qt in qty_list:
|
||||||
col = frappe._dict({
|
col = frappe._dict({
|
||||||
|
|||||||
@@ -174,7 +174,8 @@ def copy_attributes_to_variant(item, variant):
|
|||||||
|
|
||||||
# copy non no-copy fields
|
# copy non no-copy fields
|
||||||
|
|
||||||
exclude_fields = ["item_code", "item_name", "show_in_website"]
|
exclude_fields = ["naming_series", "item_code", "item_name", "show_in_website",
|
||||||
|
"show_variant_in_website", "opening_stock", "variant_of", "valuation_rate", "variant_based_on"]
|
||||||
|
|
||||||
if item.variant_based_on=='Manufacturer':
|
if item.variant_based_on=='Manufacturer':
|
||||||
# don't copy manufacturer values if based on part no
|
# don't copy manufacturer values if based on part no
|
||||||
@@ -186,6 +187,7 @@ def copy_attributes_to_variant(item, variant):
|
|||||||
if (field.reqd or field.fieldname in allow_fields) and field.fieldname not in exclude_fields:
|
if (field.reqd or field.fieldname in allow_fields) and field.fieldname not in exclude_fields:
|
||||||
if variant.get(field.fieldname) != item.get(field.fieldname):
|
if variant.get(field.fieldname) != item.get(field.fieldname):
|
||||||
variant.set(field.fieldname, item.get(field.fieldname))
|
variant.set(field.fieldname, item.get(field.fieldname))
|
||||||
|
|
||||||
variant.variant_of = item.name
|
variant.variant_of = item.name
|
||||||
variant.has_variants = 0
|
variant.has_variants = 0
|
||||||
if not variant.description:
|
if not variant.description:
|
||||||
|
|||||||
@@ -278,5 +278,16 @@
|
|||||||
"item_code": "Autocad",
|
"item_code": "Autocad",
|
||||||
"item_name": "Autocad",
|
"item_name": "Autocad",
|
||||||
"item_group": "All Item Groups"
|
"item_group": "All Item Groups"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"is_stock_item": 1,
|
||||||
|
"has_batch_no": 1,
|
||||||
|
"create_new_batch": 1,
|
||||||
|
"valuation_rate": 200,
|
||||||
|
"default_warehouse": "Stores",
|
||||||
|
"description": "Corrugated Box",
|
||||||
|
"item_code": "Corrugated Box",
|
||||||
|
"item_name": "Corrugated Box",
|
||||||
|
"item_group": "All Item Groups"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -16,6 +16,7 @@ def setup(domain):
|
|||||||
setup_user()
|
setup_user()
|
||||||
setup_employee()
|
setup_employee()
|
||||||
setup_user_roles()
|
setup_user_roles()
|
||||||
|
setup_role_permissions()
|
||||||
|
|
||||||
employees = frappe.get_all('Employee', fields=['name', 'date_of_joining'])
|
employees = frappe.get_all('Employee', fields=['name', 'date_of_joining'])
|
||||||
|
|
||||||
@@ -91,7 +92,8 @@ def setup_fiscal_year():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# set the last fiscal year (current year) as default
|
# set the last fiscal year (current year) as default
|
||||||
fiscal_year.set_as_default()
|
if fiscal_year:
|
||||||
|
fiscal_year.set_as_default()
|
||||||
|
|
||||||
def setup_holiday_list():
|
def setup_holiday_list():
|
||||||
"""Setup Holiday List for the current year"""
|
"""Setup Holiday List for the current year"""
|
||||||
@@ -374,6 +376,22 @@ def setup_pos_profile():
|
|||||||
|
|
||||||
pos.insert()
|
pos.insert()
|
||||||
|
|
||||||
|
def setup_role_permissions():
|
||||||
|
role_permissions = {'Batch': ['Accounts User', 'Item Manager']}
|
||||||
|
for doctype, roles in role_permissions.items():
|
||||||
|
for role in roles:
|
||||||
|
if not frappe.db.get_value('Custom DocPerm',
|
||||||
|
{'parent': doctype, 'role': role}):
|
||||||
|
frappe.get_doc({
|
||||||
|
'doctype': 'Custom DocPerm',
|
||||||
|
'role': role,
|
||||||
|
'read': 1,
|
||||||
|
'write': 1,
|
||||||
|
'create': 1,
|
||||||
|
'delete': 1,
|
||||||
|
'parent': doctype
|
||||||
|
}).insert(ignore_permissions=True)
|
||||||
|
|
||||||
def import_json(doctype, submit=False, values=None):
|
def import_json(doctype, submit=False, values=None):
|
||||||
frappe.flags.in_import = True
|
frappe.flags.in_import = True
|
||||||
data = json.loads(open(frappe.get_app_path('erpnext', 'demo', 'data',
|
data = json.loads(open(frappe.get_app_path('erpnext', 'demo', 'data',
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import frappe, random
|
|||||||
from frappe.desk import query_report
|
from frappe.desk import query_report
|
||||||
from erpnext.stock.stock_ledger import NegativeStockError
|
from erpnext.stock.stock_ledger import NegativeStockError
|
||||||
from erpnext.stock.doctype.serial_no.serial_no import SerialNoRequiredError, SerialNoQtyError
|
from erpnext.stock.doctype.serial_no.serial_no import SerialNoRequiredError, SerialNoQtyError
|
||||||
|
from erpnext.stock.doctype.batch.batch import UnableToSelectBatchError
|
||||||
from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_return
|
from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_return
|
||||||
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_return
|
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_return
|
||||||
|
|
||||||
@@ -59,7 +60,7 @@ def make_delivery_note():
|
|||||||
try:
|
try:
|
||||||
dn.submit()
|
dn.submit()
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
except (NegativeStockError, SerialNoRequiredError, SerialNoQtyError):
|
except (NegativeStockError, SerialNoRequiredError, SerialNoQtyError, UnableToSelectBatchError):
|
||||||
frappe.db.rollback()
|
frappe.db.rollback()
|
||||||
|
|
||||||
def make_stock_reconciliation():
|
def make_stock_reconciliation():
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ doctype_js = {
|
|||||||
# setup wizard
|
# setup wizard
|
||||||
setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
|
setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
|
||||||
setup_wizard_complete = "erpnext.setup.setup_wizard.setup_wizard.setup_complete"
|
setup_wizard_complete = "erpnext.setup.setup_wizard.setup_wizard.setup_complete"
|
||||||
setup_wizard_success = "erpnext.setup.setup_wizard.setup_wizard.setup_success"
|
|
||||||
setup_wizard_test = "erpnext.setup.setup_wizard.test_setup_wizard.run_setup_wizard_test"
|
setup_wizard_test = "erpnext.setup.setup_wizard.test_setup_wizard.run_setup_wizard_test"
|
||||||
|
|
||||||
before_install = "erpnext.setup.install.check_setup_wizard_not_completed"
|
before_install = "erpnext.setup.install.check_setup_wizard_not_completed"
|
||||||
@@ -81,7 +80,7 @@ website_route_rules = [
|
|||||||
{"from_route": "/supplier-quotations/<path:name>", "to_route": "order",
|
{"from_route": "/supplier-quotations/<path:name>", "to_route": "order",
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"doctype": "Supplier Quotation",
|
"doctype": "Supplier Quotation",
|
||||||
"parents": [{"label": _("Supplier Quotation"), "route": "quotations"}]
|
"parents": [{"label": _("Supplier Quotation"), "route": "supplier-quotations"}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{"from_route": "/quotations", "to_route": "Quotation"},
|
{"from_route": "/quotations", "to_route": "Quotation"},
|
||||||
|
|||||||
@@ -370,8 +370,13 @@ class ProductionOrder(Document):
|
|||||||
self.actual_start_date = None
|
self.actual_start_date = None
|
||||||
self.actual_end_date = None
|
self.actual_end_date = None
|
||||||
if self.get("operations"):
|
if self.get("operations"):
|
||||||
self.actual_start_date = min([d.actual_start_time for d in self.get("operations")])
|
actual_start_dates = [d.actual_start_time for d in self.get("operations") if d.actual_start_time]
|
||||||
self.actual_end_date = max([d.actual_end_time for d in self.get("operations")])
|
if actual_start_dates:
|
||||||
|
self.actual_start_date = min(actual_start_dates)
|
||||||
|
|
||||||
|
actual_end_dates = [d.actual_end_time for d in self.get("operations") if d.actual_end_time]
|
||||||
|
if actual_end_dates:
|
||||||
|
self.actual_end_date = max(actual_end_dates)
|
||||||
|
|
||||||
def delete_timesheet(self):
|
def delete_timesheet(self):
|
||||||
for timesheet in frappe.get_all("Timesheet", ["name"], {"production_order": self.name}):
|
for timesheet in frappe.get_all("Timesheet", ["name"], {"production_order": self.name}):
|
||||||
|
|||||||
@@ -408,6 +408,8 @@ erpnext.patches.v8_0.update_stock_qty_value_in_bom_item
|
|||||||
erpnext.patches.v8_0.update_sales_cost_in_project
|
erpnext.patches.v8_0.update_sales_cost_in_project
|
||||||
erpnext.patches.v8_0.save_system_settings
|
erpnext.patches.v8_0.save_system_settings
|
||||||
erpnext.patches.v8_1.delete_deprecated_reports
|
erpnext.patches.v8_1.delete_deprecated_reports
|
||||||
|
erpnext.patches.v9_0.remove_subscription_module
|
||||||
|
erpnext.patches.v8_7.make_subscription_from_recurring_data
|
||||||
erpnext.patches.v8_1.setup_gst_india #2017-06-27
|
erpnext.patches.v8_1.setup_gst_india #2017-06-27
|
||||||
execute:frappe.reload_doc('regional', 'doctype', 'gst_hsn_code')
|
execute:frappe.reload_doc('regional', 'doctype', 'gst_hsn_code')
|
||||||
erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account
|
erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account
|
||||||
@@ -432,21 +434,20 @@ erpnext.patches.v8_5.update_customer_group_in_POS_profile
|
|||||||
erpnext.patches.v8_6.update_timesheet_company_from_PO
|
erpnext.patches.v8_6.update_timesheet_company_from_PO
|
||||||
erpnext.patches.v8_6.set_write_permission_for_quotation_for_sales_manager
|
erpnext.patches.v8_6.set_write_permission_for_quotation_for_sales_manager
|
||||||
erpnext.patches.v8_5.remove_project_type_property_setter
|
erpnext.patches.v8_5.remove_project_type_property_setter
|
||||||
erpnext.patches.v8_7.add_more_gst_fields
|
erpnext.patches.v8_7.add_more_gst_fields #21-09-2017
|
||||||
erpnext.patches.v8_7.fix_purchase_receipt_status
|
erpnext.patches.v8_7.fix_purchase_receipt_status
|
||||||
erpnext.patches.v8_6.rename_bom_update_tool
|
erpnext.patches.v8_6.rename_bom_update_tool
|
||||||
erpnext.patches.v8_7.set_offline_in_pos_settings #11-09-17
|
erpnext.patches.v8_7.set_offline_in_pos_settings #11-09-17
|
||||||
erpnext.patches.v8_9.add_setup_progress_actions #08-09-2017 #26-09-2017
|
erpnext.patches.v8_9.add_setup_progress_actions #08-09-2017 #26-09-2017
|
||||||
erpnext.patches.v8_9.rename_company_sales_target_field
|
erpnext.patches.v8_9.rename_company_sales_target_field
|
||||||
erpnext.patches.v8_8.set_bom_rate_as_per_uom
|
erpnext.patches.v8_8.set_bom_rate_as_per_uom
|
||||||
erpnext.patches.v8_7.make_subscription_from_recurring_data
|
|
||||||
erpnext.patches.v8_8.add_new_fields_in_accounts_settings
|
erpnext.patches.v8_8.add_new_fields_in_accounts_settings
|
||||||
erpnext.patches.v9_0.remove_subscription_module
|
|
||||||
erpnext.patches.v8_9.set_print_zero_amount_taxes
|
erpnext.patches.v8_9.set_print_zero_amount_taxes
|
||||||
erpnext.patches.v8_9.set_default_customer_group
|
erpnext.patches.v8_9.set_default_customer_group
|
||||||
erpnext.patches.v8_9.remove_employee_from_salary_structure_parent
|
erpnext.patches.v8_9.remove_employee_from_salary_structure_parent
|
||||||
erpnext.patches.v8_9.delete_gst_doctypes_for_outside_india_accounts
|
erpnext.patches.v8_9.delete_gst_doctypes_for_outside_india_accounts
|
||||||
erpnext.patches.v8_9.set_default_fields_in_variant_settings
|
erpnext.patches.v8_9.set_default_fields_in_variant_settings
|
||||||
|
erpnext.patches.v8_9.update_billing_gstin_for_indian_account
|
||||||
erpnext.patches.v8_10.add_due_date_to_gle
|
erpnext.patches.v8_10.add_due_date_to_gle
|
||||||
erpnext.patches.v8_10.update_gl_due_date_for_pi_and_si
|
erpnext.patches.v8_10.update_gl_due_date_for_pi_and_si
|
||||||
erpnext.patches.v8_10.add_payment_terms_field_to_supplier
|
erpnext.patches.v8_10.add_payment_terms_field_to_supplier
|
||||||
|
|||||||
@@ -8,9 +8,15 @@ from frappe.utils import today
|
|||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doc('accounts', 'doctype', 'subscription')
|
frappe.reload_doc('accounts', 'doctype', 'subscription')
|
||||||
frappe.reload_doc('selling', 'doctype', 'sales_order')
|
frappe.reload_doc('selling', 'doctype', 'sales_order')
|
||||||
|
frappe.reload_doc('selling', 'doctype', 'quotation')
|
||||||
frappe.reload_doc('buying', 'doctype', 'purchase_order')
|
frappe.reload_doc('buying', 'doctype', 'purchase_order')
|
||||||
|
frappe.reload_doc('buying', 'doctype', 'supplier_quotation')
|
||||||
frappe.reload_doc('accounts', 'doctype', 'sales_invoice')
|
frappe.reload_doc('accounts', 'doctype', 'sales_invoice')
|
||||||
frappe.reload_doc('accounts', 'doctype', 'purchase_invoice')
|
frappe.reload_doc('accounts', 'doctype', 'purchase_invoice')
|
||||||
|
frappe.reload_doc('stock', 'doctype', 'purchase_receipt')
|
||||||
|
frappe.reload_doc('stock', 'doctype', 'delivery_note')
|
||||||
|
frappe.reload_doc('accounts', 'doctype', 'journal_entry')
|
||||||
|
frappe.reload_doc('accounts', 'doctype', 'payment_entry')
|
||||||
|
|
||||||
for doctype in ['Sales Order', 'Sales Invoice',
|
for doctype in ['Sales Order', 'Sales Invoice',
|
||||||
'Purchase Invoice', 'Purchase Invoice']:
|
'Purchase Invoice', 'Purchase Invoice']:
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Copyright (c) 2017, Frappe and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
company = frappe.get_all('Company', filters = {'country': 'India'})
|
||||||
|
|
||||||
|
if company:
|
||||||
|
for doctype in ['Sales Invoice', 'Delivery Note']:
|
||||||
|
frappe.db.sql(""" update `tab{0}`
|
||||||
|
set billing_address_gstin = (select gstin from `tabAddress`
|
||||||
|
where name = customer_address)
|
||||||
|
where customer_address is not null and customer_address != ''""".format(doctype))
|
||||||
@@ -53,12 +53,17 @@ class Project(Document):
|
|||||||
return frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc")
|
return frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc")
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
self.validate_project_name()
|
||||||
self.validate_dates()
|
self.validate_dates()
|
||||||
self.validate_weights()
|
self.validate_weights()
|
||||||
self.sync_tasks()
|
self.sync_tasks()
|
||||||
self.tasks = []
|
self.tasks = []
|
||||||
self.send_welcome_email()
|
self.send_welcome_email()
|
||||||
|
|
||||||
|
def validate_project_name(self):
|
||||||
|
if frappe.db.exists("Project", self.project_name):
|
||||||
|
frappe.throw(_("Project {0} already exists").format(self.project_name))
|
||||||
|
|
||||||
def validate_dates(self):
|
def validate_dates(self):
|
||||||
if self.expected_start_date and self.expected_end_date:
|
if self.expected_start_date and self.expected_end_date:
|
||||||
if getdate(self.expected_end_date) < getdate(self.expected_start_date):
|
if getdate(self.expected_end_date) < getdate(self.expected_start_date):
|
||||||
|
|||||||
@@ -288,8 +288,11 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
set_cumulative_total: function(row_idx, tax) {
|
set_cumulative_total: function(row_idx, tax) {
|
||||||
var tax_amount = (in_list(["Valuation and Total", "Total"], tax.category) ?
|
var tax_amount = tax.tax_amount_after_discount_amount;
|
||||||
tax.tax_amount_after_discount_amount : 0);
|
if (tax.category == 'Valuation') {
|
||||||
|
tax_amount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (tax.add_deduct_tax == "Deduct") { tax_amount = -1*tax_amount; }
|
if (tax.add_deduct_tax == "Deduct") { tax_amount = -1*tax_amount; }
|
||||||
|
|
||||||
if(row_idx==0) {
|
if(row_idx==0) {
|
||||||
|
|||||||
@@ -84,34 +84,13 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-08-31 14:38:52.220743",
|
"modified": "2017-09-29 14:38:52.220743",
|
||||||
"modified_by": "ewdszx@ed.ews",
|
"modified_by": "Administrator",
|
||||||
"module": "Regional",
|
"module": "Regional",
|
||||||
"name": "GST HSN Code",
|
"name": "GST HSN Code",
|
||||||
"name_case": "",
|
"name_case": "",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [],
|
||||||
{
|
|
||||||
"amend": 0,
|
|
||||||
"apply_user_permissions": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
|
|||||||
@@ -83,34 +83,13 @@
|
|||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-08-31 14:39:15.625952",
|
"modified": "2017-09-29 14:39:15.625952",
|
||||||
"modified_by": "ewdszx@ed.ews",
|
"modified_by": "Administrator",
|
||||||
"module": "Regional",
|
"module": "Regional",
|
||||||
"name": "GST Settings",
|
"name": "GST Settings",
|
||||||
"name_case": "",
|
"name_case": "",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [],
|
||||||
{
|
|
||||||
"amend": 0,
|
|
||||||
"apply_user_permissions": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 0,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 0,
|
|
||||||
"role": "System Manager",
|
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ def setup(company=None, patch=True):
|
|||||||
make_custom_fields()
|
make_custom_fields()
|
||||||
add_permissions()
|
add_permissions()
|
||||||
add_custom_roles_for_reports()
|
add_custom_roles_for_reports()
|
||||||
add_hsn_sac_codes()
|
frappe.enqueue('erpnext.regional.india.setup.add_hsn_sac_codes', now=frappe.flags.in_test)
|
||||||
add_print_formats()
|
add_print_formats()
|
||||||
if not patch:
|
if not patch:
|
||||||
update_address_template()
|
update_address_template()
|
||||||
@@ -47,12 +47,14 @@ def add_hsn_sac_codes():
|
|||||||
|
|
||||||
def create_hsn_codes(data, code_field):
|
def create_hsn_codes(data, code_field):
|
||||||
for d in data:
|
for d in data:
|
||||||
if not frappe.db.exists("GST HSN Code", d[code_field]):
|
hsn_code = frappe.new_doc('GST HSN Code')
|
||||||
hsn_code = frappe.new_doc('GST HSN Code')
|
hsn_code.description = d["description"]
|
||||||
hsn_code.description = d["description"]
|
hsn_code.hsn_code = d[code_field]
|
||||||
hsn_code.hsn_code = d[code_field]
|
hsn_code.name = d[code_field]
|
||||||
hsn_code.name = d[code_field]
|
try:
|
||||||
hsn_code.db_insert()
|
hsn_code.db_insert()
|
||||||
|
except frappe.DuplicateEntryError:
|
||||||
|
pass
|
||||||
|
|
||||||
def add_custom_roles_for_reports():
|
def add_custom_roles_for_reports():
|
||||||
for report_name in ('GST Sales Register', 'GST Purchase Register',
|
for report_name in ('GST Sales Register', 'GST Purchase Register',
|
||||||
@@ -70,7 +72,6 @@ def add_custom_roles_for_reports():
|
|||||||
|
|
||||||
def add_permissions():
|
def add_permissions():
|
||||||
for doctype in ('GST HSN Code', 'GST Settings'):
|
for doctype in ('GST HSN Code', 'GST Settings'):
|
||||||
add_permission(doctype, 'Accounts Manager', 0)
|
|
||||||
add_permission(doctype, 'All', 0)
|
add_permission(doctype, 'All', 0)
|
||||||
|
|
||||||
def add_print_formats():
|
def add_print_formats():
|
||||||
@@ -111,12 +112,15 @@ def make_custom_fields():
|
|||||||
]
|
]
|
||||||
|
|
||||||
sales_invoice_gst_fields = [
|
sales_invoice_gst_fields = [
|
||||||
|
dict(fieldname='billing_address_gstin', label='Billing Address GSTIN',
|
||||||
|
fieldtype='Data', insert_after='customer_address',
|
||||||
|
options='customer_address.gstin', print_hide=1),
|
||||||
dict(fieldname='customer_gstin', label='Customer GSTIN',
|
dict(fieldname='customer_gstin', label='Customer GSTIN',
|
||||||
fieldtype='Data', insert_after='shipping_address',
|
fieldtype='Data', insert_after='shipping_address',
|
||||||
options='shipping_address_name.gstin', print_hide=1),
|
options='shipping_address_name.gstin', print_hide=1),
|
||||||
dict(fieldname='place_of_supply', label='Place of Supply',
|
dict(fieldname='place_of_supply', label='Place of Supply',
|
||||||
fieldtype='Data', insert_after='customer_gstin', print_hide=1,
|
fieldtype='Data', insert_after='customer_gstin', print_hide=1,
|
||||||
options='shipping_address_name.gst_state_number', read_only=1),
|
options='shipping_address_name.gst_state_number', read_only=0),
|
||||||
dict(fieldname='company_gstin', label='Company GSTIN',
|
dict(fieldname='company_gstin', label='Company GSTIN',
|
||||||
fieldtype='Data', insert_after='company_address',
|
fieldtype='Data', insert_after='company_address',
|
||||||
options='company_address.gstin', print_hide=1)
|
options='company_address.gstin', print_hide=1)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register i
|
|||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
return _execute(filters, additional_table_columns=[
|
return _execute(filters, additional_table_columns=[
|
||||||
dict(fieldtype='Data', label='Customer GSTIN', width=120),
|
dict(fieldtype='Data', label='Customer GSTIN', width=120),
|
||||||
|
dict(fieldtype='Data', label='Billing Address GSTIN', width=140),
|
||||||
dict(fieldtype='Data', label='Company GSTIN', width=120),
|
dict(fieldtype='Data', label='Company GSTIN', width=120),
|
||||||
dict(fieldtype='Data', label='Place of Supply', width=120),
|
dict(fieldtype='Data', label='Place of Supply', width=120),
|
||||||
dict(fieldtype='Data', label='Reverse Charge', width=120),
|
dict(fieldtype='Data', label='Reverse Charge', width=120),
|
||||||
@@ -17,6 +18,7 @@ def execute(filters=None):
|
|||||||
dict(fieldtype='Data', label='HSN Code', width=120)
|
dict(fieldtype='Data', label='HSN Code', width=120)
|
||||||
], additional_query_columns=[
|
], additional_query_columns=[
|
||||||
'customer_gstin',
|
'customer_gstin',
|
||||||
|
'billing_address_gstin',
|
||||||
'company_gstin',
|
'company_gstin',
|
||||||
'place_of_supply',
|
'place_of_supply',
|
||||||
'reverse_charge',
|
'reverse_charge',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from erpnext.accounts.report.sales_register.sales_register import _execute
|
|||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
return _execute(filters, additional_table_columns=[
|
return _execute(filters, additional_table_columns=[
|
||||||
dict(fieldtype='Data', label='Customer GSTIN', width=120),
|
dict(fieldtype='Data', label='Customer GSTIN', width=120),
|
||||||
|
dict(fieldtype='Data', label='Billing Address GSTIN', width=140),
|
||||||
dict(fieldtype='Data', label='Company GSTIN', width=120),
|
dict(fieldtype='Data', label='Company GSTIN', width=120),
|
||||||
dict(fieldtype='Data', label='Place of Supply', width=120),
|
dict(fieldtype='Data', label='Place of Supply', width=120),
|
||||||
dict(fieldtype='Data', label='Reverse Charge', width=120),
|
dict(fieldtype='Data', label='Reverse Charge', width=120),
|
||||||
@@ -16,6 +17,7 @@ def execute(filters=None):
|
|||||||
dict(fieldtype='Data', label='E-Commerce GSTIN', width=130)
|
dict(fieldtype='Data', label='E-Commerce GSTIN', width=130)
|
||||||
], additional_query_columns=[
|
], additional_query_columns=[
|
||||||
'customer_gstin',
|
'customer_gstin',
|
||||||
|
'billing_address_gstin',
|
||||||
'company_gstin',
|
'company_gstin',
|
||||||
'place_of_supply',
|
'place_of_supply',
|
||||||
'reverse_charge',
|
'reverse_charge',
|
||||||
|
|||||||
@@ -684,7 +684,7 @@
|
|||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "2",
|
"precision": "",
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
@@ -1583,7 +1583,7 @@
|
|||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2017-05-10 17:14:45.736424",
|
"modified": "2017-09-27 08:31:37.485134",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Quotation Item",
|
"name": "Quotation Item",
|
||||||
|
|||||||
@@ -714,7 +714,7 @@
|
|||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "2",
|
"precision": "",
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
@@ -745,7 +745,7 @@
|
|||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "2",
|
"precision": "",
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
@@ -1963,7 +1963,7 @@
|
|||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2017-07-28 14:04:04.289428",
|
"modified": "2017-09-27 08:31:37.129537",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Sales Order Item",
|
"name": "Sales Order Item",
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ frappe.pages['point-of-sale'].on_page_load = function(wrapper) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
frappe.pages['point-of-sale'].refresh = function(wrapper) {
|
frappe.pages['point-of-sale'].refresh = function(wrapper) {
|
||||||
cur_frm = wrapper.pos.frm;
|
if (wrapper.pos) {
|
||||||
|
cur_frm = wrapper.pos.frm;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
erpnext.pos.PointOfSale = class PointOfSale {
|
erpnext.pos.PointOfSale = class PointOfSale {
|
||||||
@@ -742,7 +744,7 @@ class POSCart {
|
|||||||
|
|
||||||
this.wrapper.find('.discount_amount').on('change', (e) => {
|
this.wrapper.find('.discount_amount').on('change', (e) => {
|
||||||
frappe.model.set_value(this.frm.doctype, this.frm.docname,
|
frappe.model.set_value(this.frm.doctype, this.frm.docname,
|
||||||
'discount_amount', e.target.value);
|
'discount_amount', flt(e.target.value));
|
||||||
this.frm.trigger('discount_amount')
|
this.frm.trigger('discount_amount')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
let discount_wrapper = this.wrapper.find('.additional_discount_percentage');
|
let discount_wrapper = this.wrapper.find('.additional_discount_percentage');
|
||||||
|
|||||||
@@ -3,12 +3,15 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe, json
|
import frappe, json
|
||||||
|
from frappe.utils.nestedset import get_root_of
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_items(start, page_length, price_list, item_group, search_value=""):
|
def get_items(start, page_length, price_list, item_group, search_value=""):
|
||||||
serial_no = ""
|
serial_no = ""
|
||||||
batch_no = ""
|
batch_no = ""
|
||||||
item_code = search_value
|
item_code = search_value
|
||||||
|
if not frappe.db.exists('Item Group', item_group):
|
||||||
|
item_group = get_root_of('Item Group')
|
||||||
|
|
||||||
if search_value:
|
if search_value:
|
||||||
# search serial no
|
# search serial no
|
||||||
@@ -31,7 +34,7 @@ def get_items(start, page_length, price_list, item_group, search_value=""):
|
|||||||
ON
|
ON
|
||||||
(item_det.item_code=i.name or item_det.item_code=i.variant_of)
|
(item_det.item_code=i.name or item_det.item_code=i.variant_of)
|
||||||
where
|
where
|
||||||
i.disabled = 0 and i.has_variants = 0
|
i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1
|
||||||
and i.item_group in (select name from `tabItem Group` where lft >= {lft} and rgt <= {rgt})
|
and i.item_group in (select name from `tabItem Group` where lft >= {lft} and rgt <= {rgt})
|
||||||
and (i.item_code like %(item_code)s
|
and (i.item_code like %(item_code)s
|
||||||
or i.item_name like %(item_code)s or i.barcode like %(item_code)s)
|
or i.item_name like %(item_code)s or i.barcode like %(item_code)s)
|
||||||
|
|||||||
@@ -75,11 +75,7 @@ class Company(Document):
|
|||||||
if not frappe.local.flags.ignore_chart_of_accounts:
|
if not frappe.local.flags.ignore_chart_of_accounts:
|
||||||
self.create_default_accounts()
|
self.create_default_accounts()
|
||||||
self.create_default_warehouses()
|
self.create_default_warehouses()
|
||||||
|
install_country_fixtures(self.name)
|
||||||
if cint(frappe.db.get_single_value('System Settings', 'setup_complete')):
|
|
||||||
# In the case of setup, fixtures should be installed after setup_success
|
|
||||||
# This also prevents db commits before setup is successful
|
|
||||||
install_country_fixtures(self.name)
|
|
||||||
|
|
||||||
if not frappe.db.get_value("Cost Center", {"is_group": 0, "company": self.name}):
|
if not frappe.db.get_value("Cost Center", {"is_group": 0, "company": self.name}):
|
||||||
self.create_default_cost_center()
|
self.create_default_cost_center()
|
||||||
|
|||||||
@@ -66,10 +66,6 @@ def setup_complete(args=None):
|
|||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def setup_success(args=None):
|
|
||||||
company = frappe.db.sql("select name from tabCompany", as_dict=True)[0]["name"]
|
|
||||||
install_country_fixtures(company)
|
|
||||||
|
|
||||||
def create_fiscal_year_and_company(args):
|
def create_fiscal_year_and_company(args):
|
||||||
if (args.get('fy_start_date')):
|
if (args.get('fy_start_date')):
|
||||||
curr_fiscal_year = get_fy_details(args.get('fy_start_date'), args.get('fy_end_date'))
|
curr_fiscal_year = get_fy_details(args.get('fy_start_date'), args.get('fy_end_date'))
|
||||||
|
|||||||
@@ -120,8 +120,9 @@ def enable_all_roles_and_domains():
|
|||||||
_role.save()
|
_role.save()
|
||||||
|
|
||||||
# add all roles to users
|
# add all roles to users
|
||||||
user = frappe.get_doc("User", "Administrator")
|
if roles:
|
||||||
user.add_roles(*[role.get("name") for role in roles])
|
user = frappe.get_doc("User", "Administrator")
|
||||||
|
user.add_roles(*[role.get("name") for role in roles])
|
||||||
|
|
||||||
domains = frappe.get_list("Domain")
|
domains = frappe.get_list("Domain")
|
||||||
if not domains:
|
if not domains:
|
||||||
|
|||||||
@@ -103,14 +103,15 @@ def split_batch(batch_no, item_code, warehouse, qty, new_batch_id = None):
|
|||||||
def set_batch_nos(doc, warehouse_field, throw = False):
|
def set_batch_nos(doc, warehouse_field, throw = False):
|
||||||
'''Automatically select `batch_no` for outgoing items in item table'''
|
'''Automatically select `batch_no` for outgoing items in item table'''
|
||||||
for d in doc.items:
|
for d in doc.items:
|
||||||
|
qty = d.get('stock_qty') or d.get('qty') or 0
|
||||||
has_batch_no = frappe.db.get_value('Item', d.item_code, 'has_batch_no')
|
has_batch_no = frappe.db.get_value('Item', d.item_code, 'has_batch_no')
|
||||||
warehouse = d.get(warehouse_field, None)
|
warehouse = d.get(warehouse_field, None)
|
||||||
if has_batch_no and warehouse and d.qty > 0:
|
if has_batch_no and warehouse and qty > 0:
|
||||||
if not d.batch_no:
|
if not d.batch_no:
|
||||||
d.batch_no = get_batch_no(d.item_code, warehouse, d.qty, throw)
|
d.batch_no = get_batch_no(d.item_code, warehouse, qty, throw)
|
||||||
else:
|
else:
|
||||||
batch_qty = get_batch_qty(batch_no=d.batch_no, warehouse=warehouse)
|
batch_qty = get_batch_qty(batch_no=d.batch_no, warehouse=warehouse)
|
||||||
if flt(batch_qty) < flt(d.qty):
|
if flt(batch_qty) < flt(qty):
|
||||||
frappe.throw(_("Row #{0}: The batch {1} has only {2} qty. Please select another batch which has {3} qty available or split the row into multiple rows, to deliver/issue from multiple batches").format(d.idx, d.batch_no, batch_qty, d.qty))
|
frappe.throw(_("Row #{0}: The batch {1} has only {2} qty. Please select another batch which has {3} qty available or split the row into multiple rows, to deliver/issue from multiple batches").format(d.idx, d.batch_no, batch_qty, d.qty))
|
||||||
|
|
||||||
def get_batch_no(item_code, warehouse, qty, throw=False):
|
def get_batch_no(item_code, warehouse, qty, throw=False):
|
||||||
|
|||||||
@@ -713,7 +713,7 @@
|
|||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "2",
|
"precision": "",
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
@@ -1956,7 +1956,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-05-10 17:14:50.456930",
|
"modified": "2017-09-27 08:31:38.768846",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Delivery Note Item",
|
"name": "Delivery Note Item",
|
||||||
|
|||||||
@@ -369,7 +369,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-02-20 13:27:23.896148",
|
"modified": "2017-09-28 03:56:20.814993",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item Price",
|
"name": "Item Price",
|
||||||
@@ -422,6 +422,6 @@
|
|||||||
"show_name_in_global_search": 0,
|
"show_name_in_global_search": 0,
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"title_field": "item_code",
|
"title_field": "item_code",
|
||||||
"track_changes": 0,
|
"track_changes": 1,
|
||||||
"track_seen": 0
|
"track_seen": 0
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,8 @@
|
|||||||
frappe.ui.form.on('Item Variant Settings', {
|
frappe.ui.form.on('Item Variant Settings', {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
const allow_fields = [];
|
const allow_fields = [];
|
||||||
const exclude_fields = ["item_code", "item_name", "show_in_website", "show_variant_in_website",
|
const exclude_fields = ["naming_series", "item_code", "item_name", "show_in_website",
|
||||||
"opening_stock", "variant_of", "valuation_rate", "variant_based_on"];
|
"show_variant_in_website", "opening_stock", "variant_of", "valuation_rate", "variant_based_on"];
|
||||||
|
|
||||||
frappe.model.with_doctype('Item', () => {
|
frappe.model.with_doctype('Item', () => {
|
||||||
frappe.get_meta('Item').fields.forEach(d => {
|
frappe.get_meta('Item').fields.forEach(d => {
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ class ItemVariantSettings(Document):
|
|||||||
def set_default_fields(self):
|
def set_default_fields(self):
|
||||||
self.fields = []
|
self.fields = []
|
||||||
fields = frappe.get_meta('Item').fields
|
fields = frappe.get_meta('Item').fields
|
||||||
exclude_fields = ["item_code", "item_name", "show_in_website", "show_variant_in_website",
|
exclude_fields = ["naming_series", "item_code", "item_name", "show_in_website",
|
||||||
"standard_rate", "opening_stock", "image", "description",
|
"show_variant_in_website", "standard_rate", "opening_stock", "image", "description",
|
||||||
"variant_of", "valuation_rate", "description", "variant_based_on",
|
"variant_of", "valuation_rate", "description", "variant_based_on",
|
||||||
"website_image", "thumbnail", "website_specifiations", "web_long_description"]
|
"website_image", "thumbnail", "website_specifiations", "web_long_description"]
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ rfq = Class.extend({
|
|||||||
frappe.unfreeze();
|
frappe.unfreeze();
|
||||||
if(r.message){
|
if(r.message){
|
||||||
$('.btn-sm').hide()
|
$('.btn-sm').hide()
|
||||||
window.location.href = "/quotations/" + encodeURIComponent(r.message);
|
window.location.href = "/supplier-quotations/" + encodeURIComponent(r.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user