Beispiel #1
0
/**
 * Renders printable HTML sales slip
 * 
 * @param int $paymentid
 * @return string
 */
function zb_PrintCheck($paymentid)
{
    $paymentdata = zb_PaymentGetData($paymentid);
    $login = $paymentdata['login'];
    $templatebody = zb_PrintCheckLoadTemplate();
    $allfioz = zb_UserGetAllRealnames();
    $alladdress = zb_AddressGetFullCityaddresslist();
    $useraddress = $alladdress[$login];
    $agent_data = zb_AgentAssignedGetDataFast($login, $useraddress);
    $cassnames = zb_PrintCheckLoadCassNames();
    $cday = date("d");
    $cmonth = date("m");
    $month_array = months_array();
    $cmonth_name = $month_array[$cmonth];
    $cyear = curyear();
    $morph = new UBMorph();
    //forming template data
    @($templatedata['{PAYID}'] = $paymentdata['id']);
    @($templatedata['{PAYIDENC}'] = zb_NumEncode($paymentdata['id']));
    @($templatedata['{PAYDATE}'] = $paymentdata['date']);
    @($templatedata['{PAYSUMM}'] = $paymentdata['summ']);
    @($templatedata['{PAYSUMM_LIT}'] = $morph->sum2str($paymentdata['summ']));
    // omg omg omg
    @($templatedata['{REALNAME}'] = $allfioz[$login]);
    @($templatedata['{BUHNAME}'] = 'а відки я знаю?');
    @($templatedata['{CASNAME}'] = $cassnames[whoami()]);
    @($templatedata['{PAYTARGET}'] = 'Оплата за послуги / ' . $paymentdata['date']);
    @($templatedata['{FULLADDRESS}'] = $useraddress);
    @($templatedata['{CDAY}'] = $cday);
    @($templatedata['{CMONTH}'] = rcms_date_localise($cmonth_name));
    @($templatedata['{CYEAR}'] = $cyear);
    @($templatedata['{DAYPAYID}'] = zb_PrintCheckGetDayNum($paymentdata['id'], $paymentdata['date']));
    //contragent full data
    @($templatedata['{AGENTEDRPO}'] = $agent_data['edrpo']);
    @($templatedata['{AGENTNAME}'] = $agent_data['contrname']);
    @($templatedata['{AGENTID}'] = $agent_data['id']);
    @($templatedata['{AGENTBANKACC}'] = $agent_data['bankacc']);
    @($templatedata['{AGENTBANKNAME}'] = $agent_data['bankname']);
    @($templatedata['{AGENTBANKCODE}'] = $agent_data['bankcode']);
    @($templatedata['{AGENTIPN}'] = $agent_data['ipn']);
    @($templatedata['{AGENTLICENSE}'] = $agent_data['licensenum']);
    @($templatedata['{AGENTJURADDR}'] = $agent_data['juraddr']);
    @($templatedata['{AGENTPHISADDR}'] = $agent_data['phisaddr']);
    @($templatedata['{AGENTPHONE}'] = $agent_data['phone']);
    //parsing result
    $result = zb_ExportParseTemplate($templatebody, $templatedata);
    return $result;
}
Beispiel #2
0
<?php

if (cfr('PRINTCHECK')) {
    if (isset($_GET['paymentid'])) {
        $paymentid = $_GET['paymentid'];
        $alter = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
        if (!empty($alter['DOCX_SUPPORT']) && !empty($alter['DOCX_CHECK'])) {
            $morph = new UBMorph();
            @($payment = zb_PaymentGetData($paymentid));
            // id, date, summ...
            @($payment['idenc'] = zb_NumEncode($payment['id']));
            @($payment['summ_lit'] = $morph->sum2str($payment['summ']));
            @($payment['summ_exp'] = explode('.', $payment['summ']));
            @($payment['summ_cels'] = !empty($payment['summ_exp'][0]) ? $payment['summ_exp'][0] : '0');
            @($payment['summ_cops'] = !empty($payment['summ_exp'][1]) ? $payment['summ_exp'][1] : '00');
            @($payment['daypayid'] = zb_PrintCheckGetDayNum($payment['id'], $payment['date']));
            @($user['login'] = $payment['login']);
            @($user['realname'] = zb_UserGetRealName($user['login']));
            @($user['address'] = zb_UserGetFullAddress($user['login']));
            @($user['contract'] = zb_UserGetContract($user['login']));
            @($user['email'] = zb_UserGetEmail($user['login']));
            @($user['phone'] = zb_UserGetPhone($user['login']));
            @($user['mobile'] = zb_UserGetMobile($user['login']));
            @($user['agent'] = zb_AgentAssignedGetDataFast($user['login'], $user['address']));
            @($cashier = zb_PrintCheckLoadCassNames(true));
            @($current['day'] = date('d'));
            @($current['month'] = date('m'));
            @($current['monty_lit'] = months_array($current['month']));
            @($current['month_loc'] = rcms_date_localise($current['monty_lit']));
            @($current['year'] = date('Y'));
            // Forming parse template: