// Update Accounting for export
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user