Compare commits

..

29 Commits

Author SHA1 Message Date
Anand Doshi
87b5fcb3b5 Merge branch 'develop' 2015-11-09 13:17:49 +05:30
Anand Doshi
7489d29813 bumped to version 6.7.7 2015-11-09 13:47:49 +06:00
Anand Doshi
268d300030 Merge pull request #4297 from frappe/revert-4294-develop
Revert b28573ab03
2015-11-09 13:17:04 +05:30
Anand Doshi
7f77002015 Revert b28573ab03 2015-11-09 13:16:24 +05:30
Anand Doshi
b28573ab03 Merge pull request #4294 from neilLasrado/develop
[Minor fix] Allowed maintenance schedule to be imported via data import tool
2015-11-09 13:13:41 +05:30
Anand Doshi
c756ff67b0 Merge pull request #4296 from anandpdoshi/sales-order-allow-delivery
[fix] Allow both Purchase Order and Delivery from Sales Order, based on drop shipping checkbox
2015-11-09 13:13:14 +05:30
Anand Doshi
4e72ef1421 [fix] Allow both Purchase Order and Delivery from Sales Order, based on drop shipping checkbox 2015-11-09 13:01:49 +05:30
Neil Trini Lasrado
6b173f3a67 Allowed maintenance schedule to be imported via data import tool 2015-11-09 11:38:06 +05:30
Anand Doshi
fcfced624a Merge branch 'develop' 2015-11-07 15:40:22 +05:30
Anand Doshi
64949bfc4b bumped to version 6.7.6 2015-11-07 16:10:22 +06:00
Anand Doshi
438c4fb279 [patch] reload doctype Leave Allocation 2015-11-07 15:38:29 +05:30
Rushabh Mehta
ae4c8a6a48 Merge branch 'develop' 2015-11-06 16:54:17 +05:30
Rushabh Mehta
0d7213122a bumped to version 6.7.5 2015-11-06 17:24:17 +06:00
Rushabh Mehta
4268b0092a [minor] don't show po / mr buttons if delivered 2015-11-06 16:52:18 +05:30
Rushabh Mehta
64e31e9a4e [fix] process payroll 2015-11-06 14:47:12 +05:30
Rushabh Mehta
0a0c267edb Merge branch 'develop' 2015-11-06 11:45:09 +05:30
Rushabh Mehta
1a8d4b6ea7 bumped to version 6.7.4 2015-11-06 12:15:09 +06:00
Rushabh Mehta
97426776bd Merge pull request #4281 from nabinhait/address_fix
[fix] Clear addressed and contacts on a new form
2015-11-06 11:02:31 +05:30
Rushabh Mehta
60e7f01fd4 Merge branch 'develop' 2015-11-06 10:49:53 +05:30
Rushabh Mehta
169089bdde bumped to version 6.7.3 2015-11-06 11:19:53 +06:00
Rushabh Mehta
c14f80838b [fix] [hot] leave allocation patch 2015-11-06 10:49:16 +05:30
Rushabh Mehta
a5007db902 Merge branch 'develop' 2015-11-06 10:41:06 +05:30
Rushabh Mehta
0d58501229 bumped to version 6.7.2 2015-11-06 11:11:06 +06:00
Nabin Hait
7c654cd1bb Leave allocation patch included 2015-11-06 10:37:26 +05:30
Rushabh Mehta
54fc260a42 [minor] trigger link triggers while mapping material request to po to set supplier default currency 2015-11-05 15:26:02 +05:30
Rushabh Mehta
7a39d51366 [fix] pull tax rate in item tax 2015-11-05 15:19:11 +05:30
Rushabh Mehta
79c94426f7 Merge pull request #4277 from nabinhait/gross_profit_fix
[fix][report] Buying amount for product bundle in Gross Profit report
2015-11-05 14:04:30 +05:30
Nabin Hait
c3ced9a0b5 [fix][report] Buying amount for product bundle in Gross Profit report 2015-11-05 13:13:31 +05:30
Nabin Hait
915778fb69 [fix] Clear addressed and contacts on a new form 2015-10-30 14:43:13 +05:30
17 changed files with 77 additions and 51 deletions

View File

@@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '6.7.1'
__version__ = '6.7.7'

View File

@@ -168,7 +168,11 @@ def get_pricing_rules(args):
field = frappe.scrub(parenttype)
condition = ""
if args.get(field):
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
try:
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
except TypeError:
frappe.throw(_("Invalid {0}").format(args[field]))
parent_groups = frappe.db.sql_list("""select name from `tab%s`
where lft<=%s and rgt>=%s""" % (parenttype, '%s', '%s'), (lft, rgt))

View File

@@ -98,11 +98,17 @@ class GrossProfitGenerator(object):
row.base_amount = flt(row.base_net_amount)
product_bundles = self.product_bundles.get(row.parenttype, {}).get(row.parent, frappe._dict())
if row.update_stock:
product_bundles = self.product_bundles.get(row.parenttype, {}).get(row.parent, frappe._dict())
elif row.dn_detail:
product_bundles = self.product_bundles.get("Delivery Note", {})\
.get(row.delivery_note, frappe._dict())
row.item_row = row.dn_detail
# get buying amount
if row.item_code in product_bundles:
row.buying_amount = self.get_buying_amount_from_product_bundle(row, product_bundles[row.item_code])
row.buying_amount = self.get_buying_amount_from_product_bundle(row,
product_bundles[row.item_code])
else:
row.buying_amount = self.get_buying_amount(row, row.item_code)
@@ -142,7 +148,6 @@ class GrossProfitGenerator(object):
new_row.qty += row.qty
new_row.buying_amount += row.buying_amount
new_row.base_amount += row.base_amount
# new_row.allocated_amount += (row.allocated_amount or 0) if new_row.allocated_amount else 0
new_row.gross_profit = new_row.base_amount - new_row.buying_amount
new_row.gross_profit_percent = ((new_row.gross_profit / new_row.base_amount) * 100.0) \
@@ -158,9 +163,9 @@ class GrossProfitGenerator(object):
def get_buying_amount_from_product_bundle(self, row, product_bundle):
buying_amount = 0.0
for bom_item in product_bundle:
if bom_item.get("parent_detail_docname")==row.item_row:
buying_amount += self.get_buying_amount(row, bom_item.item_code)
for packed_item in product_bundle:
if packed_item.get("parent_detail_docname")==row.item_row:
buying_amount += self.get_buying_amount(row, packed_item.item_code)
return buying_amount
@@ -176,14 +181,14 @@ class GrossProfitGenerator(object):
else:
my_sle = self.sle.get((item_code, row.warehouse))
if (row.update_stock or row.dn_detail) and my_sle:
parenttype, parent, item_row = row.parenttype, row.parent, row.item_row
parenttype, parent = row.parenttype, row.parent
if row.dn_detail:
parenttype, parent, item_row = "Delivery Note", row.delivery_note, row.dn_detail
parenttype, parent = "Delivery Note", row.delivery_note
for i, sle in enumerate(my_sle):
# find the stock valution rate from stock ledger entry
if sle.voucher_type == parenttype and parent == sle.voucher_no and \
sle.voucher_detail_no == item_row:
sle.voucher_detail_no == row.item_row:
previous_stock_value = len(my_sle) > i+1 and \
flt(my_sle[i+1].stock_value) or 0.0
return previous_stock_value - flt(sle.stock_value)

View File

@@ -12,6 +12,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
if(doc.__islocal){
hide_field(['address_html','contact_html']);
erpnext.utils.clear_address_and_contact(cur_frm);
}
else{
unhide_field(['address_html','contact_html']);

View File

@@ -37,6 +37,8 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
if(!this.frm.doc.__islocal) {
erpnext.utils.render_address_and_contact(cur_frm);
} else {
erpnext.utils.clear_address_and_contact(cur_frm);
}
},

View File

