Merge branch 'develop'
This commit is contained in:
commit
bfeb7c4a57
@ -1 +1 @@
|
|||||||
__version__ = '4.21.0'
|
__version__ = '4.21.1'
|
||||||
|
@ -4,7 +4,7 @@ app_publisher = "Web Notes 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 = "4.21.0"
|
app_version = "4.21.1"
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
|
||||||
|
@ -404,23 +404,27 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
_set_values_for_item_list: function(children) {
|
_set_values_for_item_list: function(children) {
|
||||||
var me = this;
|
var me = this;
|
||||||
var price_list_rate_changed = false;
|
var price_list_rate_changed = false;
|
||||||
$.each(children, function(i, d) {
|
for(var i=0, l=children.length; i<l; i++) {
|
||||||
|
var d = children[i];
|
||||||
var existing_pricing_rule = frappe.model.get_value(d.doctype, d.name, "pricing_rule");
|
var existing_pricing_rule = frappe.model.get_value(d.doctype, d.name, "pricing_rule");
|
||||||
$.each(d, function(k, v) {
|
|
||||||
|
for(var k in d) {
|
||||||
|
var v = d[k];
|
||||||
if (["doctype", "name"].indexOf(k)===-1) {
|
if (["doctype", "name"].indexOf(k)===-1) {
|
||||||
if(k=="price_list_rate") {
|
if(k=="price_list_rate") {
|
||||||
if(flt(v) != flt(d.price_list_rate)) price_list_rate_changed = true;
|
if(flt(v) != flt(d.price_list_rate)) price_list_rate_changed = true;
|
||||||
}
|
}
|
||||||
frappe.model.set_value(d.doctype, d.name, k, v);
|
frappe.model.set_value(d.doctype, d.name, k, v);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
// if pricing rule set as blank from an existing value, apply price_list
|
// if pricing rule set as blank from an existing value, apply price_list
|
||||||
if(!me.frm.doc.ignore_pricing_rule && existing_pricing_rule && !d.pricing_rule) {
|
if(!me.frm.doc.ignore_pricing_rule && existing_pricing_rule && !d.pricing_rule) {
|
||||||
me.apply_price_list(frappe.get_doc(d.doctype, d.name));
|
me.apply_price_list(frappe.get_doc(d.doctype, d.name));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!price_list_rate_changed) me.calculate_taxes_and_totals();
|
if(!price_list_rate_changed) me.calculate_taxes_and_totals();
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
apply_price_list: function(item) {
|
apply_price_list: function(item) {
|
||||||
|
@ -138,10 +138,11 @@ class PurchaseReceipt(BuyingController):
|
|||||||
pr_qty = flt(d.qty) * flt(d.conversion_factor)
|
pr_qty = flt(d.qty) * flt(d.conversion_factor)
|
||||||
|
|
||||||
if pr_qty:
|
if pr_qty:
|
||||||
|
val_rate_db_precision = 6 if cint(self.precision("valuation_rate")) <= 6 else 9
|
||||||
sl_entries.append(self.get_sl_entries(d, {
|
sl_entries.append(self.get_sl_entries(d, {
|
||||||
"actual_qty": flt(pr_qty),
|
"actual_qty": flt(pr_qty),
|
||||||
"serial_no": cstr(d.serial_no).strip(),
|
"serial_no": cstr(d.serial_no).strip(),
|
||||||
"incoming_rate": d.valuation_rate
|
"incoming_rate": flt(d.valuation_rate, val_rate_db_precision)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
if flt(d.rejected_qty) > 0:
|
if flt(d.rejected_qty) > 0:
|
||||||
@ -288,14 +289,16 @@ class PurchaseReceipt(BuyingController):
|
|||||||
if d.item_code in stock_items and flt(d.valuation_rate) and flt(d.qty):
|
if d.item_code in stock_items and flt(d.valuation_rate) and flt(d.qty):
|
||||||
if warehouse_account.get(d.warehouse):
|
if warehouse_account.get(d.warehouse):
|
||||||
|
|
||||||
|
val_rate_db_precision = 6 if cint(self.precision("valuation_rate")) <= 6 else 9
|
||||||
|
|
||||||
# warehouse account
|
# warehouse account
|
||||||
gl_entries.append(self.get_gl_dict({
|
gl_entries.append(self.get_gl_dict({
|
||||||
"account": warehouse_account[d.warehouse],
|
"account": warehouse_account[d.warehouse],
|
||||||
"against": stock_rbnb,
|
"against": stock_rbnb,
|
||||||
"cost_center": d.cost_center,
|
"cost_center": d.cost_center,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"debit": flt(flt(d.valuation_rate) * flt(d.qty) * flt(d.conversion_factor),
|
"debit": flt(flt(d.valuation_rate, val_rate_db_precision) * flt(d.qty) * flt(d.conversion_factor),
|
||||||
self.precision("valuation_rate", d))
|
self.precision("base_amount", d))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
# stock received but not billed
|
# stock received but not billed
|
||||||
@ -329,6 +332,24 @@ class PurchaseReceipt(BuyingController):
|
|||||||
"credit": flt(d.rm_supp_cost)
|
"credit": flt(d.rm_supp_cost)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
# divisional loss adjustment
|
||||||
|
if not self.get("other_charges"):
|
||||||
|
sle_valuation_amount = flt(flt(d.valuation_rate, val_rate_db_precision) * flt(d.qty) * flt(d.conversion_factor),
|
||||||
|
self.precision("base_amount", d))
|
||||||
|
|
||||||
|
distributed_amount = flt(flt(d.base_amount, self.precision("base_amount", d))) + \
|
||||||
|
flt(d.landed_cost_voucher_amount) + flt(d.rm_supp_cost)
|
||||||
|
|
||||||
|
divisional_loss = flt(distributed_amount - sle_valuation_amount, self.precision("base_amount", d))
|
||||||
|
if divisional_loss:
|
||||||
|
gl_entries.append(self.get_gl_dict({
|
||||||
|
"account": stock_rbnb,
|
||||||
|
"against": warehouse_account[d.warehouse],
|
||||||
|
"cost_center": d.cost_center,
|
||||||
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
|
"debit": divisional_loss
|
||||||
|
}))
|
||||||
|
|
||||||
elif d.warehouse not in warehouse_with_no_account or \
|
elif d.warehouse not in warehouse_with_no_account or \
|
||||||
d.rejected_warehouse not in warehouse_with_no_account:
|
d.rejected_warehouse not in warehouse_with_no_account:
|
||||||
warehouse_with_no_account.append(d.warehouse)
|
warehouse_with_no_account.append(d.warehouse)
|
||||||
|
2
setup.py
2
setup.py
@ -1,7 +1,7 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
import os
|
import os
|
||||||
|
|
||||||
version = "4.21.0"
|
version = "4.21.1"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
Loading…
Reference in New Issue
Block a user