Release v4.0.1

This commit is contained in:
Pratik Vyas 2014-05-20 16:32:21 +05:30
commit 444d496c8b
244 changed files with 10747 additions and 7992 deletions

View File

@ -1 +1 @@
__version__ = '4.0.0' __version__ = '4.0.1'

View File

@ -1,13 +0,0 @@
{
"creation": "2013-03-21 15:24:28.000000",
"doc_type": "Sales Invoice",
"docstatus": 0,
"doctype": "Print Format",
"idx": 1,
"modified": "2013-03-21 15:26:21.000000",
"modified_by": "Administrator",
"module": "Accounts",
"name": "SalesInvoice",
"owner": "Administrator",
"standard": "Yes"
}

View File

@ -19,7 +19,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.toggle_enable(['account_name', 'group_or_ledger', 'company'], false); cur_frm.toggle_enable(['account_name', 'group_or_ledger', 'company'], false);
if(doc.group_or_ledger=='Ledger') { if(doc.group_or_ledger=='Ledger') {
cur_frm.toggle_display('freeze_account', doc.can_freeze_account); cur_frm.toggle_display('freeze_account', doc.__onload && doc.__onload.can_freeze_account);
} }
// read-only for root accounts // read-only for root accounts

View File

@ -1,5 +1,6 @@
{ {
"allow_copy": 1, "allow_copy": 1,
"allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"creation": "2013-01-30 12:49:46", "creation": "2013-01-30 12:49:46",
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.", "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
@ -199,7 +200,7 @@
"icon": "icon-money", "icon": "icon-money",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 1,
"modified": "2014-04-30 11:28:52.916199", "modified": "2014-05-12 17:03:19.733139",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Account", "name": "Account",
@ -211,6 +212,8 @@
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1,
"import": 1,
"permlevel": 0, "permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
@ -279,8 +282,8 @@
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 0, "export": 1,
"import": 0, "import": 1,
"permlevel": 0, "permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,

View File

@ -12,16 +12,9 @@ class Account(Document):
def onload(self): def onload(self):
frozen_accounts_modifier = frappe.db.get_value("Accounts Settings", "Accounts Settings", "frozen_accounts_modifier") frozen_accounts_modifier = frappe.db.get_value("Accounts Settings", "Accounts Settings", "frozen_accounts_modifier")
print frozen_accounts_modifier
if frozen_accounts_modifier in frappe.user.get_roles(): if frozen_accounts_modifier in frappe.user.get_roles():
self.can_freeze_account = True self.get("__onload").can_freeze_account = True
def as_dict(self, no_nulls=False):
doc = super(Account, self).as_dict(no_nulls)
if self.get("can_freeze_account"):
doc["can_freeze_account"] = self.can_freeze_account
return doc
def autoname(self): def autoname(self):
self.name = self.account_name.strip() + ' - ' + \ self.name = self.account_name.strip() + ' - ' + \

View File

@ -2,7 +2,7 @@
"allow_copy": 1, "allow_copy": 1,
"allow_email": 1, "allow_email": 1,
"allow_print": 1, "allow_print": 1,
"creation": "2013-01-10 16:34:05.000000", "creation": "2013-01-10 16:34:05",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -10,6 +10,7 @@
"description": "Select account head of the bank where cheque was deposited.", "description": "Select account head of the bank where cheque was deposited.",
"fieldname": "bank_account", "fieldname": "bank_account",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Bank Account", "label": "Bank Account",
"options": "Account", "options": "Account",
"permlevel": 0, "permlevel": 0,
@ -19,6 +20,7 @@
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
"in_list_view": 1,
"label": "Company", "label": "Company",
"options": "Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
@ -28,6 +30,7 @@
{ {
"fieldname": "from_date", "fieldname": "from_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_list_view": 1,
"label": "From Date", "label": "From Date",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
@ -35,14 +38,22 @@
{ {
"fieldname": "to_date", "fieldname": "to_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_list_view": 1,
"label": "To Date", "label": "To Date",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "get_non_reconciled_entries", "fieldname": "include_reconciled_entries",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Include Reconciled Entries",
"permlevel": 0
},
{
"fieldname": "get_relevant_entries",
"fieldtype": "Button", "fieldtype": "Button",
"label": "Get Non Reconciled Entries", "label": "Get Relevant Entries",
"options": "get_details", "options": "get_details",
"permlevel": 0 "permlevel": 0
}, },
@ -74,7 +85,7 @@
"icon": "icon-check", "icon": "icon-check",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"modified": "2013-07-05 14:26:22.000000", "modified": "2014-05-06 16:26:08.984595",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Bank Reconciliation", "name": "Bank Reconciliation",

View File

@ -3,7 +3,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe.utils import cstr, flt, getdate, nowdate from frappe.utils import flt, getdate, nowdate
from frappe import msgprint, _ from frappe import msgprint, _
from frappe.model.document import Document from frappe.model.document import Document
@ -13,29 +13,34 @@ class BankReconciliation(Document):
msgprint("Bank Account, From Date and To Date are Mandatory") msgprint("Bank Account, From Date and To Date are Mandatory")
return return
condition = ""
if not self.include_reconciled_entries:
condition = "and ifnull(clearance_date, '') in ('', '0000-00-00')"
dl = frappe.db.sql("""select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, dl = frappe.db.sql("""select t1.name, t1.cheque_no, t1.cheque_date, t2.debit,
t2.credit, t1.posting_date, t2.against_account t2.credit, t1.posting_date, t2.against_account, t1.clearance_date
from from
`tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2
where where
t2.parent = t1.name and t2.account = %s t2.parent = t1.name and t2.account = %s
and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1 %s""" %
and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1""", ('%s', '%s', '%s', condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)
(self.bank_account, self.from_date, self.to_date))
self.set('entries', []) self.set('entries', [])
self.total_amount = 0.0 self.total_amount = 0.0
for d in dl: for d in dl:
nl = self.append('entries', {}) nl = self.append('entries', {})
nl.posting_date = cstr(d[5]) nl.posting_date = d.posting_date
nl.voucher_id = cstr(d[0]) nl.voucher_id = d.name
nl.cheque_number = cstr(d[1]) nl.cheque_number = d.cheque_no
nl.cheque_date = cstr(d[2]) nl.cheque_date = d.cheque_date
nl.debit = flt(d[3]) nl.debit = d.debit
nl.credit = flt(d[4]) nl.credit = d.credit
nl.against_account = cstr(d[6]) nl.against_account = d.against_account
self.total_amount += flt(flt(d[4]) - flt(d[3])) nl.clearance_date = d.clearance_date
self.total_amount += flt(d.debit) - flt(d.credit)
def update_details(self): def update_details(self):
vouchers = [] vouchers = []

View File

@ -1,6 +1,6 @@
{ {
"autoname": "CBD/.######", "autoname": "CBD/.######",
"creation": "2013-03-07 11:55:04.000000", "creation": "2013-03-07 11:55:04",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -30,13 +30,13 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1
@ -44,9 +44,12 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2013-12-20 19:22:59.000000", "modified": "2014-05-09 02:12:39.595788",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Budget Detail", "name": "Budget Detail",
"owner": "Administrator" "owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,6 +1,6 @@
{ {
"autoname": "field:distribution_id", "autoname": "field:distribution_id",
"creation": "2013-01-10 16:34:05.000000", "creation": "2013-01-10 16:34:05",
"description": "**Budget Distribution** helps you distribute your budget across months if you have seasonality in your business.\n\nTo distribute a budget using this distribution, set this **Budget Distribution** in the **Cost Center**", "description": "**Budget Distribution** helps you distribute your budget across months if you have seasonality in your business.\n\nTo distribute a budget using this distribution, set this **Budget Distribution** in the **Cost Center**",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -9,6 +9,7 @@
"description": "Name of the Budget Distribution", "description": "Name of the Budget Distribution",
"fieldname": "distribution_id", "fieldname": "distribution_id",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Distribution Name", "label": "Distribution Name",
"oldfieldname": "distribution_id", "oldfieldname": "distribution_id",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -17,12 +18,13 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"search_index": 1 "search_index": 1
}, },
@ -34,20 +36,11 @@
"oldfieldtype": "Table", "oldfieldtype": "Table",
"options": "Budget Distribution Detail", "options": "Budget Distribution Detail",
"permlevel": 0 "permlevel": 0
},
{
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"permlevel": 0,
"read_only": 1
} }
], ],
"icon": "icon-bar-chart", "icon": "icon-bar-chart",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:27.000000", "modified": "2014-05-09 02:16:47.567367",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Budget Distribution", "name": "Budget Distribution",
@ -77,5 +70,7 @@
"role": "Accounts Manager", "role": "Accounts Manager",
"submit": 0 "submit": 0
} }
] ],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,7 +1,7 @@
{ {
"allow_attach": 1, "allow_attach": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-03-07 11:55:06.000000", "creation": "2013-03-07 11:55:06",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -17,7 +17,7 @@
"fieldname": "naming_series", "fieldname": "naming_series",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Series", "label": "Series",
"options": "\nC-FORM/", "options": "C-FORM-",
"permlevel": 0, "permlevel": 0,
"read_only": 0, "read_only": 0,
"reqd": 1 "reqd": 1
@ -25,6 +25,7 @@
{ {
"fieldname": "c_form_no", "fieldname": "c_form_no",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "C-Form No", "label": "C-Form No",
"permlevel": 0, "permlevel": 0,
"read_only": 0, "read_only": 0,
@ -33,6 +34,7 @@
{ {
"fieldname": "received_date", "fieldname": "received_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_list_view": 1,
"label": "Received Date", "label": "Received Date",
"permlevel": 0, "permlevel": 0,
"read_only": 0, "read_only": 0,
@ -41,6 +43,7 @@
{ {
"fieldname": "customer", "fieldname": "customer",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Customer", "label": "Customer",
"options": "Customer", "options": "Customer",
"permlevel": 0, "permlevel": 0,
@ -57,17 +60,17 @@
}, },
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Company", "label": "Company",
"options": "link:Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"read_only": 0 "read_only": 0
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Fiscal Year", "label": "Fiscal Year",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"read_only": 0, "read_only": 0,
"reqd": 1 "reqd": 1
@ -136,7 +139,7 @@
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"max_attachments": 3, "max_attachments": 3,
"modified": "2013-12-20 19:23:58.000000", "modified": "2014-05-09 02:18:00.162685",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "C-Form", "name": "C-Form",

View File

@ -3,7 +3,7 @@
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:cost_center_name", "autoname": "field:cost_center_name",
"creation": "2013-01-23 19:57:17.000000", "creation": "2013-01-23 19:57:17",
"description": "Track separate Income and Expense for product verticals or divisions.", "description": "Track separate Income and Expense for product verticals or divisions.",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -15,19 +15,11 @@
"label": "Cost Center Details", "label": "Cost Center Details",
"permlevel": 0 "permlevel": 0
}, },
{
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"permlevel": 0,
"read_only": 1
},
{ {
"fieldname": "cost_center_name", "fieldname": "cost_center_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_filter": 0, "in_filter": 0,
"in_list_view": 1,
"label": "Cost Center Name", "label": "Cost Center Name",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "cost_center_name", "oldfieldname": "cost_center_name",
@ -40,6 +32,7 @@
"fieldname": "parent_cost_center", "fieldname": "parent_cost_center",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1, "ignore_restrictions": 1,
"in_list_view": 1,
"label": "Parent Cost Center", "label": "Parent Cost Center",
"oldfieldname": "parent_cost_center", "oldfieldname": "parent_cost_center",
"oldfieldtype": "Link", "oldfieldtype": "Link",
@ -50,6 +43,7 @@
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Company", "label": "Company",
"oldfieldname": "company_name", "oldfieldname": "company_name",
"oldfieldtype": "Link", "oldfieldtype": "Link",
@ -151,7 +145,7 @@
"icon": "icon-money", "icon": "icon-money",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 1,
"modified": "2014-01-20 17:48:30.000000", "modified": "2014-05-07 06:37:48.038993",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Cost Center", "name": "Cost Center",
@ -184,6 +178,21 @@
"role": "Accounts User", "role": "Accounts User",
"submit": 0, "submit": 0,
"write": 0 "write": 0
},
{
"permlevel": 0,
"read": 1,
"role": "Sales User"
},
{
"permlevel": 0,
"read": 1,
"role": "Purchase User"
},
{
"permlevel": 0,
"read": 1,
"role": "Material User"
} }
], ],
"search_fields": "name,parent_cost_center" "search_fields": "name,parent_cost_center"

View File

@ -1,6 +1,6 @@
{ {
"autoname": "GL.#######", "autoname": "GL.#######",
"creation": "2013-01-10 16:34:06.000000", "creation": "2013-01-10 16:34:06",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -8,6 +8,7 @@
"fieldname": "posting_date", "fieldname": "posting_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Posting Date", "label": "Posting Date",
"oldfieldname": "posting_date", "oldfieldname": "posting_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
@ -17,6 +18,7 @@
{ {
"fieldname": "transaction_date", "fieldname": "transaction_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_list_view": 1,
"label": "Transaction Date", "label": "Transaction Date",
"oldfieldname": "transaction_date", "oldfieldname": "transaction_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
@ -26,6 +28,7 @@
"fieldname": "aging_date", "fieldname": "aging_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Aging Date", "label": "Aging Date",
"oldfieldname": "aging_date", "oldfieldname": "aging_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
@ -36,6 +39,7 @@
"fieldname": "account", "fieldname": "account",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Account", "label": "Account",
"oldfieldname": "account", "oldfieldname": "account",
"oldfieldtype": "Link", "oldfieldtype": "Link",
@ -47,6 +51,7 @@
"fieldname": "cost_center", "fieldname": "cost_center",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Cost Center", "label": "Cost Center",
"oldfieldname": "cost_center", "oldfieldname": "cost_center",
"oldfieldtype": "Link", "oldfieldtype": "Link",
@ -157,12 +162,12 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"search_index": 0 "search_index": 0
}, },
@ -181,7 +186,7 @@
"icon": "icon-list", "icon": "icon-list",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 1,
"modified": "2013-12-20 19:24:08.000000", "modified": "2014-05-09 02:16:29.981405",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "GL Entry", "name": "GL Entry",
@ -225,5 +230,7 @@
"write": 0 "write": 0
} }
], ],
"search_fields": "voucher_no,account,posting_date,against_voucher" "search_fields": "voucher_no,account,posting_date,against_voucher",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -140,13 +140,13 @@ cur_frm.cscript.update_totals = function(doc) {
var td=0.0; var tc =0.0; var td=0.0; var tc =0.0;
var el = doc.entries || []; var el = doc.entries || [];
for(var i in el) { for(var i in el) {
td += flt(el[i].debit, 2); td += flt(el[i].debit, precision("debit", el[i]));
tc += flt(el[i].credit, 2); tc += flt(el[i].credit, precision("credit", el[i]));
} }
var doc = locals[doc.doctype][doc.name]; var doc = locals[doc.doctype][doc.name];
doc.total_debit = td; doc.total_debit = td;
doc.total_credit = tc; doc.total_credit = tc;
doc.difference = flt((td - tc), 2); doc.difference = flt((td - tc), precision("difference"));
refresh_many(['total_debit','total_credit','difference']); refresh_many(['total_debit','total_credit','difference']);
} }

View File

@ -27,7 +27,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "naming_series", "oldfieldname": "naming_series",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "JV", "options": "JV-",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 0, "read_only": 0,
@ -383,12 +383,12 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 0, "read_only": 0,
@ -440,7 +440,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-01 17:07:31.129188", "modified": "2014-05-09 02:16:47.686703",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Journal Voucher", "name": "Journal Voucher",
@ -490,5 +490,7 @@
} }
], ],
"read_only_onload": 1, "read_only_onload": 1,
"search_fields": "voucher_type,posting_date, due_date, cheque_no" "search_fields": "voucher_type,posting_date, due_date, cheque_no",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -120,18 +120,21 @@ class JournalVoucher(AccountsController):
if flt(d.credit > 0): d.against_account = ", ".join(list(set(accounts_debited))) if flt(d.credit > 0): d.against_account = ", ".join(list(set(accounts_debited)))
def validate_debit_and_credit(self): def validate_debit_and_credit(self):
self.total_debit, self.total_credit = 0, 0 self.total_debit, self.total_credit, self.difference = 0, 0, 0
for d in self.get("entries"): for d in self.get("entries"):
if d.debit and d.credit: if d.debit and d.credit:
frappe.throw(_("You cannot credit and debit same account at the same time")) frappe.throw(_("You cannot credit and debit same account at the same time"))
self.total_debit = flt(self.total_debit) + flt(d.debit) self.total_debit = flt(self.total_debit) + flt(d.debit, self.precision("debit", "entries"))
self.total_credit = flt(self.total_credit) + flt(d.credit) self.total_credit = flt(self.total_credit) + flt(d.credit, self.precision("credit", "entries"))
if abs(self.total_debit-self.total_credit) > 0.001: self.difference = flt(self.total_debit, self.precision("total_debit")) - \
flt(self.total_credit, self.precision("total_credit"))
if self.difference:
frappe.throw(_("Total Debit must be equal to Total Credit. The difference is {0}") frappe.throw(_("Total Debit must be equal to Total Credit. The difference is {0}")
.format(self.total_debit - self.total_credit)) .format(self.difference))
def create_remarks(self): def create_remarks(self):
r = [] r = []
@ -254,8 +257,8 @@ class JournalVoucher(AccountsController):
self.get_gl_dict({ self.get_gl_dict({
"account": d.account, "account": d.account,
"against": d.against_account, "against": d.against_account,
"debit": d.debit, "debit": flt(d.debit, self.precision("debit", "entries")),
"credit": d.credit, "credit": flt(d.credit, self.precision("credit", "entries")),
"against_voucher_type": ((d.against_voucher and "Purchase Invoice") "against_voucher_type": ((d.against_voucher and "Purchase Invoice")
or (d.against_invoice and "Sales Invoice") or (d.against_invoice and "Sales Invoice")
or (d.against_jv and "Journal Voucher")), or (d.against_jv and "Journal Voucher")),
@ -279,7 +282,7 @@ class JournalVoucher(AccountsController):
msgprint(_("'Entries' cannot be empty"), raise_exception=True) msgprint(_("'Entries' cannot be empty"), raise_exception=True)
else: else:
flag, self.total_debit, self.total_credit = 0, 0, 0 flag, self.total_debit, self.total_credit = 0, 0, 0
diff = flt(self.difference, 2) diff = flt(self.difference, self.precision("difference"))
# If any row without amount, set the diff on that row # If any row without amount, set the diff on that row
for d in self.get('entries'): for d in self.get('entries'):
@ -298,45 +301,44 @@ class JournalVoucher(AccountsController):
elif diff<0: elif diff<0:
jd.debit = abs(diff) jd.debit = abs(diff)
# Set the total debit, total credit and difference self.validate_debit_and_credit()
for d in self.get('entries'):
self.total_debit += flt(d.debit, 2)
self.total_credit += flt(d.credit, 2)
self.difference = flt(self.total_debit, 2) - flt(self.total_credit, 2)
def get_outstanding_invoices(self): def get_outstanding_invoices(self):
self.set('entries', []) self.set('entries', [])
total = 0 total = 0
for d in self.get_values(): for d in self.get_values():
total += flt(d[2]) total += flt(d.outstanding_amount, self.precision("credit", "entries"))
jd = self.append('entries', {}) jd1 = self.append('entries', {})
jd.account = cstr(d[1]) jd1.account = d.account
if self.write_off_based_on == 'Accounts Receivable': if self.write_off_based_on == 'Accounts Receivable':
jd.credit = flt(d[2]) jd1.credit = flt(d.outstanding_amount, self.precision("credit", "entries"))
jd.against_invoice = cstr(d[0]) jd1.against_invoice = cstr(d.name)
elif self.write_off_based_on == 'Accounts Payable': elif self.write_off_based_on == 'Accounts Payable':
jd.debit = flt(d[2]) jd1.debit = flt(d.outstanding_amount, self.precision("debit", "entries"))
jd.against_voucher = cstr(d[0]) jd1.against_voucher = cstr(d.name)
jd.save(1)
jd = self.append('entries', {}) jd2 = self.append('entries', {})
if self.write_off_based_on == 'Accounts Receivable': if self.write_off_based_on == 'Accounts Receivable':
jd.debit = total jd2.debit = total
elif self.write_off_based_on == 'Accounts Payable': elif self.write_off_based_on == 'Accounts Payable':
jd.credit = total jd2.credit = total
jd.save(1)
self.validate_debit_and_credit()
def get_values(self): def get_values(self):
cond = (flt(self.write_off_amount) > 0) and \ cond = " and outstanding_amount <= {0}".format(self.write_off_amount) \
' and outstanding_amount <= '+ self.write_off_amount or '' if flt(self.write_off_amount) > 0 else ""
if self.write_off_based_on == 'Accounts Receivable': if self.write_off_based_on == 'Accounts Receivable':
return frappe.db.sql("""select name, debit_to, outstanding_amount return frappe.db.sql("""select name, debit_to as account, outstanding_amount
from `tabSales Invoice` where docstatus = 1 and company = %s from `tabSales Invoice` where docstatus = 1 and company = %s
and outstanding_amount > 0 %s""" % ('%s', cond), self.company) and outstanding_amount > 0 %s""" % ('%s', cond), self.company, as_dict=True)
elif self.write_off_based_on == 'Accounts Payable': elif self.write_off_based_on == 'Accounts Payable':
return frappe.db.sql("""select name, credit_to, outstanding_amount return frappe.db.sql("""select name, credit_to as account, outstanding_amount
from `tabPurchase Invoice` where docstatus = 1 and company = %s from `tabPurchase Invoice` where docstatus = 1 and company = %s
and outstanding_amount > 0 %s""" % ('%s', cond), self.company) and outstanding_amount > 0 %s""" % ('%s', cond), self.company, as_dict=True)
@frappe.whitelist() @frappe.whitelist()
def get_default_bank_cash_account(company, voucher_type): def get_default_bank_cash_account(company, voucher_type):

View File

@ -2,7 +2,7 @@
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:mode_of_payment", "autoname": "field:mode_of_payment",
"creation": "2012-12-04 17:49:20.000000", "creation": "2012-12-04 17:49:20",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
@ -10,6 +10,7 @@
{ {
"fieldname": "mode_of_payment", "fieldname": "mode_of_payment",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Mode of Payment", "label": "Mode of Payment",
"oldfieldname": "mode_of_payment", "oldfieldname": "mode_of_payment",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -20,6 +21,7 @@
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Company", "label": "Company",
"options": "Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
@ -29,6 +31,8 @@
"description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.", "description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.",
"fieldname": "default_account", "fieldname": "default_account",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1,
"in_list_view": 1,
"label": "Default Account", "label": "Default Account",
"options": "Account", "options": "Account",
"permlevel": 0, "permlevel": 0,
@ -37,7 +41,7 @@
], ],
"icon": "icon-credit-card", "icon": "icon-credit-card",
"idx": 1, "idx": 1,
"modified": "2013-12-20 19:24:14.000000", "modified": "2014-05-07 05:06:13.702313",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Mode of Payment", "name": "Mode of Payment",
@ -53,6 +57,12 @@
"role": "Accounts Manager", "role": "Accounts Manager",
"submit": 0, "submit": 0,
"write": 1 "write": 1
},
{
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Accounts User"
} }
] ]
} }

View File

@ -1,6 +1,6 @@
{ {
"autoname": "PCE/.###", "autoname": "PCE/.###",
"creation": "2013-01-10 16:34:07.000000", "creation": "2013-01-10 16:34:07",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -14,6 +14,7 @@
{ {
"fieldname": "transaction_date", "fieldname": "transaction_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_list_view": 1,
"label": "Transaction Date", "label": "Transaction Date",
"oldfieldname": "transaction_date", "oldfieldname": "transaction_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
@ -22,6 +23,7 @@
{ {
"fieldname": "posting_date", "fieldname": "posting_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_list_view": 1,
"label": "Posting Date", "label": "Posting Date",
"oldfieldname": "posting_date", "oldfieldname": "posting_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
@ -30,11 +32,12 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1,
"label": "Closing Fiscal Year", "label": "Closing Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -42,6 +45,7 @@
"fieldname": "amended_from", "fieldname": "amended_from",
"fieldtype": "Data", "fieldtype": "Data",
"ignore_restrictions": 1, "ignore_restrictions": 1,
"in_list_view": 1,
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "amended_from", "oldfieldname": "amended_from",
@ -51,11 +55,11 @@
}, },
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Company", "label": "Company",
"oldfieldname": "company", "oldfieldname": "company",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -97,7 +101,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-01-20 17:48:59.000000", "modified": "2014-05-09 02:16:36.920034",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Period Closing Voucher", "name": "Period Closing Voucher",
@ -132,5 +136,7 @@
"write": 1 "write": 1
} }
], ],
"search_fields": "posting_date, fiscal_year" "search_fields": "posting_date, fiscal_year",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -172,11 +172,11 @@
}, },
{ {
"fieldname": "letter_head", "fieldname": "letter_head",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Letter Head", "label": "Letter Head",
"oldfieldname": "letter_head", "oldfieldname": "letter_head",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Letter Head", "options": "Letter Head",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 0 "read_only": 0
@ -193,19 +193,19 @@
}, },
{ {
"fieldname": "select_print_heading", "fieldname": "select_print_heading",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 0, "in_filter": 0,
"label": "Print Heading", "label": "Print Heading",
"oldfieldname": "select_print_heading", "oldfieldname": "select_print_heading",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Print Heading", "options": "Print Heading",
"permlevel": 0, "permlevel": 0,
"read_only": 0 "read_only": 0
} }
], ],
"icon": "icon-cog", "icon": "icon-cog",
"idx": 1, "idx": 1,
"modified": "2014-05-04 08:47:33.250720", "modified": "2014-05-09 02:17:34.814856",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "POS Setting", "name": "POS Setting",
@ -235,5 +235,7 @@
"role": "Accounts User", "role": "Accounts User",
"submit": 0 "submit": 0
} }
] ],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,6 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
test_records = frappe.get_test_records('Pos Setting')

View File

@ -1,16 +0,0 @@
[
{
"cash_bank_account": "_Test Account Bank Account - _TC",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"currency": "INR",
"doctype": "POS Setting",
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"income_account": "Sales - _TC",
"name": "_Test POS Setting",
"naming_series": "_T-POS Setting-",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory",
"warehouse": "_Test Warehouse - _TC"
}
]

View File

@ -1,4 +1,5 @@
{ {
"allow_import": 1,
"autoname": "PRULE.#####", "autoname": "PRULE.#####",
"creation": "2014-02-21 15:02:51", "creation": "2014-02-21 15:02:51",
"docstatus": 0, "docstatus": 0,
@ -202,7 +203,7 @@
"icon": "icon-gift", "icon": "icon-gift",
"idx": 1, "idx": 1,
"istable": 0, "istable": 0,
"modified": "2014-05-05 11:09:38.244111", "modified": "2014-05-12 16:24:52.005162",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Pricing Rule", "name": "Pricing Rule",
@ -211,16 +212,23 @@
{ {
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"export": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"report": 1,
"role": "Accounts Manager", "role": "Accounts Manager",
"write": 1 "write": 1
}, },
{ {
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"export": 0,
"import": 0,
"permlevel": 0, "permlevel": 0,
"print": 0,
"read": 1, "read": 1,
"report": 1,
"role": "Sales Manager", "role": "Sales Manager",
"write": 1 "write": 1
}, },
@ -229,6 +237,7 @@
"delete": 1, "delete": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"report": 1,
"role": "Purchase Manager", "role": "Purchase Manager",
"write": 1 "write": 1
}, },
@ -237,16 +246,23 @@
"delete": 1, "delete": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"report": 1,
"role": "Website Manager", "role": "Website Manager",
"write": 1 "write": 1
}, },
{ {
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"export": 1,
"import": 1,
"permlevel": 0, "permlevel": 0,
"read": 1, "read": 1,
"report": 1,
"restrict": 1,
"role": "System Manager", "role": "System Manager",
"write": 1 "write": 1
} }
] ],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -110,6 +110,12 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
entries_add: function(doc, cdt, cdn) { entries_add: function(doc, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn); var row = frappe.get_doc(cdt, cdn);
this.frm.script_manager.copy_from_first_row("entries", row, ["expense_account", "cost_center"]); this.frm.script_manager.copy_from_first_row("entries", row, ["expense_account", "cost_center"]);
},
on_submit: function() {
$.each(this.frm.doc["entries"], function(i, row) {
if(row.purchase_receipt) frappe.model.clear_doc("Purchase Receipt", row.purchase_receipt)
})
} }
}); });

View File

@ -2,7 +2,7 @@
"allow_attach": 1, "allow_attach": 1,
"allow_import": 1, "allow_import": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-05-21 16:16:39.000000", "creation": "2013-05-21 16:16:39",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -28,7 +28,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "naming_series", "oldfieldname": "naming_series",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "BILL", "options": "PINV-",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 0, "read_only": 0,
@ -692,11 +692,11 @@
}, },
{ {
"fieldname": "mode_of_payment", "fieldname": "mode_of_payment",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Mode of Payment", "label": "Mode of Payment",
"oldfieldname": "mode_of_payment", "oldfieldname": "mode_of_payment",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Mode of Payment", "options": "Mode of Payment",
"permlevel": 0, "permlevel": 0,
"read_only": 0 "read_only": 0
}, },
@ -709,20 +709,20 @@
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
"fieldname": "letter_head", "fieldname": "letter_head",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Letter Head", "label": "Letter Head",
"options": "link:Letter Head", "options": "Letter Head",
"permlevel": 0, "permlevel": 0,
"print_hide": 1 "print_hide": 1
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 0, "read_only": 0,
@ -744,7 +744,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-02-17 12:01:59.000000", "modified": "2014-05-09 02:16:52.618986",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Purchase Invoice", "name": "Purchase Invoice",
@ -822,5 +822,7 @@
} }
], ],
"read_only_onload": 1, "read_only_onload": 1,
"search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount" "search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -270,7 +270,7 @@ cur_frm.cscript.is_opening = function(doc, dt, dn) {
cur_frm.cscript['Make Delivery Note'] = function() { cur_frm.cscript['Make Delivery Note'] = function() {
frappe.model.open_mapped_doc({ frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_delivery_note", method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_delivery_note",
source_name: cur_frm.doc.name frm: cur_frm
}) })
} }
@ -387,6 +387,10 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
if(cint(frappe.boot.notification_settings.sales_invoice)) { if(cint(frappe.boot.notification_settings.sales_invoice)) {
cur_frm.email_doc(frappe.boot.notification_settings.sales_invoice_message); cur_frm.email_doc(frappe.boot.notification_settings.sales_invoice_message);
} }
$.each(doc["entries"], function(i, row) {
if(row.delivery_note) frappe.model.clear_doc("Delivery Note", row.delivery_note)
})
} }
cur_frm.cscript.convert_into_recurring_invoice = function(doc, dt, dn) { cur_frm.cscript.convert_into_recurring_invoice = function(doc, dt, dn) {

View File

@ -2,7 +2,7 @@
"allow_attach": 1, "allow_attach": 1,
"allow_import": 1, "allow_import": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-05-24 19:29:05.000000", "creation": "2013-05-24 19:29:05",
"default_print_format": "Standard", "default_print_format": "Standard",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -22,7 +22,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "naming_series", "oldfieldname": "naming_series",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "INV\nINV/10-11/", "options": "SINV-",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 0, "read_only": 0,
@ -160,12 +160,12 @@
}, },
{ {
"fieldname": "mode_of_payment", "fieldname": "mode_of_payment",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Mode of Payment", "label": "Mode of Payment",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "mode_of_payment", "oldfieldname": "mode_of_payment",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Mode of Payment", "options": "Mode of Payment",
"permlevel": 0, "permlevel": 0,
"read_only": 0 "read_only": 0
}, },
@ -878,11 +878,11 @@
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
"fieldname": "letter_head", "fieldname": "letter_head",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Letter Head", "label": "Letter Head",
"oldfieldname": "letter_head", "oldfieldname": "letter_head",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Letter Head", "options": "Letter Head",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 0 "read_only": 0
@ -925,13 +925,13 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"read_only": 0, "read_only": 0,
@ -1180,7 +1180,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-01-28 18:45:10.000000", "modified": "2014-05-09 02:17:00.217556",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Invoice", "name": "Sales Invoice",
@ -1226,5 +1226,7 @@
} }
], ],
"read_only_onload": 1, "read_only_onload": 1,
"search_fields": "posting_date, due_date, debit_to, fiscal_year, grand_total, outstanding_amount" "search_fields": "posting_date, due_date, debit_to, fiscal_year, grand_total, outstanding_amount",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -6,6 +6,8 @@ import unittest, json, copy
from frappe.utils import flt from frappe.utils import flt
from erpnext.accounts.utils import get_stock_and_account_difference from erpnext.accounts.utils import get_stock_and_account_difference
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
from erpnext.projects.doctype.time_log_batch.test_time_log_batch import *
class TestSalesInvoice(unittest.TestCase): class TestSalesInvoice(unittest.TestCase):
def make(self): def make(self):
@ -365,27 +367,30 @@ class TestSalesInvoice(unittest.TestCase):
561.8) 561.8)
def test_time_log_batch(self): def test_time_log_batch(self):
tlb = frappe.get_doc("Time Log Batch", "_T-Time Log Batch-00001") delete_time_log_and_batch()
time_log = create_time_log()
tlb = create_time_log_batch(time_log)
tlb = frappe.get_doc("Time Log Batch", tlb.name)
tlb.submit() tlb.submit()
si = frappe.get_doc(frappe.copy_doc(test_records[0])) si = frappe.get_doc(frappe.copy_doc(test_records[0]))
si.get("entries")[0].time_log_batch = "_T-Time Log Batch-00001" si.get("entries")[0].time_log_batch = tlb.name
si.insert() si.insert()
si.submit() si.submit()
self.assertEquals(frappe.db.get_value("Time Log Batch", "_T-Time Log Batch-00001", self.assertEquals(frappe.db.get_value("Time Log Batch", tlb.name, "status"), "Billed")
"status"), "Billed")
self.assertEquals(frappe.db.get_value("Time Log", "_T-Time Log-00001", "status"), self.assertEquals(frappe.db.get_value("Time Log", time_log, "status"), "Billed")
"Billed")
si.cancel() si.cancel()
self.assertEquals(frappe.db.get_value("Time Log Batch", "_T-Time Log Batch-00001", self.assertEquals(frappe.db.get_value("Time Log Batch", tlb.name, "status"), "Submitted")
"status"), "Submitted")
self.assertEquals(frappe.db.get_value("Time Log", "_T-Time Log-00001", "status"), self.assertEquals(frappe.db.get_value("Time Log", time_log, "status"), "Batched for Billing")
"Batched for Billing")
frappe.delete_doc("Sales Invoice", si.name)
delete_time_log_and_batch()
def test_sales_invoice_gl_entry_without_aii(self): def test_sales_invoice_gl_entry_without_aii(self):
self.clear_stock_account_balance() self.clear_stock_account_balance()
@ -423,9 +428,9 @@ class TestSalesInvoice(unittest.TestCase):
def test_pos_gl_entry_with_aii(self): def test_pos_gl_entry_with_aii(self):
self.clear_stock_account_balance() self.clear_stock_account_balance()
set_perpetual_inventory() set_perpetual_inventory()
self.make_pos_setting()
self._insert_purchase_receipt() self._insert_purchase_receipt()
self._insert_pos_settings()
pos = copy.deepcopy(test_records[1]) pos = copy.deepcopy(test_records[1])
pos["is_pos"] = 1 pos["is_pos"] = 1
@ -479,6 +484,26 @@ class TestSalesInvoice(unittest.TestCase):
set_perpetual_inventory(0) set_perpetual_inventory(0)
frappe.db.sql("delete from `tabPOS Setting`")
def make_pos_setting(self):
pos_setting = frappe.get_doc({
"cash_bank_account": "_Test Account Bank Account - _TC",
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"currency": "INR",
"doctype": "POS Setting",
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"income_account": "Sales - _TC",
"name": "_Test POS Setting",
"naming_series": "_T-POS Setting-",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory",
"warehouse": "_Test Warehouse - _TC"
})
pos_setting.insert()
def test_si_gl_entry_with_aii_and_update_stock_with_warehouse_but_no_account(self): def test_si_gl_entry_with_aii_and_update_stock_with_warehouse_but_no_account(self):
self.clear_stock_account_balance() self.clear_stock_account_balance()
set_perpetual_inventory() set_perpetual_inventory()
@ -604,14 +629,6 @@ class TestSalesInvoice(unittest.TestCase):
dn.submit() dn.submit()
return dn return dn
def _insert_pos_settings(self):
from erpnext.accounts.doctype.pos_setting.test_pos_setting \
import test_records as pos_setting_test_records
frappe.db.sql("""delete from `tabPOS Setting`""")
ps = frappe.copy_doc(pos_setting_test_records[0])
ps.insert()
def test_sales_invoice_with_advance(self): def test_sales_invoice_with_advance(self):
from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \
import test_records as jv_test_records import test_records as jv_test_records
@ -843,5 +860,5 @@ class TestSalesInvoice(unittest.TestCase):
self.assertRaises(SerialNoStatusError, si.submit) self.assertRaises(SerialNoStatusError, si.submit)
test_dependencies = ["Journal Voucher", "POS Setting", "Contact", "Address"] test_dependencies = ["Journal Voucher", "Contact", "Address"]
test_records = frappe.get_test_records('Sales Invoice') test_records = frappe.get_test_records('Sales Invoice')

View File

@ -10,11 +10,13 @@ test_records = frappe.get_test_records('Shipping Rule')
class TestShippingRule(unittest.TestCase): class TestShippingRule(unittest.TestCase):
def test_from_greater_than_to(self): def test_from_greater_than_to(self):
shipping_rule = frappe.copy_doc(test_records[0]) shipping_rule = frappe.copy_doc(test_records[0])
shipping_rule.name = test_records[0].get('name')
shipping_rule.get("shipping_rule_conditions")[0].from_value = 101 shipping_rule.get("shipping_rule_conditions")[0].from_value = 101
self.assertRaises(FromGreaterThanToError, shipping_rule.insert) self.assertRaises(FromGreaterThanToError, shipping_rule.insert)
def test_many_zero_to_values(self): def test_many_zero_to_values(self):
shipping_rule = frappe.copy_doc(test_records[0]) shipping_rule = frappe.copy_doc(test_records[0])
shipping_rule.name = test_records[0].get('name')
shipping_rule.get("shipping_rule_conditions")[0].to_value = 0 shipping_rule.get("shipping_rule_conditions")[0].to_value = 0
self.assertRaises(ManyBlankToValuesError, shipping_rule.insert) self.assertRaises(ManyBlankToValuesError, shipping_rule.insert)
@ -27,6 +29,7 @@ class TestShippingRule(unittest.TestCase):
((50, 150), (50, 150)), ((50, 150), (50, 150)),
]: ]:
shipping_rule = frappe.copy_doc(test_records[0]) shipping_rule = frappe.copy_doc(test_records[0])
shipping_rule.name = test_records[0].get('name')
shipping_rule.get("shipping_rule_conditions")[0].from_value = range_a[0] shipping_rule.get("shipping_rule_conditions")[0].from_value = range_a[0]
shipping_rule.get("shipping_rule_conditions")[0].to_value = range_a[1] shipping_rule.get("shipping_rule_conditions")[0].to_value = range_a[1]
shipping_rule.get("shipping_rule_conditions")[1].from_value = range_b[0] shipping_rule.get("shipping_rule_conditions")[1].from_value = range_b[0]

View File

@ -94,7 +94,8 @@ def validate_account_for_auto_accounting_for_stock(gl_map):
for entry in gl_map: for entry in gl_map:
if entry.account in aii_accounts: if entry.account in aii_accounts:
frappe.throw(_("Account {0} can only be updated via Stock Transactions"), StockAccountInvalidTransaction) frappe.throw(_("Account: {0} can only be updated via \
Stock Transactions").format(entry.account), StockAccountInvalidTransaction)
def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None, def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None,

View File

@ -1,11 +1,11 @@
{ {
"creation": "2012-04-11 13:16:56.000000", "creation": "2012-04-11 13:16:56",
"doc_type": "Journal Voucher", "doc_type": "Journal Voucher",
"docstatus": 0, "docstatus": 0,
"doctype": "Print Format", "doctype": "Print Format",
"html": "<!-- p.big {line-height: 200%} .noborder td { border: 0px solid #fff; } -->\n<div style=\"position: relative;\">\n<h3><script>doc.company</script><br /> <br /> \n<hr />\nPAYMENT ADVICE</h3>\n<table class=\"noborder\" style=\"width: 100%;\">\n<tbody>\n<tr>\n<td style=\"vertical-align: top;\" width=\"50%\">To :<br />\n<script type=\"text/javascript\">// <![CDATA[\ndoc.pay_to_recd_from\n// ]]></script>\n</td>\n<td width=\"50%\">\n<table class=\"noborder\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"30%\">Voucher No :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.name\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Voucher Date :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.voucher_date)\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Cheque No :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_no)\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Cheque Date :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_date)\n// ]]></script>\n</td>\n</tr>\n</tbody>\n</table>\n</td>\n</tr>\n</tbody>\n</table>\n<br /> <strong>We are pleased to enclose our cheque in full/part Settlement of your under noted bills</strong> <br /> \n<hr />\n<table class=\"noborder\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"70%\">&nbsp;</td>\n<td width=\"15%\">Total :</td>\n<td class=\"pos_left\" width=\"15%\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td colspan=\"3\">Narration :\n<script type=\"text/javascript\">// <![CDATA[\nreplace_newlines(doc.remark)\n// ]]></script>\n<br /><br /><br /></td>\n</tr>\n</tbody>\n</table>\n<div style=\"position: absolute; top: 14cm; left: 0cm;\">Prepared By</div>\n<div style=\"position: absolute; top: 14cm; left: 5.5cm;\">Authorised Signatory</div>\n<div style=\"position: absolute; top: 14cm; left: 11cm;\">Received Payment as Above</div>\n<div style=\"position: absolute; top: 16.4cm; left: 5.9cm;\"><strong>_____________</strong></div>\n<div style=\"position: absolute; top: 16.7cm; left: 6cm;\"><strong>A/c Payee</strong></div>\n<div style=\"position: absolute; top: 16.7cm; left: 5.9cm;\"><strong>_____________</strong></div>\n<div style=\"position: absolute; top: 16.9cm; left: 12cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_date)\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 17.9cm; left: 1cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.pay_to_recd_from\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 18.6cm; left: 1cm; width: 7cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount_in_words\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 19.7cm; left: 12cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount\n// ]]></script>\n</div>\n</div>", "html": "<!-- p.big {line-height: 200%} .noborder td { border: 0px solid #fff; } -->\n<div style=\"position: relative;\">\n<h3><script>doc.company</script><br /> <br /> \n<hr />\nPAYMENT ADVICE</h3>\n<table class=\"noborder\" style=\"width: 100%;\">\n<tbody>\n<tr>\n<td style=\"vertical-align: top;\" width=\"50%\">To :<br />\n<script type=\"text/javascript\">// <![CDATA[\ndoc.pay_to_recd_from\n// ]]></script>\n</td>\n<td width=\"50%\">\n<table class=\"noborder\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"30%\">Voucher No :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.name\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Voucher Date :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.voucher_date)\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Cheque No :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_no)\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Cheque Date :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_date)\n// ]]></script>\n</td>\n</tr>\n</tbody>\n</table>\n</td>\n</tr>\n</tbody>\n</table>\n<br /> <strong>We are pleased to enclose our cheque in full/part Settlement of your under noted bills</strong> <br /> \n<hr />\n<table class=\"noborder\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"70%\">&nbsp;</td>\n<td width=\"15%\">Total :</td>\n<td class=\"pos_left\" width=\"15%\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td colspan=\"3\">Narration :\n<script type=\"text/javascript\">// <![CDATA[\nreplace_newlines(doc.remark)\n// ]]></script>\n<br /><br /><br /></td>\n</tr>\n</tbody>\n</table>\n<div style=\"position: absolute; top: 14cm; left: 0cm;\">Prepared By</div>\n<div style=\"position: absolute; top: 14cm; left: 5.5cm;\">Authorised Signatory</div>\n<div style=\"position: absolute; top: 14cm; left: 11cm;\">Received Payment as Above</div>\n<div style=\"position: absolute; top: 16.4cm; left: 5.9cm;\"><strong>_____________</strong></div>\n<div style=\"position: absolute; top: 16.7cm; left: 6cm;\"><strong>A/c Payee</strong></div>\n<div style=\"position: absolute; top: 16.7cm; left: 5.9cm;\"><strong>_____________</strong></div>\n<div style=\"position: absolute; top: 16.9cm; left: 12cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_date)\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 17.9cm; left: 1cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.pay_to_recd_from\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 18.6cm; left: 1cm; width: 7cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount_in_words\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 19.7cm; left: 12cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount\n// ]]></script>\n</div>\n</div>",
"idx": 1, "idx": 1,
"modified": "2012-04-13 12:24:20.000000", "modified": "2014-05-13 16:07:18.792349",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Cheque Printing Format", "name": "Cheque Printing Format",

View File

@ -1,11 +1,11 @@
{ {
"creation": "2012-05-01 12:46:31.000000", "creation": "2012-05-01 12:46:31",
"doc_type": "Journal Voucher", "doc_type": "Journal Voucher",
"docstatus": 0, "docstatus": 0,
"doctype": "Print Format", "doctype": "Print Format",
"html": "<h3 align=\"center\"><script>doc.select_print_heading || \"Payment Receipt Note\"</script></h3>\n\n<table class='simpletable'>\n<tr>\n<td><b> Receipt No.: </b></td>\n<td><script>doc.name</script></td>\n</tr>\n<tr>\n<td><b> Date : </b></td>\n<td><script>date.str_to_user(doc.voucher_date)</script></td>\n</tr> \n<tr>\n<td><b> Remark: </b></td>\n<td><script> doc.remark </script></td>\n</tr>\n<tr>\n<td><b> Received From: </b></td>\n<td><b><script> doc.pay_to_recd_from </script></b></td>\n</tr>\n</table>\n<br>\n\n<div><b><script>doc.total_amount</script></b> </td></div><br>\n<div style=\"text-align:left\"><b><script>doc.total_amount_in_words</script></b></div><br>\n<br>\n<table class=\"noborder\">\n<tr>\n<td style = \"text-align = right;\"><h3>For <script>doc.company</script>,</h3><br><div>(Authorised Signatory)</div></td>\n</tr>\n</table>", "html": "<h3 align=\"center\"><script>doc.select_print_heading || \"Payment Receipt Note\"</script></h3>\n\n<table class='simpletable'>\n<tr>\n<td><b> Receipt No.: </b></td>\n<td><script>doc.name</script></td>\n</tr>\n<tr>\n<td><b> Date : </b></td>\n<td><script>date.str_to_user(doc.voucher_date)</script></td>\n</tr> \n<tr>\n<td><b> Remark: </b></td>\n<td><script> doc.remark </script></td>\n</tr>\n<tr>\n<td><b> Received From: </b></td>\n<td><b><script> doc.pay_to_recd_from </script></b></td>\n</tr>\n</table>\n<br>\n\n<div><b><script>doc.total_amount</script></b> </td></div><br>\n<div style=\"text-align:left\"><b><script>doc.total_amount_in_words</script></b></div><br>\n<br>\n<table class=\"noborder\">\n<tr>\n<td style = \"text-align = right;\"><h3>For <script>doc.company</script>,</h3><br><div>(Authorised Signatory)</div></td>\n</tr>\n</table>",
"idx": 1, "idx": 1,
"modified": "2013-01-21 18:40:20.000000", "modified": "2014-05-13 16:07:19.144006",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Payment Receipt Voucher", "name": "Payment Receipt Voucher",

View File

@ -0,0 +1,14 @@
{
"creation": "2013-03-21 15:24:28",
"doc_type": "Sales Invoice",
"docstatus": 0,
"doctype": "Print Format",
"idx": 1,
"modified": "2014-05-13 17:51:43.245831",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
"owner": "Administrator",
"print_format_type": "Server",
"standard": "Yes"
}

View File

@ -1,11 +1,11 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-04-22 16:16:03.000000", "creation": "2013-04-22 16:16:03",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-05-13 16:08:55.961149",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Accounts Payable", "name": "Accounts Payable",

View File

@ -1,10 +1,10 @@
{ {
"creation": "2013-07-30 17:28:49.000000", "creation": "2013-07-30 17:28:49",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-05-13 16:08:56.009640",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Delivered Items To Be Billed", "name": "Delivered Items To Be Billed",

View File

@ -132,8 +132,7 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
for gle in gl_entries: for gle in gl_entries:
amount = flt(gle.debit) - flt(gle.credit) amount = flt(gle.debit) - flt(gle.credit)
if filters.get("account") and (gle.posting_date < filters.from_date if filters.get("account") and (gle.posting_date<filters.from_date or cstr(gle.is_opening)=="Yes"):
or cstr(gle.is_opening) == "Yes"):
gle_map[gle.account].opening += amount gle_map[gle.account].opening += amount
opening += amount opening += amount
elif gle.posting_date <= filters.to_date: elif gle.posting_date <= filters.to_date:

View File

@ -1,10 +1,10 @@
{ {
"creation": "2013-02-21 14:26:44.000000", "creation": "2013-02-21 14:26:44",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-05-13 16:08:56.120371",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Ordered Items To Be Billed", "name": "Ordered Items To Be Billed",

View File

@ -1,11 +1,11 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-05-28 15:54:16.000000", "creation": "2013-05-28 15:54:16",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-05-13 16:08:56.166593",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Purchase Order Items To Be Billed", "name": "Purchase Order Items To Be Billed",

View File

@ -1,10 +1,10 @@
{ {
"creation": "2013-07-30 18:35:10.000000", "creation": "2013-07-30 18:35:10",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-05-13 16:08:56.176404",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Received Items To Be Billed", "name": "Received Items To Be Billed",

View File

@ -1,10 +1,10 @@
{ {
"creation": "2013-05-06 12:28:23.000000", "creation": "2013-05-06 12:28:23",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-05-13 16:08:56.188121",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Partners Commission", "name": "Sales Partners Commission",

View File

@ -43,14 +43,14 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
make_purchase_receipt: function() { make_purchase_receipt: function() {
frappe.model.open_mapped_doc({ frappe.model.open_mapped_doc({
method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt", method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
source_name: cur_frm.doc.name frm: cur_frm
}) })
}, },
make_purchase_invoice: function() { make_purchase_invoice: function() {
frappe.model.open_mapped_doc({ frappe.model.open_mapped_doc({
method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice", method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
source_name: cur_frm.doc.name frm: cur_frm
}) })
}, },

View File

@ -2,7 +2,7 @@
"allow_attach": 1, "allow_attach": 1,
"allow_import": 1, "allow_import": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-05-21 16:16:39.000000", "creation": "2013-05-21 16:16:39",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Transaction", "document_type": "Transaction",
@ -21,7 +21,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "naming_series", "oldfieldname": "naming_series",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "\nPO", "options": "PO-",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
@ -537,23 +537,23 @@
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
"fieldname": "letter_head", "fieldname": "letter_head",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Letter Head", "label": "Letter Head",
"oldfieldname": "letter_head", "oldfieldname": "letter_head",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Letter Head", "options": "Letter Head",
"permlevel": 0, "permlevel": 0,
"print_hide": 1 "print_hide": 1
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"reqd": 1, "reqd": 1,
@ -636,7 +636,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-01-29 15:26:21.000000", "modified": "2014-05-09 02:17:04.992233",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Purchase Order", "name": "Purchase Order",
@ -647,9 +647,9 @@
"cancel": 0, "cancel": 0,
"create": 0, "create": 0,
"delete": 0, "delete": 0,
"email": 1, "email": 0,
"permlevel": 0, "permlevel": 0,
"print": 1, "print": 0,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Material User", "role": "Material User",
@ -696,5 +696,7 @@
} }
], ],
"read_only_onload": 1, "read_only_onload": 1,
"search_fields": "status, transaction_date, supplier,grand_total" "search_fields": "status, transaction_date, supplier,grand_total",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -45,7 +45,7 @@ class PurchaseOrder(BuyingController):
self.validate_with_previous_doc() self.validate_with_previous_doc()
self.validate_for_subcontracting() self.validate_for_subcontracting()
self.update_raw_materials_supplied("po_raw_material_details") self.create_raw_materials_supplied("po_raw_material_details")
def validate_with_previous_doc(self): def validate_with_previous_doc(self):
super(PurchaseOrder, self).validate_with_previous_doc(self.tname, { super(PurchaseOrder, self).validate_with_previous_doc(self.tname, {

View File

@ -1,5 +1,5 @@
{ {
"creation": "2013-02-22 01:27:42.000000", "creation": "2013-02-22 01:27:42",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -35,6 +35,21 @@
"read_only": 1, "read_only": 1,
"width": "300px" "width": "300px"
}, },
{
"fieldname": "batch_no",
"fieldtype": "Link",
"label": "Batch No",
"no_copy": 1,
"options": "Batch",
"permlevel": 0
},
{
"fieldname": "serial_no",
"fieldtype": "Text",
"label": "Serial No",
"no_copy": 1,
"permlevel": 0
},
{ {
"fieldname": "col_break1", "fieldname": "col_break1",
"fieldtype": "Column Break", "fieldtype": "Column Break",
@ -57,6 +72,7 @@
"oldfieldname": "consumed_qty", "oldfieldname": "consumed_qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"read_only": 1,
"reqd": 1 "reqd": 1
}, },
{ {
@ -137,9 +153,12 @@
"hide_toolbar": 0, "hide_toolbar": 0,
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-02-13 11:29:35.000000", "modified": "2014-05-08 18:37:42.966473",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Purchase Receipt Item Supplied", "name": "Purchase Receipt Item Supplied",
"owner": "wasim@webnotestech.com" "owner": "wasim@webnotestech.com",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,6 +1,6 @@
{ {
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-04-30 13:13:03.000000", "creation": "2013-04-30 13:13:03",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -24,7 +24,7 @@
"fieldtype": "Select", "fieldtype": "Select",
"label": "Series", "label": "Series",
"no_copy": 1, "no_copy": 1,
"options": "\nQAI/11-12/", "options": "QI-",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -32,6 +32,7 @@
"fieldname": "inspection_type", "fieldname": "inspection_type",
"fieldtype": "Select", "fieldtype": "Select",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Inspection Type", "label": "Inspection Type",
"oldfieldname": "inspection_type", "oldfieldname": "inspection_type",
"oldfieldtype": "Select", "oldfieldtype": "Select",
@ -43,6 +44,7 @@
"fieldname": "report_date", "fieldname": "report_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Report Date", "label": "Report Date",
"oldfieldname": "report_date", "oldfieldname": "report_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
@ -54,6 +56,7 @@
"fieldname": "item_code", "fieldname": "item_code",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
"in_list_view": 1,
"in_filter": 1, "in_filter": 1,
"label": "Item Code", "label": "Item Code",
"oldfieldname": "item_code", "oldfieldname": "item_code",
@ -203,7 +206,7 @@
"icon": "icon-search", "icon": "icon-search",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-01-20 17:49:14.000000", "modified": "2014-05-06 08:20:33.015328",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Quality Inspection", "name": "Quality Inspection",

View File

@ -2,7 +2,7 @@
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-01-10 16:34:11.000000", "creation": "2013-01-10 16:34:11",
"description": "Supplier of Goods or Services.", "description": "Supplier of Goods or Services.",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -23,7 +23,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "naming_series", "oldfieldname": "naming_series",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "\nSUPP\nSUPP/10-11/", "options": "SUPP-",
"permlevel": 0 "permlevel": 0
}, },
{ {
@ -123,6 +123,7 @@
{ {
"fieldname": "default_currency", "fieldname": "default_currency",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Default Currency", "label": "Default Currency",
"no_copy": 1, "no_copy": 1,
"options": "Currency", "options": "Currency",
@ -131,6 +132,7 @@
{ {
"fieldname": "default_price_list", "fieldname": "default_price_list",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Price List", "label": "Price List",
"options": "Price List", "options": "Price List",
"permlevel": 0 "permlevel": 0
@ -138,6 +140,7 @@
{ {
"fieldname": "default_taxes_and_charges", "fieldname": "default_taxes_and_charges",
"fieldtype": "Link", "fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Taxes and Charges", "label": "Taxes and Charges",
"options": "Purchase Taxes and Charges Master", "options": "Purchase Taxes and Charges Master",
"permlevel": 0 "permlevel": 0
@ -183,7 +186,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2014-01-28 19:05:55.000000", "modified": "2014-05-07 06:08:33.836379",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier", "name": "Supplier",
@ -216,6 +219,16 @@
"role": "Purchase Master Manager", "role": "Purchase Master Manager",
"submit": 0, "submit": 0,
"write": 1 "write": 1
},
{
"permlevel": 0,
"read": 1,
"role": "Material User"
},
{
"permlevel": 0,
"read": 1,
"role": "Accounts User"
} }
], ],
"search_fields": "supplier_name,supplier_type" "search_fields": "supplier_name,supplier_type"

View File

@ -39,7 +39,7 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext
make_purchase_order: function() { make_purchase_order: function() {
frappe.model.open_mapped_doc({ frappe.model.open_mapped_doc({
method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order", method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order",
source_name: cur_frm.doc.name frm: cur_frm
}) })
} }
}); });

View File

@ -2,7 +2,7 @@
"allow_attach": 1, "allow_attach": 1,
"allow_import": 1, "allow_import": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-05-21 16:16:45.000000", "creation": "2013-05-21 16:16:45",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Transaction", "document_type": "Transaction",
@ -21,7 +21,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "naming_series", "oldfieldname": "naming_series",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "SQTN", "options": "SQTN-",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
@ -435,11 +435,11 @@
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
"fieldname": "letter_head", "fieldname": "letter_head",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Letter Head", "label": "Letter Head",
"oldfieldname": "letter_head", "oldfieldname": "letter_head",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Letter Head", "options": "Letter Head",
"permlevel": 0, "permlevel": 0,
"print_hide": 1 "print_hide": 1
}, },
@ -533,13 +533,13 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"reqd": 1, "reqd": 1,
@ -562,7 +562,7 @@
"icon": "icon-shopping-cart", "icon": "icon-shopping-cart",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-01-29 15:25:52.000000", "modified": "2014-05-09 02:17:10.664189",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier Quotation", "name": "Supplier Quotation",
@ -640,5 +640,7 @@
} }
], ],
"read_only_onload": 1, "read_only_onload": 1,
"search_fields": "status, transaction_date, supplier,grand_total" "search_fields": "status, transaction_date, supplier,grand_total",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,11 +1,11 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-05-03 14:55:53.000000", "creation": "2013-05-03 14:55:53",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-05-13 16:08:56.060149",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Item-wise Purchase History", "name": "Item-wise Purchase History",

View File

@ -1,11 +1,11 @@
{ {
"add_total_row": 1, "add_total_row": 1,
"creation": "2013-05-13 16:10:02.000000", "creation": "2013-05-13 16:10:02",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-05-13 16:08:56.180305",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Requested Items To Be Ordered", "name": "Requested Items To Be Ordered",

View File

@ -1,10 +1,10 @@
{ {
"creation": "2013-10-09 10:38:40.000000", "creation": "2013-10-09 10:38:40",
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-03-07 15:30:27.000000", "modified": "2014-05-13 16:08:56.218629",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier Addresses and Contacts", "name": "Supplier Addresses and Contacts",

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
data = [ def get_data():
return [
{ {
"label": _("Documents"), "label": _("Documents"),
"icon": "icon-star", "icon": "icon-star",

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
data = [ def get_data():
return [
{ {
"label": _("Documents"), "label": _("Documents"),
"icon": "icon-star", "icon": "icon-star",

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
data = { def get_data():
return {
"Accounts": { "Accounts": {
"color": "#3498db", "color": "#3498db",
"icon": "icon-money", "icon": "icon-money",

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
data = [ def get_data():
return [
{ {
"label": _("Documents"), "label": _("Documents"),
"icon": "icon-star", "icon": "icon-star",

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
data = [ def get_data():
return [
{ {
"label": _("Documents"), "label": _("Documents"),
"icon": "icon-star", "icon": "icon-star",

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
data = [ def get_data():
return [
{ {
"label": _("Documents"), "label": _("Documents"),
"icon": "icon-star", "icon": "icon-star",

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
data = [ def get_data():
return [
{ {
"label": _("Documents"), "label": _("Documents"),
"icon": "icon-star", "icon": "icon-star",

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
from frappe.widgets.moduleview import add_setup_section from frappe.widgets.moduleview import add_setup_section
def get_data():
data = [ data = [
{ {
"label": _("Settings"), "label": _("Settings"),
@ -122,9 +123,6 @@ data = [
}, },
] ]
def get_data():
out = list(data)
for module, label, icon in ( for module, label, icon in (
("accounts", _("Accounts"), "icon-money"), ("accounts", _("Accounts"), "icon-money"),
("stock", _("Stock"), "icon-truck"), ("stock", _("Stock"), "icon-truck"),
@ -133,6 +131,6 @@ def get_data():
("hr", _("Human Resources"), "icon-group"), ("hr", _("Human Resources"), "icon-group"),
("support", _("Support"), "icon-phone")): ("support", _("Support"), "icon-phone")):
add_setup_section(out, "erpnext", module, label, icon) add_setup_section(data, "erpnext", module, label, icon)
return out return data

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
data = [ def get_data():
return [
{ {
"label": _("Documents"), "label": _("Documents"),
"icon": "icon-star", "icon": "icon-star",

View File

@ -1,6 +1,7 @@
from frappe import _ from frappe import _
data = [ def get_data():
return [
{ {
"label": _("Documents"), "label": _("Documents"),
"icon": "icon-star", "icon": "icon-star",

View File

@ -1,302 +1,88 @@
{ {
"_last_update": null, "allow_rename": 1,
"_user_tags": null,
"allow_attach": null,
"allow_copy": null,
"allow_email": null,
"allow_import": null,
"allow_print": null,
"allow_rename": null,
"allow_trash": null,
"autoname": "field:party_type_name", "autoname": "field:party_type_name",
"change_log": null,
"client_script": null,
"client_script_core": null,
"client_string": null,
"colour": null,
"creation": "2014-04-07 12:32:18.010384", "creation": "2014-04-07 12:32:18.010384",
"custom": null,
"default_print_format": null,
"description": null,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
"dt_template": null,
"fields": [ "fields": [
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "party_type_name", "fieldname": "party_type_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": 1, "in_list_view": 1,
"label": "Party Type Name", "label": "Party Type Name",
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null, "reqd": 1
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": 1,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "parent_party_type", "fieldname": "parent_party_type",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Parent Party Type", "label": "Parent Party Type",
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": "Party Type", "options": "Party Type",
"permlevel": 0, "permlevel": 0
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": "Yes", "default": "Yes",
"depends_on": null,
"description": null,
"fieldname": "allow_children", "fieldname": "allow_children",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": null,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Allow Children", "label": "Allow Children",
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": "Yes\nNo", "options": "Yes\nNo",
"permlevel": 0, "permlevel": 0
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "default_price_list", "fieldname": "default_price_list",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": null, "ignore_restrictions": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Default Price List", "label": "Default Price List",
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": "Price List", "options": "Price List",
"permlevel": 0, "permlevel": 0
"print_hide": null,
"print_width": null,
"read_only": null,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "lft", "fieldname": "lft",
"fieldtype": "Int", "fieldtype": "Int",
"hidden": 1, "hidden": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "LFT", "label": "LFT",
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1, "read_only": 1,
"report_hide": null, "search_index": 1
"reqd": null,
"search_index": 1,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "rgt", "fieldname": "rgt",
"fieldtype": "Int", "fieldtype": "Int",
"hidden": 1, "hidden": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "RGT", "label": "RGT",
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null,
"print_width": null,
"read_only": 1, "read_only": 1,
"report_hide": null, "search_index": 1
"reqd": null,
"search_index": 1,
"set_only_once": null,
"trigger": null,
"width": null
}, },
{ {
"allow_on_submit": null,
"default": null,
"depends_on": null,
"description": null,
"fieldname": "old_parent", "fieldname": "old_parent",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
"ignore_restrictions": null,
"in_filter": null,
"in_list_view": null,
"label": "Old Parent", "label": "Old Parent",
"no_column": null,
"no_copy": null,
"oldfieldname": null,
"oldfieldtype": null,
"options": null,
"permlevel": 0, "permlevel": 0,
"print_hide": null, "read_only": 1
"print_width": null,
"read_only": 1,
"report_hide": null,
"reqd": null,
"search_index": null,
"set_only_once": null,
"trigger": null,
"width": null
} }
], ],
"hide_heading": null, "modified": "2014-05-07 05:18:29.669293",
"hide_toolbar": null,
"icon": null,
"idx": null,
"in_create": null,
"in_dialog": null,
"is_submittable": null,
"is_transaction_doc": null,
"issingle": null,
"istable": null,
"max_attachments": null,
"menu_index": null,
"modified": "2014-04-07 12:54:46.254776",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Contacts", "module": "Contacts",
"name": "Party Type", "name": "Party Type",
"name_case": null,
"owner": "Administrator", "owner": "Administrator",
"parent": null,
"parent_node": null,
"parentfield": null,
"parenttype": null,
"permissions": [ "permissions": [
{ {
"amend": null,
"cancel": null,
"create": 1, "create": 1,
"delete": null,
"email": null,
"export": null,
"import": null,
"match": null,
"permlevel": 0, "permlevel": 0,
"print": null,
"read": 1, "read": 1,
"report": null,
"restrict": null,
"restricted": null,
"role": "Sales User", "role": "Sales User",
"submit": null,
"write": 1 "write": 1
}, },
{ {
"amend": null,
"cancel": null,
"create": 1, "create": 1,
"delete": null,
"email": null,
"export": null,
"import": null,
"match": null,
"permlevel": 0, "permlevel": 0,
"print": null,
"read": 1, "read": 1,
"report": null,
"restrict": null,
"restricted": null,
"role": "Purchase User", "role": "Purchase User",
"submit": null,
"write": 1 "write": 1
} }
], ]
"plugin": null,
"print_outline": null,
"read_only": null,
"read_only_onload": null,
"search_fields": null,
"section_style": null,
"server_code": null,
"server_code_compiled": null,
"server_code_core": null,
"server_code_error": null,
"show_in_menu": null,
"smallicon": null,
"subject": null,
"tag_fields": null,
"title_field": null,
"use_template": null,
"version": null
} }

View File

@ -316,7 +316,7 @@ class AccountsController(TransactionBase):
def _cleanup(self): def _cleanup(self):
for tax in self.tax_doclist: for tax in self.tax_doclist:
tax.item_wise_tax_detail = json.dumps(tax.item_wise_tax_detail) tax.item_wise_tax_detail = json.dumps(tax.item_wise_tax_detail, separators=(',', ':'))
def _set_in_company_currency(self, item, print_field, base_field): def _set_in_company_currency(self, item, print_field, base_field):
"""set values in base currency""" """set values in base currency"""

View File

@ -200,48 +200,82 @@ class BuyingController(StockController):
and not self.supplier_warehouse: and not self.supplier_warehouse:
frappe.throw(_("Supplier Warehouse mandatory for sub-contracted Purchase Receipt")) frappe.throw(_("Supplier Warehouse mandatory for sub-contracted Purchase Receipt"))
def update_raw_materials_supplied(self, raw_material_table): def create_raw_materials_supplied(self, raw_material_table):
self.set(raw_material_table, [])
if self.is_subcontracted=="Yes": if self.is_subcontracted=="Yes":
parent_items = []
rm_supplied_idx = 0
for item in self.get(self.fname): for item in self.get(self.fname):
if self.doctype == "Purchase Receipt": if self.doctype == "Purchase Receipt":
item.rm_supp_cost = 0.0 item.rm_supp_cost = 0.0
if item.item_code in self.sub_contracted_items: if item.item_code in self.sub_contracted_items:
self.add_bom_items(item, raw_material_table) self.update_raw_materials_supplied(item, raw_material_table, rm_supplied_idx)
if [item.item_code, item.name] not in parent_items:
parent_items.append([item.item_code, item.name])
self.cleanup_raw_materials_supplied(parent_items, raw_material_table)
elif self.doctype == "Purchase Receipt": elif self.doctype == "Purchase Receipt":
for item in self.get(self.fname): for item in self.get(self.fname):
item.rm_supp_cost = 0.0 item.rm_supp_cost = 0.0
def add_bom_items(self, d, raw_material_table): def update_raw_materials_supplied(self, item, raw_material_table, rm_supplied_idx):
bom_items = self.get_items_from_default_bom(d.item_code) bom_items = self.get_items_from_default_bom(item.item_code)
raw_materials_cost = 0 raw_materials_cost = 0
for item in bom_items:
required_qty = flt(item.qty_consumed_per_unit) * flt(d.qty) * flt(d.conversion_factor)
rm_doclist = {
"doctype": self.doctype + " Item Supplied",
"reference_name": d.name,
"bom_detail_no": item.name,
"main_item_code": d.item_code,
"rm_item_code": item.item_code,
"stock_uom": item.stock_uom,
"required_qty": required_qty,
"conversion_factor": d.conversion_factor,
"rate": item.rate,
"amount": required_qty * flt(item.rate)
}
if self.doctype == "Purchase Receipt":
rm_doclist.update({
"consumed_qty": required_qty,
"description": item.description,
})
self.append(raw_material_table, rm_doclist) for bom_item in bom_items:
# check if exists
exists = 0
for d in self.get(raw_material_table):
if d.main_item_code == item.item_code and d.rm_item_code == bom_item.item_code \
and d.reference_name == item.name:
rm, exists = d, 1
break
raw_materials_cost += required_qty * flt(item.rate) if not exists:
rm = self.append(raw_material_table, {})
required_qty = flt(bom_item.qty_consumed_per_unit) * flt(item.qty) * flt(item.conversion_factor)
rm.reference_name = item.name
rm.bom_detail_no = bom_item.name
rm.main_item_code = item.item_code
rm.rm_item_code = bom_item.item_code
rm.stock_uom = bom_item.stock_uom
rm.required_qty = required_qty
rm.conversion_factor = item.conversion_factor
rm.rate = bom_item.rate
rm.amount = required_qty * flt(bom_item.rate)
rm.idx = rm_supplied_idx
if self.doctype == "Purchase Receipt": if self.doctype == "Purchase Receipt":
d.rm_supp_cost = raw_materials_cost rm.consumed_qty = required_qty
rm.description = bom_item.description
if item.batch_no and not rm.batch_no:
rm.batch_no = item.batch_no
rm_supplied_idx += 1
raw_materials_cost += required_qty * flt(bom_item.rate)
if self.doctype == "Purchase Receipt":
item.rm_supp_cost = raw_materials_cost
def cleanup_raw_materials_supplied(self, parent_items, raw_material_table):
"""Remove all those child items which are no longer present in main item table"""
delete_list = []
for d in self.get(raw_material_table):
if [d.main_item_code, d.reference_name] not in parent_items:
# mark for deletion from doclist
delete_list.append([d.main_item_code, d.reference_name])
# delete from doclist
if delete_list:
rm_supplied_details = self.get(raw_material_table)
self.set(raw_material_table, [])
for d in rm_supplied_details:
if d not in delete_list:
self.append(raw_material_table, d)
def get_items_from_default_bom(self, item_code): def get_items_from_default_bom(self, item_code):
bom_items = frappe.db.sql("""select t2.item_code, t2.qty_consumed_per_unit, bom_items = frappe.db.sql("""select t2.item_code, t2.qty_consumed_per_unit,

View File

@ -20,7 +20,7 @@ def get_filters_cond(doctype, filters, conditions):
query = DatabaseQuery(doctype) query = DatabaseQuery(doctype)
query.filters = flt query.filters = flt
query.conditions = conditions query.conditions = conditions
query.build_filter_conditions() query.build_filter_conditions(flt, conditions)
cond = ' and ' + ' and '.join(query.conditions) cond = ' and ' + ' and '.join(query.conditions)
else: else:

View File

@ -88,6 +88,7 @@ class StatusUpdater(Document):
def on_communication(self): def on_communication(self):
self.communication_set = True self.communication_set = True
self.get("communications").sort(key=lambda d: d.creation)
self.set_status(update=True) self.set_status(update=True)
del self.communication_set del self.communication_set

View File

@ -83,6 +83,9 @@ def make_feed(feedtype, doctype, name, owner, subject, color):
def update_feed(doc, method=None): def update_feed(doc, method=None):
"adds a new feed" "adds a new feed"
if frappe.flags.in_patch:
return
if method in ['on_update', 'on_submit']: if method in ['on_update', 'on_submit']:
subject, color = feed_dict.get(doc.doctype, [None, None]) subject, color = feed_dict.get(doc.doctype, [None, None])
if subject: if subject:

View File

@ -27,6 +27,7 @@ cur_frm.cscript.kra_template = function(doc, dt, dn) {
frappe.model.map_current_doc({ frappe.model.map_current_doc({
method: "erpnext.hr.doctype.appraisal.appraisal.fetch_appraisal_template", method: "erpnext.hr.doctype.appraisal.appraisal.fetch_appraisal_template",
source_name: cur_frm.doc.kra_template, source_name: cur_frm.doc.kra_template,
frm: cur_frm
}); });
} }

View File

@ -1,6 +1,6 @@
{ {
"autoname": "APRSL.#####", "autoname": "APRSL.#####",
"creation": "2013-01-10 16:34:12.000000", "creation": "2013-01-10 16:34:12",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -157,23 +157,23 @@
}, },
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Company", "label": "Company",
"oldfieldname": "company", "oldfieldname": "company",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "link:Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -196,7 +196,7 @@
"icon": "icon-thumbs-up", "icon": "icon-thumbs-up",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-01-22 16:05:34.000000", "modified": "2014-05-09 02:16:37.334857",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Appraisal", "name": "Appraisal",
@ -245,5 +245,7 @@
"write": 1 "write": 1
} }
], ],
"search_fields": "status, employee, employee_name" "search_fields": "status, employee, employee_name",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,7 +1,7 @@
{ {
"allow_import": 1, "allow_import": 1,
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2013-01-10 16:34:13.000000", "creation": "2013-01-10 16:34:13",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
@ -21,7 +21,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "naming_series", "oldfieldname": "naming_series",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "ATT", "options": "ATT-",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -94,23 +94,23 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Company", "label": "Company",
"oldfieldname": "company", "oldfieldname": "company",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "link:Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -129,7 +129,7 @@
"icon": "icon-ok", "icon": "icon-ok",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-01-20 17:48:23.000000", "modified": "2014-05-09 02:16:37.761770",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Attendance", "name": "Attendance",
@ -175,5 +175,7 @@
"write": 1 "write": 1
} }
], ],
"search_fields": "employee, employee_name, att_date, status" "search_fields": "employee, employee_name, att_date, status",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -2,23 +2,15 @@
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:branch", "autoname": "field:branch",
"creation": "2013-01-10 16:34:13.000000", "creation": "2013-01-10 16:34:13",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
"fields": [ "fields": [
{
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"permlevel": 0,
"read_only": 1
},
{ {
"fieldname": "branch", "fieldname": "branch",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Branch", "label": "Branch",
"oldfieldname": "branch", "oldfieldname": "branch",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -28,7 +20,7 @@
], ],
"icon": "icon-code-fork", "icon": "icon-code-fork",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:26.000000", "modified": "2014-05-07 06:39:31.752490",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Branch", "name": "Branch",

View File

@ -2,23 +2,15 @@
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:deduction_name", "autoname": "field:deduction_name",
"creation": "2013-01-22 16:50:30.000000", "creation": "2013-01-22 16:50:30",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
"fields": [ "fields": [
{
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"permlevel": 0,
"read_only": 1
},
{ {
"fieldname": "deduction_name", "fieldname": "deduction_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Name", "label": "Name",
"oldfieldname": "deduction_name", "oldfieldname": "deduction_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -28,6 +20,7 @@
{ {
"fieldname": "description", "fieldname": "description",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"in_list_view": 1,
"label": "Description", "label": "Description",
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
@ -37,7 +30,7 @@
], ],
"icon": "icon-flag", "icon": "icon-flag",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:34.000000", "modified": "2014-05-07 06:39:38.154345",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Deduction Type", "name": "Deduction Type",

View File

@ -1,7 +1,8 @@
{ {
"allow_import": 1, "allow_import": 1,
"allow_rename": 1,
"autoname": "field:department_name", "autoname": "field:department_name",
"creation": "2013-02-05 11:48:26.000000", "creation": "2013-02-05 11:48:26",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
@ -9,6 +10,7 @@
{ {
"fieldname": "department_name", "fieldname": "department_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Department", "label": "Department",
"oldfieldname": "department_name", "oldfieldname": "department_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -19,6 +21,7 @@
"description": "Days for which Holidays are blocked for this department.", "description": "Days for which Holidays are blocked for this department.",
"fieldname": "leave_block_list", "fieldname": "leave_block_list",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Leave Block List", "label": "Leave Block List",
"options": "Leave Block List", "options": "Leave Block List",
"permlevel": 0 "permlevel": 0
@ -26,7 +29,7 @@
], ],
"icon": "icon-sitemap", "icon": "icon-sitemap",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:38.000000", "modified": "2014-05-07 06:39:39.931091",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Department", "name": "Department",

View File

@ -2,7 +2,7 @@
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:designation_name", "autoname": "field:designation_name",
"creation": "2013-01-10 16:34:13.000000", "creation": "2013-01-10 16:34:13",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
@ -10,6 +10,7 @@
{ {
"fieldname": "designation_name", "fieldname": "designation_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Designation", "label": "Designation",
"oldfieldname": "designation_name", "oldfieldname": "designation_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -19,7 +20,7 @@
], ],
"icon": "icon-bookmark", "icon": "icon-bookmark",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:38.000000", "modified": "2014-05-07 06:39:38.265440",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Designation", "name": "Designation",

View File

@ -2,23 +2,15 @@
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:earning_name", "autoname": "field:earning_name",
"creation": "2013-01-24 11:03:32.000000", "creation": "2013-01-24 11:03:32",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
"fields": [ "fields": [
{
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"permlevel": 0,
"read_only": 1
},
{ {
"fieldname": "earning_name", "fieldname": "earning_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Name", "label": "Name",
"oldfieldname": "earning_name", "oldfieldname": "earning_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -28,6 +20,7 @@
{ {
"fieldname": "description", "fieldname": "description",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"in_list_view": 1,
"label": "Description", "label": "Description",
"oldfieldname": "description", "oldfieldname": "description",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
@ -38,6 +31,7 @@
{ {
"fieldname": "taxable", "fieldname": "taxable",
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1,
"label": "Taxable", "label": "Taxable",
"oldfieldname": "taxable", "oldfieldname": "taxable",
"oldfieldtype": "Select", "oldfieldtype": "Select",
@ -50,6 +44,7 @@
"fieldname": "exemption_limit", "fieldname": "exemption_limit",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "hidden": 0,
"in_list_view": 1,
"label": "Exemption Limit", "label": "Exemption Limit",
"oldfieldname": "exemption_limit", "oldfieldname": "exemption_limit",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
@ -58,7 +53,7 @@
], ],
"icon": "icon-flag", "icon": "icon-flag",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:38.000000", "modified": "2014-05-07 06:39:38.414922",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Earning Type", "name": "Earning Type",

View File

@ -12,15 +12,14 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
onload: function() { onload: function() {
this.setup_leave_approver_select(); this.setup_leave_approver_select();
this.frm.toggle_display(["esic_card_no", "gratuity_lic_id", "pan_number", "pf_number"],
frappe.boot.sysdefaults.country==="India");
if(this.frm.doc.__islocal) this.frm.set_value("employee_name", ""); if(this.frm.doc.__islocal) this.frm.set_value("employee_name", "");
}, },
refresh: function() { refresh: function() {
var me = this; var me = this;
erpnext.toggle_naming_series(); erpnext.toggle_naming_series();
if(!this.frm.doc.__islocal && !this.frm.doc.salary_structure_exists) { if(!this.frm.doc.__islocal && this.frm.doc.__onload &&
!this.frm.doc.__onload.salary_structure_exists) {
cur_frm.add_custom_button(__('Make Salary Structure'), function() { cur_frm.add_custom_button(__('Make Salary Structure'), function() {
me.make_salary_structure(this); }); me.make_salary_structure(this); });
} }
@ -60,7 +59,7 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
make_salary_structure: function(btn) { make_salary_structure: function(btn) {
frappe.model.open_mapped_doc({ frappe.model.open_mapped_doc({
method: "erpnext.hr.doctype.employee.employee.make_salary_structure", method: "erpnext.hr.doctype.employee.employee.make_salary_structure",
source_name: cur_frm.doc.name frm: cur_frm
}); });
} }
}); });

View File

@ -136,10 +136,10 @@
}, },
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Company", "label": "Company",
"options": "link:Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
@ -337,30 +337,6 @@
"oldfieldtype": "Data", "oldfieldtype": "Data",
"permlevel": 0 "permlevel": 0
}, },
{
"fieldname": "esic_card_no",
"fieldtype": "Data",
"label": "ESIC CARD No",
"oldfieldname": "esic_card_no",
"oldfieldtype": "Data",
"permlevel": 0
},
{
"fieldname": "pf_number",
"fieldtype": "Data",
"label": "PF Number",
"oldfieldname": "pf_number",
"oldfieldtype": "Data",
"permlevel": 0
},
{
"fieldname": "gratuity_lic_id",
"fieldtype": "Data",
"label": "Gratuity LIC ID",
"oldfieldname": "gratuity_lic_id",
"oldfieldtype": "Data",
"permlevel": 0
},
{ {
"fieldname": "organization_profile", "fieldname": "organization_profile",
"fieldtype": "Section Break", "fieldtype": "Section Break",
@ -497,12 +473,6 @@
"permlevel": 0, "permlevel": 0,
"width": "50%" "width": "50%"
}, },
{
"fieldname": "pan_number",
"fieldtype": "Data",
"label": "PAN Number",
"permlevel": 0
},
{ {
"fieldname": "passport_number", "fieldname": "passport_number",
"fieldtype": "Data", "fieldtype": "Data",
@ -698,20 +668,11 @@
"oldfieldname": "feedback", "oldfieldname": "feedback",
"oldfieldtype": "Text", "oldfieldtype": "Text",
"permlevel": 0 "permlevel": 0
},
{
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"permlevel": 0,
"read_only": 1
} }
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2014-04-30 09:03:10.879762", "modified": "2014-05-09 02:16:47.217445",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee", "name": "Employee",
@ -727,6 +688,7 @@
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"restricted": 1,
"role": "Employee", "role": "Employee",
"submit": 0, "submit": 0,
"write": 0 "write": 0
@ -768,5 +730,7 @@
"role": "Leave Approver" "role": "Leave Approver"
} }
], ],
"search_fields": "employee_name" "search_fields": "employee_name",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -14,17 +14,9 @@ from frappe.model.mapper import get_mapped_doc
class Employee(Document): class Employee(Document):
def onload(self): def onload(self):
self.salary_structure_exists = frappe.db.get_value("Salary Structure", self.get("__onload").salary_structure_exists = frappe.db.get_value("Salary Structure",
{"employee": self.name, "is_active": "Yes", "docstatus": ["!=", 2]}) {"employee": self.name, "is_active": "Yes", "docstatus": ["!=", 2]})
def as_dict(self, no_nulls=False):
doc = super(Employee, self).as_dict(no_nulls)
if hasattr(self, "salary_structure_exists"):
doc["salary_structure_exists"] = self.salary_structure_exists
return doc
def autoname(self): def autoname(self):
naming_method = frappe.db.get_value("HR Settings", None, "emp_created_by") naming_method = frappe.db.get_value("HR Settings", None, "emp_created_by")
if not naming_method: if not naming_method:
@ -129,12 +121,6 @@ class Employee(Document):
if self.date_of_birth and self.date_of_joining and getdate(self.date_of_birth) >= getdate(self.date_of_joining): if self.date_of_birth and self.date_of_joining and getdate(self.date_of_birth) >= getdate(self.date_of_joining):
throw(_("Date of Joining must be greater than Date of Birth")) throw(_("Date of Joining must be greater than Date of Birth"))
elif self.scheduled_confirmation_date and self.date_of_joining and (getdate(self.scheduled_confirmation_date) < getdate(self.date_of_joining)):
throw(_("Scheduled Confirmation Date must be greater than Date of Joining"))
elif self.final_confirmation_date and self.date_of_joining and (getdate(self.final_confirmation_date) < getdate(self.date_of_joining)):
throw(_("Final Confirmation Date must be greater than Date of Joining"))
elif self.date_of_retirement and self.date_of_joining and (getdate(self.date_of_retirement) <= getdate(self.date_of_joining)): elif self.date_of_retirement and self.date_of_joining and (getdate(self.date_of_retirement) <= getdate(self.date_of_joining)):
throw(_("Date Of Retirement must be greater than Date of Joining")) throw(_("Date Of Retirement must be greater than Date of Joining"))
@ -155,6 +141,8 @@ class Employee(Document):
throw(_("Please enter relieving date.")) throw(_("Please enter relieving date."))
def validate_for_enabled_user_id(self): def validate_for_enabled_user_id(self):
if not self.status == 'Active':
return
enabled = frappe.db.sql("""select name from `tabUser` where enabled = frappe.db.sql("""select name from `tabUser` where
name=%s and enabled=1""", self.user_id) name=%s and enabled=1""", self.user_id)
if not enabled: if not enabled:

View File

@ -1,36 +1,36 @@
{ {
"creation": "2013-02-22 01:27:45.000000", "creation": "2013-02-22 01:27:45",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{ {
"fieldname": "branch", "fieldname": "branch",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Branch", "label": "Branch",
"oldfieldname": "branch", "oldfieldname": "branch",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Branch", "options": "Branch",
"permlevel": 0 "permlevel": 0
}, },
{ {
"fieldname": "department", "fieldname": "department",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Department", "label": "Department",
"oldfieldname": "department", "oldfieldname": "department",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Department", "options": "Department",
"permlevel": 0 "permlevel": 0
}, },
{ {
"fieldname": "designation", "fieldname": "designation",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Designation", "label": "Designation",
"oldfieldname": "designation", "oldfieldname": "designation",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Designation", "options": "Designation",
"permlevel": 0 "permlevel": 0
}, },
{ {
@ -54,9 +54,12 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2013-12-20 19:24:12.000000", "modified": "2014-05-09 02:16:44.613840",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee Internal Work History", "name": "Employee Internal Work History",
"owner": "Administrator" "owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,7 +1,7 @@
{ {
"allow_import": 0, "allow_import": 0,
"autoname": "LAPPR-/.#####", "autoname": "LAPPR-/.#####",
"creation": "2013-04-12 06:56:15.000000", "creation": "2013-04-12 06:56:15",
"description": "Users who can approve a specific employee's leave applications", "description": "Users who can approve a specific employee's leave applications",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -11,6 +11,7 @@
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1, "in_list_view": 1,
"label": "Leave Approver", "label": "Leave Approver",
"options": "[Select]",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"reqd": 1, "reqd": 1,
@ -19,9 +20,12 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2013-12-20 19:23:12.000000", "modified": "2014-05-15 19:32:14.134420",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee Leave Approver", "name": "Employee Leave Approver",
"owner": "Administrator" "owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,7 +1,7 @@
{ {
"allow_import": 1, "allow_import": 1,
"autoname": "field:employee_type_name", "autoname": "field:employee_type_name",
"creation": "2013-01-10 16:34:14.000000", "creation": "2013-01-10 16:34:14",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
@ -9,6 +9,7 @@
{ {
"fieldname": "employee_type_name", "fieldname": "employee_type_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Employment Type", "label": "Employment Type",
"oldfieldname": "employee_type_name", "oldfieldname": "employee_type_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -18,7 +19,7 @@
], ],
"icon": "icon-flag", "icon": "icon-flag",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:43.000000", "modified": "2014-05-07 06:39:38.630562",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employment Type", "name": "Employment Type",

View File

@ -1,6 +1,6 @@
{ {
"autoname": "EXP.######", "autoname": "EXP.######",
"creation": "2013-01-10 16:34:14.000000", "creation": "2013-01-10 16:34:14",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -114,23 +114,23 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Company", "label": "Company",
"oldfieldname": "company", "oldfieldname": "company",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "link:Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -187,7 +187,7 @@
"icon": "icon-money", "icon": "icon-money",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-01-22 16:05:34.000000", "modified": "2014-05-09 02:16:38.198490",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Expense Claim", "name": "Expense Claim",
@ -234,5 +234,7 @@
"write": 1 "write": 1
} }
], ],
"search_fields": "approval_status,employee,employee_name" "search_fields": "approval_status,employee,employee_name",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,5 +1,5 @@
{ {
"creation": "2013-02-22 01:27:46.000000", "creation": "2013-02-22 01:27:46",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -17,12 +17,12 @@
}, },
{ {
"fieldname": "expense_type", "fieldname": "expense_type",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Expense Claim Type", "label": "Expense Claim Type",
"oldfieldname": "expense_type", "oldfieldname": "expense_type",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "link:Expense Claim Type", "options": "Expense Claim Type",
"permlevel": 0, "permlevel": 0,
"print_width": "150px", "print_width": "150px",
"reqd": 1, "reqd": 1,
@ -69,9 +69,12 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2013-12-20 19:23:13.000000", "modified": "2014-05-09 02:16:38.529082",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Expense Claim Detail", "name": "Expense Claim Detail",
"owner": "harshada@webnotestech.com" "owner": "harshada@webnotestech.com",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,22 +1,14 @@
{ {
"allow_import": 1, "allow_import": 1,
"creation": "2013-01-10 16:34:14.000000", "creation": "2013-01-10 16:34:14",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
"fields": [ "fields": [
{
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"permlevel": 0,
"read_only": 1
},
{ {
"fieldname": "holiday_list_name", "fieldname": "holiday_list_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Holiday List Name", "label": "Holiday List Name",
"oldfieldname": "holiday_list_name", "oldfieldname": "holiday_list_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -26,23 +18,26 @@
{ {
"fieldname": "is_default", "fieldname": "is_default",
"fieldtype": "Check", "fieldtype": "Check",
"in_list_view": 1,
"label": "Default", "label": "Default",
"permlevel": 0 "permlevel": 0
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "weekly_off", "fieldname": "weekly_off",
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1,
"label": "Weekly Off", "label": "Weekly Off",
"no_copy": 1, "no_copy": 1,
"options": "\nSunday\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday", "options": "\nSunday\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday",
@ -77,7 +72,7 @@
], ],
"icon": "icon-calendar", "icon": "icon-calendar",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:46.000000", "modified": "2014-05-09 02:16:38.887266",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Holiday List", "name": "Holiday List",
@ -96,5 +91,7 @@
"submit": 0, "submit": 0,
"write": 1 "write": 1
} }
] ],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,7 +1,7 @@
{ {
"allow_import": 1, "allow_import": 1,
"autoname": "LAL/.#####", "autoname": "LAL/.#####",
"creation": "2013-02-20 19:10:38.000000", "creation": "2013-02-20 19:10:38",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -15,6 +15,7 @@
"fieldname": "employee", "fieldname": "employee",
"fieldtype": "Link", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Employee", "label": "Employee",
"oldfieldname": "employee", "oldfieldname": "employee",
"oldfieldtype": "Link", "oldfieldtype": "Link",
@ -27,6 +28,7 @@
"fieldname": "employee_name", "fieldname": "employee_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Employee Name", "label": "Employee Name",
"permlevel": 0, "permlevel": 0,
"read_only": 1, "read_only": 1,
@ -34,12 +36,13 @@
}, },
{ {
"fieldname": "leave_type", "fieldname": "leave_type",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1,
"label": "Leave Type", "label": "Leave Type",
"oldfieldname": "leave_type", "oldfieldname": "leave_type",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "link:Leave Type", "options": "Leave Type",
"permlevel": 0, "permlevel": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1
@ -49,6 +52,7 @@
"fieldname": "posting_date", "fieldname": "posting_date",
"fieldtype": "Date", "fieldtype": "Date",
"hidden": 0, "hidden": 0,
"in_list_view": 1,
"label": "Posting Date", "label": "Posting Date",
"no_copy": 1, "no_copy": 1,
"oldfieldname": "date", "oldfieldname": "date",
@ -60,12 +64,12 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"oldfieldname": "fiscal_year", "oldfieldname": "fiscal_year",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1
@ -132,7 +136,7 @@
"icon": "icon-ok", "icon": "icon-ok",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-01-22 16:05:35.000000", "modified": "2014-05-09 02:16:39.508488",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Allocation", "name": "Leave Allocation",
@ -168,5 +172,7 @@
"write": 1 "write": 1
} }
], ],
"search_fields": "employee,employee_name,leave_type,total_leaves_allocated,fiscal_year" "search_fields": "employee,employee_name,leave_type,total_leaves_allocated,fiscal_year",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -19,7 +19,9 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
function(user) { function(user) {
return {value: user, label: frappe.user_info(user).fullname}; return {value: user, label: frappe.user_info(user).fullname};
})); }));
if(leave_approver) cur_frm.set_value("leave_approver", leave_approver); if(leave_approver) cur_frm.set_value("leave_approver", leave_approver);
cur_frm.cscript.get_leave_balance(cur_frm.doc); cur_frm.cscript.get_leave_balance(cur_frm.doc);
} }
}); });

View File

@ -1,7 +1,7 @@
{ {
"allow_attach": 1, "allow_attach": 1,
"autoname": "LAP/.#####", "autoname": "LAP/.#####",
"creation": "2013-02-20 11:18:11.000000", "creation": "2013-02-20 11:18:11",
"description": "Apply / Approve Leaves", "description": "Apply / Approve Leaves",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -22,16 +22,16 @@
"fieldname": "leave_approver", "fieldname": "leave_approver",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Leave Approver", "label": "Leave Approver",
"options": "link:User", "options": "[Select]",
"permlevel": 0 "permlevel": 0
}, },
{ {
"fieldname": "leave_type", "fieldname": "leave_type",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Leave Type", "label": "Leave Type",
"options": "link:Leave Type", "options": "Leave Type",
"permlevel": 0, "permlevel": 0,
"reqd": 1, "reqd": 1,
"search_index": 1 "search_index": 1
@ -135,10 +135,10 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"read_only": 0, "read_only": 0,
"reqd": 1, "reqd": 1,
@ -182,7 +182,7 @@
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"max_attachments": 3, "max_attachments": 3,
"modified": "2014-01-20 17:48:56.000000", "modified": "2014-05-15 19:30:47.331357",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Application", "name": "Leave Application",
@ -263,5 +263,7 @@
"write": 1 "write": 1
} }
], ],
"search_fields": "employee,employee_name,leave_type,from_date,to_date,total_leave_days,fiscal_year" "search_fields": "employee,employee_name,leave_type,from_date,to_date,total_leave_days,fiscal_year",
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -2,7 +2,7 @@
"allow_copy": 1, "allow_copy": 1,
"allow_email": 1, "allow_email": 1,
"allow_print": 1, "allow_print": 1,
"creation": "2013-01-10 16:34:15.000000", "creation": "2013-01-10 16:34:15",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -15,33 +15,37 @@
{ {
"description": "Leave blank if considered for all employee types", "description": "Leave blank if considered for all employee types",
"fieldname": "employee_type", "fieldname": "employee_type",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1,
"label": "Employee Type", "label": "Employee Type",
"options": "link:Employment Type", "options": "Employment Type",
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "Leave blank if considered for all branches", "description": "Leave blank if considered for all branches",
"fieldname": "branch", "fieldname": "branch",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1,
"label": "Branch", "label": "Branch",
"options": "link:Branch", "options": "Branch",
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "Leave blank if considered for all departments", "description": "Leave blank if considered for all departments",
"fieldname": "department", "fieldname": "department",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1,
"label": "Department", "label": "Department",
"options": "link:Department", "options": "Department",
"permlevel": 0 "permlevel": 0
}, },
{ {
"description": "Leave blank if considered for all designations", "description": "Leave blank if considered for all designations",
"fieldname": "designation", "fieldname": "designation",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1,
"label": "Designation", "label": "Designation",
"options": "link:Designation", "options": "Designation",
"permlevel": 0 "permlevel": 0
}, },
{ {
@ -52,18 +56,18 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Fiscal Year", "label": "Fiscal Year",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "leave_type", "fieldname": "leave_type",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Leave Type", "label": "Leave Type",
"options": "link:Leave Type", "options": "Leave Type",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -94,7 +98,7 @@
"icon": "icon-cog", "icon": "icon-cog",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"modified": "2013-07-05 14:45:50.000000", "modified": "2014-05-09 02:16:44.996178",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Control Panel", "name": "Leave Control Panel",
@ -110,5 +114,7 @@
"write": 1 "write": 1
} }
], ],
"read_only": 1 "read_only": 1,
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -1,23 +1,15 @@
{ {
"allow_import": 1, "allow_import": 1,
"autoname": "field:leave_type_name", "autoname": "field:leave_type_name",
"creation": "2013-02-21 09:55:58.000000", "creation": "2013-02-21 09:55:58",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
"fields": [ "fields": [
{
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"permlevel": 0,
"read_only": 1
},
{ {
"fieldname": "leave_type_name", "fieldname": "leave_type_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Leave Type Name", "label": "Leave Type Name",
"oldfieldname": "leave_type_name", "oldfieldname": "leave_type_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -27,6 +19,7 @@
{ {
"fieldname": "max_days_allowed", "fieldname": "max_days_allowed",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Max Days Leave Allowed", "label": "Max Days Leave Allowed",
"oldfieldname": "max_days_allowed", "oldfieldname": "max_days_allowed",
"oldfieldtype": "Data", "oldfieldtype": "Data",
@ -36,6 +29,7 @@
{ {
"fieldname": "is_carry_forward", "fieldname": "is_carry_forward",
"fieldtype": "Check", "fieldtype": "Check",
"in_list_view": 1,
"label": "Is Carry Forward", "label": "Is Carry Forward",
"oldfieldname": "is_carry_forward", "oldfieldname": "is_carry_forward",
"oldfieldtype": "Check", "oldfieldtype": "Check",
@ -45,6 +39,7 @@
"fieldname": "is_encash", "fieldname": "is_encash",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 1, "hidden": 1,
"in_list_view": 1,
"label": "Is Encash", "label": "Is Encash",
"oldfieldname": "is_encash", "oldfieldname": "is_encash",
"oldfieldtype": "Check", "oldfieldtype": "Check",
@ -67,7 +62,7 @@
], ],
"icon": "icon-flag", "icon": "icon-flag",
"idx": 1, "idx": 1,
"modified": "2014-01-20 17:48:56.000000", "modified": "2014-05-07 06:39:38.884656",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Type", "name": "Leave Type",
@ -98,6 +93,11 @@
"role": "HR Manager", "role": "HR Manager",
"submit": 0, "submit": 0,
"write": 1 "write": 1
},
{
"permlevel": 0,
"read": 1,
"role": "Employee"
} }
] ]
} }

View File

@ -2,7 +2,7 @@
"allow_copy": 1, "allow_copy": 1,
"allow_email": 1, "allow_email": 1,
"allow_print": 1, "allow_print": 1,
"creation": "2012-03-27 14:35:59.000000", "creation": "2012-03-27 14:35:59",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Other", "document_type": "Other",
@ -27,15 +27,17 @@
}, },
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Select", "fieldtype": "Link",
"in_list_view": 1,
"label": "Company", "label": "Company",
"options": "link:Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "branch", "fieldname": "branch",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Branch", "label": "Branch",
"options": "Branch", "options": "Branch",
"permlevel": 0 "permlevel": 0
@ -62,9 +64,9 @@
}, },
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Fiscal Year", "label": "Fiscal Year",
"options": "link:Fiscal Year", "options": "Fiscal Year",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -142,7 +144,7 @@
"icon": "icon-cog", "icon": "icon-cog",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"modified": "2013-07-22 15:23:58.000000", "modified": "2014-05-09 02:16:45.165977",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Salary Manager", "name": "Salary Manager",
@ -155,5 +157,7 @@
"role": "HR Manager", "role": "HR Manager",
"write": 1 "write": 1
} }
] ],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -71,24 +71,6 @@
"read_only": 1, "read_only": 1,
"search_index": 0 "search_index": 0
}, },
{
"fieldname": "pf_no",
"fieldtype": "Data",
"label": "PF No.",
"oldfieldname": "pf_no",
"oldfieldtype": "Data",
"permlevel": 0,
"read_only": 1
},
{
"fieldname": "esic_no",
"fieldtype": "Data",
"label": "ESIC No.",
"oldfieldname": "esic_no",
"oldfieldtype": "Data",
"permlevel": 0,
"read_only": 1
},
{ {
"fieldname": "letter_head", "fieldname": "letter_head",
"fieldtype": "Link", "fieldtype": "Link",
@ -118,10 +100,10 @@
}, },
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Company", "label": "Company",
"options": "link:Company", "options": "Company",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 1
}, },
@ -343,7 +325,7 @@
"icon": "icon-file-text", "icon": "icon-file-text",
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"modified": "2014-05-01 04:21:14.543092", "modified": "2014-05-09 02:17:14.634335",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Salary Slip", "name": "Salary Slip",
@ -382,5 +364,7 @@
"restricted": 0, "restricted": 0,
"role": "Employee" "role": "Employee"
} }
] ],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -38,12 +38,10 @@ class SalarySlip(TransactionBase):
def pull_emp_details(self): def pull_emp_details(self):
emp = frappe.db.get_value("Employee", self.employee, emp = frappe.db.get_value("Employee", self.employee,
["bank_name", "bank_ac_no", "esic_card_no", "pf_number"], as_dict=1) ["bank_name", "bank_ac_no"], as_dict=1)
if emp: if emp:
self.bank_name = emp.bank_name self.bank_name = emp.bank_name
self.bank_account_no = emp.bank_ac_no self.bank_account_no = emp.bank_ac_no
self.esic_no = emp.esic_card_no
self.pf_no = emp.pf_number
def get_leave_details(self, lwp=None): def get_leave_details(self, lwp=None):
if not self.fiscal_year: if not self.fiscal_year:

Some files were not shown because too many files have changed in this diff Show More