Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
275c04c1f7
@ -34,6 +34,8 @@ cur_frm.cscript.onload = function(doc,cdt,cdn){
|
|||||||
cur_frm.set_df_property("exp_approver", "options", r.message);
|
cur_frm.set_df_property("exp_approver", "options", r.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.clear_sanctioned = function(doc) {
|
cur_frm.cscript.clear_sanctioned = function(doc) {
|
||||||
|
@ -17,12 +17,12 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
from webnotes.utils import add_days, cint, cstr, default_fields, flt, getdate, now, nowdate
|
from webnotes.utils import add_days, cint, cstr, default_fields, flt, getdate, now, nowdate, formatdate
|
||||||
from webnotes.model import db_exists
|
from webnotes.model import db_exists
|
||||||
from webnotes.model.doc import addchild
|
from webnotes.model.doc import addchild
|
||||||
from webnotes.model.wrapper import getlist, copy_doclist
|
from webnotes.model.wrapper import getlist, copy_doclist
|
||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
from webnotes import form, msgprint
|
from webnotes import form, msgprint, _
|
||||||
|
|
||||||
get_value = webnotes.conn.get_value
|
get_value = webnotes.conn.get_value
|
||||||
|
|
||||||
@ -604,14 +604,15 @@ class DocType(TransactionBase):
|
|||||||
exact_outstanding = flt(tot_outstanding) + flt(grand_total)
|
exact_outstanding = flt(tot_outstanding) + flt(grand_total)
|
||||||
get_obj('Account',acc_head[0][0]).check_credit_limit(acc_head[0][0], obj.doc.company, exact_outstanding)
|
get_obj('Account',acc_head[0][0]).check_credit_limit(acc_head[0][0], obj.doc.company, exact_outstanding)
|
||||||
|
|
||||||
def validate_fiscal_year(self,fiscal_year,transaction_date,dn):
|
def validate_fiscal_year(self, fiscal_year, transaction_date, label):
|
||||||
fy=webnotes.conn.sql("select year_start_date from `tabFiscal Year` where name='%s'"%fiscal_year)
|
from accounts.utils import get_fiscal_year
|
||||||
ysd=fy and fy[0][0] or ""
|
if get_fiscal_year(transaction_date)[0] != fiscal_year:
|
||||||
yed=add_days(str(ysd),365)
|
msgprint(("%(label)s '%(posting_date)s': " + _("not within Fiscal Year") + \
|
||||||
if str(transaction_date) < str(ysd) or str(transaction_date) > str(yed):
|
": '%(fiscal_year)s'") % {
|
||||||
msgprint("%s not within the fiscal year"%(dn))
|
"label": label,
|
||||||
raise Exception
|
"posting_date": formatdate(transaction_date),
|
||||||
|
"fiscal_year": fiscal_year
|
||||||
|
}, raise_exception=1)
|
||||||
|
|
||||||
# get against document date self.prevdoc_date_field
|
# get against document date self.prevdoc_date_field
|
||||||
#-----------------------------
|
#-----------------------------
|
||||||
|
@ -34,8 +34,6 @@ def delete_transactions():
|
|||||||
for t in webnotes.conn.sql("select options from tabDocField where parent='%s' and fieldtype='Table'" % d):
|
for t in webnotes.conn.sql("select options from tabDocField where parent='%s' and fieldtype='Table'" % d):
|
||||||
webnotes.conn.sql("delete from `tab%s`" % (t))
|
webnotes.conn.sql("delete from `tab%s`" % (t))
|
||||||
webnotes.conn.sql("delete from `tab%s`" % (d))
|
webnotes.conn.sql("delete from `tab%s`" % (d))
|
||||||
webnotes.conn.sql("COMMIT")
|
|
||||||
webnotes.conn.sql("START TRANSACTION")
|
|
||||||
print "Deleted " + d
|
print "Deleted " + d
|
||||||
|
|
||||||
|
|
||||||
@ -101,8 +99,6 @@ def delete_masters():
|
|||||||
webnotes.conn.sql("delete from `tab%s`" % (t))
|
webnotes.conn.sql("delete from `tab%s`" % (t))
|
||||||
lst = '"'+'","'.join(masters[d])+ '"'
|
lst = '"'+'","'.join(masters[d])+ '"'
|
||||||
webnotes.conn.sql("delete from `tab%s` where name not in (%s)" % (d, lst))
|
webnotes.conn.sql("delete from `tab%s` where name not in (%s)" % (d, lst))
|
||||||
webnotes.conn.sql("COMMIT")
|
|
||||||
webnotes.conn.sql("START TRANSACTION")
|
|
||||||
print "Deleted " + d
|
print "Deleted " + d
|
||||||
|
|
||||||
|
|
||||||
@ -131,8 +127,6 @@ def delete_main_masters():
|
|||||||
for t in webnotes.conn.sql("select options from tabDocField where parent='%s' and fieldtype='Table'" % d):
|
for t in webnotes.conn.sql("select options from tabDocField where parent='%s' and fieldtype='Table'" % d):
|
||||||
webnotes.conn.sql("delete from `tab%s`" % (t))
|
webnotes.conn.sql("delete from `tab%s`" % (t))
|
||||||
webnotes.conn.sql("delete from `tab%s`" % (d))
|
webnotes.conn.sql("delete from `tab%s`" % (d))
|
||||||
webnotes.conn.sql("COMMIT")
|
|
||||||
webnotes.conn.sql("START TRANSACTION")
|
|
||||||
print "Deleted " + d
|
print "Deleted " + d
|
||||||
|
|
||||||
|
|
||||||
@ -171,6 +165,7 @@ def reset_global_defaults():
|
|||||||
|
|
||||||
def run():
|
def run():
|
||||||
webnotes.connect()
|
webnotes.connect()
|
||||||
|
webnotes.conn.begin()
|
||||||
|
|
||||||
# Confirmation from user
|
# Confirmation from user
|
||||||
confirm = ''
|
confirm = ''
|
||||||
@ -192,14 +187,17 @@ def run():
|
|||||||
delete_transactions()
|
delete_transactions()
|
||||||
|
|
||||||
if cleanup_type == '1':
|
if cleanup_type == '1':
|
||||||
|
print "Reset Transaction Series"
|
||||||
reset_transaction_series()
|
reset_transaction_series()
|
||||||
else:
|
else:
|
||||||
delete_masters()
|
delete_masters()
|
||||||
|
print "Reset All Series"
|
||||||
reset_all_series()
|
reset_all_series()
|
||||||
delete_main_masters()
|
delete_main_masters()
|
||||||
reset_global_defaults()
|
reset_global_defaults()
|
||||||
|
|
||||||
print "System cleaned up succesfully"
|
print "System cleaned up succesfully"
|
||||||
|
webnotes.conn.commit()
|
||||||
webnotes.conn.close()
|
webnotes.conn.close()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user