Fix export accounting, added Domain List
This commit is contained in:
@@ -89,10 +89,10 @@ class Export_Plugin_Quicken extends Export_Plugin {
|
||||
continue;
|
||||
|
||||
// Get the mapping item for account purposes
|
||||
if ($iio->product_id) {
|
||||
if ($iio->module() instanceof Model_Product) {
|
||||
$edo = ORM::factory('Export_DataMap')
|
||||
->where('module_id','=',$iio->product->mid())
|
||||
->and_where('item_id','=',$iio->product_id)
|
||||
->where('module_id','=',$iio->module_id)
|
||||
->and_where('item_id','=',$iio->module_ref)
|
||||
->find();
|
||||
|
||||
if ($edo->loaded()) {
|
||||
@@ -103,7 +103,7 @@ class Export_Plugin_Quicken extends Export_Plugin {
|
||||
throw HTTP_Exception::factory(501,'Missing product map data for :product (:id)',array(':product'=>$iio->product->title(),':id'=>$iio->product_id));
|
||||
}
|
||||
|
||||
$items[$c]['MEMO'] = sprintf('%s (%s)',$iio->product->title(),$iio->period());
|
||||
$items[$c]['MEMO'] = sprintf('%s (%s)',$iio->module()->title(),$iio->period());
|
||||
|
||||
// Non product item
|
||||
} else {
|
||||
@@ -133,9 +133,16 @@ class Export_Plugin_Quicken extends Export_Plugin {
|
||||
$items[$c]['TAXAMOUNT'] = 0;
|
||||
}
|
||||
|
||||
// @todo This rounding should be a system config.
|
||||
$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);
|
||||
if ($iio->module() instanceof Model_Charge) {
|
||||
$items[$c]['QNTY'] *= $iio->module()->quantity;
|
||||
$items[$c]['PRICE'] = sprintf('%3.2f',round($iio->subtotal()-$iio->discount(),2));
|
||||
$items[$c]['AMOUNT'] = sprintf('%3.2f',round($iio->module()->amount-$iio->discount(),2)*-1);
|
||||
|
||||
} else {
|
||||
// @todo This rounding should be a system config.
|
||||
$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++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user