Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5d0b36973 | ||
|
|
7677b56f7c | ||
|
|
b280398626 | ||
|
|
99c6c79834 | ||
|
|
3437a9a123 | ||
|
|
6a2e138021 | ||
|
|
ff41c82c2b | ||
|
|
99dfa3060a | ||
|
|
89b6c47b2e | ||
|
|
ec07d18222 | ||
|
|
1cd5e583ba | ||
|
|
bdd470a6d1 | ||
|
|
2f09dc0e62 | ||
|
|
eee23eaf5c | ||
|
|
d487bf77e1 | ||
|
|
efd5eadfea | ||
|
|
57e97c06e6 | ||
|
|
6f93cd5bd0 | ||
|
|
533d22e88b | ||
|
|
b3489548a9 | ||
|
|
ccd2e00331 | ||
|
|
0a6aaf4257 | ||
|
|
ea8fab52c6 | ||
|
|
8200485baa | ||
|
|
c874a82559 | ||
|
|
101aaed643 | ||
|
|
20d2d7548a | ||
|
|
3e2ecc3423 | ||
|
|
6b9902627d | ||
|
|
38f808cfae | ||
|
|
b327429db7 | ||
|
|
bf667a6540 | ||
|
|
ce4a0b20ab | ||
|
|
68fd31ca0e | ||
|
|
b77eaf7053 | ||
|
|
245c2e885a | ||
|
|
098bd34f00 | ||
|
|
063e86a1bf | ||
|
|
73bf1bc4b0 | ||
|
|
5f0027a2d0 | ||
|
|
fd82f4b0d4 | ||
|
|
83cc7c9382 | ||
|
|
149c033c8f | ||
|
|
355b4110c9 | ||
|
|
cb19f52985 | ||
|
|
3899d74f15 | ||
|
|
d288909310 | ||
|
|
c948a4fc92 | ||
|
|
01eefafad5 | ||
|
|
b736aafb8b | ||
|
|
a1d3d84415 | ||
|
|
c1cc7b68c4 | ||
|
|
4c952f48f8 | ||
|
|
bd1a628c55 | ||
|
|
93c001455f | ||
|
|
548cf183ea | ||
|
|
153156e31a | ||
|
|
a0b967f2cd | ||
|
|
f356e539bb | ||
|
|
84b827efcd | ||
|
|
e14e042f2f | ||
|
|
bfcacbf2ca | ||
|
|
78966fe03b | ||
|
|
a3a977d02a | ||
|
|
45c14ed41c | ||
|
|
e2f4b35b11 | ||
|
|
56cc542eb7 | ||
|
|
461e9c1e09 | ||
|
|
2b97cee32c | ||
|
|
b70767b08e | ||
|
|
aff2b9479d | ||
|
|
a987b35b72 | ||
|
|
653303180a | ||
|
|
d9e216878f | ||
|
|
f58cad6b13 | ||
|
|
0681c77f6a | ||
|
|
9eb830ac4f | ||
|
|
d9b4c52046 | ||
|
|
2bbf784fd8 | ||
|
|
71a730a36f | ||
|
|
47bdf8b659 | ||
|
|
685f89f2b7 | ||
|
|
5d69900f66 | ||
|
|
3d26ddd790 | ||
|
|
e7cb911634 |
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
__version__ = '7.2.10'
|
||||
__version__ = '7.2.20'
|
||||
|
||||
def get_default_company(user=None):
|
||||
'''Get default company for user'''
|
||||
|
||||
@@ -74,6 +74,9 @@ class BankReconciliation(Document):
|
||||
clearance_date_updated = False
|
||||
for d in self.get('payment_entries'):
|
||||
if d.clearance_date:
|
||||
if not d.payment_document:
|
||||
frappe.throw(_("Row #{0}: Payment document is required to complete the trasaction"))
|
||||
|
||||
if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date):
|
||||
frappe.throw(_("Row #{0}: Clearance date {1} cannot be before Cheque Date {2}")
|
||||
.format(d.idx, d.clearance_date, d.cheque_date))
|
||||
|
||||
@@ -43,9 +43,18 @@ frappe.ui.form.on('Budget', {
|
||||
},
|
||||
|
||||
budget_against: function(frm) {
|
||||
frm.trigger("set_null_value")
|
||||
frm.trigger("toggle_reqd_fields")
|
||||
},
|
||||
|
||||
set_null_value: function(frm) {
|
||||
if(frm.doc.budget_against == 'Cost Center') {
|
||||
frm.set_value('project', null)
|
||||
} else {
|
||||
frm.set_value('cost_center', null)
|
||||
}
|
||||
},
|
||||
|
||||
toggle_reqd_fields: function(frm) {
|
||||
frm.toggle_reqd("cost_center", frm.doc.budget_against=="Cost Center");
|
||||
frm.toggle_reqd("project", frm.doc.budget_against=="Project");
|
||||
|
||||
@@ -22,6 +22,7 @@ class Budget(Document):
|
||||
frappe.throw(_("{0} is mandatory").format(self.budget_against))
|
||||
self.validate_duplicate()
|
||||
self.validate_accounts()
|
||||
self.set_null_value()
|
||||
|
||||
def validate_duplicate(self):
|
||||
budget_against_field = frappe.scrub(self.budget_against)
|
||||
@@ -54,25 +55,31 @@ class Budget(Document):
|
||||
else:
|
||||
account_list.append(d.account)
|
||||
|
||||
def set_null_value(self):
|
||||
if self.budget_against == 'Cost Center':
|
||||
self.project = None
|
||||
else:
|
||||
self.cost_center = None
|
||||
|
||||
def validate_expense_against_budget(args):
|
||||
args = frappe._dict(args)
|
||||
if not args.cost_center and not args.project:
|
||||
return
|
||||
for budget_against in [args.project, args.cost_center]:
|
||||
if budget_against \
|
||||
for budget_against in ['project', 'cost_center']:
|
||||
if args.get(budget_against) \
|
||||
and frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"}):
|
||||
|
||||
if args.project:
|
||||
if args.project and budget_against == 'project':
|
||||
condition = "and b.project='%s'" % frappe.db.escape(args.project)
|
||||
args.budget_against_field = "Project"
|
||||
|
||||
elif args.cost_center:
|
||||
elif args.cost_center and budget_against == 'cost_center':
|
||||
cc_lft, cc_rgt = frappe.db.get_value("Cost Center", args.cost_center, ["lft", "rgt"])
|
||||
condition = """and exists(select name from `tabCost Center`
|
||||
where lft<=%s and rgt>=%s and name=b.cost_center)""" % (cc_lft, cc_rgt)
|
||||
args.budget_against_field = "Cost Center"
|
||||
|
||||
args.budget_against = budget_against
|
||||
|
||||
args.budget_against = args.get(budget_against)
|
||||
|
||||
budget_records = frappe.db.sql("""
|
||||
select
|
||||
|
||||
@@ -278,14 +278,14 @@
|
||||
"icon": "fa fa-money",
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 1,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-11-07 05:20:40.282432",
|
||||
"modified": "2017-01-30 11:27:36.615323",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cost Center",
|
||||
|
||||
@@ -45,6 +45,9 @@ class JournalEntry(AccountsController):
|
||||
self.accounts = [account for account in self.accounts
|
||||
if not (account.debit_in_account_currency==0.0 and account.credit_in_account_currency==0.0)]
|
||||
|
||||
if not self.accounts:
|
||||
frappe.throw("Debit or Credit amount is not found in account table")
|
||||
|
||||
def on_submit(self):
|
||||
self.check_credit_limit()
|
||||
self.make_gl_entries()
|
||||
|
||||
@@ -79,8 +79,13 @@ frappe.ui.form.on('Payment Entry', {
|
||||
frm.events.show_general_ledger(frm);
|
||||
},
|
||||
|
||||
company: function(frm) {
|
||||
frm.events.hide_unhide_fields(frm);
|
||||
frm.events.set_dynamic_labels(frm);
|
||||
},
|
||||
|
||||
hide_unhide_fields: function(frm) {
|
||||
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
|
||||
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
|
||||
|
||||
frm.toggle_display("source_exchange_rate",
|
||||
(frm.doc.paid_amount && frm.doc.paid_from_account_currency != company_currency));
|
||||
@@ -118,7 +123,7 @@ frappe.ui.form.on('Payment Entry', {
|
||||
},
|
||||
|
||||
set_dynamic_labels: function(frm) {
|
||||
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
|
||||
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
|
||||
|
||||
frm.set_currency_labels(["base_paid_amount", "base_received_amount", "base_total_allocated_amount",
|
||||
"difference_amount"], company_currency);
|
||||
@@ -131,6 +136,10 @@ frappe.ui.form.on('Payment Entry', {
|
||||
|
||||
frm.set_currency_labels(["total_allocated_amount", "unallocated_amount"], party_account_currency);
|
||||
|
||||
var currency_field = (frm.doc.payment_type=="Receive") ? "paid_from_account_currency" : "paid_to_account_currency"
|
||||
frm.set_df_property("total_allocated_amount", "options", currency_field);
|
||||
frm.set_df_property("unallocated_amount", "options", currency_field);
|
||||
|
||||
frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"],
|
||||
party_account_currency, "references");
|
||||
|
||||
@@ -741,4 +750,4 @@ frappe.ui.form.on('Payment Entry Deduction', {
|
||||
deductions_remove: function(frm) {
|
||||
frm.events.set_difference_amount(frm);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1315,6 +1315,34 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "is_sample_item",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Sample Item",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -1788,7 +1816,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-16 16:04:52.465169",
|
||||
"modified": "2017-02-07 01:21:03.737800",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice Item",
|
||||
|
||||
@@ -43,7 +43,11 @@ def get_pos_data():
|
||||
}
|
||||
|
||||
def get_meta():
|
||||
doctype_meta = {'customer': frappe.get_meta('Customer')}
|
||||
doctype_meta = {
|
||||
'customer': frappe.get_meta('Customer'),
|
||||
'invoice': frappe.get_meta('Sales Invoice')
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -78,8 +82,7 @@ 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.customer_group = pos_profile.get('customer_group') or get_root('Customer Group')
|
||||
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')
|
||||
doc.terms = frappe.db.get_value('Terms and Conditions', pos_profile.get('tc_name'), 'terms') or doc.terms or ''
|
||||
|
||||
def get_root(table):
|
||||
root = frappe.db.sql(""" select name from `tab%(table)s` having
|
||||
|
||||
@@ -3188,6 +3188,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Status",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -4182,7 +4183,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-11-09 14:18:24.760263",
|
||||
"modified": "2017-01-18 13:21:13.226318",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice",
|
||||
|
||||
@@ -1381,6 +1381,34 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "is_sample_item",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Sample Item",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -1882,7 +1910,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-16 16:04:02.438952",
|
||||
"modified": "2017-02-07 01:21:47.142162",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice Item",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _, scrub
|
||||
from erpnext.stock.utils import get_incoming_rate
|
||||
from frappe.utils import flt
|
||||
|
||||
|
||||
@@ -208,21 +209,18 @@ class GrossProfitGenerator(object):
|
||||
flt(my_sle[i+1].stock_value) or 0.0
|
||||
return previous_stock_value - flt(sle.stock_value)
|
||||
else:
|
||||
return flt(row.qty) * self.get_average_buying_rate(item_code)
|
||||
|
||||
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
|
||||
|
||||
return 0.0
|
||||
|
||||
def get_average_buying_rate(self, item_code):
|
||||
def get_average_buying_rate(self, row, item_code):
|
||||
if not item_code in self.average_buying_rate:
|
||||
if item_code in self.non_stock_items:
|
||||
self.average_buying_rate[item_code] = flt(frappe.db.sql("""select sum(base_net_amount) / sum(qty * conversion_factor)
|
||||
from `tabPurchase Invoice Item`
|
||||
where item_code = %s and docstatus=1""", item_code)[0][0])
|
||||
else:
|
||||
self.average_buying_rate[item_code] = flt(frappe.db.sql("""select avg(valuation_rate)
|
||||
from `tabStock Ledger Entry`
|
||||
where item_code = %s and qty_after_transaction > 0""", item_code)[0][0])
|
||||
self.average_buying_rate[item_code] = get_incoming_rate(row)
|
||||
|
||||
return self.average_buying_rate[item_code]
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ def validate_filters(filters):
|
||||
|
||||
def get_columns(filters):
|
||||
return [
|
||||
_("Payment Document") + ":Link/DocType: 100",
|
||||
_("Payment Document") + ":: 100",
|
||||
_("Payment Entry") + ":Dynamic Link/"+_("Payment Document")+":140",
|
||||
_("Party Type") + "::100",
|
||||
_("Party") + ":Dynamic Link/Party Type:140",
|
||||
|
||||
@@ -11,9 +11,11 @@ from erpnext.accounts.report.trial_balance.trial_balance import validate_filters
|
||||
value_fields = ("income", "expense", "gross_profit_loss")
|
||||
|
||||
def execute(filters=None):
|
||||
if not filters.get('based_on'): filters["based_on"] = 'Cost Center'
|
||||
|
||||
based_on = filters.based_on.replace(' ', '_').lower()
|
||||
validate_filters(filters)
|
||||
accounts = get_accounts_data(based_on, filters.company)
|
||||
accounts = get_accounts_data(based_on, filters.get("company"))
|
||||
data = get_data(accounts, filters, based_on)
|
||||
columns = get_columns(filters)
|
||||
return columns, data
|
||||
@@ -27,14 +29,14 @@ def get_accounts_data(based_on, company):
|
||||
|
||||
def get_data(accounts, filters, based_on):
|
||||
if not accounts:
|
||||
return None
|
||||
return []
|
||||
|
||||
accounts, accounts_by_name, parent_children_map = filter_accounts(accounts)
|
||||
|
||||
gl_entries_by_account = {}
|
||||
|
||||
set_gl_entries_by_account(filters.company, filters.from_date,
|
||||
filters.to_date, based_on, gl_entries_by_account, ignore_closing_entries=not flt(filters.with_period_closing_entry))
|
||||
set_gl_entries_by_account(filters.get("company"), filters.get("from_date"),
|
||||
filters.get("to_date"), based_on, gl_entries_by_account, ignore_closing_entries=not flt(filters.get("with_period_closing_entry")))
|
||||
|
||||
total_row = calculate_values(accounts, gl_entries_by_account, filters)
|
||||
accumulate_values_into_parents(accounts, accounts_by_name)
|
||||
@@ -90,7 +92,7 @@ def accumulate_values_into_parents(accounts, accounts_by_name):
|
||||
|
||||
def prepare_data(accounts, filters, total_row, parent_children_map, based_on):
|
||||
data = []
|
||||
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
||||
company_currency = frappe.db.get_value("Company", filters.get("company"), "default_currency")
|
||||
|
||||
for d in accounts:
|
||||
has_value = False
|
||||
@@ -99,7 +101,7 @@ def prepare_data(accounts, filters, total_row, parent_children_map, based_on):
|
||||
"account": d.name,
|
||||
"parent_account": d.parent_account,
|
||||
"indent": d.indent,
|
||||
"fiscal_year": filters.fiscal_year,
|
||||
"fiscal_year": filters.get("fiscal_year"),
|
||||
"currency": company_currency,
|
||||
"based_on": based_on
|
||||
}
|
||||
@@ -122,9 +124,9 @@ def get_columns(filters):
|
||||
return [
|
||||
{
|
||||
"fieldname": "account",
|
||||
"label": _(filters.based_on),
|
||||
"label": _(filters.get("based_on")),
|
||||
"fieldtype": "Link",
|
||||
"options": filters.based_on,
|
||||
"options": filters.get("based_on"),
|
||||
"width": 300
|
||||
},
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ def get_data():
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Setting up Email"),
|
||||
"label": _("Setting up Email Account"),
|
||||
"youtube_id": "YFYe0DrB95o"
|
||||
},
|
||||
{
|
||||
@@ -62,11 +62,6 @@ def get_data():
|
||||
"label": _("Workflow"),
|
||||
"youtube_id": "yObJUg9FxFs"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("Email Account"),
|
||||
"youtube_id": "YFYe0DrB95o"
|
||||
},
|
||||
{
|
||||
"type": "help",
|
||||
"label": _("File Manager"),
|
||||
|
||||
@@ -223,7 +223,8 @@ class BuyingController(StockController):
|
||||
})
|
||||
if not rm.rate:
|
||||
from erpnext.stock.stock_ledger import get_valuation_rate
|
||||
rm.rate = get_valuation_rate(bom_item.item_code, self.supplier_warehouse)
|
||||
rm.rate = get_valuation_rate(bom_item.item_code, self.supplier_warehouse,
|
||||
self.doctype, self.name)
|
||||
else:
|
||||
rm.rate = bom_item.rate
|
||||
|
||||
|
||||
@@ -198,6 +198,7 @@ def make_return_doc(doctype, source_name, target_doc=None):
|
||||
if tax.charge_type == "Actual":
|
||||
tax.tax_amount = -1 * tax.tax_amount
|
||||
|
||||
doc.discount_amount = -1 * source.discount_amount
|
||||
doc.run_method("calculate_taxes_and_totals")
|
||||
|
||||
def update_item(source_doc, target_doc, source_parent):
|
||||
|
||||
@@ -9,6 +9,7 @@ import frappe.defaults
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext.accounts.general_ledger import make_gl_entries, delete_gl_entries, process_gl_map
|
||||
from erpnext.controllers.accounts_controller import AccountsController
|
||||
from erpnext.stock.stock_ledger import get_valuation_rate
|
||||
|
||||
class StockController(AccountsController):
|
||||
def validate(self):
|
||||
@@ -42,7 +43,7 @@ class StockController(AccountsController):
|
||||
|
||||
gl_list = []
|
||||
warehouse_with_no_account = []
|
||||
|
||||
|
||||
for item_row in voucher_details:
|
||||
sle_list = sle_map.get(item_row.name)
|
||||
if sle_list:
|
||||
@@ -51,9 +52,17 @@ class StockController(AccountsController):
|
||||
# from warehouse account
|
||||
|
||||
self.check_expense_account(item_row)
|
||||
|
||||
if not sle.stock_value_difference:
|
||||
self.validate_negative_stock(sle)
|
||||
|
||||
# If item is not a sample item
|
||||
# and ( valuation rate not mentioned in an incoming entry
|
||||
# or incoming entry not found while delivering the item),
|
||||
# try to pick valuation rate from previous sle or Item master and update in SLE
|
||||
# Otherwise, throw an exception
|
||||
|
||||
if not sle.stock_value_difference and self.doctype != "Stock Reconciliation" \
|
||||
and not item_row.get("is_sample_item"):
|
||||
|
||||
sle = self.update_stock_ledger_entries(sle)
|
||||
|
||||
gl_list.append(self.get_gl_dict({
|
||||
"account": warehouse_account[sle.warehouse]["name"],
|
||||
@@ -84,13 +93,27 @@ class StockController(AccountsController):
|
||||
"\n".join(warehouse_with_no_account))
|
||||
|
||||
return process_gl_map(gl_list)
|
||||
|
||||
def validate_negative_stock(self, sle):
|
||||
if sle.qty_after_transaction < 0 and sle.actual_qty < 0:
|
||||
frappe.throw(_("For the Item {0}, valuation rate not found for warehouse {1}. To be able to do accounting entries (for booking expenses), we need valuation rate for item {2}. Please create an incoming stock transaction, on or before {3} {4}, and then try submiting {5}")
|
||||
.format(sle.item_code, sle.warehouse,
|
||||
sle.item_code, sle.posting_date, sle.posting_time, self.name))
|
||||
|
||||
def update_stock_ledger_entries(self, sle):
|
||||
sle.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse,
|
||||
self.doctype, self.name)
|
||||
|
||||
sle.stock_value = flt(sle.qty_after_transaction) * flt(sle.valuation_rate)
|
||||
sle.stock_value_difference = flt(sle.actual_qty) * flt(sle.valuation_rate)
|
||||
|
||||
if sle.name:
|
||||
frappe.db.sql("""
|
||||
update
|
||||
`tabStock Ledger Entry`
|
||||
set
|
||||
stock_value = %(stock_value)s,
|
||||
valuation_rate = %(valuation_rate)s,
|
||||
stock_value_difference = %(stock_value_difference)s
|
||||
where
|
||||
name = %(name)s""", (sle))
|
||||
|
||||
return sle
|
||||
|
||||
def get_voucher_details(self, default_expense_account, default_cost_center, sle_map):
|
||||
if self.doctype == "Stock Reconciliation":
|
||||
return [frappe._dict({ "name": voucher_detail_no, "expense_account": default_expense_account,
|
||||
@@ -138,10 +161,18 @@ class StockController(AccountsController):
|
||||
|
||||
def get_stock_ledger_details(self):
|
||||
stock_ledger = {}
|
||||
for sle in frappe.db.sql("""select warehouse, stock_value_difference,
|
||||
voucher_detail_no, item_code, posting_date, posting_time, actual_qty, qty_after_transaction
|
||||
from `tabStock Ledger Entry` where voucher_type=%s and voucher_no=%s""",
|
||||
(self.doctype, self.name), as_dict=True):
|
||||
stock_ledger_entries = frappe.db.sql("""
|
||||
select
|
||||
name, warehouse, stock_value_difference, valuation_rate,
|
||||
voucher_detail_no, item_code, posting_date, posting_time,
|
||||
actual_qty, qty_after_transaction
|
||||
from
|
||||
`tabStock Ledger Entry`
|
||||
where
|
||||
voucher_type=%s and voucher_no=%s
|
||||
""", (self.doctype, self.name), as_dict=True)
|
||||
|
||||
for sle in stock_ledger_entries:
|
||||
stock_ledger.setdefault(sle.voucher_detail_no, []).append(sle)
|
||||
return stock_ledger
|
||||
|
||||
|
||||
@@ -455,10 +455,12 @@ class calculate_taxes_and_totals(object):
|
||||
|
||||
def calculate_paid_amount(self):
|
||||
paid_amount = base_paid_amount = 0.0
|
||||
for payment in self.doc.get('payments'):
|
||||
payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
|
||||
paid_amount += payment.amount
|
||||
base_paid_amount += payment.base_amount
|
||||
|
||||
if self.doc.is_pos:
|
||||
for payment in self.doc.get('payments'):
|
||||
payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
|
||||
paid_amount += payment.amount
|
||||
base_paid_amount += payment.base_amount
|
||||
|
||||
self.doc.paid_amount = flt(paid_amount, self.doc.precision("paid_amount"))
|
||||
self.doc.base_paid_amount = flt(base_paid_amount, self.doc.precision("base_paid_amount"))
|
||||
|
||||
@@ -23,7 +23,7 @@ frappe.ui.form.on("Opportunity", {
|
||||
refresh: function(frm) {
|
||||
var doc = frm.doc;
|
||||
frm.events.enquiry_from(frm);
|
||||
if(doc.status!=="Lost") {
|
||||
if(!doc.__islocal && doc.status!=="Lost") {
|
||||
if(doc.with_items){
|
||||
frm.add_custom_button(__('Supplier Quotation'),
|
||||
function() {
|
||||
@@ -109,7 +109,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
erpnext.toggle_naming_series();
|
||||
|
||||
var frm = cur_frm;
|
||||
if(frm.perm[0].write && doc.docstatus==0) {
|
||||
if(!doc.__islocal && frm.perm[0].write && doc.docstatus==0) {
|
||||
if(frm.doc.status==="Open") {
|
||||
frm.add_custom_button(__("Close"), function() {
|
||||
frm.set_value("status", "Closed");
|
||||
|
||||
@@ -93,7 +93,7 @@ class LeaveAllocation(Document):
|
||||
|
||||
if flt(leaves_taken) > flt(self.total_leaves_allocated):
|
||||
if frappe.db.get_value("Leave Type", self.leave_type, "allow_negative"):
|
||||
frappe.msgprint(_("Note: Total allocated leaves {0} shouldn't be less than already approved leaves {1} for the period").format(self.total_leaves_allocated, leaves_taken), LessAllocationError)
|
||||
frappe.msgprint(_("Note: Total allocated leaves {0} shouldn't be less than already approved leaves {1} for the period").format(self.total_leaves_allocated, leaves_taken))
|
||||
else:
|
||||
frappe.throw(_("Total allocated leaves {0} cannot be less than already approved leaves {1} for the period").format(self.total_leaves_allocated, leaves_taken), LessAllocationError)
|
||||
|
||||
|
||||
@@ -10,6 +10,19 @@ frappe.ui.form.on("Process Payroll", {
|
||||
frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet);
|
||||
},
|
||||
|
||||
setup: function(frm) {
|
||||
frm.set_query("payment_account", function() {
|
||||
var account_types = ["Bank", "Cash"];
|
||||
return {
|
||||
filters: {
|
||||
"account_type": ["in", account_types],
|
||||
"is_group": 0,
|
||||
"company": frm.doc.company
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
frm.disable_save();
|
||||
},
|
||||
@@ -50,16 +63,6 @@ frappe.ui.form.on("Process Payroll", {
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
account: function(frm) {
|
||||
var account_types = ["Bank", "Cash"];
|
||||
return {
|
||||
filters: {
|
||||
"account_type": ["in", account_types],
|
||||
"is_group": 0,
|
||||
"company": frm.doc.company
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -290,10 +290,8 @@ class ProcessPayroll(Document):
|
||||
@frappe.whitelist()
|
||||
def get_start_end_dates(payroll_frequency, start_date=None):
|
||||
'''Returns dict of start and end dates for given payroll frequency based on start_date'''
|
||||
if not payroll_frequency:
|
||||
frappe.throw(_("Please set Payroll Frequency first"))
|
||||
|
||||
if payroll_frequency == "Monthly" or payroll_frequency == "Bimonthly":
|
||||
if payroll_frequency == "Monthly" or payroll_frequency == "Bimonthly" or payroll_frequency == "":
|
||||
fiscal_year = get_fiscal_year(start_date)[0]
|
||||
month = "%02d" % getdate(start_date).month
|
||||
m = get_month_details(fiscal_year, month)
|
||||
|
||||
@@ -2,7 +2,16 @@
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Salary Component', {
|
||||
refresh: function(frm) {
|
||||
|
||||
setup: function(frm) {
|
||||
frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
return {
|
||||
filters: {
|
||||
"root_type": "Expense",
|
||||
"is_group": 0,
|
||||
"company": d.company
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
@@ -304,9 +304,9 @@ class ProductionOrder(Document):
|
||||
|
||||
def get_operations_data(self, data):
|
||||
return {
|
||||
'from_time': data.planned_start_time,
|
||||
'from_time': get_datetime(data.planned_start_time),
|
||||
'hours': data.time_in_mins / 60.0,
|
||||
'to_time': data.planned_end_time,
|
||||
'to_time': get_datetime(data.planned_end_time),
|
||||
'project': self.project,
|
||||
'operation': data.operation,
|
||||
'operation_id': data.name,
|
||||
|
||||
@@ -362,3 +362,5 @@ execute:frappe.delete_doc('Desktop Icon', {'module_name': 'Profit and Loss Statm
|
||||
erpnext.patches.v7_2.update_website_for_variant
|
||||
erpnext.patches.v7_2.update_doctype_status
|
||||
erpnext.patches.v7_2.update_salary_slips
|
||||
erpnext.patches.v7_2.set_null_value_to_fields
|
||||
erpnext.patches.v7_2.update_abbr_in_salary_slips
|
||||
11
erpnext/patches/v7_2/set_null_value_to_fields.py
Normal file
11
erpnext/patches/v7_2/set_null_value_to_fields.py
Normal 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():
|
||||
fields = {"Cost Center": "project", "Project": "cost_center"}
|
||||
for budget_against, field in fields.items():
|
||||
frappe.db.sql(""" update `tabBudget` set {field} = null
|
||||
where budget_against = %s """.format(field = field), budget_against)
|
||||
13
erpnext/patches/v7_2/update_abbr_in_salary_slips.py
Normal file
13
erpnext/patches/v7_2/update_abbr_in_salary_slips.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
frappe.reload_doctype('Salary Slip')
|
||||
if not frappe.db.has_column('Salary Detail', 'abbr'):
|
||||
return
|
||||
|
||||
salary_details = frappe.db.sql("""select abbr, salary_component, name from `tabSalary Detail`
|
||||
where abbr is null or abbr = ''""", as_dict=True)
|
||||
|
||||
for salary_detail in salary_details:
|
||||
salary_component_abbr = frappe.get_value("Salary Component", salary_detail.salary_component, "salary_component_abbr")
|
||||
frappe.db.sql("""update `tabSalary Detail` set abbr = %s where name = %s""",(salary_component_abbr, salary_detail.name))
|
||||
@@ -2,6 +2,10 @@ import frappe
|
||||
from erpnext.hr.doctype.process_payroll.process_payroll import get_month_details
|
||||
|
||||
def execute():
|
||||
ss_columns = frappe.db.get_table_columns("Salary Slip")
|
||||
if "fiscal_year" not in ss_columns or "month" not in ss_columns:
|
||||
return
|
||||
|
||||
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
|
||||
|
||||
@@ -8,6 +8,8 @@ from frappe.utils import flt, getdate, get_url
|
||||
from frappe import _
|
||||
|
||||
from frappe.model.document import Document
|
||||
from erpnext.controllers.queries import get_filters_cond
|
||||
from frappe.desk.reportview import get_match_cond
|
||||
|
||||
class Project(Document):
|
||||
def get_feed(self):
|
||||
@@ -215,12 +217,29 @@ def get_list_context(context=None):
|
||||
}
|
||||
|
||||
def get_users_for_project(doctype, txt, searchfield, start, page_len, filters):
|
||||
return frappe.db.sql("""select name, concat_ws(' ', first_name, middle_name, last_name)
|
||||
conditions = []
|
||||
return frappe.db.sql("""select name, concat_ws(' ', first_name, middle_name, last_name)
|
||||
from `tabUser`
|
||||
where enabled=1
|
||||
and name not in ("Guest", "Administrator")
|
||||
and name not in ("Guest", "Administrator")
|
||||
and ({key} like %(txt)s
|
||||
or full_name like %(txt)s)
|
||||
{fcond} {mcond}
|
||||
order by
|
||||
name asc""")
|
||||
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
|
||||
if(locate(%(_txt)s, full_name), locate(%(_txt)s, full_name), 99999),
|
||||
idx desc,
|
||||
name, full_name
|
||||
limit %(start)s, %(page_len)s""".format(**{
|
||||
'key': searchfield,
|
||||
'fcond': get_filters_cond(doctype, filters, conditions),
|
||||
'mcond': get_match_cond(doctype)
|
||||
}), {
|
||||
'txt': "%%%s%%" % txt,
|
||||
'_txt': txt.replace("%", ""),
|
||||
'start': start,
|
||||
'page_len': page_len
|
||||
})
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_cost_center_name(project):
|
||||
|
||||
@@ -588,11 +588,13 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
||||
calculate_paid_amount: function(){
|
||||
var me = this;
|
||||
var paid_amount = base_paid_amount = 0.0;
|
||||
$.each(this.frm.doc['payments'] || [], function(index, data){
|
||||
data.base_amount = flt(data.amount * me.frm.doc.conversion_rate, precision("base_amount"));
|
||||
paid_amount += data.amount;
|
||||
base_paid_amount += data.base_amount;
|
||||
})
|
||||
if(this.frm.doc.is_pos) {
|
||||
$.each(this.frm.doc['payments'] || [], function(index, data){
|
||||
data.base_amount = flt(data.amount * me.frm.doc.conversion_rate, precision("base_amount"));
|
||||
paid_amount += data.amount;
|
||||
base_paid_amount += data.base_amount;
|
||||
})
|
||||
}
|
||||
|
||||
this.frm.doc.paid_amount = flt(paid_amount, precision("paid_amount"));
|
||||
this.frm.doc.base_paid_amount = flt(base_paid_amount, precision("base_paid_amount"));
|
||||
|
||||
@@ -28,7 +28,6 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
||||
|
||||
def on_update(self):
|
||||
NestedSet.on_update(self)
|
||||
WebsiteGenerator.on_update(self)
|
||||
invalidate_cache_for(self)
|
||||
self.validate_name_with_item()
|
||||
self.validate_one_root()
|
||||
|
||||
@@ -1476,6 +1476,34 @@
|
||||
"unique": 0,
|
||||
"width": "120px"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "is_sample_item",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Sample Item",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -1691,7 +1719,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-12-24 12:33:37.728117",
|
||||
"modified": "2017-02-07 01:22:03.047137",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delivery Note Item",
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -54,6 +55,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Series",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -82,6 +84,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Code",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -112,6 +115,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Variant Of",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -140,6 +144,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -168,6 +173,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Barcode",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -195,6 +201,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Item Group",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -225,6 +232,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Default Unit of Measure",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -254,6 +262,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -279,6 +288,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Disabled",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -308,6 +318,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Maintain Stock",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -338,6 +349,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Opening Stock",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -353,39 +365,40 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:(doc.__islocal && doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no && doc.opening_stock)",
|
||||
"fieldname": "valuation_rate",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Valuation Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:(doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)",
|
||||
"fieldname": "valuation_rate",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Valuation Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "standard_rate",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@@ -393,6 +406,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Standard Selling Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -420,6 +434,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Fixed Asset",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -448,6 +463,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Asset Category",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -476,6 +492,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Image",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -504,6 +521,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Description",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -531,6 +549,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Brand",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -560,6 +579,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Description",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -590,6 +610,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Inventory",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -620,6 +641,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Default Warehouse",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -651,6 +673,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "End of Life",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -681,6 +704,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Has Batch No",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -713,6 +737,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Has Serial No",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -744,6 +769,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Serial Number Series",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -771,6 +797,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Default Material Request Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -800,6 +827,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Column Break",
|
||||
@@ -829,6 +857,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Allow over delivery or receipt upto this percent",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -858,6 +887,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Valuation Method",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -886,6 +916,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Warranty Period (in days)",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -916,6 +947,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Net Weight",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -943,6 +975,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Weight UOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -972,6 +1005,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Auto re-order",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1001,6 +1035,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Reorder level based on Warehouse",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1030,6 +1065,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Variants",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1060,6 +1096,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Has Variants",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -1089,6 +1126,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Attributes",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -1117,6 +1155,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Purchase Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1146,6 +1185,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Purchase Item",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1176,6 +1216,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Minimum Order Qty",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1204,6 +1245,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Safety Stock",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1233,6 +1275,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Lead Time in days",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1263,6 +1306,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Default Buying Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1294,6 +1338,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Default Expense Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1324,6 +1369,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Unit of Measure Conversion",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1353,6 +1399,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "UOMs",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -1383,6 +1430,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Last Purchase Rate",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -1412,6 +1460,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Supplier Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1440,6 +1489,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Default Supplier",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1467,6 +1517,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Delivered by Supplier (Drop Ship)",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1495,6 +1546,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Manufacturer",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1523,6 +1575,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Manufacturer Part Number",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1550,6 +1603,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Code for Suppliers",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1579,6 +1633,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Supplier Items",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1606,6 +1661,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Sales Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1635,6 +1691,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Sales Item",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1664,6 +1721,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Publish in Hub",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1692,6 +1750,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Synced With Hub",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1720,6 +1779,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Default Income Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1748,6 +1808,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Default Selling Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1776,6 +1837,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Customer Item Codes",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1806,6 +1868,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Customer Items",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1834,6 +1897,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Max Discount (%)",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1862,6 +1926,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Tax",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1891,6 +1956,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Taxes",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1920,6 +1986,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Inspection Criteria",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1949,6 +2016,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Inspection Required before Purchase",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1978,6 +2046,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Inspection Required before Delivery",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2007,6 +2076,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Quality Parameters",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2037,6 +2107,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Manufacturing",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2066,6 +2137,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Default BOM",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -2097,6 +2169,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Supply Raw Materials for Purchase",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2126,6 +2199,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -2152,6 +2226,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Customer Code",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -2178,6 +2253,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Website",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2206,6 +2282,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Show in Website",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2233,6 +2310,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Show in Website (Variant)",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2261,6 +2339,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Route",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2290,6 +2369,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Weightage",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2318,6 +2398,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Slideshow",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2347,6 +2428,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Image",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2374,6 +2456,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Thumbnail",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2401,6 +2484,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -2428,6 +2512,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Website Warehouse",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2457,6 +2542,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Website Item Groups",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2486,6 +2572,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Website Specifications",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2513,6 +2600,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Copy From Item Group",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2540,6 +2628,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Website Specifications",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2568,6 +2657,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Website Description",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2594,6 +2684,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Total Projected Qty",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -2622,7 +2713,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 1,
|
||||
"modified": "2017-01-10 12:02:51.807965",
|
||||
"modified": "2017-01-18 17:43:20.262925",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Item",
|
||||
|
||||
@@ -93,7 +93,6 @@ class Item(WebsiteGenerator):
|
||||
where parentfield='website_item_groups' and parenttype='Item' and parent=%s""", self.name)
|
||||
|
||||
def on_update(self):
|
||||
super(Item, self).on_update()
|
||||
invalidate_cache_for_item(self)
|
||||
self.validate_name_with_item_group()
|
||||
self.update_item_price()
|
||||
@@ -452,24 +451,32 @@ class Item(WebsiteGenerator):
|
||||
"valuation_method", "has_batch_no", "is_fixed_asset")
|
||||
|
||||
vals = frappe.db.get_value("Item", self.name, to_check, as_dict=True)
|
||||
if not vals.get('valuation_method') and self.get('valuation_method'):
|
||||
vals['valuation_method'] = frappe.db.get_single_value("Stock Settings", "valuation_method") or "FIFO"
|
||||
|
||||
if vals:
|
||||
for key in to_check:
|
||||
if self.get(key) != vals.get(key):
|
||||
if not self.check_if_linked_document_exists():
|
||||
if cstr(self.get(key)) != cstr(vals.get(key)):
|
||||
if not self.check_if_linked_document_exists(key):
|
||||
break # no linked document, allowed
|
||||
else:
|
||||
frappe.throw(_("As there are existing transactions for this item, you can not change the value of {0}").format(frappe.bold(self.meta.get_label(key))))
|
||||
frappe.throw(_("As there are existing transactions against item {0}, you can not change the value of {1}").format(self.name, frappe.bold(self.meta.get_label(key))))
|
||||
|
||||
if vals and not self.is_fixed_asset and self.is_fixed_asset != vals.is_fixed_asset:
|
||||
asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1)
|
||||
if asset:
|
||||
frappe.throw(_('"Is Fixed Asset" cannot be unchecked, as Asset record exists against the item'))
|
||||
|
||||
def check_if_linked_document_exists(self):
|
||||
for doctype in ("Sales Order Item", "Delivery Note Item", "Sales Invoice Item",
|
||||
"Material Request Item", "Purchase Order Item", "Purchase Receipt Item",
|
||||
"Purchase Invoice Item", "Stock Entry Detail", "Stock Reconciliation Item"):
|
||||
def check_if_linked_document_exists(self, key):
|
||||
linked_doctypes = ["Delivery Note Item", "Sales Invoice Item", "Purchase Receipt Item",
|
||||
"Purchase Invoice Item", "Stock Entry Detail", "Stock Reconciliation Item"]
|
||||
|
||||
# For "Is Stock Item", following doctypes is important
|
||||
# because reserved_qty, ordered_qty and requested_qty updated from these doctypes
|
||||
if key == "is_stock_item":
|
||||
linked_doctypes += ["Sales Order Item", "Purchase Order Item", "Material Request Item"]
|
||||
|
||||
for doctype in linked_doctypes:
|
||||
if frappe.db.get_value(doctype, filters={"item_code": self.name, "docstatus": 1}) or \
|
||||
frappe.db.get_value("Production Order",
|
||||
filters={"production_item": self.name, "docstatus": 1}):
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"item_group": "_Test Item Group",
|
||||
"item_name": "_Test Item",
|
||||
"apply_warehouse_wise_reorder_level": 1,
|
||||
"valuation_rate": 100,
|
||||
"reorder_levels": [
|
||||
{
|
||||
"material_request_type": "Purchase",
|
||||
@@ -61,6 +62,7 @@
|
||||
"item_code": "_Test Item Home Desktop 100",
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test Item Home Desktop 100",
|
||||
"valuation_rate": 100,
|
||||
"taxes": [
|
||||
{
|
||||
"doctype": "Item Tax",
|
||||
|
||||
@@ -12,22 +12,23 @@ class LandedCostVoucher(Document):
|
||||
def get_items_from_purchase_receipts(self):
|
||||
self.set("items", [])
|
||||
for pr in self.get("purchase_receipts"):
|
||||
pr_items = frappe.db.sql("""select pr_item.item_code, pr_item.description,
|
||||
pr_item.qty, pr_item.base_rate, pr_item.base_amount, pr_item.name
|
||||
from `tab{doctype} Item` pr_item where parent = %s
|
||||
and exists(select name from tabItem where name = pr_item.item_code and is_stock_item = 1)
|
||||
""".format(doctype=pr.receipt_document_type), pr.receipt_document, as_dict=True)
|
||||
if pr.receipt_document_type and pr.receipt_document:
|
||||
pr_items = frappe.db.sql("""select pr_item.item_code, pr_item.description,
|
||||
pr_item.qty, pr_item.base_rate, pr_item.base_amount, pr_item.name
|
||||
from `tab{doctype} Item` pr_item where parent = %s
|
||||
and exists(select name from tabItem where name = pr_item.item_code and is_stock_item = 1)
|
||||
""".format(doctype=pr.receipt_document_type), pr.receipt_document, as_dict=True)
|
||||
|
||||
for d in pr_items:
|
||||
item = self.append("items")
|
||||
item.item_code = d.item_code
|
||||
item.description = d.description
|
||||
item.qty = d.qty
|
||||
item.rate = d.base_rate
|
||||
item.amount = d.base_amount
|
||||
item.receipt_document_type = pr.receipt_document_type
|
||||
item.receipt_document = pr.receipt_document
|
||||
item.purchase_receipt_item = d.name
|
||||
for d in pr_items:
|
||||
item = self.append("items")
|
||||
item.item_code = d.item_code
|
||||
item.description = d.description
|
||||
item.qty = d.qty
|
||||
item.rate = d.base_rate
|
||||
item.amount = d.base_amount
|
||||
item.receipt_document_type = pr.receipt_document_type
|
||||
item.receipt_document = pr.receipt_document
|
||||
item.purchase_receipt_item = d.name
|
||||
|
||||
if self.get("taxes"):
|
||||
self.set_applicable_charges_for_item()
|
||||
|
||||
@@ -1574,6 +1574,34 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "is_sample_item",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Sample Item",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -1885,7 +1913,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-16 16:04:21.778869",
|
||||
"modified": "2017-02-07 01:21:36.348032",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Purchase Receipt Item",
|
||||
|
||||
@@ -219,9 +219,9 @@ class StockEntry(StockController):
|
||||
|
||||
# validate qty during submit
|
||||
if d.docstatus==1 and d.s_warehouse and not allow_negative_stock and d.actual_qty < d.transfer_qty:
|
||||
frappe.throw(_("Row {0}: Qty not available for {4} in warehouse {1} at posting time of the entry ({2} {3})".format(d.idx,
|
||||
frappe.throw(_("Row {0}: Qty not available for {4} in warehouse {1} at posting time of the entry ({2} {3})").format(d.idx,
|
||||
frappe.bold(d.s_warehouse), formatdate(self.posting_date),
|
||||
format_time(self.posting_time), frappe.bold(d.item_code)))
|
||||
format_time(self.posting_time), frappe.bold(d.item_code))
|
||||
+ '<br><br>' + _("Available qty is {0}, you need {1}").format(frappe.bold(d.actual_qty),
|
||||
frappe.bold(d.transfer_qty)),
|
||||
NegativeStockError, title=_('Insufficient Stock'))
|
||||
@@ -867,4 +867,4 @@ def get_warehouse_details(args):
|
||||
"basic_rate" : get_incoming_rate(args)
|
||||
}
|
||||
|
||||
return ret
|
||||
return ret
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"doctype": "DocType",
|
||||
"document_type": "Other",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
@@ -23,6 +24,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Barcode",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -50,6 +52,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -76,6 +79,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Source Warehouse",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -105,6 +109,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -130,6 +135,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Target Warehouse",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -159,6 +165,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -184,6 +191,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Code",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -213,6 +221,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -238,6 +247,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -264,6 +274,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Description",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -291,6 +302,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Description",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -321,6 +333,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -347,6 +360,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Image",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -374,6 +388,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Image View",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -402,6 +417,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Quantity and Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -420,7 +436,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 1,
|
||||
"columns": 3,
|
||||
"fieldname": "qty",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
@@ -428,6 +444,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Qty",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -448,14 +465,15 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 2,
|
||||
"columns": 0,
|
||||
"fieldname": "basic_rate",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Basic Rate (as per Stock UOM)",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -485,6 +503,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Basic Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -513,6 +532,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Additional Cost",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -541,6 +561,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -570,6 +591,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Valuation Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -598,6 +620,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -623,6 +646,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "UOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -652,6 +676,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Conversion Factor",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -680,6 +705,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Stock UOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -709,6 +735,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Qty as per Stock UOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -737,6 +764,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Serial No / Batch",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -763,6 +791,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Serial No",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -791,6 +820,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -816,6 +846,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Batch No",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -845,6 +876,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Accounting",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -872,6 +904,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Difference Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -899,6 +932,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -926,6 +960,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -953,6 +988,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "More Information",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -967,6 +1003,34 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "is_sample_item",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Sample Item",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
@@ -979,6 +1043,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Actual Qty (at source/target)",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -1008,6 +1073,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "BOM No",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -1035,6 +1101,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -1061,6 +1128,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Material Request",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -1088,6 +1156,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Material Request Item",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -1114,7 +1183,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-27 15:19:26.597414",
|
||||
"modified": "2017-02-07 01:21:14.367586",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Entry Detail",
|
||||
|
||||
@@ -258,7 +258,14 @@ class update_entries_after(object):
|
||||
|
||||
if not self.valuation_rate and actual_qty > 0:
|
||||
self.valuation_rate = sle.incoming_rate
|
||||
|
||||
|
||||
# Get valuation rate from previous SLE or Item master, if item is not a sample item
|
||||
if not self.valuation_rate and sle.voucher_detail_no:
|
||||
is_sample_item = self.check_if_sample_item(sle.voucher_type, sle.voucher_detail_no)
|
||||
if not is_sample_item:
|
||||
self.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse,
|
||||
sle.voucher_type, sle.voucher_no, self.allow_zero_rate)
|
||||
|
||||
def get_fifo_values(self, sle):
|
||||
incoming_rate = flt(sle.incoming_rate)
|
||||
actual_qty = flt(sle.actual_qty)
|
||||
@@ -281,10 +288,14 @@ class update_entries_after(object):
|
||||
qty_to_pop = abs(actual_qty)
|
||||
while qty_to_pop:
|
||||
if not self.stock_queue:
|
||||
if self.qty_after_transaction > 0:
|
||||
_rate = get_valuation_rate(sle.item_code, sle.warehouse, self.allow_zero_rate)
|
||||
# Get valuation rate from last sle if exists or from valuation rate field in item master
|
||||
is_sample_item = self.check_if_sample_item(sle.voucher_type, sle.voucher_detail_no)
|
||||
if not is_sample_item:
|
||||
_rate = get_valuation_rate(sle.item_code, sle.warehouse,
|
||||
sle.voucher_type, sle.voucher_no, self.allow_zero_rate)
|
||||
else:
|
||||
_rate = 0
|
||||
|
||||
self.stock_queue.append([0, _rate])
|
||||
|
||||
index = None
|
||||
@@ -330,7 +341,11 @@ class update_entries_after(object):
|
||||
|
||||
if not self.stock_queue:
|
||||
self.stock_queue.append([0, sle.incoming_rate or sle.outgoing_rate or self.valuation_rate])
|
||||
|
||||
|
||||
def check_if_sample_item(self, voucher_type, voucher_detail_no):
|
||||
ref_item_dt = voucher_type + (" Detail" if voucher_type == "Stock Entry" else " Item")
|
||||
return frappe.db.get_value(ref_item_dt, voucher_detail_no, "is_sample_item")
|
||||
|
||||
def get_sle_before_datetime(self):
|
||||
"""get previous stock ledger entry before current time-bucket"""
|
||||
return get_stock_ledger_entries(self.args, "<", "desc", "limit 1", for_update=False)
|
||||
@@ -404,7 +419,8 @@ def get_stock_ledger_entries(previous_sle, operator=None, order="desc", limit=No
|
||||
"order": order
|
||||
}, previous_sle, as_dict=1, debug=debug)
|
||||
|
||||
def get_valuation_rate(item_code, warehouse, allow_zero_rate=False):
|
||||
def get_valuation_rate(item_code, warehouse, voucher_type, voucher_no, allow_zero_rate=False):
|
||||
# Get valuation rate from last sle for the same item and warehouse
|
||||
last_valuation_rate = frappe.db.sql("""select valuation_rate
|
||||
from `tabStock Ledger Entry`
|
||||
where item_code = %s and warehouse = %s
|
||||
@@ -412,6 +428,7 @@ def get_valuation_rate(item_code, warehouse, allow_zero_rate=False):
|
||||
order by posting_date desc, posting_time desc, name desc limit 1""", (item_code, warehouse))
|
||||
|
||||
if not last_valuation_rate:
|
||||
# Get valuation rate from last sle for the item against any warehouse
|
||||
last_valuation_rate = frappe.db.sql("""select valuation_rate
|
||||
from `tabStock Ledger Entry`
|
||||
where item_code = %s and valuation_rate > 0
|
||||
@@ -420,9 +437,13 @@ def get_valuation_rate(item_code, warehouse, allow_zero_rate=False):
|
||||
valuation_rate = flt(last_valuation_rate[0][0]) if last_valuation_rate else 0
|
||||
|
||||
if not valuation_rate:
|
||||
valuation_rate = frappe.db.get_value("Item Price", {"item_code": item_code, "buying": 1}, "price_list_rate")
|
||||
# If negative stock allowed, and item delivered without any incoming entry,
|
||||
# syste does not found any SLE, then take valuation rate from Item
|
||||
valuation_rate = frappe.db.get_value("Item", item_code, "valuation_rate")
|
||||
|
||||
if not allow_zero_rate and not valuation_rate and cint(frappe.db.get_value("Accounts Settings", None, "auto_accounting_for_stock")):
|
||||
frappe.throw(_("Purchase rate for item: {0} not found, which is required to book accounting entry (expense). Please mention item price against a buying price list.").format(item_code))
|
||||
if not allow_zero_rate and not valuation_rate \
|
||||
and cint(frappe.db.get_value("Accounts Settings", None, "auto_accounting_for_stock")):
|
||||
|
||||
frappe.throw(_("Valuation rate not found for the Item {0}, which is required to do accounting entries for {1} {2}. If the item is transacting as a sample item in the {1}, please mention that in the {1} Item table. Otherwise, please create an incoming stock transaction for the item or mention valuation rate in the Item record, and then try submiting/cancelling this entry").format(item_code, voucher_type, voucher_no))
|
||||
|
||||
return valuation_rate
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
{% endif %}
|
||||
<p style='margin-top: 30px'>
|
||||
<a class='btn btn-primary'
|
||||
href='/job_application?job_title={{ doc.name }}'>
|
||||
href='/job_application?new=1&job_title={{ doc.name }}'>
|
||||
{{ _("Apply Now") }}</a>
|
||||
</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user