Recurring invoice checkbox added in features setup

This commit is contained in:
Nabin Hait
2011-12-06 19:04:21 +05:30
parent b28d6dc617
commit 38d24534d7
4 changed files with 45 additions and 15 deletions

View File

@@ -507,9 +507,9 @@ def manage_recurring_invoices():
and notify the concerned people and notify the concerned people
""" """
rv = sql("""select name, recurring_id from `tabReceivable Voucher` where ifnull(convert_into_recurring_invoice, 0) = 1 rv = sql("""select name, recurring_id from `tabReceivable Voucher` where ifnull(convert_into_recurring_invoice, 0) = 1
and next_date = %s and next_date <= end_date""", nowdate()) and next_date = %s and next_date <= end_date order by next_date desc""", nowdate())
for d in rv: for d in rv:
if not sql("""select name from `tabReceivable Voucher` where posting_date = %s and recurring_id = %s""", (nowdate, d[1])): if not sql("""select name from `tabReceivable Voucher` where posting_date = %s and recurring_id = %s""", (nowdate(), d[1])):
prev_rv = get_obj('Receivable Voucher', d[0], with_children=1) prev_rv = get_obj('Receivable Voucher', d[0], with_children=1)
new_rv = create_new_invoice(prev_rv) new_rv = create_new_invoice(prev_rv)
@@ -520,6 +520,7 @@ def create_new_invoice(prev_rv):
new_rv = clone(prev_rv) new_rv = clone(prev_rv)
# update new rv # update new rv
new_rv.doc.voucher_date = new_rv.doc.next_date new_rv.doc.voucher_date = new_rv.doc.next_date
new_rv.doc.posting_date = new_rv.doc.next_date new_rv.doc.posting_date = new_rv.doc.next_date
new_rv.doc.aging_date = new_rv.doc.next_date new_rv.doc.aging_date = new_rv.doc.next_date

View File

@@ -1,5 +1,8 @@
def execute(): def execute():
import webnotes import webnotes
from webnotes.modules.module_manager import reload_doc from webnotes.modules.module_manager import reload_doc
from webnotes.model.code import get_obj
reload_doc('accounts', 'doctype', 'receivable_voucher') reload_doc('accounts', 'doctype', 'receivable_voucher')
get_obj('Features setup').validate()

View File

@@ -5,14 +5,14 @@
{ {
'creation': '2011-09-07 11:59:05', 'creation': '2011-09-07 11:59:05',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-10-05 10:50:17', 'modified': '2011-12-06 18:48:53',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1317790484', '_last_update': '1323176623',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard', 'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
@@ -22,7 +22,7 @@
'name_case': 'Title Case', 'name_case': 'Title Case',
'section_style': 'Simple', 'section_style': 'Simple',
'show_in_menu': 1, 'show_in_menu': 1,
'version': 21 'version': 24
}, },
# These values are common for all DocField # These values are common for all DocField
@@ -211,6 +211,39 @@
'label': 'Sales Extras' 'label': 'Sales Extras'
}, },
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'label': 'Accounts'
},
# DocField
{
'colour': 'White:FFF',
'description': 'Check if you need automatic recurring invoices. After submitting any sales invoice, Recurring section will be visible.',
'doctype': 'DocField',
'fieldname': 'fs_recurring_invoice',
'fieldtype': 'Check',
'label': 'Recurring Invoice'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break'
},
# DocField
{
'colour': 'White:FFF',
'description': 'To enable <b>Point of Sale</b> features',
'doctype': 'DocField',
'fieldname': 'fs_pos',
'fieldtype': 'Check',
'label': 'Point of Sale'
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',
@@ -244,16 +277,6 @@
'label': 'Quality' 'label': 'Quality'
}, },
# DocField
{
'colour': 'White:FFF',
'description': 'To enable <b>Point of Sale</b> features',
'doctype': 'DocField',
'fieldname': 'fs_pos',
'fieldtype': 'Check',
'label': 'Point of Sale'
},
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': 'DocField',

View File

@@ -690,6 +690,9 @@ pscript.feature_dict = {
}, },
'fs_pos': { 'fs_pos': {
'Receivable Voucher': {'fields':['is_pos']} 'Receivable Voucher': {'fields':['is_pos']}
},
'fs_recurring_invoice': {
'Receivable Voucher': {'fields': ['Recurring Invoice']}
} }
} }