mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
Merge branch 'develop'
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
__version__ = '5.0.24'
|
__version__ = '5.0.25'
|
||||||
|
|||||||
@@ -29,7 +29,8 @@
|
|||||||
"options": "Supplier",
|
"options": "Supplier",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0
|
"read_only": 0,
|
||||||
|
"search_index": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "supplier",
|
"depends_on": "supplier",
|
||||||
@@ -112,7 +113,7 @@
|
|||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 1
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "bill_date",
|
"fieldname": "bill_date",
|
||||||
@@ -125,7 +126,7 @@
|
|||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 1
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "amended_from",
|
"fieldname": "amended_from",
|
||||||
@@ -151,7 +152,7 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"search_index": 1
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "currency_and_price_list",
|
"fieldname": "currency_and_price_list",
|
||||||
@@ -452,7 +453,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "base_discount_amount",
|
"fieldname": "base_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Discount Amount (Company Currency)",
|
"label": "Additional Discount Amount (Company Currency)",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@@ -556,7 +557,7 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"search_index": 1
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "write_off_amount",
|
"fieldname": "write_off_amount",
|
||||||
@@ -733,7 +734,7 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"search_index": 1
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
@@ -760,7 +761,7 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"search_index": 1
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "mode_of_payment",
|
"fieldname": "mode_of_payment",
|
||||||
@@ -789,7 +790,7 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"search_index": 1
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "remarks",
|
"fieldname": "remarks",
|
||||||
@@ -930,7 +931,7 @@
|
|||||||
"icon": "icon-file-text",
|
"icon": "icon-file-text",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2015-05-27 02:54:48.668118",
|
"modified": "2015-06-16 16:46:47.308287",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Invoice",
|
"name": "Purchase Invoice",
|
||||||
|
|||||||
@@ -38,7 +38,8 @@
|
|||||||
"options": "Customer",
|
"options": "Customer",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0
|
"read_only": 0,
|
||||||
|
"search_index": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "customer",
|
"depends_on": "customer",
|
||||||
@@ -502,7 +503,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "base_discount_amount",
|
"fieldname": "base_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Discount Amount (Company Currency)",
|
"label": "Additional Discount Amount (Company Currency)",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@@ -880,7 +881,7 @@
|
|||||||
"options": "Project",
|
"options": "Project",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"search_index": 1
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.source == 'Campaign'",
|
"depends_on": "eval:doc.source == 'Campaign'",
|
||||||
@@ -1243,7 +1244,7 @@
|
|||||||
"icon": "icon-file-text",
|
"icon": "icon-file-text",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2015-05-27 02:48:02.897865",
|
"modified": "2015-06-16 16:45:06.618286",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice",
|
"name": "Sales Invoice",
|
||||||
|
|||||||
@@ -65,8 +65,7 @@ class SalesInvoice(SellingController):
|
|||||||
self.set_against_income_account()
|
self.set_against_income_account()
|
||||||
self.validate_c_form()
|
self.validate_c_form()
|
||||||
self.validate_time_logs_are_submitted()
|
self.validate_time_logs_are_submitted()
|
||||||
self.validate_multiple_billing("Delivery Note", "dn_detail", "amount",
|
self.validate_multiple_billing("Delivery Note", "dn_detail", "amount", "items")
|
||||||
"items")
|
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
super(SalesInvoice, self).on_submit()
|
super(SalesInvoice, self).on_submit()
|
||||||
|
|||||||
@@ -9,8 +9,9 @@ from frappe.utils import flt
|
|||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
|
validate_filters(filters)
|
||||||
|
|
||||||
columns = get_columns()
|
columns = get_columns(filters)
|
||||||
entries = get_entries(filters)
|
entries = get_entries(filters)
|
||||||
invoice_posting_date_map = get_invoice_posting_date_map(filters)
|
invoice_posting_date_map = get_invoice_posting_date_map(filters)
|
||||||
against_date = ""
|
against_date = ""
|
||||||
@@ -37,10 +38,17 @@ def execute(filters=None):
|
|||||||
|
|
||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
def get_columns():
|
def validate_filters(filters):
|
||||||
|
if (filters.get("payment_type") == "Incoming" and filters.get("party_type") == "Supplier") or \
|
||||||
|
(filters.get("payment_type") == "Outgoing" and filters.get("party_type") == "Customer"):
|
||||||
|
frappe.throw(_("{0} payment entries can not be filtered by {1}")\
|
||||||
|
.format(filters.payment_type, filters.party_type))
|
||||||
|
|
||||||
|
def get_columns(filters):
|
||||||
return [_("Journal Entry") + ":Link/Journal Entry:140",
|
return [_("Journal Entry") + ":Link/Journal Entry:140",
|
||||||
_("Party Type") + ":Link/DocType:100", _("Party") + ":Dynamic Link/party_type:140",
|
_("Party Type") + ":Link/DocType:100", _("Party") + ":Dynamic Link/Party Type:140",
|
||||||
_("Posting Date") + ":Date:100", _("Against Invoice") + ":Link/Purchase Invoice:130",
|
_("Posting Date") + ":Date:100",
|
||||||
|
_("Against Invoice") + (":Link/Purchase Invoice:130" if filters.get("payment_type") == "Outgoing" else ":Link/Sales Invoice:130"),
|
||||||
_("Against Invoice Posting Date") + ":Date:130", _("Debit") + ":Currency:120", _("Credit") + ":Currency:120",
|
_("Against Invoice Posting Date") + ":Date:130", _("Debit") + ":Currency:120", _("Credit") + ":Currency:120",
|
||||||
_("Reference No") + "::100", _("Reference Date") + ":Date:100", _("Remarks") + "::150", _("Age") +":Int:40",
|
_("Reference No") + "::100", _("Reference Date") + ":Date:100", _("Remarks") + "::150", _("Age") +":Int:40",
|
||||||
"0-30:Currency:100", "30-60:Currency:100", "60-90:Currency:100", _("90-Above") + ":Currency:100"
|
"0-30:Currency:100", "30-60:Currency:100", "60-90:Currency:100", _("90-Above") + ":Currency:100"
|
||||||
|
|||||||
@@ -457,7 +457,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "base_discount_amount",
|
"fieldname": "base_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Discount Amount (Company Currency)",
|
"label": "Additional Discount Amount (Company Currency)",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@@ -873,7 +873,7 @@
|
|||||||
"icon": "icon-file-text",
|
"icon": "icon-file-text",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2015-06-02 17:15:44.711032",
|
"modified": "2015-06-15 15:38:56.794601",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Purchase Order",
|
"name": "Purchase Order",
|
||||||
|
|||||||
@@ -439,7 +439,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "base_discount_amount",
|
"fieldname": "base_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Discount Amount (Company Currency)",
|
"label": "Additional Discount Amount (Company Currency)",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@@ -660,7 +660,7 @@
|
|||||||
"icon": "icon-shopping-cart",
|
"icon": "icon-shopping-cart",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2015-06-02 17:15:57.283516",
|
"modified": "2015-06-15 15:39:08.954248",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Supplier Quotation",
|
"name": "Supplier Quotation",
|
||||||
|
|||||||
17
erpnext/change_log/v5/v5_0_25.md
Normal file
17
erpnext/change_log/v5/v5_0_25.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
- Performance upgrade in Trial Balance, General Ledger, AR/AP, Balance Sheet and P&L Statement reports
|
||||||
|
- Add index on Account and GL Entry, Sales Invoice and Purchase Invoice table
|
||||||
|
- Don't create Time Logs against Production Order if Workstation is not specified in Operations
|
||||||
|
- Task should be mandatory in Time Log only when Project is mentioned but Production Order is not
|
||||||
|
- Supplier invoice no unique validation and supplier invoice date can not be after posting date
|
||||||
|
- Removed BOM No from mandatory from Stock Entry against Production Order
|
||||||
|
- Load tasks in project for printing purpose
|
||||||
|
- Added Customers Not Buying Since Long Time against Sales Invoice
|
||||||
|
- POS - search by Item Group
|
||||||
|
- Payment period based on invoice date: show party columns and filter based on party
|
||||||
|
- Barcode added to Purchase Receipt
|
||||||
|
- Fetch item name and desc on change of item code in Quality Inspection
|
||||||
|
- Show item name in item grid view based 'In List View' property
|
||||||
|
- Validate and update manufactured qty in Stock Entry
|
||||||
|
- Show only users with Expense Approver role in Expense Claim Approver field
|
||||||
|
- Over Production Allowance Percentage Setting added to Manufacturing Settings
|
||||||
|
- Activity Cost - Mandatory removed for Employee
|
||||||
@@ -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.24"
|
app_version = "5.0.25"
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ cur_frm.cscript.onload = function(doc,cdt,cdn) {
|
|||||||
|
|
||||||
cur_frm.set_query("exp_approver", function() {
|
cur_frm.set_query("exp_approver", function() {
|
||||||
return {
|
return {
|
||||||
filters: [["UserRole", "role", "=", "Expense Approver"]]
|
query: "erpnext.hr.doctype.expense_claim.expense_claim.get_expense_approver"
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,3 +59,12 @@ class ExpenseClaim(Document):
|
|||||||
for d in self.get('expenses'):
|
for d in self.get('expenses'):
|
||||||
if flt(d.sanctioned_amount) > flt(d.claim_amount):
|
if flt(d.sanctioned_amount) > flt(d.claim_amount):
|
||||||
frappe.throw(_("Sanctioned Amount cannot be greater than Claim Amount in Row {0}.").format(d.idx))
|
frappe.throw(_("Sanctioned Amount cannot be greater than Claim Amount in Row {0}.").format(d.idx))
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_expense_approver(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
return frappe.db.sql("""
|
||||||
|
select u.name, concat(u.first_name, ' ', u.last_name)
|
||||||
|
from tabUser u, tabUserRole r
|
||||||
|
where u.name = r.parent and r.role = 'Expense Approver' and u.name like %s
|
||||||
|
""", ("%" + txt + "%"))
|
||||||
@@ -55,6 +55,13 @@
|
|||||||
"label": "Time Between Operations (in mins)",
|
"label": "Time Between Operations (in mins)",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": ""
|
"precision": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "over_production_allowance_percentage",
|
||||||
|
"fieldtype": "Percent",
|
||||||
|
"label": "Over Production Allowance Percentage",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
@@ -65,7 +72,7 @@
|
|||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2015-04-21 07:57:40.260862",
|
"modified": "2015-06-15 05:52:22.986958",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Manufacturing Settings",
|
"name": "Manufacturing Settings",
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ class ProductionOrder(Document):
|
|||||||
# total qty in SO
|
# total qty in SO
|
||||||
so_qty = flt(so_item_qty) + flt(dnpi_qty)
|
so_qty = flt(so_item_qty) + flt(dnpi_qty)
|
||||||
|
|
||||||
if total_qty > so_qty:
|
allowance_percentage = flt(frappe.db.get_single_value("Manufacturing Settings", "over_production_allowance_percentage"))
|
||||||
|
if total_qty > so_qty + (allowance_percentage/100 * so_qty):
|
||||||
frappe.throw(_("Cannot produce more Item {0} than Sales Order quantity {1}").format(self.production_item,
|
frappe.throw(_("Cannot produce more Item {0} than Sales Order quantity {1}").format(self.production_item,
|
||||||
so_qty), OverProductionError)
|
so_qty), OverProductionError)
|
||||||
|
|
||||||
|
|||||||
@@ -5,18 +5,26 @@ import frappe
|
|||||||
def execute():
|
def execute():
|
||||||
index_map = {
|
index_map = {
|
||||||
"Account": ["parent_account", "lft", "rgt"],
|
"Account": ["parent_account", "lft", "rgt"],
|
||||||
"GL Entry": ["posting_date", "account", 'party', "voucher_no"]
|
"GL Entry": ["posting_date", "account", 'party', "voucher_no"],
|
||||||
|
"Sales Invoice": ["posting_date", "debit_to", "customer"],
|
||||||
|
"Purchase Invoice": ["posting_date", "credit_to", "supplier"]
|
||||||
}
|
}
|
||||||
|
|
||||||
for dt, indexes in index_map.items():
|
for dt, indexes in index_map.items():
|
||||||
existing_indexes = [d.Key_name for d in frappe.db.sql("""show index from `tab{0}`
|
existing_indexes = [(d.Key_name, d.Column_name) for d in frappe.db.sql("""show index from `tab{0}`
|
||||||
where Column_name != 'name'""".format(dt), as_dict=1)]
|
where Column_name != 'name'""".format(dt), as_dict=1)]
|
||||||
|
|
||||||
for old in existing_indexes:
|
for old, column in existing_indexes:
|
||||||
if old in ("parent", "group_or_ledger", "is_pl_account", "debit_or_credit", "account_name", "company"):
|
if column in ("parent", "group_or_ledger", "is_group", "is_pl_account", "debit_or_credit",
|
||||||
|
"account_name", "company", "project_name", "voucher_date", "due_date", "bill_no",
|
||||||
|
"bill_date", "is_opening", "fiscal_year", "outstanding_amount"):
|
||||||
frappe.db.sql("alter table `tab{0}` drop index {1}".format(dt, old))
|
frappe.db.sql("alter table `tab{0}` drop index {1}".format(dt, old))
|
||||||
existing_indexes.remove(old)
|
|
||||||
|
existing_indexes = [(d.Key_name, d.Column_name) for d in frappe.db.sql("""show index from `tab{0}`
|
||||||
|
where Column_name != 'name'""".format(dt), as_dict=1)]
|
||||||
|
|
||||||
|
existing_indexed_columns = list(set([x[1] for x in existing_indexes]))
|
||||||
|
|
||||||
for new in indexes:
|
for new in indexes:
|
||||||
if new not in existing_indexes:
|
if new not in existing_indexed_columns:
|
||||||
frappe.db.sql("alter table `tab{0}` add index ({1})".format(dt, new))
|
frappe.db.sql("alter table `tab{0}` add index ({1})".format(dt, new))
|
||||||
@@ -9,41 +9,6 @@
|
|||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Master",
|
"document_type": "Master",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"fieldname": "employee",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"label": "Employee",
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Employee",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "employee_name",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Employee Name",
|
|
||||||
"options": "",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"read_only": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_2",
|
|
||||||
"fieldtype": "Column Break",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": ""
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"fieldname": "activity_type",
|
"fieldname": "activity_type",
|
||||||
@@ -64,6 +29,41 @@
|
|||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0
|
"set_only_once": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_2",
|
||||||
|
"fieldtype": "Column Break",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"fieldname": "employee",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Employee",
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Employee",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "employee_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Employee Name",
|
||||||
|
"options": "",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "section_break_4",
|
"fieldname": "section_break_4",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2015-06-11 06:50:47.999788",
|
"modified": "2015-06-16 03:12:25.644839",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Projects",
|
"module": "Projects",
|
||||||
"name": "Activity Cost",
|
"name": "Activity Cost",
|
||||||
|
|||||||
@@ -15,12 +15,21 @@ class ActivityCost(Document):
|
|||||||
self.check_unique()
|
self.check_unique()
|
||||||
|
|
||||||
def set_title(self):
|
def set_title(self):
|
||||||
if not self.employee_name:
|
if self.employee:
|
||||||
self.employee_name = frappe.db.get_value("Employee", self.employee, "employee_name")
|
if not self.employee_name:
|
||||||
self.title = _("{0} for {1}").format(self.employee_name, self.activity_type)
|
self.employee_name = frappe.db.get_value("Employee", self.employee, "employee_name")
|
||||||
|
self.title = _("{0} for {1}").format(self.employee_name, self.activity_type)
|
||||||
|
else:
|
||||||
|
self.title = self.activity_type
|
||||||
|
|
||||||
def check_unique(self):
|
def check_unique(self):
|
||||||
if frappe.db.sql("""select name from `tabActivity Cost` where employee_name= %s and activity_type= %s and name != %s""",
|
if self.employee:
|
||||||
(self.employee_name, self.activity_type, self.name)):
|
if frappe.db.sql("""select name from `tabActivity Cost` where employee_name= %s and activity_type= %s and name != %s""",
|
||||||
frappe.throw(_("Activity Cost exists for Employee {0} against Activity Type - {1}")
|
(self.employee_name, self.activity_type, self.name)):
|
||||||
.format(self.employee, self.activity_type), DuplicationError)
|
frappe.throw(_("Activity Cost exists for Employee {0} against Activity Type - {1}")
|
||||||
|
.format(self.employee, self.activity_type), DuplicationError)
|
||||||
|
else:
|
||||||
|
if frappe.db.sql("""select name from `tabActivity Cost` where ifnull(employee, '')='' and activity_type= %s and name != %s""",
|
||||||
|
(self.activity_type, self.name)):
|
||||||
|
frappe.throw(_("Default Activity Cost exists for Activity Type - {0}")
|
||||||
|
.format(self.activity_type), DuplicationError)
|
||||||
|
|||||||
@@ -272,4 +272,7 @@ def get_events(start, end, filters=None):
|
|||||||
def get_activity_cost(employee=None, activity_type=None):
|
def get_activity_cost(employee=None, activity_type=None):
|
||||||
rate = frappe.db.sql("""select costing_rate, billing_rate from `tabActivity Cost` where employee= %s
|
rate = frappe.db.sql("""select costing_rate, billing_rate from `tabActivity Cost` where employee= %s
|
||||||
and activity_type= %s""", (employee, activity_type), as_dict=1)
|
and activity_type= %s""", (employee, activity_type), as_dict=1)
|
||||||
|
if not rate:
|
||||||
|
rate = frappe.db.sql("""select costing_rate, billing_rate from `tabActivity Cost` where ifnull(employee, '')=''
|
||||||
|
and activity_type= %s""", (activity_type), as_dict=1)
|
||||||
return rate[0] if rate else {}
|
return rate[0] if rate else {}
|
||||||
|
|||||||
@@ -488,7 +488,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "base_discount_amount",
|
"fieldname": "base_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Discount Amount (Company Currency)",
|
"label": "Additional Discount Amount (Company Currency)",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@@ -858,7 +858,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"modified": "2015-05-27 02:48:00.388847",
|
"modified": "2015-06-15 15:37:39.199814",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Quotation",
|
"name": "Quotation",
|
||||||
|
|||||||
@@ -493,7 +493,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "base_discount_amount",
|
"fieldname": "base_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Discount Amount (Company Currency)",
|
"label": "Additional Discount Amount (Company Currency)",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@@ -1080,7 +1080,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"modified": "2015-05-27 02:48:01.160307",
|
"modified": "2015-06-15 15:36:38.898462",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Sales Order",
|
"name": "Sales Order",
|
||||||
|
|||||||
@@ -517,7 +517,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "base_discount_amount",
|
"fieldname": "base_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Discount Amount (Company Currency)",
|
"label": "Additional Discount Amount (Company Currency)",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@@ -1070,7 +1070,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2015-05-27 02:47:59.778147",
|
"modified": "2015-06-15 15:37:54.699371",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Delivery Note",
|
"name": "Delivery Note",
|
||||||
|
|||||||
@@ -443,7 +443,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "base_discount_amount",
|
"fieldname": "base_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Discount Amount (Company Currency)",
|
"label": "Additional Discount Amount (Company Currency)",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@@ -854,7 +854,7 @@
|
|||||||
"icon": "icon-truck",
|
"icon": "icon-truck",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2015-05-27 02:48:00.763945",
|
"modified": "2015-06-15 15:38:43.754869",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Purchase Receipt",
|
"name": "Purchase Receipt",
|
||||||
|
|||||||
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.24"
|
version = "5.0.25"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
|||||||
Reference in New Issue
Block a user