Please see also RFE: Memorized Transactions
1. Creating new Recurring Invoice Selection features:
b) Start Date:
c) End Date:
d) Amount:
e) Enter due date
f) Specify customer
g) Specify responsible staff member (in case it is not creating staff member themselves)
h) Degree of automation:
2. Changes in prices
b) Prices for a service type change
c) Prices for a customer change
3. Managing invoices
4. Contract is cancelled before term
5. Customer changes type of service
6. CEO requests overview of all invoices of a particular time frame
7. Overview of all Recurring Invoices ending soon
8. Overview of all Invoices requiring further processing
9. Show invoice status with different colors
10. What happens if you click on an invoice on the central management page?
11. Responsible staff member turns ill / requests vacation
12. Invoice should be converted to recurring invoice at a later point in time
ad_proc -public im_memorized_transaction_sweeper {} { Checks for FinDocs to be created (e.g. reoccuring invoices) } { set sql " select transaction_id, document_id, frequency_id, to_char(last_transaction, 'YYYY-MM-DD') from im_memorized_transactions " db_foreach col $sql { switch $frequency_id { [im_memorized_transaction_frequency_weekly] { set next_transaction_due [clock format [clock scan {+7 days} -base [clock scan {$last_transaction}] ] -format %Y-%m-%d] } [im_memorized_transaction_frequency_monthly] { set next_transaction_due [clock format [clock scan {+1 months} -base [clock scan {$last_transaction}] ] -format %Y-%m-%d] } [im_memorized_transaction_frequency_quarterly] { set next_transaction_due [clock format [clock scan {+3 months} -base [clock scan {$last_transaction}] ] -format %Y-%m-%d] } [im_memorized_transaction_frequency_semestral] { set next_transaction_due [clock format [clock scan {+6 months} -base [clock scan {$last_transaction}] ] -format %Y-%m-%d] } [im_memorized_transaction_frequency_yearly] { set next_transaction_due [clock format [clock scan {+12 months} -base [clock scan {$last_transaction}] ] -format %Y-%m-%d] } } if { $next_transaction_due == [clock format [clock seconds] -format {%Y-%m-%d}] } { # Create a new workflow case (instance) set workflow_key [parameter::get -package_id [apm_package_id_from_key intranet-cost] -parameter "MemorizedTransactionWorkflowKey" -default ""] set context_key "" set case_id [wf_case_new \ $workflow_key \ $context_key \ $document_id \ ] # Determine the first task in the case to be executed and start+finisch the task. im_workflow_skip_first_transition -case_id $case_id } } } create sequence im_memorized_transactions_id_seq; create table im_memorized_transactions ( transaction_id integer primary key, document_id integer not null, frequency_id integer not null, first_transaction timestamptz, last_transaction timestamptz ); ALTER TABLE im_memorized_transactions ALTER COLUMN transaction_id SET DEFAULT NEXTVAL('im_memorized_transactions_id_seq'); SELECT im_component_plugin__new ( null, -- plugin_id 'acs_object', -- object_type now(), -- creation_date null, -- creation_user null, -- creation_ip null, -- context_id 'Memorized Transactions', -- plugin_name 'intranet-cost', -- package_name 'right', -- location '/intranet-cost/index', -- page_url null, -- view_name 5, -- sort_order 'im_memorized_transactions' -- component_tcl );
Calle Aprestadora 19, 12o-2a
08902 Hospitalet de Llobregat (Barcelona)
Spain
Tel Europe: +34 609 953 751
Tel US: +1 415 200 2465
Mail: info@project-open.com