Merge branch 'develop'
This commit is contained in:
commit
47fe136d15
@ -1,2 +1,2 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
__version__ = '5.0.13'
|
__version__ = '5.0.14'
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
frappe.provide("erpnext.accounts");
|
frappe.provide("erpnext.accounts");
|
||||||
frappe.require("assets/erpnext/js/utils.js");
|
frappe.require("assets/erpnext/js/utils.js");
|
||||||
|
|
||||||
erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
|
erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||||
onload: function() {
|
onload: function() {
|
||||||
this.load_defaults();
|
this.load_defaults();
|
||||||
this.setup_queries();
|
this.setup_queries();
|
||||||
@ -130,10 +130,31 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
|
|||||||
cur_frm.cscript.update_totals(me.frm.doc);
|
cur_frm.cscript.update_totals(me.frm.doc);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
|
||||||
|
accounts_add: function(doc, cdt, cdn) {
|
||||||
|
var row = frappe.get_doc(cdt, cdn);
|
||||||
|
$.each(doc.accounts, function(i, d) {
|
||||||
|
if(d.account && d.party && d.party_type) {
|
||||||
|
row.account = d.account;
|
||||||
|
row.party = d.party;
|
||||||
|
row.party_type = d.party_type;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// set difference
|
||||||
|
if(doc.difference) {
|
||||||
|
if(doc.difference > 0) {
|
||||||
|
row.credit = doc.difference;
|
||||||
|
} else {
|
||||||
|
row.debit = -doc.difference;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
cur_frm.script_manager.make(erpnext.accounts.JournalVoucher);
|
cur_frm.script_manager.make(erpnext.accounts.JournalEntry);
|
||||||
|
|
||||||
cur_frm.cscript.refresh = function(doc) {
|
cur_frm.cscript.refresh = function(doc) {
|
||||||
erpnext.toggle_naming_series();
|
erpnext.toggle_naming_series();
|
||||||
|
@ -81,7 +81,8 @@ class JournalEntry(AccountsController):
|
|||||||
frappe.throw(_("Row {0}: Party Type and Party is only applicable against Receivable / Payable account").format(d.idx))
|
frappe.throw(_("Row {0}: Party Type and Party is only applicable against Receivable / Payable account").format(d.idx))
|
||||||
|
|
||||||
def check_credit_limit(self):
|
def check_credit_limit(self):
|
||||||
customers = list(set([d.party for d in self.get("accounts") if d.party_type=="Customer" and flt(d.debit) > 0]))
|
customers = list(set([d.party for d in self.get("accounts")
|
||||||
|
if d.party_type=="Customer" and d.party and flt(d.debit) > 0]))
|
||||||
if customers:
|
if customers:
|
||||||
from erpnext.selling.doctype.customer.customer import check_credit_limit
|
from erpnext.selling.doctype.customer.customer import check_credit_limit
|
||||||
for customer in customers:
|
for customer in customers:
|
||||||
|
@ -205,9 +205,9 @@ def get_pricing_rules(args):
|
|||||||
|
|
||||||
def filter_pricing_rules(args, pricing_rules):
|
def filter_pricing_rules(args, pricing_rules):
|
||||||
# filter for qty
|
# filter for qty
|
||||||
if pricing_rules and args.get("qty"):
|
if pricing_rules:
|
||||||
pricing_rules = filter(lambda x: (args.qty>=flt(x.min_qty)
|
pricing_rules = filter(lambda x: (flt(args.get("qty"))>=flt(x.min_qty)
|
||||||
and (args.qty<=x.max_qty if x.max_qty else True)), pricing_rules)
|
and (flt(args.get("qty"))<=x.max_qty if x.max_qty else True)), pricing_rules)
|
||||||
|
|
||||||
# find pricing rule with highest priority
|
# find pricing rule with highest priority
|
||||||
if pricing_rules:
|
if pricing_rules:
|
||||||
|
@ -65,7 +65,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(!from_delivery_note) {
|
if(!from_delivery_note) {
|
||||||
cur_frm.page.add_menu_item(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck")
|
cur_frm.add_custom_button(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,14 +75,14 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show buttons only when pos view is active
|
// Show buttons only when pos view is active
|
||||||
if (doc.docstatus===0 && !cur_frm.page.current_view_name!=="pos") {
|
if (cint(doc.docstatus==0) && cur_frm.page.current_view_name!=="pos") {
|
||||||
cur_frm.cscript.sales_order_btn();
|
cur_frm.cscript.sales_order_btn();
|
||||||
cur_frm.cscript.delivery_note_btn();
|
cur_frm.cscript.delivery_note_btn();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
sales_order_btn: function() {
|
sales_order_btn: function() {
|
||||||
this.$sales_order_btn = cur_frm.page.add_menu_item(__('From Sales Order'),
|
this.$sales_order_btn = cur_frm.add_custom_button(__('From Sales Order'),
|
||||||
function() {
|
function() {
|
||||||
frappe.model.map_current_doc({
|
frappe.model.map_current_doc({
|
||||||
method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
|
method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
|
||||||
@ -99,7 +99,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
},
|
},
|
||||||
|
|
||||||
delivery_note_btn: function() {
|
delivery_note_btn: function() {
|
||||||
this.$delivery_note_btn = cur_frm.page.add_menu_item(__('From Delivery Note'),
|
this.$delivery_note_btn = cur_frm.add_custom_button(__('From Delivery Note'),
|
||||||
function() {
|
function() {
|
||||||
frappe.model.map_current_doc({
|
frappe.model.map_current_doc({
|
||||||
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
|
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
|
||||||
|
@ -101,7 +101,6 @@ def round_off_debit_credit(gl_map):
|
|||||||
debit_credit_diff += entry.debit - entry.credit
|
debit_credit_diff += entry.debit - entry.credit
|
||||||
|
|
||||||
debit_credit_diff = flt(debit_credit_diff, precision)
|
debit_credit_diff = flt(debit_credit_diff, precision)
|
||||||
print debit_credit_diff, 1.0 / (10**precision)
|
|
||||||
if abs(debit_credit_diff) >= (2.0 / (10**precision)):
|
if abs(debit_credit_diff) >= (2.0 / (10**precision)):
|
||||||
frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.")
|
frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.")
|
||||||
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))
|
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))
|
||||||
|
@ -183,8 +183,6 @@ class GrossProfitGenerator(object):
|
|||||||
my_sle = self.sle.get((item_code, row.warehouse))
|
my_sle = self.sle.get((item_code, row.warehouse))
|
||||||
for i, sle in enumerate(my_sle):
|
for i, sle in enumerate(my_sle):
|
||||||
# find the stock valution rate from stock ledger entry
|
# find the stock valution rate from stock ledger entry
|
||||||
print sle.voucher_type, row.parenttype, sle.voucher_no, row.parent, \
|
|
||||||
sle.voucher_detail_no, row.item_row
|
|
||||||
if sle.voucher_type == row.parenttype and row.parent == sle.voucher_no and \
|
if sle.voucher_type == row.parenttype and row.parent == sle.voucher_no and \
|
||||||
sle.voucher_detail_no == row.item_row:
|
sle.voucher_detail_no == row.item_row:
|
||||||
previous_stock_value = len(my_sle) > i+1 and \
|
previous_stock_value = len(my_sle) > i+1 and \
|
||||||
|
@ -31,7 +31,7 @@ def get_data():
|
|||||||
{
|
{
|
||||||
"type": "help",
|
"type": "help",
|
||||||
"label": _("Opening Stock Balance"),
|
"label": _("Opening Stock Balance"),
|
||||||
"youtube_id": "yPgrtfeCTs"
|
"youtube_id": "0yPgrtfeCTs"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "help",
|
"type": "help",
|
||||||
@ -106,7 +106,7 @@ def get_data():
|
|||||||
{
|
{
|
||||||
"type": "help",
|
"type": "help",
|
||||||
"label": _("Opening Stock Balance"),
|
"label": _("Opening Stock Balance"),
|
||||||
"youtube_id": "yPgrtfeCTs"
|
"youtube_id": "0yPgrtfeCTs"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "help",
|
"type": "help",
|
||||||
|
@ -266,7 +266,7 @@ def get_data():
|
|||||||
{
|
{
|
||||||
"type": "help",
|
"type": "help",
|
||||||
"label": _("Opening Stock Balance"),
|
"label": _("Opening Stock Balance"),
|
||||||
"youtube_id": "yPgrtfeCTs"
|
"youtube_id": "0yPgrtfeCTs"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "help",
|
"type": "help",
|
||||||
|
@ -44,11 +44,14 @@ class NewsletterList(Document):
|
|||||||
return self.update_total_subscribers()
|
return self.update_total_subscribers()
|
||||||
|
|
||||||
def update_total_subscribers(self):
|
def update_total_subscribers(self):
|
||||||
self.total_subscribers = frappe.db.sql("""select count(*) from `tabNewsletter List Subscriber`
|
self.total_subscribers = self.get_total_subscribers()
|
||||||
where newsletter_list=%s""", self.name)[0][0]
|
|
||||||
self.db_update()
|
self.db_update()
|
||||||
return self.total_subscribers
|
return self.total_subscribers
|
||||||
|
|
||||||
|
def get_total_subscribers(self):
|
||||||
|
return frappe.db.sql("""select count(*) from `tabNewsletter List Subscriber`
|
||||||
|
where newsletter_list=%s""", self.name)[0][0]
|
||||||
|
|
||||||
def on_trash(self):
|
def on_trash(self):
|
||||||
for d in frappe.get_all("Newsletter List Subscriber", "name", {"newsletter_list": self.name}):
|
for d in frappe.get_all("Newsletter List Subscriber", "name", {"newsletter_list": self.name}):
|
||||||
frappe.delete_doc("Newsletter List Subscriber", d.name)
|
frappe.delete_doc("Newsletter List Subscriber", d.name)
|
||||||
|
@ -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.13"
|
app_version = "5.0.14"
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
|
||||||
|
@ -23,9 +23,6 @@ class LeaveAllocation(Document):
|
|||||||
def on_update(self):
|
def on_update(self):
|
||||||
self.get_total_allocated_leaves()
|
self.get_total_allocated_leaves()
|
||||||
|
|
||||||
def on_cancel(self):
|
|
||||||
self.check_for_leave_application()
|
|
||||||
|
|
||||||
def validate_new_leaves_allocated_value(self):
|
def validate_new_leaves_allocated_value(self):
|
||||||
"""validate that leave allocation is in multiples of 0.5"""
|
"""validate that leave allocation is in multiples of 0.5"""
|
||||||
if flt(self.new_leaves_allocated) % 0.5:
|
if flt(self.new_leaves_allocated) % 0.5:
|
||||||
|
@ -12,7 +12,6 @@ from frappe.model.document import Document
|
|||||||
class NamingSeriesNotSetError(frappe.ValidationError): pass
|
class NamingSeriesNotSetError(frappe.ValidationError): pass
|
||||||
|
|
||||||
class NamingSeries(Document):
|
class NamingSeries(Document):
|
||||||
|
|
||||||
def get_transactions(self, arg=None):
|
def get_transactions(self, arg=None):
|
||||||
doctypes = list(set(frappe.db.sql_list("""select parent
|
doctypes = list(set(frappe.db.sql_list("""select parent
|
||||||
from `tabDocField` where fieldname='naming_series'""")
|
from `tabDocField` where fieldname='naming_series'""")
|
||||||
|
@ -163,8 +163,8 @@ def get_basic_details(args, item):
|
|||||||
"uom": item.stock_uom,
|
"uom": item.stock_uom,
|
||||||
"min_order_qty": flt(item.min_order_qty) if args.parenttype == "Material Request" else "",
|
"min_order_qty": flt(item.min_order_qty) if args.parenttype == "Material Request" else "",
|
||||||
"conversion_factor": 1.0,
|
"conversion_factor": 1.0,
|
||||||
"qty": args.qty or 0.0,
|
"qty": args.qty or 1.0,
|
||||||
"stock_qty": 0.0,
|
"stock_qty": 1.0,
|
||||||
"price_list_rate": 0.0,
|
"price_list_rate": 0.0,
|
||||||
"base_price_list_rate": 0.0,
|
"base_price_list_rate": 0.0,
|
||||||
"rate": 0.0,
|
"rate": 0.0,
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
{% if doc.in_format_data("item_code") and not doc.is_print_hide("item_code") -%}
|
{% if doc.in_format_data("item_code") and not doc.is_print_hide("item_code") -%}
|
||||||
<div class="primary">{{ doc.item_code }}</div>
|
<div class="primary">{{ doc.item_code }}</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% if (doc.in_format_data("item_name") and
|
{% if (doc.in_format_data("item_name") and not doc.is_print_hide("item_name") and
|
||||||
(not doc.in_format_data("item_code") or doc.is_print_hide("item_code")
|
(not doc.in_format_data("item_code") or doc.is_print_hide("item_code")
|
||||||
or doc.item_code != doc.item_name)) -%}
|
or doc.item_code != doc.item_name)) -%}
|
||||||
<div class="primary">{{ doc.get_formatted("item_name") }}</div>
|
<div class="primary">{{ doc.get_formatted("item_name") }}</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
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.13"
|
version = "5.0.14"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user