Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
815cb8959a | ||
|
|
38937ecd3c | ||
|
|
521aa2e94a | ||
|
|
390df6626b | ||
|
|
a2d8585b07 | ||
|
|
84e658058b | ||
|
|
10e813b010 | ||
|
|
a7bd8ee34b | ||
|
|
90a51225a4 | ||
|
|
8980ce6052 | ||
|
|
c0f56de971 | ||
|
|
8d50eb32c1 | ||
|
|
50bbc99889 | ||
|
|
0cf9469f86 | ||
|
|
d13db9cd84 | ||
|
|
07b3bf6417 | ||
|
|
25ea307b9f | ||
|
|
8252117fe5 | ||
|
|
c602396366 | ||
|
|
f59d3a4e07 |
@@ -1,2 +1,2 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
__version__ = '5.0.2'
|
__version__ = '5.0.6'
|
||||||
|
|||||||
@@ -71,12 +71,11 @@ def save_entries(gl_map, adv_adj, update_outstanding):
|
|||||||
# check against budget
|
# check against budget
|
||||||
validate_expense_against_budget(entry)
|
validate_expense_against_budget(entry)
|
||||||
|
|
||||||
|
|
||||||
# update total debit / credit
|
# update total debit / credit
|
||||||
total_debit += flt(entry.debit)
|
total_debit += flt(entry.debit)
|
||||||
total_credit += flt(entry.credit)
|
total_credit += flt(entry.credit)
|
||||||
|
|
||||||
validate_total_debit_credit(total_debit, total_credit)
|
validate_total_debit_credit(total_debit, total_credit, gl_map)
|
||||||
|
|
||||||
def make_entry(args, adv_adj, update_outstanding):
|
def make_entry(args, adv_adj, update_outstanding):
|
||||||
args.update({"doctype": "GL Entry"})
|
args.update({"doctype": "GL Entry"})
|
||||||
@@ -86,9 +85,9 @@ def make_entry(args, adv_adj, update_outstanding):
|
|||||||
gle.run_method("on_update_with_args", adv_adj, update_outstanding)
|
gle.run_method("on_update_with_args", adv_adj, update_outstanding)
|
||||||
gle.submit()
|
gle.submit()
|
||||||
|
|
||||||
def validate_total_debit_credit(total_debit, total_credit):
|
def validate_total_debit_credit(total_debit, total_credit, gl_map):
|
||||||
if abs(total_debit - total_credit) > 0.005:
|
if abs(total_debit - total_credit) > 0.005:
|
||||||
frappe.throw(_("Debit and Credit not equal for this voucher. Difference is {0}.").format(total_debit - total_credit))
|
frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.").format(gl_map[0].voucher_type, gl_map[0].voucher_no, total_debit - total_credit))
|
||||||
|
|
||||||
def validate_account_for_auto_accounting_for_stock(gl_map):
|
def validate_account_for_auto_accounting_for_stock(gl_map):
|
||||||
if gl_map[0].voucher_type=="Journal Entry":
|
if gl_map[0].voucher_type=="Journal Entry":
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ def get_fiscal_year(date=None, fiscal_year=None, label="Date", verbose=1, compan
|
|||||||
|
|
||||||
def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verbose=1, company=None):
|
def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verbose=1, company=None):
|
||||||
# if year start date is 2012-04-01, year end date should be 2013-03-31 (hence subdate)
|
# if year start date is 2012-04-01, year end date should be 2013-03-31 (hence subdate)
|
||||||
cond = ""
|
cond = " ifnull(disabled, 0) = 0"
|
||||||
if fiscal_year:
|
if fiscal_year:
|
||||||
cond = "fy.name = %(fiscal_year)s"
|
cond += " and fy.name = %(fiscal_year)s"
|
||||||
else:
|
else:
|
||||||
cond = "%(transaction_date)s >= fy.year_start_date and %(transaction_date)s <= fy.year_end_date"
|
cond += " and %(transaction_date)s >= fy.year_start_date and %(transaction_date)s <= fy.year_end_date"
|
||||||
|
|
||||||
if company:
|
if company:
|
||||||
cond += """ and (not exists(select name from `tabFiscal Year Company` fyc where fyc.parent = fy.name)
|
cond += """ and (not exists(select name from `tabFiscal Year Company` fyc where fyc.parent = fy.name)
|
||||||
@@ -36,7 +36,7 @@ def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verb
|
|||||||
})
|
})
|
||||||
|
|
||||||
if not fy:
|
if not fy:
|
||||||
error_msg = _("""{0} {1} not in any Fiscal Year. For more details check {2}.""").format(label, formatdate(transaction_date), "https://erpnext.com/kb/accounts/fiscal-year-error")
|
error_msg = _("""{0} {1} not in any active Fiscal Year. For more details check {2}.""").format(label, formatdate(transaction_date), "https://erpnext.com/kb/accounts/fiscal-year-error")
|
||||||
if verbose==1: frappe.msgprint(error_msg)
|
if verbose==1: frappe.msgprint(error_msg)
|
||||||
raise FiscalYearError, error_msg
|
raise FiscalYearError, error_msg
|
||||||
return fy
|
return fy
|
||||||
|
|||||||
@@ -283,6 +283,9 @@ class calculate_taxes_and_totals(object):
|
|||||||
last_tax.tax_amount_after_discount_amount += diff
|
last_tax.tax_amount_after_discount_amount += diff
|
||||||
last_tax.total += diff
|
last_tax.total += diff
|
||||||
|
|
||||||
|
self._set_in_company_currency(last_tax,
|
||||||
|
["total", "tax_amount", "tax_amount_after_discount_amount"])
|
||||||
|
|
||||||
def calculate_totals(self):
|
def calculate_totals(self):
|
||||||
self.doc.grand_total = flt(self.doc.get("taxes")[-1].total
|
self.doc.grand_total = flt(self.doc.get("taxes")[-1].total
|
||||||
if self.doc.get("taxes") else self.doc.net_total)
|
if self.doc.get("taxes") else self.doc.net_total)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors"
|
|||||||
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
||||||
app_icon = "icon-th"
|
app_icon = "icon-th"
|
||||||
app_color = "#e74c3c"
|
app_color = "#e74c3c"
|
||||||
app_version = "5.0.2"
|
app_version = "5.0.6"
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
|
||||||
|
|||||||
@@ -96,15 +96,16 @@ def set_party_in_jv_and_gl_entry(receivable_payable_accounts):
|
|||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
def delete_individual_party_account():
|
def delete_individual_party_account():
|
||||||
frappe.db.sql("""delete from `tabAccount` acc
|
frappe.db.sql("""delete from `tabAccount`
|
||||||
where ifnull(acc.master_type, '') in ('Customer', 'Supplier')
|
where ifnull(master_type, '') in ('Customer', 'Supplier')
|
||||||
and ifnull(acc.master_name, '') != ''
|
and ifnull(master_name, '') != ''
|
||||||
and not exists(select gle.name from `tabGL Entry` gle where gle.account = acc.name)""")
|
and not exists(select gle.name from `tabGL Entry` gle
|
||||||
|
where gle.account = tabAccount.name)""")
|
||||||
|
|
||||||
accounts_not_deleted = frappe.db.sql_list("""select name from `tabAccount` acc
|
accounts_not_deleted = frappe.db.sql_list("""select tabAccount.name from `tabAccount`
|
||||||
where ifnull(acc.master_type, '') in ('Customer', 'Supplier')
|
where ifnull(master_type, '') in ('Customer', 'Supplier')
|
||||||
and ifnull(acc.master_name, '') != ''
|
and ifnull(master_name, '') != ''
|
||||||
and exists(select gle.name from `tabGL Entry` gle where gle.account = acc.name)""")
|
and exists(select gle.name from `tabGL Entry` gle where gle.account = tabAccount.name)""")
|
||||||
|
|
||||||
if accounts_not_deleted:
|
if accounts_not_deleted:
|
||||||
print "Accounts not deleted: " + "\n".join(accounts_not_deleted)
|
print "Accounts not deleted: " + "\n".join(accounts_not_deleted)
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
|
|||||||
var company_currency = this.get_company_currency();
|
var company_currency = this.get_company_currency();
|
||||||
|
|
||||||
if(!this.frm.doc.conversion_rate) {
|
if(!this.frm.doc.conversion_rate) {
|
||||||
|
if(this.frm.doc.currency == company_currency) {
|
||||||
|
this.frm.set_value("conversion_rate", 1);
|
||||||
|
} else {
|
||||||
frappe.throw(repl('%(conversion_rate_label)s' +
|
frappe.throw(repl('%(conversion_rate_label)s' +
|
||||||
__(' is mandatory. Maybe Currency Exchange record is not created for ') +
|
__(' is mandatory. Maybe Currency Exchange record is not created for ') +
|
||||||
'%(from_currency)s' + __(" to ") + '%(to_currency)s',
|
'%(from_currency)s' + __(" to ") + '%(to_currency)s',
|
||||||
@@ -55,6 +58,8 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
|
|||||||
"to_currency": company_currency
|
"to_currency": company_currency
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
calculate_item_values: function() {
|
calculate_item_values: function() {
|
||||||
@@ -314,6 +319,8 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
|
|||||||
tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount +
|
tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount +
|
||||||
discount_amount_loss, precision("tax_amount", tax));
|
discount_amount_loss, precision("tax_amount", tax));
|
||||||
tax.total = flt(tax.total + discount_amount_loss, precision("total", tax));
|
tax.total = flt(tax.total + discount_amount_loss, precision("total", tax));
|
||||||
|
|
||||||
|
this.set_in_company_currency(tax, ["total", "tax_amount_after_discount_amount"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
manipulate_grand_total_for_inclusive_tax: function() {
|
manipulate_grand_total_for_inclusive_tax: function() {
|
||||||
@@ -333,6 +340,9 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
|
|||||||
last_tax.tax_amount += diff;
|
last_tax.tax_amount += diff;
|
||||||
last_tax.tax_amount_after_discount += diff;
|
last_tax.tax_amount_after_discount += diff;
|
||||||
last_tax.total += diff;
|
last_tax.total += diff;
|
||||||
|
|
||||||
|
this.set_in_company_currency(last_tax,
|
||||||
|
["total", "tax_amount", "tax_amount_after_discount_amount"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc) {
|
if(!r.exc) {
|
||||||
me.frm.set_value("taxes", r.message);
|
me.frm.set_value("taxes", r.message);
|
||||||
me.calculate_taxes_and_totals();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -1,6 +1,6 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
version = "5.0.2"
|
version = "5.0.6"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
|||||||
Reference in New Issue
Block a user