This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/invoice/classes/Controller/Task/Invoice.php

33 lines
988 B
PHP
Raw Normal View History

2013-10-10 02:44:53 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides OSB invoice task capabilities.
*
* @package Invoice
* @category Controllers
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Controller_Task_Invoice extends Controller_Task {
2013-05-02 09:52:19 +00:00
public $auto_render = FALSE;
2013-10-10 02:44:53 +00:00
public function action_audit_invoice_items() {
$output = '';
foreach (ORM::factory('Invoice_Item')->find_all() as $iio) {
if ($iio->product_name AND $iio->product_id) {
if (md5(strtoupper($iio->product_name)) == md5(strtoupper($iio->product->title()))) {
2013-10-10 02:44:53 +00:00
$iio->product_name = NULL;
$iio->save();
} else {
print_r(array("DIFF",'id'=>$iio->id,'pn'=>serialize($iio->product_name),'ppn'=>serialize($iio->product->title()),'pid'=>$iio->product_id,'test'=>strcasecmp($iio->product_name,$iio->product->title())));
2013-10-10 02:44:53 +00:00
}
}
}
$this->response->body($output);
}
}
?>