1 (edited by trecords 10/08/2016 04:18:48 pm)

Topic: Add Transaction type

Hi,

I need to add transaction type something like ST_CREDITPAYMENT and define custom actions like delete_comments, void_bank_trans, void_gl_trans. I will add this into types.inc There are some more functions relates to this like systype_db and without hook.

But what is the reason to create these transaction types? I want to understand the purpose for this. And also why do these types are not database managed but in file.

Regards.

2 (edited by apmuthu 10/11/2016 03:38:01 am)

Re: Add Transaction type

Which version of FA are you referring to - FA 2.3.25+ or 2.4RC1?

In FA 2.4RC1, the following new defines have been added:

//
//    Depreciation period types
//
define('FA_MONTHLY', 0);
define('FA_YEARLY', 1);
...
//    Manufacturing types
//

define('WO_MATERIALS', 2);
...
// Tax calculation algorithms used in als and purchase (depends on supplier's invoicing software)

define('TCA_TOTALS', 1); // taxes are calculated from respective net totals for all lines
define('TCA_LINES', 2); // taxes calculated for every line, then summed
//
//    Bank account owner types
//
define('BO_UNKNOWN', 0);
define('BO_COMPANY', 1);
define('BO_CUSTBRANCH', 2);
define('BO_SUPPLIER', 3);
...
// tax register type
define('TR_OUTPUT', 0); // sales
define('TR_INPUT', 1);    // purchase
...

Quite a few settings in the config.php have been migrated to the sys_prefs table on a per company basis.

You can possibly check the (ST_CUSTPAYMENT && ST_CUSTCREDIT)  in your constructs without touching the include/types.inc file.

3 (edited by trecords 10/13/2016 06:08:19 pm)

Re: Add Transaction type

ST_CUSTPAYMENT && ST_CUSTCREDIT will not help as I have difference table for clients and contracts with them. I need to process 3 type of payment per company or directly per client.

There are some usefull functions within FA like submenu_option, submenu_view, submenu_print where as they are but only for internal predefined types.

Anyway I have decided to copy existing similar type related functions into module and modify them with new types/names.

Would be better to have more generalized framework which will help to develop functions more easy and faster.

Re: Add Transaction type

The transaction  types are a type of transactions we are recording in our FA database.  Just remember.  We are saving general ledgers in a same table.  And we can differentiate  the transaction and can be viewed similar transactions from it.  Say for example for journal entries are type 0.  This can be defined as ST_JOURNAL. It's easy understanding while you coding.  You always need to check the type no.  If you use the 0 instead of the transaction type constant.

Subscription service based on FA
HRM CRM POS batch Themes

5 (edited by trecords 10/15/2016 05:18:44 pm)

Re: Add Transaction type

@kvvaradha Agree, this is good to have user friendly names also it helps for references to trace transactions. By going more deep I see more functions related to them.

I should edit FA core code because there are built in functions like payment_person_name() which required modification of my types.
But now I have faced with new issue my code is in module and types.inc or gl_trans view files are not call it within FA :S

So will modify FA and keep logs, no other way to go sad