mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
@@ -421,8 +421,8 @@ class DocType(TransactionBase):
|
|||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
def validate_pos(self):
|
def validate_pos(self):
|
||||||
if not self.doc.cash_bank_account:
|
if not self.doc.cash_bank_account and flt(self.doc.paid_amount):
|
||||||
msgprint("Cash/Bank Account is mandatory for POS entry")
|
msgprint("Cash/Bank Account is mandatory for POS, for making payment entry")
|
||||||
raise Exception
|
raise Exception
|
||||||
if (flt(self.doc.paid_amount) + flt(self.doc.write_off_amount) - round(flt(self.doc.grand_total), 2))>0.001:
|
if (flt(self.doc.paid_amount) + flt(self.doc.write_off_amount) - round(flt(self.doc.grand_total), 2))>0.001:
|
||||||
msgprint("(Paid amount + Write Off Amount) can not be greater than Grand Total")
|
msgprint("(Paid amount + Write Off Amount) can not be greater than Grand Total")
|
||||||
@@ -676,8 +676,14 @@ class DocType(TransactionBase):
|
|||||||
if not d.warehouse:
|
if not d.warehouse:
|
||||||
d.warehouse = cstr(w)
|
d.warehouse = cstr(w)
|
||||||
|
|
||||||
if flt(self.doc.paid_amount) == 0:
|
if flt(self.doc.paid_amount) == 0:
|
||||||
webnotes.conn.set(self.doc,'paid_amount',(flt(self.doc.grand_total) - flt(self.doc.write_off_amount)))
|
if self.doc.cash_bank_account:
|
||||||
|
webnotes.conn.set(self.doc, 'paid_amount',
|
||||||
|
(flt(self.doc.grand_total) - flt(self.doc.write_off_amount)))
|
||||||
|
else:
|
||||||
|
# show message that the amount is not paid
|
||||||
|
webnotes.conn.set(self.doc,'paid_amount',0)
|
||||||
|
webnotes.msgprint("Note: Payment Entry not created since 'Cash/Bank Account' was not specified.")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
webnotes.conn.set(self.doc,'paid_amount',0)
|
webnotes.conn.set(self.doc,'paid_amount',0)
|
||||||
|
|||||||
@@ -407,9 +407,21 @@ class DocType(TransactionBase):
|
|||||||
if not default_currency:
|
if not default_currency:
|
||||||
msgprint('Message: Please enter default currency in Company Master')
|
msgprint('Message: Please enter default currency in Company Master')
|
||||||
raise Exception
|
raise Exception
|
||||||
if (obj.doc.currency == default_currency and flt(obj.doc.conversion_rate) != 1.00) or not obj.doc.conversion_rate or (obj.doc.currency != default_currency and flt(obj.doc.conversion_rate) == 1.00):
|
|
||||||
msgprint("Message: Please Enter Appropriate Conversion Rate.")
|
if obj.doc.conversion_rate == 0:
|
||||||
raise Exception
|
msgprint('Conversion Rate cannot be 0', raise_exception=1)
|
||||||
|
elif not obj.doc.conversion_rate:
|
||||||
|
msgprint('Please specify Conversion Rate', raise_exception=1)
|
||||||
|
elif obj.doc.currency == default_currency and \
|
||||||
|
flt(obj.doc.conversion_rate) != 1.00:
|
||||||
|
msgprint("""Conversion Rate should be equal to 1.00, \
|
||||||
|
since the specified Currency and the company's currency \
|
||||||
|
are same""", raise_exception=1)
|
||||||
|
elif obj.doc.currency != default_currency and \
|
||||||
|
flt(obj.doc.conversion_rate) == 1.00:
|
||||||
|
msgprint("""Conversion Rate should not be equal to 1.00, \
|
||||||
|
since the specified Currency and the company's currency \
|
||||||
|
are different""", raise_exception=1)
|
||||||
|
|
||||||
def validate_doc(self, obj, prevdoc_doctype, prevdoc_docname):
|
def validate_doc(self, obj, prevdoc_doctype, prevdoc_docname):
|
||||||
if prevdoc_docname :
|
if prevdoc_docname :
|
||||||
|
|||||||
16
erpnext/patches/may_2012/remove_euro_currency.py
Normal file
16
erpnext/patches/may_2012/remove_euro_currency.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
def execute():
|
||||||
|
"""
|
||||||
|
* Replace EURO with EUR
|
||||||
|
* Delete EURO from tabCurrency
|
||||||
|
"""
|
||||||
|
import webnotes
|
||||||
|
tables = webnotes.conn.sql("show tables")
|
||||||
|
for (tab,) in tables:
|
||||||
|
desc = webnotes.conn.sql("desc `%s`" % tab, as_dict=1)
|
||||||
|
for d in desc:
|
||||||
|
if "currency" in d.get('Field'):
|
||||||
|
field = d.get('Field')
|
||||||
|
webnotes.conn.sql("""\
|
||||||
|
update `%s` set `%s`='EUR'
|
||||||
|
where `%s`='EURO'""" % (tab, field, field))
|
||||||
|
webnotes.conn.sql("delete from `tabCurrency` where name='EURO'")
|
||||||
@@ -402,4 +402,9 @@ patch_list = [
|
|||||||
'patch_file': 'profile_perm_patch',
|
'patch_file': 'profile_perm_patch',
|
||||||
'description': 'Make profile readonly for role All'
|
'description': 'Make profile readonly for role All'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'patch_module': 'patches.may_2012',
|
||||||
|
'patch_file': 'remove_euro_currency',
|
||||||
|
'description': 'Remove EURO currency and replace with EUR'
|
||||||
|
},
|
||||||
]
|
]
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
# These values are common in all dictionaries
|
# These values are common in all dictionaries
|
||||||
{
|
{
|
||||||
'creation': '2012-03-27 14:36:05',
|
'creation': '2012-05-15 12:14:48',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2012-03-27 14:45:50',
|
'modified': '2012-05-28 19:03:56',
|
||||||
'modified_by': u'Administrator',
|
'modified_by': u'Administrator',
|
||||||
'owner': u'Administrator'
|
'owner': u'Administrator'
|
||||||
},
|
},
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
'section_style': u'Tabbed',
|
'section_style': u'Tabbed',
|
||||||
'server_code_error': u' ',
|
'server_code_error': u' ',
|
||||||
'show_in_menu': 0,
|
'show_in_menu': 0,
|
||||||
'version': 190
|
'version': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocField
|
# These values are common for all DocField
|
||||||
@@ -323,6 +323,7 @@
|
|||||||
'fieldname': u'produced_qty',
|
'fieldname': u'produced_qty',
|
||||||
'fieldtype': u'Currency',
|
'fieldtype': u'Currency',
|
||||||
'label': u'Produced Qty',
|
'label': u'Produced Qty',
|
||||||
|
'no_copy': 1,
|
||||||
'oldfieldname': u'produced_qty',
|
'oldfieldname': u'produced_qty',
|
||||||
'oldfieldtype': u'Currency',
|
'oldfieldtype': u'Currency',
|
||||||
'permlevel': 1
|
'permlevel': 1
|
||||||
|
|||||||
@@ -207,21 +207,32 @@ class DocType(TransactionBase):
|
|||||||
if default: add_cond = 'ifnull(t2.is_default,0) = 1'
|
if default: add_cond = 'ifnull(t2.is_default,0) = 1'
|
||||||
else: add_cond = 't1.parent = "'+cstr(obj.doc.charge)+'"'
|
else: add_cond = 't1.parent = "'+cstr(obj.doc.charge)+'"'
|
||||||
idx = 0
|
idx = 0
|
||||||
other_charge = webnotes.conn.sql("select t1.charge_type,t1.row_id,t1.description,t1.account_head,t1.rate,t1.tax_amount,t1.included_in_print_rate, t1.cost_center_other_charges from `tabSales Taxes and Charges` t1, `tabSales Taxes and Charges Master` t2 where t1.parent = t2.name and t2.company = '%s' and %s order by t1.idx" % (obj.doc.company, add_cond), as_dict = 1)
|
other_charge = webnotes.conn.sql("""\
|
||||||
|
select t1.*
|
||||||
|
from
|
||||||
|
`tabSales Taxes and Charges` t1,
|
||||||
|
`tabSales Taxes and Charges Master` t2
|
||||||
|
where
|
||||||
|
t1.parent = t2.name and
|
||||||
|
t2.company = '%s' and
|
||||||
|
%s
|
||||||
|
order by t1.idx""" % (obj.doc.company, add_cond), as_dict=1)
|
||||||
|
from webnotes.model import default_fields
|
||||||
for other in other_charge:
|
for other in other_charge:
|
||||||
d = addchild(obj.doc, 'other_charges', 'Sales Taxes and Charges', 1, obj.doclist)
|
# remove default fields like parent, parenttype etc.
|
||||||
d.charge_type = other['charge_type']
|
# from query results
|
||||||
d.row_id = other['row_id']
|
for field in default_fields:
|
||||||
d.description = other['description']
|
if field in other: del other[field]
|
||||||
d.account_head = other['account_head']
|
|
||||||
d.cost_center_other_charges = other['cost_center_other_charges']
|
d = addchild(obj.doc, 'other_charges', 'Sales Taxes and Charges', 1,
|
||||||
d.rate = flt(other['rate'])
|
obj.doclist)
|
||||||
d.tax_amount = flt(other['tax_amount'])
|
d.fields.update(other)
|
||||||
d.included_in_print_rate = cint(other['included_in_print_rate'])
|
d.rate = flt(d.rate)
|
||||||
|
d.tax_amount = flt(d.tax_rate)
|
||||||
|
d.included_in_print_rate = cint(d.included_in_print_rate)
|
||||||
d.idx = idx
|
d.idx = idx
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|
||||||
|
|
||||||
# Get TERMS AND CONDITIONS
|
# Get TERMS AND CONDITIONS
|
||||||
# =======================================================================================
|
# =======================================================================================
|
||||||
def get_tc_details(self,obj):
|
def get_tc_details(self,obj):
|
||||||
|
|||||||
@@ -20,17 +20,17 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
|||||||
|
|
||||||
var route = wn.get_route();
|
var route = wn.get_route();
|
||||||
if(route[1]=='Supplier') {
|
if(route[1]=='Supplier') {
|
||||||
var supplier = locals.Supplier[route[2]]
|
var supplier = wn.container.page.frm.doc;
|
||||||
doc.supplier = supplier.name;
|
doc.supplier = supplier.name;
|
||||||
doc.supplier_name = supplier.supplier_name;
|
doc.supplier_name = supplier.supplier_name;
|
||||||
doc.address_type = 'Office';
|
doc.address_type = 'Office';
|
||||||
} else if(route[1]=='Customer') {
|
} else if(route[1]=='Customer') {
|
||||||
var customer = locals.Customer[route[2]]
|
var customer = wn.container.page.frm.doc;
|
||||||
doc.customer = customer.name;
|
doc.customer = customer.name;
|
||||||
doc.customer_name = customer.customer_name;
|
doc.customer_name = customer.customer_name;
|
||||||
doc.address_type = 'Office';
|
doc.address_type = 'Office';
|
||||||
} else if(route[1]=='Sales Partner') {
|
} else if(route[1]=='Sales Partner') {
|
||||||
var sp = locals['Sales Partner'][route[2]];
|
var sp = wn.container.page.frm.doc;
|
||||||
doc.sales_partner = sp.name;
|
doc.sales_partner = sp.name;
|
||||||
doc.address_type = 'Office';
|
doc.address_type = 'Office';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,18 +21,18 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
|||||||
|
|
||||||
var route = wn.get_route();
|
var route = wn.get_route();
|
||||||
if(route[1]=='Supplier') {
|
if(route[1]=='Supplier') {
|
||||||
var supplier = locals.Supplier[route[2]]
|
var supplier = wn.container.page.frm.doc;
|
||||||
doc.supplier = supplier.name;
|
doc.supplier = supplier.name;
|
||||||
doc.supplier_name = supplier.supplier_name;
|
doc.supplier_name = supplier.supplier_name;
|
||||||
} else if(route[1]=='Customer') {
|
} else if(route[1]=='Customer') {
|
||||||
var customer = locals.Customer[route[2]];
|
var customer = wn.container.page.frm.doc;
|
||||||
doc.customer = customer.name;
|
doc.customer = customer.name;
|
||||||
doc.customer_name = customer.customer_name;
|
doc.customer_name = customer.customer_name;
|
||||||
if(customer.customer_type == 'Individual') {
|
if(customer.customer_type == 'Individual') {
|
||||||
doc.first_name = customer.customer_name;
|
doc.first_name = customer.customer_name;
|
||||||
}
|
}
|
||||||
} else if(route[1]=='Sales Partner') {
|
} else if(route[1]=='Sales Partner') {
|
||||||
var sp = locals['Sales Partner'][route[2]];
|
var sp = wn.container.page.frm.doc;
|
||||||
doc.sales_partner = sp.name;
|
doc.sales_partner = sp.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
public/css/fonts/marckscript.woff
Normal file
BIN
public/css/fonts/marckscript.woff
Normal file
Binary file not shown.
Reference in New Issue
Block a user