[hr] allowed rename in earning and deduction type

This commit is contained in:
Nabin Hait 2013-05-02 11:27:25 +05:30
parent 006d074b26
commit 81bbfba0cc
5 changed files with 18 additions and 48 deletions

View File

@ -1,6 +1,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import getdate, nowdate, flt, cstr
from accounts.report.accounts_receivable.accounts_receivable import get_ageing_data
def execute(filters=None):
if not filters: filters = {}
@ -125,19 +126,3 @@ def get_paid_amount(gle, report_date, entries_after_report_date):
(gle.account, report_date, gle.voucher_type, gle.voucher_no, gle.name))[0][0]
return flt(paid_amount)
def get_ageing_data(ageing_based_on_date, age_on, outstanding_amount):
val1 = val2 = val3 = val4 = diff = 0
diff = age_on and ageing_based_on_date \
and (getdate(age_on) - getdate(ageing_based_on_date)).days or 0
if diff <= 30:
val1 = outstanding_amount
elif 30 < diff <= 60:
val2 = outstanding_amount
elif 60 < diff <= 90:
val3 = outstanding_amount
elif diff > 90:
val4 = outstanding_amount
return [diff, val1, val2, val3, val4]

View File

@ -1,7 +1,7 @@
wn.query_reports["Collection Report"] = {
"filters": [
{
"fieldname":"from_date",
"fieldname": "from_date",
"label": "From Date",
"fieldtype": "Date",
"default": wn.defaults.get_user_default("year_start_date"),

View File

@ -1,12 +1,13 @@
[
{
"creation": "2013-01-10 16:34:13",
"creation": "2013-01-22 16:50:30",
"docstatus": 0,
"modified": "2013-01-22 14:25:38",
"modified": "2013-05-02 11:22:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_rename": 1,
"autoname": "field:deduction_name",
"doctype": "DocType",
"document_type": "Master",

View File

@ -1,12 +1,13 @@
[
{
"creation": "2013-01-10 16:34:13",
"creation": "2013-01-24 11:03:32",
"docstatus": 0,
"modified": "2013-01-23 16:32:07",
"modified": "2013-05-02 11:22:48",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_rename": 1,
"autoname": "field:earning_name",
"doctype": "DocType",
"document_type": "Master",

View File

@ -1,8 +1,8 @@
[
{
"creation": "2013-03-01 19:09:43",
"creation": "2013-03-05 14:50:38",
"docstatus": 0,
"modified": "2013-03-01 08:22:16",
"modified": "2013-05-01 15:49:47",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
@ -24,14 +24,19 @@
"permlevel": 0
},
{
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Batch",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Material Master Manager",
"submit": 0
"submit": 0,
"write": 1
},
{
"doctype": "DocType",
@ -94,28 +99,6 @@
"oldfieldtype": "Date"
},
{
"doctype": "DocField",
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"oldfieldtype": "Small Text",
"read_only": 1
},
{
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"report": 1,
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"match": "",
"permlevel": 1
"doctype": "DocPerm"
}
]