Improvements to invoice display and other misc items
This commit is contained in:
@@ -110,6 +110,7 @@ abstract class Checkout_Plugin_Paypal extends Checkout_Plugin {
|
||||
$iio = ORM::factory('Invoice_Item');
|
||||
$iio->quantity = 1;
|
||||
$iio->module_id = $cno->mid()->id;
|
||||
$iio->module_ref = $cno->id;
|
||||
$iio->item_type = 125; // Payment Fee
|
||||
$iio->price_base = (++$j==count($amts)) ? $cno->data['mc_gross_'.$c]-$i : Currency::round($pio->alloc_amt/array_sum($amts)*$cno->data['mc_gross_'.$c]);
|
||||
$iio->date_start = $iio->date_stop = time();
|
||||
|
@@ -9,12 +9,22 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Checkout_Notify extends ORM_OSB {
|
||||
class Model_Checkout_Notify extends ORM_OSB implements Invoicable {
|
||||
// Relationships
|
||||
protected $_has_one = array(
|
||||
'checkout'=>array('far_key'=>'checkout_id','foreign_key'=>'id'),
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'date_orig'=>array(
|
||||
array('Config::date',array(':value')),
|
||||
),
|
||||
);
|
||||
|
||||
public function invoice_item() {
|
||||
return sprintf('Payment Fee: %s',$this->checkout->name);
|
||||
}
|
||||
|
||||
public function process() {
|
||||
return $this->checkout->plugin()->notify($this);
|
||||
}
|
||||
|
37
modules/checkout/classes/Task/Checkout/Notify/List.php
Normal file
37
modules/checkout/classes/Task/Checkout/Notify/List.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* List all the Checkout Notify items.
|
||||
*
|
||||
* @package Checkout
|
||||
* @category Tasks
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Task_Checkout_Notify_List extends Minion_Task {
|
||||
protected function _execute(array $params) {
|
||||
$header = "%03s %11s %03s %10s %1s %1s %8s %8s %15s %25s %16s %30s\n";
|
||||
|
||||
$output = sprintf($header,'ID','DateRun','CID','Checkout','S','P','Total','Fee','ID','Cart','TXN ID','Item1');
|
||||
|
||||
foreach (ORM::factory('Checkout_Notify')->find_all() as $cno)
|
||||
$output .= sprintf($header,
|
||||
$cno->id,
|
||||
$cno->display('date_orig'),
|
||||
$cno->checkout_id,
|
||||
$cno->checkout->name,
|
||||
$cno->status ? 'A' : 'I',
|
||||
$cno->processed ? 'A' : 'I',
|
||||
$cno->data['mc_gross'],
|
||||
$cno->data['mc_fee'],
|
||||
$cno->data['payer_id'],
|
||||
$cno->data['custom'],
|
||||
$cno->data['txn_id'],
|
||||
$cno->data['item_name1']
|
||||
);
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user