66 lines
1.2 KiB
PHP
66 lines
1.2 KiB
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
*
|
|
*
|
|
* @package Invoice
|
|
* @category Tasks
|
|
* @author Deon George
|
|
* @copyright (c) 2009-2013 Open Source Billing
|
|
* @license http://dev.osbill.net/license.html
|
|
*/
|
|
class Task_Devel_Invoice_List extends Minion_Task {
|
|
protected function _execute(array $params) {
|
|
$c = 0;
|
|
|
|
foreach (ORM::factory('Invoice')->where('id','>',4331)->and_where('id','<',5320)->order_by('id','ASC')->find_all() as $io) {
|
|
if ($io->due() == 0)
|
|
continue;
|
|
|
|
/*
|
|
elseif ($io->due() < 0) {
|
|
foreach ($io->subitems() as $iio) {
|
|
switch ($iio->price_base) {
|
|
case 40.909:
|
|
$iio->price_base=40.92;
|
|
break;
|
|
|
|
case 98.045:
|
|
case 98.05:
|
|
$iio->price_base=98.055;
|
|
break;
|
|
|
|
case 103.045:
|
|
$iio->price_base=103.055;
|
|
break;
|
|
|
|
case 204.545:
|
|
$iio->price_base=204.56;
|
|
break;
|
|
case 209.545:
|
|
$iio->price_base=209.56;
|
|
break;
|
|
|
|
default:
|
|
print_r($iio->dump());
|
|
|
|
}
|
|
|
|
$iio->save();
|
|
}
|
|
|
|
printf("%4s %6.2f\n",$io->id,$io->due());
|
|
if ($c++>2)
|
|
break;
|
|
|
|
} elseif ($io->due() < 1) {
|
|
printf("%4s %6.2f\n",$io->id,$io->due());
|
|
}
|
|
*/
|
|
printf("%4s %6.2f\n",$io->id,$io->due());
|
|
|
|
}
|
|
}
|
|
}
|
|
?>
|