Compare commits

...

27 Commits

Author SHA1 Message Date
Nabin Hait
c657cceffc Merge branch 'hotfix' 2017-01-02 17:26:54 +05:30
Nabin Hait
1ecf613c3c bumped to version 7.2.6 2017-01-02 17:56:54 +06:00
Nabin Hait
ceea71bcfc Merge pull request #7365 from rohitwaghchaure/terms_and_condition
minor fix
2017-01-02 17:24:42 +05:30
Nabin Hait
b0e329b803 Merge pull request #7367 from saurabh6790/sms_log_fix
[fix] status check fix
2017-01-02 17:24:25 +05:30
Nabin Hait
506120936a Merge pull request #7373 from KanchanChauhan/leave-for-absent
[Fix] Attendance validation in Leave Application
2017-01-02 17:23:45 +05:30
Nabin Hait
7fc18f359c Currency symbol for budget amount based on company 2017-01-02 17:21:34 +05:30
Nabin Hait
92254d3930 Set serial nos in DN based on FIFO based on Stock Settings 2017-01-02 17:01:27 +05:30
Nabin Hait
06966e8e1d minor fix 2017-01-02 15:10:01 +05:30
Kanchan Chauhan
5594050104 [Fix] Attendance validation in Leave Application 2017-01-02 11:14:44 +05:30
Rohit Waghchaure
cdbacf5398 minor fix 2016-12-30 17:06:01 +05:30
Saurabh
6bbed0297b [fix] status check fix 2016-12-30 17:05:40 +05:30
Nabin Hait
3cae3a5190 Merge branch 'hotfix' 2016-12-30 15:54:31 +05:30
Nabin Hait
edb99f8750 bumped to version 7.2.5 2016-12-30 16:24:31 +06:00
Nabin Hait
4de4b56c60 Merge pull request #7363 from rohitwaghchaure/terms_and_conditions_for_company
set default terms and condition if tc_name is available on the form
2016-12-30 15:46:57 +05:30
Rohit Waghchaure
585448b225 set default terms and condition if tc_name is available on the form 2016-12-30 15:41:55 +05:30
Nabin Hait
257ecf71ac Merge branch 'hotfix' 2016-12-30 14:56:20 +05:30
Nabin Hait
5105b1e789 bumped to version 7.2.4 2016-12-30 15:26:19 +06:00
Nabin Hait
dc0a277085 Merge pull request #7355 from manassolanki/hotfix
Fetching the item details from the reference doctype in QI
2016-12-30 14:10:21 +05:30
Nabin Hait
fa2feae314 Merge pull request #7359 from nabinhait/hotfix
[fix] Make Journal Entry against SO
2016-12-30 12:38:56 +05:30
Nabin Hait
494a4d9ba1 Merge pull request #7360 from KanchanChauhan/salary-register-repprt
[Fix] Monthly Salary Register Fix
2016-12-30 12:38:46 +05:30
Kanchan Chauhan
7b29dc7208 [Fix] Monthly Salary Register Fix 2016-12-30 12:36:00 +05:30
Nabin Hait
9646be1d5d [fix] Make Journal Entry against SO 2016-12-30 11:14:41 +05:30
Manas Solanki
5c82e9ef8b Fetching the item details from the reference doctype in quality inspection
Error Report [2016-12-29]
2016-12-29 18:01:25 +05:30
Nabin Hait
ae25e0da88 Merge branch 'hotfix' 2016-12-29 11:04:05 +05:30
Nabin Hait
3d98d23e22 bumped to version 7.2.3 2016-12-29 11:34:05 +06:00
Nabin Hait
11bde0ba14 Patch fixed 2016-12-29 10:58:05 +05:30
Rushabh Mehta
94c4d7014d [fix] item_name in stock reco 2016-12-28 06:56:09 +05:30
13 changed files with 57 additions and 38 deletions

View File

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

View File

@@ -9,11 +9,13 @@
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "account",
"fieldtype": "Link",
"hidden": 0,
@@ -30,6 +32,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -40,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "budget_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -50,11 +54,13 @@
"label": "Budget Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -72,7 +78,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:27:58.705376",
"modified": "2017-01-02 17:02:53.339420",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Budget Account",

View File

