Compare commits

..

35 Commits

Author SHA1 Message Date
Nabin Hait
0d5e208f8c Merge branch 'develop' 2016-07-28 16:01:00 +05:30
Nabin Hait
a163299991 bumped to version 7.0.9 2016-07-28 16:31:00 +06:00
Nabin Hait
acff41ddd2 Merge pull request #5906 from nabinhait/opportunity_status_fix
Added converted status in Opportunity
2016-07-28 15:59:43 +05:30
Nabin Hait
e72ff9377a Added converted status in Opportunity 2016-07-28 15:59:20 +05:30
Nabin Hait
a948407460 Merge branch 'develop' 2016-07-28 15:46:36 +05:30
Nabin Hait
ee70f26131 bumped to version 7.0.8 2016-07-28 16:16:35 +06:00
Rushabh Mehta
142b6187b3 Merge pull request #5902 from akshay83/develop
[fix] serial no button
2016-07-28 15:05:04 +05:30
akshay
14384c2787 [fix] serial no button 2016-07-28 13:53:17 +05:30
Nabin Hait
7357902802 Merge pull request #5896 from nabinhait/fix_112
[fix] repost gle only if there is any stock account without warehouse
2016-07-27 17:34:23 +05:30
Nabin Hait
fa97b3cac7 [fix] repost gle only if there is any stock account without warehouse 2016-07-27 17:33:32 +05:30
Nabin Hait
95f53cca44 Merge pull request #5885 from nabinhait/payment_entry_fix12
[fix] Set amounts only if party and bank account exists
2016-07-27 16:45:20 +05:30
Nabin Hait
949ceb18fc Merge pull request #5894 from nabinhait/sle_fix_101
minor fix for stock ledger entry
2016-07-27 16:44:54 +05:30
Nabin Hait
7590b8fff1 minor fix for stock ledger entry 2016-07-27 16:44:26 +05:30
Rushabh Mehta
5a8b7ca7be Merge pull request #5888 from neilLasrado/develop
[Patch] Change status in Opportunity to Quotation where status is converted
2016-07-27 16:03:21 +05:30
Neil Trini Lasrado
98151ce5b2 [Patch] Change status in Opportunity to Quotation where status is converted 2016-07-27 15:58:16 +05:30
Rushabh Mehta
380dbb044f Merge pull request #5886 from neilLasrado/develop
[Fix] Fixed issues in Fee records
2016-07-27 15:32:26 +05:30
Neil Trini Lasrado
ee75d41da0 [Fix] Fixed issues in Fee records 2016-07-27 15:23:19 +05:30
Rushabh Mehta
e26a42dc7a Merge branch 'develop' 2016-07-27 15:19:58 +05:30
Rushabh Mehta
b2c9848886 bumped to version 7.0.7 2016-07-27 15:49:58 +06:00
Nabin Hait
b4bf757a15 Update fix_nonwarehouse_ledger_gl_entries_for_transactions.py 2016-07-27 15:19:12 +05:30
Rushabh Mehta
fc49c2c5f9 Merge branch 'develop' 2016-07-27 15:09:03 +05:30
Rushabh Mehta
384f0b18c0 bumped to version 7.0.6 2016-07-27 15:39:03 +06:00
Nabin Hait
2a2346422d [fix] Set amounts only if party and bank account exists 2016-07-27 13:08:00 +05:30
Rushabh Mehta
548ea777a9 Merge pull request #5883 from saurabh6790/maintenance_schedule_fix
[fix] report filter fix
2016-07-27 12:43:41 +05:30
Nabin Hait
67047fbb06 Merge branch 'rohitwaghchaure-warehouse_blank_issue_for_non_stock_account' into develop 2016-07-27 12:43:25 +05:30
Nabin Hait
10007ab4df [fix] reposting of gle where stock account not linked with warehouse 2016-07-27 12:43:02 +05:30
Nabin Hait
444bedcd20 Merge branch 'warehouse_blank_issue_for_non_stock_account' of https://github.com/rohitwaghchaure/erpnext_develop into rohitwaghchaure-warehouse_blank_issue_for_non_stock_account 2016-07-27 12:33:10 +05:30
Rushabh Mehta
2af5dfa9cc Merge pull request #5884 from saurabh6790/schools_fix
[minor][fix] rename attribute from amount to components
2016-07-27 12:23:22 +05:30
Saurabh
4bc0f7d105 [minor][fix] rename attribute from amount to components 2016-07-27 12:10:21 +05:30
Saurabh
3642f987c7 [fix] report filter fix 2016-07-27 11:42:50 +05:30
Rushabh Mehta
fd288f36ec Merge pull request #5880 from bcornwellmott/fixSalarySlip_TimeSheet_SQL
Added date filters for the Timesheet query in Salary Slip
2016-07-27 08:22:29 +05:30
Rushabh Mehta
593d2e3146 Merge pull request #5877 from rohitwaghchaure/v7_fixes
[minor] Fixes
2016-07-26 21:21:45 +05:30
Rohit Waghchaure
c4afd63e50 [minor] Fixes 2016-07-26 20:47:42 +05:30
Rohit Waghchaure
4d3e8da4a2 [Fix] Set warehouse to stock account and fixed gl entries against transactions. 2016-07-26 17:09:33 +05:30
Ben Cornwell-Mott
d4d1f1b036 Added date filters for the Timesheet query in Salary Slip 2016-07-26 03:33:38 -07:00
15 changed files with 95 additions and 31 deletions