@@ -29,7 +29,7 @@ blogs.
"""
app_icon = "icon-th"
app_color = "#e74c3c"
app_version = "6.7.1"
app_version = "6.7.7"
source_link = "https://github.com/frappe/erpnext"
error_report_email = "support@erpnext.com"

View File

@@ -196,11 +196,11 @@ class ProcessPayroll(Document):
journal_entry.set("accounts", [
{
"account": salary_account,
"debit": amount
"debit_in_account_currency": amount
},
{
"account": default_bank_account,
"credit": amount
"credit_in_account_currency": amount
},
])

View File

@@ -230,3 +230,4 @@ erpnext.patches.v6_5.show_in_website_for_template_item
erpnext.patches.v6_4.fix_expense_included_in_valuation
execute:frappe.delete_doc_if_exists("Report", "Item-wise Last Purchase Rate")
erpnext.patches.v6_6.fix_website_image
erpnext.patches.v6_6.remove_fiscal_year_from_leave_allocation

View File

@@ -2,14 +2,16 @@ from __future__ import unicode_literals
import frappe
def execute():
for leave_allocation in frappe.db.sql("select name, fiscal_year from `tabLeave Allocation`", as_dict=True):
year_start_date, year_end_date = frappe.db.get_value("Fiscal Year", leave_allocation["fiscal_year"],
["year_start_date", "year_end_date"])
frappe.db.sql("""update `tabLeave Allocation`
set from_date=%s, to_date=%s where name=%s""",
(year_start_date, year_end_date, leave_allocation["name"]))
frappe.db.commit()
frappe.reload_doctype("Leave Allocation")
if frappe.db.has_column("Leave Allocation", "fiscal_year"):
for leave_allocation in frappe.db.sql("select name, fiscal_year from `tabLeave Allocation`", as_dict=True):
dates = frappe.db.get_value("Fiscal Year", leave_allocation["fiscal_year"],
["year_start_date", "year_end_date"])
if dates:
year_start_date, year_end_date = dates
frappe.db.sql("""update `tabLeave Allocation`
set from_date=%s, to_date=%s where name=%s""",
(year_start_date, year_end_date, leave_allocation["name"]))

View File

@@ -100,6 +100,11 @@ $.extend(erpnext, {
$.extend(erpnext.utils, {
clear_address_and_contact: function(frm) {
$(frm.fields_dict['address_html'].wrapper).html("");
frm.fields_dict['contact_html'] && $(frm.fields_dict['contact_html'].wrapper).html("");
},
render_address_and_contact: function(frm) {
// render address
$(frm.fields_dict['address_html'].wrapper)

View File

@@ -14,6 +14,8 @@ frappe.ui.form.on("Customer", "refresh", function(frm) {
if(!frm.doc.__islocal) {
erpnext.utils.render_address_and_contact(frm);
} else {
erpnext.utils.clear_address_and_contact(frm);
}
var grid = cur_frm.get_field("sales_team").grid;

View File

@@ -15,22 +15,31 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
refresh: function(doc, dt, dn) {
this._super();
this.frm.dashboard.reset();
var is_delivered_by_supplier = false;
var is_delivery_note = false;
var allow_purchase = false;
var allow_delivery = false;
if(doc.docstatus==1) {
if(doc.status != 'Stopped' && doc.status != 'Closed') {
$.each(cur_frm.doc.items, function(i, item){
if(item.delivered_by_supplier == 1 || item.supplier){
if(item.qty > flt(item.ordered_qty))
is_delivered_by_supplier = true;
for (var i in cur_frm.doc.items) {
var item = cur_frm.doc.items[i];
if(item.delivered_by_supplier === 1 || item.supplier){
if(item.qty > flt(item.ordered_qty)
&& item.qty > flt(item.delivered_qty)) {
allow_purchase = true;
}
}
else{
if(item.qty > flt(item.delivered_qty))
is_delivery_note = true;
if (item.delivered_by_supplier===0) {
if(item.qty > flt(item.delivered_qty)) {
allow_delivery = true;
}
}
})
if (allow_delivery && allow_purchase) {
break;
}
}
// material request
if(!doc.order_type || ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1
@@ -39,7 +48,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
}
// make purchase order
if(flt(doc.per_delivered, 2) < 100 && is_delivered_by_supplier) {
if(flt(doc.per_delivered, 2) < 100 && allow_purchase) {
cur_frm.add_custom_button(__('Purchase Order'), cur_frm.cscript.make_purchase_order);
}
@@ -62,7 +71,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
}
// delivery note
if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && is_delivery_note) {
if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) {
cur_frm.add_custom_button(__('Delivery'), this.make_delivery_note).addClass("btn-primary");
}

View File

@@ -5,6 +5,7 @@ cur_frm.cscript.refresh = function(doc,dt,dn){
if(doc.__islocal){
hide_field(['address_html', 'contact_html']);
erpnext.utils.clear_address_and_contact(cur_frm);
}
else{
unhide_field(['address_html', 'contact_html']);

View File

@@ -78,11 +78,6 @@ frappe.ui.form.on("Item", {
frm.set_value("description", frm.doc.item_code);
},
tax_type: function(frm, cdt, cdn){
var d = locals[cdt][cdn];
return get_server_fields('get_tax_rate', d.tax_type, 'taxes', doc, cdt, cdn, 1);
},
copy_from_item_group: function(frm) {
return frm.call({
doc: frm.doc,
@@ -315,3 +310,4 @@ cur_frm.add_fetch('attribute', 'numeric_values', 'numeric_values');
cur_frm.add_fetch('attribute', 'from_range', 'from_range');
cur_frm.add_fetch('attribute', 'to_range', 'to_range');
cur_frm.add_fetch('attribute', 'increment', 'increment');
cur_frm.add_fetch('tax_type', 'tax_rate', 'tax_rate');

View File

@@ -398,9 +398,6 @@ class Item(WebsiteGenerator):
item_description=%s, modified=NOW() where item_code=%s""",
(self.item_name, self.description, self.name))
def get_tax_rate(self, tax_type):
return { "tax_rate": frappe.db.get_value("Account", tax_type, "tax_rate") }
def on_trash(self):
super(Item, self).on_trash()
frappe.db.sql("""delete from tabBin where item_code=%s""", self.item_code)

View File

@@ -143,22 +143,23 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
make_purchase_order: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order",
frm: cur_frm
})
frm: cur_frm,
run_link_triggers: true
});
},
make_supplier_quotation: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation",
frm: cur_frm
})
});
},
make_stock_entry: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry",
frm: cur_frm
})
});
}
});

View File

@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
version = "6.7.1"
version = "6.7.7"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()