Export fixes and updates from live
This commit is contained in:
@@ -83,7 +83,7 @@ class Export_Plugin_Quicken extends Export_Plugin {
|
||||
$c = 0;
|
||||
|
||||
// Add the items to the invoice
|
||||
foreach ($io->invoice_item->find_all() as $iio) {
|
||||
foreach ($io->items('CHARGE') as $iio) {
|
||||
// Skip any zero amount items not relating to a service
|
||||
if ($iio->total() == 0 and ! $iio->service_id)
|
||||
continue;
|
||||
@@ -141,16 +141,26 @@ class Export_Plugin_Quicken extends Export_Plugin {
|
||||
}
|
||||
|
||||
// Add credits as a other item
|
||||
if ($io->total_credits()) {
|
||||
foreach ($io->items('CREDIT') as $iio) {
|
||||
$items[$c]['ACCNT'] = 'Other Income';
|
||||
$items[$c]['INVITEM'] = 'Product:Unknown';
|
||||
$items[$c]['CLEAR'] = 'N';
|
||||
$items[$c]['QNTY'] = 1;
|
||||
$items[$c]['MEMO'] = 'Credit Item';
|
||||
$items[$c]['TAXAMOUNT'] = 0;
|
||||
|
||||
$items[$c]['PRICE'] = sprintf('%3.2f',round(($io->total_credits()-$io->tax())*-1,2));
|
||||
$items[$c]['AMOUNT'] = sprintf('%3.2f',round(($io->total_credits()-$io->tax()),2));
|
||||
foreach ($iio->tax_items() as $tid => $amount) {
|
||||
$to = ORM::factory('Tax',$tid);
|
||||
|
||||
$items[$c]['TAXABLE'] = 'Y';
|
||||
$items[$c]['TAXCODE'] = $to->description;
|
||||
$items[$c]['TAXRATE'] = sprintf('%3.2f%%',$to->rate);
|
||||
$items[$c]['TAXAMOUNT'] = sprintf('%3.2f',$amount*-1);
|
||||
}
|
||||
|
||||
$items[$c]['PRICE'] = sprintf('%3.2f',round($iio->subtotal()-$iio->discount(),2));
|
||||
$items[$c]['AMOUNT'] = sprintf('%3.2f',round($iio->subtotal()-$iio->discount(),2)*-1);
|
||||
|
||||
$c++;
|
||||
}
|
||||
|
||||
return $this->output(Arr::merge($defaults,$invoice),$items);
|
||||
|
Reference in New Issue
Block a user