Added Invoice/SSL download recording, other misc fixes

This commit is contained in:
Deon George
2013-10-11 13:08:50 +11:00
parent 6f855fb32d
commit 6e95184b0c
15 changed files with 137 additions and 12 deletions

View File

@@ -16,6 +16,7 @@ class Model_Invoice extends ORM_OSB implements Cartable {
protected $_has_many = array(
'invoice_item'=>array('far_key'=>'id'),
'invoice_item_tax'=>array('through'=>'invoice_item'),
'invoice_memo'=>array('far_key'=>'id'),
'service'=>array('through'=>'invoice_item'),
'payment'=>array('through'=>'payment_item'),
'payment_item'=>array('far_key'=>'id'),
@@ -190,6 +191,7 @@ class Model_Invoice extends ORM_OSB implements Cartable {
return $format ? Currency::display($result) : $result;
}
//ZZ
/**
* Return a list of valid checkout options for this invoice
*/
@@ -698,10 +700,10 @@ class Model_Invoice extends ORM_OSB implements Cartable {
/**
* Return a list of invoices that are over their due date with/without auto billing
*/
public function list_overdue_billing($time=NULL,$billing=FALSE) {
public function list_overdue_billing($time=NULL,$billing=FALSE,$authorised=TRUE) {
$result = array();
foreach ($this->list_overdue($time) as $io) {
foreach ($this->list_overdue($time,$authorised) as $io) {
$i = FALSE;
foreach ($io->service->find_all() as $so)
if (($billing AND $so->account_billing_id) OR (! $billing AND ! $so->account_billing_id)) {

View File

@@ -0,0 +1,30 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class supports Invoice Memos.
*
* @package Invoice
* @category Models
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Invoice_Memo extends ORM_OSB {
// Relationships
protected $_belongs_to = array(
'invoice'=>array(),
);
protected $_has_one = array(
'account'=>array('foreign_key'=>'id'),
);
/**
* Filters used to format the display of values into friendlier values
*/
protected $_display_filters = array(
'date_orig'=>array(
array('Config::datetime',array(':value')),
),
);
}
?>