// Update Accounting for export

This commit is contained in:
vSchoener
2011-11-15 14:45:24 +00:00
parent 4c7fba91c4
commit 8c11276d3e
6 changed files with 436 additions and 2 deletions
+3 -1
View File
@@ -40,6 +40,8 @@ class AccountingCore
VALUES %s';
$values = '';
// Build the query for the update
foreach($assoZoneShopList as $asso)
if (array_key_exists('id_zone', $asso) &&
array_key_exists('id_shop', $asso) &&
@@ -106,4 +108,4 @@ class AccountingCore
FROM `'._DB_PREFIX_.'accounting_zone_shop`
WHERE `id_shop` = '.(int)$id_shop);
}
}
}
+17
View File
@@ -40,6 +40,9 @@ class TaxCore extends ObjectModel
/** @var boolean true if the tax has been historized */
public $deleted = 0;
/** @var string Account Number */
public $account_number;
protected $fieldsRequired = array('rate');
protected $fieldsValidate = array('rate' => 'isFloat');
protected $fieldsRequiredLang = array('name');
@@ -62,6 +65,7 @@ class TaxCore extends ObjectModel
$fields['rate'] = (float)($this->rate);
$fields['active'] = (int)($this->active);
$fields['deleted'] = (int)($this->deleted);
$fields['account_number'] = $this->account_number;
return $fields;
}
@@ -267,5 +271,18 @@ class TaxCore extends ObjectModel
return $tax_calculator->getTotalRate();
}
/**
* Returns the Account number of a Tax
*
* @param integer $id_tax
* @return string Account Number
*/
public static function getAccountNumberByIdTax($id_tax)
{
return Db::getInstance()->getValue('
SELECT account_number FROM `'._DB_PREFIX_.'tax`
WHERE id_tax = '.(int)$id_tax);
}
}