From 92af22aa12cb2500a0c5ef135628fbbc68ef2369 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 18 Dec 2012 13:45:59 +0530 Subject: [PATCH 1/4] removed debug mode --- hr/doctype/leave_application/leave_application.js | 1 + hr/doctype/leave_application/leave_application.py | 4 ++-- hr/doctype/leave_application/leave_application.txt | 11 ++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hr/doctype/leave_application/leave_application.js b/hr/doctype/leave_application/leave_application.js index 042cccad8d..7253bdba0a 100755 --- a/hr/doctype/leave_application/leave_application.js +++ b/hr/doctype/leave_application/leave_application.js @@ -16,6 +16,7 @@ cur_frm.add_fetch('employee','employee_name','employee_name'); + cur_frm.cscript.onload = function(doc, dt, dn) { if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()}); diff --git a/hr/doctype/leave_application/leave_application.py b/hr/doctype/leave_application/leave_application.py index c0a51799fe..d945367e79 100755 --- a/hr/doctype/leave_application/leave_application.py +++ b/hr/doctype/leave_application/leave_application.py @@ -104,14 +104,14 @@ def get_leave_balance(employee, leave_type, fiscal_year): leave_all = webnotes.conn.sql("""select total_leaves_allocated from `tabLeave Allocation` where employee = %s and leave_type = %s and fiscal_year = %s and docstatus = 1""", (employee, - leave_type, fiscal_year), debug=1) + leave_type, fiscal_year)) leave_all = leave_all and flt(leave_all[0][0]) or 0 leave_app = webnotes.conn.sql("""select SUM(total_leave_days) from `tabLeave Application` where employee = %s and leave_type = %s and fiscal_year = %s - and docstatus = 1""", (employee, leave_type, fiscal_year), debug=1) + and docstatus = 1""", (employee, leave_type, fiscal_year)) leave_app = leave_app and flt(leave_app[0][0]) or 0 ret = {'leave_balance': leave_all - leave_app} diff --git a/hr/doctype/leave_application/leave_application.txt b/hr/doctype/leave_application/leave_application.txt index 2e4d7c2055..dce8539a51 100644 --- a/hr/doctype/leave_application/leave_application.txt +++ b/hr/doctype/leave_application/leave_application.txt @@ -2,9 +2,9 @@ { "owner": "Administrator", "docstatus": 0, - "creation": "2012-12-07 18:27:12", + "creation": "2012-12-10 10:25:20", "modified_by": "Administrator", - "modified": "2012-12-07 18:47:48" + "modified": "2012-12-18 11:06:53" }, { "is_submittable": 1, @@ -160,7 +160,7 @@ "search_index": 0, "doctype": "DocField", "label": "Fiscal Year", - "options": "Link:Fiscal Year", + "options": "link:Fiscal Year", "fieldname": "fiscal_year", "fieldtype": "Select", "reqd": 1, @@ -239,5 +239,10 @@ "role": "Leave Approver", "cancel": 0, "permlevel": 2 + }, + { + "doctype": "DocPerm", + "role": "All", + "permlevel": 3 } ] \ No newline at end of file From b6166caec74e9bc0d6dc4760d0f8f660acd6165b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 19 Dec 2012 10:35:09 +0530 Subject: [PATCH 2/4] modified timestamp --- hr/doctype/leave_application/leave_application.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr/doctype/leave_application/leave_application.txt b/hr/doctype/leave_application/leave_application.txt index dce8539a51..edebe4bfd9 100644 --- a/hr/doctype/leave_application/leave_application.txt +++ b/hr/doctype/leave_application/leave_application.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-12-10 10:25:20", "modified_by": "Administrator", - "modified": "2012-12-18 11:06:53" + "modified": "2012-12-18 11:06:54" }, { "is_submittable": 1, From 64a839a747d2ccdbe7dbcdb7f50df145ae2ef383 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 19 Dec 2012 11:43:28 +0530 Subject: [PATCH 3/4] fixes in ordered/delivered items to be billed --- .../delivered_items_to_be_billed.txt | 6 +++--- .../ordered_items_to_be_billed.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt b/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt index 4a01347bce..13d238a1fc 100644 --- a/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt +++ b/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt @@ -2,16 +2,16 @@ { "owner": "Administrator", "docstatus": 0, - "creation": "2012-11-23 16:46:22", + "creation": "2012-11-28 11:24:29", "modified_by": "Administrator", - "modified": "2012-11-26 10:11:53" + "modified": "2012-12-19 11:41:38" }, { "name": "__common__", "ref_doctype": "Sales Invoice", "doctype": "Report", "is_standard": "Yes", - "query": "select \n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n`tabDelivery Note`.`status` as \"Status\",\n `tabDelivery Note`.`posting_date` as \"Date:Date\",\n `tabDelivery Note Item`.item_code as \"Item:Link/Item:120\",\n `tabDelivery Note Item`.description as \"Description\",\n `tabDelivery Note Item`.qty as \"Qty:Float\",\n `tabDelivery Note Item`.billed_qty as \"Billed Qty:Float\"\nfrom\n `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note Item`.`parent` = `tabDelivery Note`.`name`\n and `tabDelivery Note`.docstatus = 1\n and ifnull(`tabDelivery Note Item`.billed_qty,0) < ifnull(`tabDelivery Note Item`.qty,0)\norder by `tabDelivery Note`.posting_date asc" + "query": "select \n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n`tabDelivery Note`.`status` as \"Status\",\n `tabDelivery Note`.`posting_date` as \"Date:Date\",\n `tabDelivery Note Item`.item_code as \"Item:Link/Item:120\",\n `tabDelivery Note Item`.description as \"Description:Data:120\",\n `tabDelivery Note Item`.export_amount as \"Amount:Currency:110\",\n `tabDelivery Note Item`.billed_amt as \"Billed Amount:Currency:110\",\n (ifnull(`tabDelivery Note Item`.export_amount,0) - ifnull(`tabDelivery Note Item`.billed_amt,0)) as \"Pending Amount:Currency:120\"\nfrom\n `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note Item`.`parent` = `tabDelivery Note`.`name`\n and `tabDelivery Note`.docstatus = 1\n and ifnull(`tabDelivery Note Item`.billed_amt,0) < ifnull(`tabDelivery Note Item`.export_amount,0)\norder by `tabDelivery Note`.posting_date asc" }, { "name": "Delivered Items To Be Billed", diff --git a/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt b/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt index bf410933f3..31b31441a5 100644 --- a/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt +++ b/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt @@ -2,16 +2,16 @@ { "owner": "Administrator", "docstatus": 0, - "creation": "2012-12-14 10:22:40", + "creation": "2012-12-14 14:27:05", "modified_by": "Administrator", - "modified": "2012-12-14 10:24:16" + "modified": "2012-12-19 11:42:45" }, { "name": "__common__", "ref_doctype": "Sales Invoice", "doctype": "Report", "is_standard": "Yes", - "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.description as \"Description\",\n `tabSales Order Item`.qty as \"Qty:Float\",\n `tabSales Order Item`.billed_qty as \"Billed Qty:Float\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and ifnull(`tabSales Order Item`.billed_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc" + "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.description as \"Description:Data:120\",\n `tabSales Order Item`.export_amount as \"Amount:Currency:110\",\n `tabSales Order Item`.billed_amt as \"Billed Amount:Currency:110\",\n (ifnull(`tabSales Order Item`.export_amount, 0) - ifnull(`tabSales Order Item`.billed_amt, 0)) as \"Pending Amount:Currency:120\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and ifnull(`tabSales Order Item`.billed_amt,0) < ifnull(`tabSales Order Item`.export_amount,0)\norder by `tabSales Order`.transaction_date asc" }, { "name": "Ordered Items To Be Billed", From bb852e45e9598685ea4f3e4eb0b9997a3d1a992b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 19 Dec 2012 11:55:42 +0530 Subject: [PATCH 4/4] fixes in ordered/delivered items to be billed --- .../delivered_items_to_be_billed.txt | 4 ++-- .../ordered_items_to_be_billed/ordered_items_to_be_billed.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt b/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt index 13d238a1fc..bc409f84a2 100644 --- a/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt +++ b/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt @@ -4,14 +4,14 @@ "docstatus": 0, "creation": "2012-11-28 11:24:29", "modified_by": "Administrator", - "modified": "2012-12-19 11:41:38" + "modified": "2012-12-19 11:54:55" }, { "name": "__common__", "ref_doctype": "Sales Invoice", "doctype": "Report", "is_standard": "Yes", - "query": "select \n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n`tabDelivery Note`.`status` as \"Status\",\n `tabDelivery Note`.`posting_date` as \"Date:Date\",\n `tabDelivery Note Item`.item_code as \"Item:Link/Item:120\",\n `tabDelivery Note Item`.description as \"Description:Data:120\",\n `tabDelivery Note Item`.export_amount as \"Amount:Currency:110\",\n `tabDelivery Note Item`.billed_amt as \"Billed Amount:Currency:110\",\n (ifnull(`tabDelivery Note Item`.export_amount,0) - ifnull(`tabDelivery Note Item`.billed_amt,0)) as \"Pending Amount:Currency:120\"\nfrom\n `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note Item`.`parent` = `tabDelivery Note`.`name`\n and `tabDelivery Note`.docstatus = 1\n and ifnull(`tabDelivery Note Item`.billed_amt,0) < ifnull(`tabDelivery Note Item`.export_amount,0)\norder by `tabDelivery Note`.posting_date asc" + "query": "select \n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n`tabDelivery Note`.`status` as \"Status\",\n `tabDelivery Note`.`posting_date` as \"Date:Date\",\n `tabDelivery Note Item`.item_code as \"Item:Link/Item:120\",\n `tabDelivery Note Item`.description as \"Description:Data:120\",\n `tabDelivery Note Item`.amount as \"Amount:Currency:110\",\n (`tabDelivery Note Item`.billed_amt * ifnull(`tabDelivery Note`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (ifnull(`tabDelivery Note Item`.amount,0) - (ifnull(`tabDelivery Note Item`.billed_amt,0) * ifnull(`tabDelivery Note`.conversion_rate, 1))) as \"Pending Amount:Currency:120\"\nfrom\n `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note Item`.`parent` = `tabDelivery Note`.`name`\n and `tabDelivery Note`.docstatus = 1\n and ifnull(`tabDelivery Note Item`.billed_amt,0) < ifnull(`tabDelivery Note Item`.export_amount,0)\norder by `tabDelivery Note`.posting_date asc" }, { "name": "Delivered Items To Be Billed", diff --git a/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt b/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt index 31b31441a5..b5d4229fdd 100644 --- a/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt +++ b/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt @@ -4,14 +4,14 @@ "docstatus": 0, "creation": "2012-12-14 14:27:05", "modified_by": "Administrator", - "modified": "2012-12-19 11:42:45" + "modified": "2012-12-19 11:52:26" }, { "name": "__common__", "ref_doctype": "Sales Invoice", "doctype": "Report", "is_standard": "Yes", - "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.description as \"Description:Data:120\",\n `tabSales Order Item`.export_amount as \"Amount:Currency:110\",\n `tabSales Order Item`.billed_amt as \"Billed Amount:Currency:110\",\n (ifnull(`tabSales Order Item`.export_amount, 0) - ifnull(`tabSales Order Item`.billed_amt, 0)) as \"Pending Amount:Currency:120\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and ifnull(`tabSales Order Item`.billed_amt,0) < ifnull(`tabSales Order Item`.export_amount,0)\norder by `tabSales Order`.transaction_date asc" + "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.description as \"Description:Data:120\",\n `tabSales Order Item`.amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (ifnull(`tabSales Order Item`.amount, 0) - (ifnull(`tabSales Order Item`.billed_amt, 0) * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and ifnull(`tabSales Order Item`.billed_amt,0) < ifnull(`tabSales Order Item`.export_amount,0)\norder by `tabSales Order`.transaction_date asc" }, { "name": "Ordered Items To Be Billed",