FI: Recurring Invoices


Please see also RFE: Memorized Transactions


Current gaps ]po[ V4.0 as of 4/2012

  • Invoices cannot be set as recurring invoices.

Use cases for Recurring Invoices

1. Creating new Recurring Invoice Selection features:

    a) Frequency:
  • Daily
  • Weekly
  • Monthly
  • Annually
  • Referring to a particular event
  • After a certain amount of days / months / years
  • b) Start Date:
  • Creation Date
  • Specific Date
  • c) End Date:
  • Specific Date
  • After a certain amount of days / months / years
  • After a certain number of invoices
  • Never
  • d) Amount:
  • Enter amount manually
  • Select a type of service from a dropdown menu (Amount for that service has already been specified
  • Select customer first, different amounts for customers can then be selected
  • Select currency
  • Select VAT
  • 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:
  • Billing
  • Monitoring incoming payments
  • Dunning process
  • Approval of other staff member?

2. Changes in prices

    a) Price of a single item changes
  • Search engine to find related invoice
  • Manually change price of specific item
  • Select when change comes to effect
  • Change applies to one invoice or to all subsequent invoices (start date and end date)
  • b) Prices for a service type change
  • Select service type and change price in local view
  • Workflow: update invoices which contain the specific service type
  • tart date and end date

    c) Prices for a customer change
  • Same as service type (select customer and change price list in local view)

3. Managing invoices

  • a) Invoices are listed in a special Recurring Invoices section, users can select and edit single invoices
  • Start date / end date change
  • Frequency changes
  • Amount changes
  • Customer data changes (Workflow changing data in respective invoices when changing customer data)

4. Contract is cancelled before term

  • Recurring Invoice is cancelled, no further invoices are sent
  • Remaining amount is billed in a single invoice
  • Final account summarizing all billed invoices
  • When are the changes due?

5. Customer changes type of service

  • Recurring Invoice is cancelled and new item is created
  • Recurring Invoice is changed to new type of service

6. CEO requests overview of all invoices of a particular time frame

  • Specific week, month, year
  • All invoices which have been created in that time frame
  • All invoices which are due in that time frame
  • Invoices grouped by staff member, customer, type of service, accounting period

7. Overview of all Recurring Invoices ending soon

  • Possibility to contact customers and propose contract extension
  • Reminder of furthers job steps etc.

8. Overview of all Invoices requiring further processing

  • Box showing due invoices on „home“ page (what does due mean: billing, payments, dunning?)

9. Show invoice status with different colors

  • Different colors varying according to upcoming job step (shown in central overview of invoices)
  • Filter function (show only due invoices)

10. What happens if you click on an invoice on the central management page?

  • Recently created invoice is shown
  • dditional data: start and end date, frequency, maybe overall amount of invoices belonging to the contract
  • Click on „show all invoices which were created until now“ (to contract)
    • Overview (list) showing all invoices created
    • Overview also showing date and amount for single invoices
    • Click on single invoice to show that one
    • How many invoices are shown in that overview?

11. Responsible staff member turns ill / requests vacation

  • Possibility to show due invoices in „home“ box of other staff members
  • Automatically or manually?

12. Invoice should be converted to recurring invoice at a later point in time

 

GUI Ideas



 

Code

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
);


  
  Contact Us
  Project Open Business Solutions S.L.

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