mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 06:59:20 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
@@ -83,7 +83,7 @@ class DocType:
|
|||||||
|
|
||||||
# Account name must be unique
|
# Account name must be unique
|
||||||
def validate_duplicate_account(self):
|
def validate_duplicate_account(self):
|
||||||
if (self.doc.__islocal or (not self.doc.name)) and sql("select name from tabAccount where account_name=%s and company=%s", (self.doc.account_name, self.doc.company)):
|
if (self.doc.fields.get('__islocal') or (not self.doc.name)) and sql("select name from tabAccount where account_name=%s and company=%s", (self.doc.account_name, self.doc.company)):
|
||||||
msgprint("Account Name already exists, please rename", raise_exception=1)
|
msgprint("Account Name already exists, please rename", raise_exception=1)
|
||||||
|
|
||||||
# validate root details
|
# validate root details
|
||||||
|
|||||||
@@ -63,6 +63,13 @@ class DocType:
|
|||||||
vouchers = []
|
vouchers = []
|
||||||
for d in getlist(self.doclist, 'entries'):
|
for d in getlist(self.doclist, 'entries'):
|
||||||
if d.clearance_date:
|
if d.clearance_date:
|
||||||
|
if getdate(d.clearance_date) < getdate(d.cheque_date):
|
||||||
|
msgprint("Clearance Date can not be before Cheque Date (Row #%s)" %
|
||||||
|
d.idx, raise_exception=1)
|
||||||
|
if getdate(d.clearance_date) < getdate(d.posting_date):
|
||||||
|
msgprint("Clearance Date can not be before Posting Date (Row #%s)" %
|
||||||
|
d.idx, raise_exception=1)
|
||||||
|
|
||||||
sql("update `tabJournal Voucher` set clearance_date = %s, modified = %s where name=%s", (d.clearance_date, nowdate(), d.voucher_id))
|
sql("update `tabJournal Voucher` set clearance_date = %s, modified = %s where name=%s", (d.clearance_date, nowdate(), d.voucher_id))
|
||||||
vouchers.append(d.voucher_id)
|
vouchers.append(d.voucher_id)
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,8 @@ wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({
|
|||||||
|
|
||||||
prepare_data: function(data) {
|
prepare_data: function(data) {
|
||||||
this._super(data);
|
this._super(data);
|
||||||
data.paid = flt(
|
data.paid = data.docstatus == 1 ?
|
||||||
((data.grand_total - data.outstanding_amount) / data.grand_total) * 100,
|
flt(((data.grand_total - data.outstanding_amount) / data.grand_total) * 100, 2) : 0;
|
||||||
2);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({
|
|||||||
},
|
},
|
||||||
prepare_data: function(data) {
|
prepare_data: function(data) {
|
||||||
this._super(data);
|
this._super(data);
|
||||||
data.paid = flt((data.grand_total - data.outstanding_amount) / data.grand_total * 100, 2);
|
data.paid = (data.docstatus == 1) ?
|
||||||
|
flt((data.grand_total - data.outstanding_amount) / data.grand_total * 100, 2) : 0;
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{width: '3%', content: 'check'},
|
{width: '3%', content: 'check'},
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import webnotes
|
|||||||
def execute():
|
def execute():
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
try:
|
try:
|
||||||
webnotes.conn.sql("""alter table `tabStock Ledger Entry` add index posting_sort_index(posting_date, posting_time, name)""")webnotes.conn.commit()
|
webnotes.conn.sql("""alter table `tabStock Ledger Entry` add index posting_sort_index(posting_date, posting_time, name)""")
|
||||||
|
webnotes.conn.commit()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if e.args[0]!=1061: raise e
|
if e.args[0]!=1061: raise e
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ class DocType:
|
|||||||
def __init__(self,d,dl):
|
def __init__(self,d,dl):
|
||||||
self.doc, self.doclist = d,dl
|
self.doc, self.doclist = d,dl
|
||||||
|
|
||||||
|
def validate(self):
|
||||||
|
if self.doc.fields.get('__islocal') and len(self.doc.abbr) > 5:
|
||||||
|
webnotes.msgprint("Abbreviation cannot have more than 5 characters",
|
||||||
|
raise_exception=1)
|
||||||
|
|
||||||
# Create default accounts
|
# Create default accounts
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
def create_default_accounts(self):
|
def create_default_accounts(self):
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ cur_frm.cscript.refresh = function(doc) {
|
|||||||
// make sensitive fields(has_serial_no, is_stock_item, valuation_method)
|
// make sensitive fields(has_serial_no, is_stock_item, valuation_method)
|
||||||
// read only if any stock ledger entry exists
|
// read only if any stock ledger entry exists
|
||||||
|
|
||||||
|
if (!doc.__islocal) {
|
||||||
|
set_field_permlevel("item_code", 1);
|
||||||
|
}
|
||||||
|
|
||||||
if ((!doc.__islocal) && (doc.is_stock_item == 'Yes')) {
|
if ((!doc.__islocal) && (doc.is_stock_item == 'Yes')) {
|
||||||
var callback = function(r, rt) {
|
var callback = function(r, rt) {
|
||||||
if (r.message == 'exists') permlevel = 1;
|
if (r.message == 'exists') permlevel = 1;
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ class DocType(TransactionBase):
|
|||||||
|
|
||||||
def check_if_last_visit(self):
|
def check_if_last_visit(self):
|
||||||
"""check if last maintenance visit against same sales order/ customer issue"""
|
"""check if last maintenance visit against same sales order/ customer issue"""
|
||||||
|
check_for_docname = check_for_doctype = None
|
||||||
for d in getlist(self.doclist, 'maintenance_visit_details'):
|
for d in getlist(self.doclist, 'maintenance_visit_details'):
|
||||||
if d.prevdoc_docname:
|
if d.prevdoc_docname:
|
||||||
check_for_docname = d.prevdoc_docname
|
check_for_docname = d.prevdoc_docname
|
||||||
|
|||||||
Reference in New Issue
Block a user