View File

@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '7.0.5'
__version__ = '7.0.9'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -251,8 +251,8 @@ class PaymentEntry(AccountsController):
self.unallocated_amount = party_amount - self.total_allocated_amount
def set_difference_amount(self):
base_unallocated_amount = flt(self.unallocated_amount) * \
(self.source_exchange_rate if self.payment_type=="Receive" else self.target_exchange_rate)
base_unallocated_amount = flt(self.unallocated_amount) * (flt(self.source_exchange_rate)
if self.payment_type=="Receive" else flt(self.target_exchange_rate))
base_party_amount = flt(self.base_total_allocated_amount) + flt(base_unallocated_amount)
@@ -672,7 +672,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
pe.setup_party_account_field()
pe.set_missing_values()
if bank:
if party_account and bank:
pe.set_exchange_rate()
pe.set_amounts()
return pe

View File

@@ -10,6 +10,7 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 1,
"fields": [
{
"allow_on_submit": 0,
@@ -266,7 +267,7 @@
"no_copy": 1,
"oldfieldname": "status",
"oldfieldtype": "Select",
"options": "Open\nQuotation\nLost\nReplied\nClosed",
"options": "Open\nQuotation\nConverted\nLost\nReplied\nClosed",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
@@ -1001,7 +1002,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-06-14 15:50:55.080217",
"modified": "2016-07-28 15:58:06.614493",
"modified_by": "Administrator",
"module": "CRM",
"name": "Opportunity",

View File

@@ -64,8 +64,8 @@ class SalarySlip(TransactionBase):
if self.salary_slip_based_on_timesheet and not self.get('timesheets'):
self.set("timesheets", [])
timesheets = frappe.db.sql(""" select * from `tabTimesheet` where employee = %(employee)s and (status = 'Submitted' or
status = 'Billed')""", {'employee': self.employee}, as_dict=1)
timesheets = frappe.db.sql(""" select * from `tabTimesheet` where employee = %(employee)s and start_date BETWEEN %(start_date)s AND %(end_date)s and (status = 'Submitted' or
status = 'Billed')""", {'employee': self.employee, 'start_date': self.start_date, 'end_date': self.end_date}, as_dict=1)
for data in timesheets:
self.append('timesheets', {

View File

@@ -279,7 +279,7 @@ execute:frappe.rename_doc("DocType", "Payments", "Sales Invoice Payment", force=
erpnext.patches.v7_0.update_mins_to_first_response
erpnext.patches.v6_20x.repost_valuation_rate_for_negative_inventory
erpnext.patches.v7_0.system_settings_setup_complete
erpnext.patches.v7_0.set_naming_series_for_timesheet
erpnext.patches.v7_0.set_naming_series_for_timesheet #2016-07-27
execute:frappe.reload_doc('projects', 'doctype', 'project')
execute:frappe.reload_doc('projects', 'doctype', 'project_user')
erpnext.patches.v7_0.convert_timelogbatch_to_timesheet
@@ -303,3 +303,4 @@ erpnext.patches.v7_0.migrate_schools_to_erpnext
erpnext.patches.v7_0.remove_administrator_role_in_doctypes
erpnext.patches.v7_0.rename_fee_amount_to_fee_component
erpnext.patches.v7_0.calculate_total_costing_amount
erpnext.patches.v7_0.fix_nonwarehouse_ledger_gl_entries_for_transactions

View File

@@ -11,5 +11,6 @@ def execute():
ts.update_cost()
ts.calculate_total_amounts()
ts.flags.ignore_validate = True
ts.flags.ignore_mandatory = True
ts.flags.ignore_validate_update_after_submit = True
ts.save()

View File

@@ -0,0 +1,52 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if not frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock"):
return
frappe.reload_doctype("Account")
warehouses = frappe.db.sql_list("""select name from tabAccount
where account_type = 'Stock' and is_group = 0
and (warehouse is null or warehouse = '')""")
if warehouses:
warehouses = set_warehouse_for_stock_account(warehouses)
if not warehouses:
return
stock_vouchers = frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no
from `tabStock Ledger Entry` sle
where sle.warehouse in (%s) and creation > '2016-05-01'
and not exists(select name from `tabGL Entry`
where account=sle.warehouse and voucher_type=sle.voucher_type and voucher_no=sle.voucher_no)
order by sle.posting_date""" %
', '.join(['%s']*len(warehouses)), tuple(warehouses))
rejected = []
for voucher_type, voucher_no in stock_vouchers:
try:
frappe.db.sql("""delete from `tabGL Entry`
where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no))
voucher = frappe.get_doc(voucher_type, voucher_no)
voucher.make_gl_entries()
frappe.db.commit()
except Exception, e:
print frappe.get_traceback()
rejected.append([voucher_type, voucher_no])
frappe.db.rollback()
print rejected
def set_warehouse_for_stock_account(warehouse_account):
for account in warehouse_account:
if frappe.db.exists('Warehouse', account):
frappe.db.set_value("Account", account, "warehouse", account)
else:
warehouse_account.remove(account)
return warehouse_account

View File

@@ -33,13 +33,13 @@ $.extend(erpnext, {
setup_serial_no: function() {
var grid_row = cur_frm.open_grid_row();
if(!grid_row || !grid_row.fields_dict.serial_no ||
grid_row.fields_dict.serial_no.get_status()!=="Write") return;
if(!grid_row || !grid_row.grid_form.fields_dict.serial_no ||
grid_row.grid_form.fields_dict.serial_no.get_status()!=="Write") return;
var $btn = $('<button class="btn btn-sm btn-default">'+__("Add Serial No")+'</button>')
.appendTo($("<div>")
.css({"margin-bottom": "10px", "margin-top": "10px"})
.appendTo(grid_row.fields_dict.serial_no.$wrapper));
.appendTo(grid_row.grid_form.fields_dict.serial_no.$wrapper));
$btn.on("click", function() {
var d = new frappe.ui.Dialog({
@@ -69,7 +69,7 @@ $.extend(erpnext, {
var serial_no = d.get_value("serial_no");
if(serial_no) {
var val = (grid_row.doc.serial_no || "").split("\n").concat([serial_no]).join("\n");
grid_row.fields_dict.serial_no.set_model_value(val.trim());
grid_row.grid_form.fields_dict.serial_no.set_model_value(val.trim());
}
d.hide();
return false;
@@ -190,4 +190,4 @@ $(document).on('app_ready', function() {
});
});
}
});
});

View File

@@ -13,6 +13,6 @@ class FeeStructure(Document):
def calculate_total(self):
"""Calculates total amount."""
self.total_amount = 0
for d in self.amount:
for d in self.components:
self.total_amount += d.amount

View File

@@ -394,6 +394,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"default": "0",
"fieldname": "total_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -419,7 +420,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"default": "",
"default": "0",
"fieldname": "paid_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -445,6 +446,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"default": "0",
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -478,7 +480,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-07-25 08:44:33.595812",
"modified": "2016-07-27 03:52:28.509757",
"modified_by": "Administrator",
"module": "Schools",
"name": "Fees",

View File

@@ -14,8 +14,9 @@ class Fees(Document):
def calculate_total(self):
"""Calculates total amount."""
self.total_amount = 0
for d in self.amount:
for d in self.components:
self.total_amount += d.amount
self.outstanding_amount = self.total_amount
def get_fee_list(doctype, txt, filters, limit_start, limit_page_length=20):
user = frappe.session.user

View File

@@ -71,9 +71,11 @@ def get_conditions(filters):
conditions += " and item_code = '%s'" % frappe.db.escape(filters.get("item_code"), percent=False)
if filters.get("warehouse"):
lft, rgt = frappe.db.get_value("Warehouse", filters.get("warehouse"), ["lft", "rgt"])
conditions += " and exists (select name from `tabWarehouse` wh \
where wh.lft >= %s and wh.rgt <= %s and sle.warehouse = wh.name)"%(lft, rgt)
warehouse_details = frappe.db.get_value("Warehouse", filters.get("warehouse"), ["lft", "rgt"], as_dict=1)
if warehouse_details:
conditions += " and exists (select name from `tabWarehouse` wh \
where wh.lft >= %s and wh.rgt <= %s and sle.warehouse = wh.name)"%(warehouse_details.lft,
warehouse_details.rgt)
return conditions

View File

@@ -99,8 +99,10 @@ def get_opening_balance(filters, columns):
return row
def get_warehouse_condition(warehouse):
lft, rgt = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"])
return " exists (select name from `tabWarehouse` wh \
where wh.lft >= %s and wh.rgt <= %s and sle.warehouse = wh.name)"%(lft, rgt)
warehouse_details = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"], as_dict=1)
if warehouse_details:
return " exists (select name from `tabWarehouse` wh \
where wh.lft >= %s and wh.rgt <= %s and sle.warehouse = wh.name)"%(warehouse_details.lft,
warehouse_details.rgt)
return ''

View File

@@ -63,10 +63,12 @@ def get_bin_list(filters):
conditions.append("item_code = '%s' "%filters.item_code)
if filters.warehouse:
lft, rgt = frappe.db.get_value("Warehouse", filters.warehouse, ["lft", "rgt"])
conditions.append(" exists (select name from `tabWarehouse` wh \
where wh.lft >= %s and wh.rgt <= %s and bin.warehouse = wh.name)"%(lft, rgt))
warehouse_details = frappe.db.get_value("Warehouse", filters.warehouse, ["lft", "rgt"], as_dict=1)
if warehouse_details:
conditions.append(" exists (select name from `tabWarehouse` wh \
where wh.lft >= %s and wh.rgt <= %s and bin.warehouse = wh.name)"%(warehouse_details.lft,
warehouse_details.rgt))
bin_list = frappe.db.sql("""select item_code, warehouse, actual_qty, planned_qty, indented_qty,
ordered_qty, reserved_qty, reserved_qty_for_production, projected_qty

View File

@@ -250,7 +250,7 @@ class update_entries_after(object):
self.valuation_rate = new_stock_value / new_stock_qty
else:
self.valuation_rate = self.outgoing_rate
self.valuation_rate = sle.outgoing_rate
else:
if flt(self.qty_after_transaction) >= 0 and sle.outgoing_rate: