本文整理汇总了PHP中sbr_meta::getTaxPercent方法的典型用法代码示例。如果您正苦于以下问题:PHP sbr_meta::getTaxPercent方法的具体用法?PHP sbr_meta::getTaxPercent怎么用?PHP sbr_meta::getTaxPercent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sbr_meta
的用法示例。
在下文中一共展示了sbr_meta::getTaxPercent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateStatement
/**
* Генерируем заявление на открытие аккредитива (только заказчику - юрику)
*
* @param string $error
* @param type $lc
* @return type
*/
public function generateStatement(&$error, $lc = false)
{
require_once dirname(__FILE__) . '/num_to_word.php';
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/LocalDateTime.php";
$template = $_SERVER['DOCUMENT_ROOT'] . '/norisk2/xml/doc_statement.xml';
$sbr_num = $this->sbr->getContractNum(null, null);
$this->sbr->getFrlReqvs();
$this->sbr->getEmpReqvs();
$this->sbr->setCheckEmpReqvs($this->id);
if (!$lc) {
$pskb = new pskb($this->sbr);
$lc = $pskb->getLC();
}
$days_acredit = round((strtotime($lc['dateExecLC']) - time()) / (3600 * 24));
$days_acredit = $days_acredit . " " . ending($days_acredit, 'день', 'дня', 'дней');
if ($lc['ps_frl'] == onlinedengi::BANK_YL) {
$frl_reqv_payment = $lc['accPerf'] . "\r\n";
$frl_reqv_payment .= "БИК: {$lc['psPerf']}";
} else {
$frl_reqv_payment = $lc['accPerf'];
}
if ($lc['ps_emp'] == onlinedengi::BANK_YL) {
$emp_reqv_payment = $lc['accCust'] . "\r\n";
$emp_reqv_payment .= "БИК: {$lc['psCust']}";
} else {
$emp_reqv_payment = $lc['accCust'];
}
if ($lc['ps_frl'] == onlinedengi::WMR || $lc['ps_frl'] == onlinedengi::YD) {
$tax_percent_vaan = '5.4%';
//@todo надо как то эти цифры брать из схемы
$tax_percent_bank = '0.6%';
} elseif ($lc['ps_frl'] != pskb::WW) {
$tax_percent_vaan = '2.5%';
$tax_percent_bank = '0.5%';
} else {
$tax_percent_bank = '0%';
}
$tax_percent_bank = sbr_meta::getTaxPercent(sbr::FRL, pskb::$exrates_map[$lc['ps_frl']], 'Комиссия Банка', $this->sbr->scheme_type) . "%";
$dvals = array('P' => pskb::$exrates_map[$lc['ps_emp']]);
$tax_total = 0;
$tax_bank = 0;
$total_cost = $this->sbr->cost;
foreach ($this->sbr->scheme['taxes'][sbr::EMP] as $tax) {
if ($tax['tax_code'] != 'TAX_FL') {
$tax_bank += sbr_meta::calcAnyTax($tax['tax_id'], $tax['scheme_id'], $total_cost, $dvals);
//$stage->calcTax($tax, $dvals, $outsys);
continue;
}
$tax_total += sbr_meta::calcAnyTax($tax['tax_id'], $tax['scheme_id'], $total_cost, $dvals);
//$stage->calcTax($tax, $dvals, $outsys);
if (!floatval($tax_total)) {
continue;
}
}
$sum_reserved = $this->sbr->getReserveSum(true, pskb::$exrates_map[$lc['ps_emp']]);
$sum_vaan = num2strL(round($tax_total, 2));
$sum_vaan_nds = num2strEx(round($tax_total / 118 * 18, 2));
$replace = array('$sbr_num' => $sbr_num, '$sbr_date' => date("d.m.Y", strtotime($this->sbr->sended)), '$efio' => $lc['nameCust'], '$ffio' => $lc['namePerf'], '$num_acredit' => $lc['lc_id'], '$date_acredit' => date('d.m.Y'), '$sum' => num2strL($this->sbr->cost), '$sum_str' => num2str($this->sbr->cost, true), '$emp_payment_method_name' => pskb::$psys[pskb::USER_EMP][$lc['ps_emp']], '$emp_reqv_payment' => $emp_reqv_payment, '$frl_payment_method_name' => pskb::$psys[pskb::USER_FRL][$lc['ps_frl']], '$frl_reqv_payment' => $frl_reqv_payment, '$frl_phone' => $lc['numPerf'], '$days_acredit' => $days_acredit, '$tax_percent_vaan' => $tax_percent_vaan, '$tax_percent_bank' => $tax_percent_bank, '$sum_vaan' => $sum_vaan, '$sum_vaan_nds' => $sum_vaan_nds, '$sum_reserved' => num2strL($sum_reserved), '$sum_reserved_str' => num2str($sum_reserved, true), '$tax_bank' => num2strL($tax_bank), '$sum_d' => num2strD($this->sbr->cost), '$tax_bank_d' => num2strD($tax_bank), '$sum_vaan_d' => num2strD(round($tax_total, 2)), '$sum_vaan_nds_d' => num2strD(round($tax_total / 118 * 18, 2)));
$pdf = sbr::xml2pdf($template, $replace);
if (!($file = $this->sbr->_saveDocFile($pdf->Output(NULL, 'S')))) {
$error['fatal'] = "Ошибка при формировании Заявление на открытие аккредитива";
}
return $file;
}