User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin.

Expense extension

About

This extensions provides Simple Invoices with expense features

Note:

  • The main purpose of this extension is for reporting
  • You can assign an expense to a biller, customer, invoice or product - but this is for reporting purposes only, you can't add an expense to an invoice and have that expense added to the total etc..

Notes

Install

This extension is available in svn (as at 2009/08/08) and will be included in 2009.1 release. To enable this extension download the release with this extension then go to 'Settings' tab and select 'Settings'. In this page select 'Extensions' and then click the 'Register” link next to the Expenses extension and clic. Once registered just click the 'Enable' link next to Expenses in the list of extensions.

Once the extension has been enabled please run the below sql in your Simple Invoices database to create the required tables

SQL

To enable the extension - only run if you don't activate the extension via the GUI

 INSERT INTO si_extensions VALUES ('2','1','expense','expense','1');

To create the tables

CREATE TABLE  `si_expense` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`amount` DECIMAL(25,6) NOT NULL ,
`domain_id` INT( 11 ) NOT NULL ,
`expense_account_id` INT( 11 ) NOT NULL ,
`biller_id` INT( 11 ) NOT NULL ,
`customer_id` INT( 11 ) NOT NULL ,
`invoice_id` INT( 11 ) NOT NULL ,
`product_id` INT( 11 ) NOT NULL ,
`date` DATE NOT NULL ,
`note` TEXT NOT NULL ,
`status` INT(1) NOT NULL 
) ENGINE = INNODB ;
 
CREATE TABLE  `si_expense_account` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`domain_id` INT( 11 ) NOT NULL ,
`name` VARCHAR( 255 ) NOT NULL
) ENGINE = INNODB;
 
INSERT INTO `si_expense_account` (`id`, `domain_id`, `name`) VALUES (NULL, '1', 'Car expense'), (NULL, '1', 'IT costs');
 
CREATE TABLE `si_expense_item_tax` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`expense_id` INT( 11 ) NOT NULL ,
`tax_id` INT( 11 ) NOT NULL ,
`tax_type` VARCHAR( 1 ) NOT NULL ,
`tax_rate` DECIMAL( 25, 6 ) NOT NULL ,
`tax_amount` DECIMAL( 25, 2 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM ;

Who

This extension was developed by Justin Kelly of SixHQ for Carlos of Maximum Consult

License

This extension is released under the GNU GPL 3

Discussion

javier, 2009/09/29 08:04

Hi, guys, excellent job

I have a problem with expenses extension. I activate/register and add tables in database without problems. But when I click in “Expenses” menu, an error message appears saying:

Fatal error: Uncaught exception 'Zend_Acl_Exception' with message 'Resource 'expense' not found' in /myserverandpath/library/Zend/Acl.php:297 Stack trace: #0 /myserverandpath/library/Zend/Acl.php(691): Zend_Acl→get('expense') #1 /myserverandpath/include/check_permission.php(7): Zend_Acl→isAllowed('administrator', 'expense', NULL) #2 /myserverandpath/include/init.php(171): include_once('/myserverandpath…') #3 /myserverandpath/index.php(26): require_once('/myserverandpath…') #4 {main} thrown in /myserverandpath/library/Zend/Acl.php on line 297.

any clues? I really would like to user this soft!!

thank you very much

javier

justin, 2009/10/06 22:59

hey javier,

this will be fixed in the next release 2009.1.01 - due out very soon

cheers

justin

Ronald Wong, 2009/10/22 14:10

I have the same issue. So at this stage, expense is not functional?

justin, 2009/10/26 22:19

hey ronald

try the 2009.1 update 1 release of Simple Invoices - refer the blog - the above problem should be fixed in that release

let us know how you go

cheers

justin

Gregg Berkholtz, 2010/04/12 08:09

Expenses extension appears to break on 2010.2 Beta 2; - Upgraded from 2009.1 - Enabled expenses extension via GIU - Attempted to click Expenses link from Money tab & received SQL error about non-existant si_expense table - Ran SQL from what's shown at the top of this expense_extension wiki - From “Money” tab, clicked “Expense”, then “Add New Expense”. - Blank page appears, while URL shows http://valid.host.name/index.php?module=expense&view=add

Ryan Snyder, 2010/06/20 12:45

Currently running 2010.2 - beta 8. Enabled the expense extension, added the SQL. Noticed on the expense page it displays 'There have been no products created. Click the 'Add New Product' button above to create one' not sure where that needs to be edited. When i clicked 'add new expense' can plug in everything but when you save there doesn't seem to be anything that is saved.

Any help would be appreciated.

Ryan Snyder, 2010/06/20 20:10

Reinstalled the database and the application now it is working. Not sure why it happened or what changed but now it is working.

Walter Wu, 2012/04/20 08:49

I installed the expense extension as instructed above and it works. But I found that when expense is enabled, recurrence disappears. Disable expense and recurrence comes back. Any clues as to how I can resolve this?

 
 | wiki/expense_extension.txt · Last modified: 2016/10/11 06:15 (external edit)