Revize 1282
Přidáno uživatelem Ondřej Fibich před asi 13 roky(ů)
freenetis/branches/testing/application/libraries/importers/Raiffeisenbank/RB_Importer.php | ||
---|---|---|
$bank_acc_model = new Bank_account_Model();
|
||
$fee_model = new Fee_Model();
|
||
$ebank_nrs = array("2400", "5500");
|
||
|
||
if (!isset(self::$parsed_bank_acc))
|
||
{ // mame jiz parsovany ucet v DB?
|
||
// (tato promenna bude nastavena pouze pokud se parsuje
|
||
... | ... | |
// Teď potřebujeme najít nebo vytvořit speciální podvojné účty k parsovanému bank. učtu:
|
||
$spec_accounts = array
|
||
(
|
||
"bank_interests" => "Úroky z $parsed_acc->name",
|
||
"time_deposits_interests" => "Úroky z termín. vkladů $parsed_acc->name",
|
||
"time_deposits" => "Termínované vklady $parsed_acc->name",
|
||
"bank_fees" => "Poplatky z $parsed_acc->name"
|
||
Account_attribute_Model::BANK_INTERESTS => array
|
||
(
|
||
"bank_interests",
|
||
"Úroky z $parsed_acc->name",
|
||
),
|
||
Account_attribute_Model::TIME_DEPOSITS_INTERESTS => array
|
||
(
|
||
"time_deposits_interests",
|
||
"Úroky z termín. vkladů $parsed_acc->name",
|
||
),
|
||
Account_attribute_Model::TIME_DEPOSITS => array
|
||
(
|
||
"time_deposits",
|
||
"Termínované vklady $parsed_acc->name",
|
||
),
|
||
Account_attribute_Model::BANK_FEES => array
|
||
(
|
||
"bank_fees",
|
||
"Poplatky z $parsed_acc->name",
|
||
)
|
||
);
|
||
|
||
foreach ($spec_accounts as $accnt => $name)
|
||
foreach ($spec_accounts as $accnt_attr => $name)
|
||
{
|
||
$spec_acc = self::$parsed_bank_acc->get_related_account_by_attribute_id(
|
||
Account_attribute_Model::$$accnt
|
||
$accnt_attr
|
||
);
|
||
|
||
if (!$spec_acc || !$spec_acc->id)
|
||
{ // pokud spec. ucet neexistuje, pak si jej vytvorime
|
||
$spec_acc = Account_Model::create(Account_attribute_Model::$$accnt, $name, 1);
|
||
$spec_acc = Account_Model::create($accnt_attr, $name[1], 1);
|
||
$spec_acc->add(self::$parsed_bank_acc);
|
||
$spec_acc->save();
|
||
}
|
||
$$accnt = $spec_acc;
|
||
${$name[0]} = $spec_acc;
|
||
}
|
||
|
||
$suppliers = ORM::factory('account')
|
Také k dispozici: Unified diff
Opravy:
- oprava importu RB