@@ -326,10 +326,12 @@ class JournalEntry(AccountsController):
if d.account_currency == self.company_currency:
d.exchange_rate = 1
elif not d.exchange_rate or d.exchange_rate == 1 or \
(d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name and d.posting_date):
(d.reference_type in ("Sales Invoice", "Purchase Invoice")
and d.reference_name and self.posting_date):
# Modified to include the posting date for which to retreive the exchange rate
d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency, self.company,
d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency,
self.company, d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
if not d.exchange_rate:
frappe.throw(_("Row {0}: Exchange Rate is mandatory").format(d.idx))
@@ -651,7 +653,8 @@ def get_payment_entry(ref_doc, args):
if args.get("party_account"):
# Modified to include the posting date for which the exchange rate is required.
# Assumed to be the posting date in the reference document
exchange_rate = get_exchange_rate(ref_doc.posting_date, args.get("party_account"), args.get("party_account_currency"),
exchange_rate = get_exchange_rate(ref_doc.get("posting_date") or ref_doc.get("transaction_date"),
args.get("party_account"), args.get("party_account_currency"),
ref_doc.company, ref_doc.doctype, ref_doc.name)
je = frappe.new_doc("Journal Entry")
@@ -686,7 +689,8 @@ def get_payment_entry(ref_doc, args):
bank_row.update(bank_account)
# Modified to include the posting date for which the exchange rate is required.
# Assumed to be the posting date of the reference date
bank_row.exchange_rate = get_exchange_rate(ref_doc.posting_date, bank_account["account"],
bank_row.exchange_rate = get_exchange_rate(ref_doc.get("posting_date")
or ref_doc.get("transaction_date"), bank_account["account"],
bank_account["account_currency"], ref_doc.company)
bank_row.cost_center = cost_center

View File

@@ -109,12 +109,16 @@ def apply_pricing_rule(args):
item_list = args.get("items")
args.pop("items")
set_serial_nos_based_on_fifo = frappe.db.get_single_value("Stock Settings",
"automatically_set_serial_nos_based_on_fifo")
for item in item_list:
args_copy = copy.deepcopy(args)
args_copy.update(item)
out.append(get_pricing_rule_for_item(args_copy))
out.append(get_serial_no_for_item(args_copy))
if set_serial_nos_based_on_fifo:
out.append(get_serial_no_for_item(args_copy))
return out
def get_serial_no_for_item(args):

View File

@@ -217,7 +217,7 @@ class LeaveApplication(Document):
def validate_attendance(self):
attendance = frappe.db.sql("""select name from `tabAttendance` where employee = %s and (att_date between %s and %s)
and docstatus = 1""",
and status = "Present" and docstatus = 1""",
(self.employee, self.from_date, self.to_date))
if attendance:
frappe.throw(_("Attendance for employee {0} is already marked for this day").format(self.employee),

View File

@@ -4,19 +4,18 @@
frappe.query_reports["Monthly Salary Register"] = {
"filters": [
{
"fieldname":"month",
"label": __("Month"),
"fieldtype": "Select",
"options": "\nJan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
"default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
"Dec"][frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth()],
"fieldname":"from_date",
"label": __("From"),
"fieldtype": "Date",
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
"reqd": 1
},
{
"fieldname":"fiscal_year",
"label": __("Fiscal Year"),
"fieldtype": "Link",
"options": "Fiscal Year",
"default": sys_defaults.fiscal_year,
"fieldname":"to_date",
"label": __("To"),
"fieldtype": "Date",
"default": frappe.datetime.get_today(),
"reqd": 1
},
{
"fieldname":"employee",

View File

@@ -18,7 +18,7 @@ def execute(filters=None):
data = []
for ss in salary_slips:
row = [ss.name, ss.employee, ss.employee_name, ss.branch, ss.department, ss.designation,
ss.company, ss.month, ss.leave_withut_pay, ss.payment_days]
ss.company, ss.start_date, ss.end_date, ss.leave_withut_pay, ss.payment_days]
for e in earning_types:
row.append(ss_earning_map.get(ss.name, {}).get(e))
@@ -38,7 +38,7 @@ def get_columns(salary_slips):
columns = [
_("Salary Slip ID") + ":Link/Salary Slip:150",_("Employee") + ":Link/Employee:120", _("Employee Name") + "::140", _("Branch") + ":Link/Branch:120",
_("Department") + ":Link/Department:120", _("Designation") + ":Link/Designation:120",
_("Company") + ":Link/Company:120", _("Month") + "::80", _("Leave Without Pay") + ":Float:130",
_("Company") + ":Link/Company:120", _("Start Date") + "::80", _("End Date") + "::80", _("Leave Without Pay") + ":Float:130",
_("Payment Days") + ":Float:120"
]
@@ -60,23 +60,18 @@ def get_columns(salary_slips):
def get_salary_slips(filters):
conditions, filters = get_conditions(filters)
salary_slips = frappe.db.sql("""select * from `tabSalary Slip` where docstatus = 1 %s
order by employee, month""" % conditions, filters, as_dict=1)
order by employee""" % conditions, filters, as_dict=1)
if not salary_slips:
frappe.throw(_("No salary slip found for month {0} and year {1}").format(
filters.get("month"), filters.get("fiscal_year")))
frappe.throw(_("No salary slip found between {0} and {1}").format(
filters.get("from_date"), filters.get("to_date")))
return salary_slips
def get_conditions(filters):
conditions = ""
if filters.get("month"):
month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
"Dec"].index(filters["month"]) + 1
filters["month"] = month
conditions += " and month = %(month)s"
if filters.get("fiscal_year"): conditions += " and fiscal_year = %(fiscal_year)s"
if filters.get("from_date"): conditions += " and start_date >= %(from_date)s"
if filters.get("to_date"): conditions += " and end_date <= %(to_date)s"
if filters.get("company"): conditions += " and company = %(company)s"
if filters.get("employee"): conditions += " and employee = %(employee)s"

View File

@@ -3,5 +3,13 @@ import frappe
def execute():
stock_settings = frappe.get_doc('Stock Settings')
if stock_settings.default_warehouse \
and not frappe.db.exists("Warehouse", stock_settings.default_warehouse):
stock_settings.default_warehouse = None
if stock_settings.stock_uom and not frappe.db.exists("UOM", stock_settings.stock_uom):
stock_settings.stock_uom = None
stock_settings.flags.ignore_mandatory = True
stock_settings.save()

View File

@@ -349,7 +349,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
me.frm.set_value("letter_head", company_doc.default_letter_head);
}
}
if (company_doc.default_terms && me.frm.doc.doctype != "Purchase Invoice") {
if (company_doc.default_terms && me.frm.doc.doctype != "Purchase Invoice" && frappe.meta.has_field(me.frm.doc.doctype, "tc_name")) {
me.frm.set_value("tc_name", company_doc.default_terms);
}

View File

@@ -77,7 +77,7 @@ def send_via_gateway(arg):
for d in arg.get('receiver_list'):
args[ss.receiver_parameter] = d
status = send_request(ss.sms_gateway_url, args)
if status > 200 and status < 300:
if status >= 200 and status < 300:
success_list.append(d)
if len(success_list) > 0:

View File

@@ -9,7 +9,8 @@ from frappe.utils.jinja import validate_template
class TermsandConditions(Document):
def validate(self):
validate_template(self.terms)
if self.terms:
validate_template(self.terms)
@frappe.whitelist()
def get_terms_and_conditions(template_name, doc):

View File

@@ -9,7 +9,7 @@ cur_frm.fields_dict['item_code'].get_query = function(doc, cdt, cdn) {
return {
query: "erpnext.stock.doctype.quality_inspection.quality_inspection.item_query",
filters: {
"from": doc.reference_type,
"from": doc.reference_type + " Item",
"parent": doc.reference_name
}
}

View File

@@ -237,7 +237,7 @@ class StockReconciliation(StockController):
elif not frappe.db.sql("""select name from `tabStock Ledger Entry` limit 1"""):
if frappe.db.get_value("Account", self.expense_account, "report_type") == "Profit and Loss":
frappe.throw(_("Difference Account must be a Asset/Liability type account, since this Stock Reconciliation is an Opening Entry"), OpeningEntryAccountError)
def set_total_qty_and_amount(self):
for d in self.get("items"):
d.amount = flt(d.qty) * flt(d.valuation_rate)
@@ -267,7 +267,8 @@ def get_items(warehouse, posting_date, posting_time):
items = frappe.get_list("Bin", fields=["item_code"], filters={"warehouse": warehouse}, as_list=1)
items += frappe.get_list("Item", fields=["name"], filters= {"is_stock_item": 1, "has_serial_no": 0,
"has_batch_no": 0, "has_variants": 0, "disabled": 0, "default_warehouse": warehouse}, as_list=1)
"has_batch_no": 0, "has_variants": 0, "disabled": 0, "default_warehouse": warehouse},
as_list=1)
res = []
for item in set(items):
@@ -280,6 +281,7 @@ def get_items(warehouse, posting_date, posting_time):
"item_code": item[0],
"warehouse": warehouse,
"qty": stock_bal[0],
"item_name": frappe.db.get_value('Item', item[0], 'item_name'),
"valuation_rate": stock_bal[1],
"current_qty": stock_bal[0],
"current_valuation_rate": stock_bal[1]