Work on invoice printing - to clean up

This commit is contained in:
Deon George
2011-05-02 22:28:17 +10:00
parent 2f7a10804e
commit 8013aadc4c
16 changed files with 1045 additions and 73 deletions

View File

@@ -15,14 +15,57 @@ class Company {
return new Company;
}
public static function street() {
// @todo Details should be obtained from DB
return 'PO Box 149';
}
public static function city() {
// @todo Details should be obtained from DB
return 'Bendigo';
}
public static function state() {
// @todo Details should be obtained from DB
return 'VIC';
}
public static function pcode() {
// @todo Details should be obtained from DB
return '3550';
}
public static function address($ln='<br/>') {
// @todo Company address should be calculated
return implode($ln,array('PO Box 149','Bendigo, VIC 3550'));
return implode($ln,array(static::street(),sprintf('%s, %s %s',static::city(),static::state(),static::pcode())));
}
public static function phone() {
// @todo Company phone should be obtained from db
return '03 5410 1135';
}
public static function fax() {
// @todo Details should be obtained from DB
return '03 5410 1145';
}
public static function contacts() {
// @todo Company phone should be calculated
return 'Tel: 03 5410 1135';
return 'Tel: '.static::phone();
}
public static function bsb() {
// @todo Details should be obtained from DB
return Kohana::config('config.bsb');
}
public static function account() {
// @todo Details should be obtained from DB
return Kohana::config('config.accnum');
}
public static function taxid() {
// @todo Details should be obtained from DB
return Kohana::config('config.taxid');
}
public static function render() {

View File

@@ -1,4 +1,37 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
class Config extends lnApp_Config {}
class Config extends lnApp_Config {
/**
* Find a list of all database enabled modules
*
* @uses cache
*/
public static function appmodules() {
$cacheable = TRUE;
if (array_key_exists('cache',Kohana::modules())) {
$cache = Cache::instance(static::cachetype());
if ($cacheable AND $cache->get('modules'))
return $cache->get('modules');
} else
$cache = '';
$modules = array();
$module_table = 'module';
if (class_exists('Model_'.ucfirst($module_table))) {
$mo = ORM::factory($module_table)->where('status','=',1)->find_all()->as_array();
foreach ($mo as $o)
$modules[$o->name] = MODPATH.$o->name;
}
if ($cache)
$cache->set('modules',$modules);
return $modules;
}
}
?>

View File

@@ -32,6 +32,9 @@ return array(
'172.31.10.200'=>Kohana::DEVELOPMENT,
'www.graytech.net.au'=>Kohana::PRODUCTION,
),
'bsb' => '633-000', // @todo This should come from the DB
'accnum' => '120 440 821', // @todo This should come from the DB
'site_name' => 'Graytech Hosting Pty Ltd', // @todo This should come from the DB
'taxid' => 'ABN: 49 106 229 476', // @todo This should come from the DB
);
?>

View File

@@ -0,0 +1,15 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* OSB invoice configuration
*
* @package OSB
* @category Configuration
* @author Deon George
* @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
return array(
'driver' => 'TCPDF',
);
?>