Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1376

Přidáno uživatelem David Raška před více než 12 roky(ů)

Opravy:
- #32: Vklad pokladnou v FIO banky prirazuje castky ke clenum

Zobrazit rozdíly:

freenetis/branches/testing/application/libraries/importers/Fio/FioSaver.php
}
elseif ($item["typ"] == "Vklad pokladnou")
{
// let's create interest transfer
$transfer_id = Transfer_Model::insert_transfer(
$cash->id, $account->id, null, null,
$user_id, null, $datetime, $now, $item["typ"],
abs($item["castka"])
);
$bt->clear();
$bt->set_logger(false);
$bt->origin_id = null;
$bt->destination_id = $ba->id;
$bt->transfer_id = $transfer_id;
$bt->bank_statement_id = $bank_statement_id;
$bt->transaction_code = $item["id_pohybu"];
$bt->number = $number;
$bt->constant_symbol = $item["ks"];
$bt->variable_symbol = $item["vs"];
$bt->specific_symbol = $item["ss"];
$bt->save();
$stats["deposits"] += abs($item["castka"]);
$stats["deposits_nr"]++;
$member = $variable_symbol_model->where('variable_symbol',(int) $item["vs"])->find()->account->member;
if (!$member->id)
{
// let's create interest transfer
$transfer_id = Transfer_Model::insert_transfer(
$cash->id, $account->id, null, null,
$user_id, null, $datetime, $now, $item["typ"],
abs($item["castka"])
);
$bt->clear();
$bt->set_logger(false);
$bt->origin_id = null;
$bt->destination_id = $ba->id;
$bt->transfer_id = $transfer_id;
$bt->bank_statement_id = $bank_statement_id;
$bt->transaction_code = $item["id_pohybu"];
$bt->number = $number;
$bt->constant_symbol = $item["ks"];
$bt->variable_symbol = $item["vs"];
$bt->specific_symbol = $item["ss"];
$bt->save();
$stats["deposits"] += abs($item["castka"]);
$stats["deposits_nr"]++;
}
else
{
$member_id = $member->id;
// double-entry incoming transfer
$transfer_id = Transfer_Model::insert_transfer(
$member_fees->id, $account->id, null, $member_id,
$user_id, null, $datetime, $now, $item["zprava"],
abs($item["castka"])
);
// incoming bank transfer
$bt->clear();
$bt->set_logger(false);
$bt->origin_id = $counter_ba->id;
$bt->destination_id = $ba->id;
$bt->transfer_id = $transfer_id;
$bt->bank_statement_id = $bank_statement_id;
$bt->transaction_code = $item["id_pohybu"];
$bt->number = $number;
$bt->constant_symbol = $item["ks"];
$bt->variable_symbol = $item["vs"];
$bt->specific_symbol = $item["ss"];
$bt->save();
// assign transfer? (0 - invalid id, 1 - assoc id, other are ordinary members)
if ($member_id > 1)
{
$ca = ORM::factory("account")
->where('member_id', $member_id)
->find();
// assigning transfer
$a_transfer_id = Transfer_Model::insert_transfer(
$account->id, $ca->id, $transfer_id, $member_id,
$user_id, null, $datetime, $now,
__("Assigning of transfer"), abs($item["castka"])
);
// transaction fee
$fee = $fee_model->get_by_date_type(
$datetime, 'transfer fee'
);
if ($fee && $fee->fee > 0)
{
$tf_transfer_id = Transfer_Model::insert_transfer(
$ca->id, $operating->id, $transfer_id,
$member_id, $user_id, null, $datetime,
$now, __("Transfer fee"), $fee->fee
);
}
$counter_ba->member_id = $member_id;
$counter_ba->save_throwable();
}
// member fee stats
$stats["member_fees"] += abs($item["castka"]);
$stats["member_fees_nr"]++;
}
}
// otherwise we assume that it is member fee
else

Také k dispozici: Unified diff