/** * sets some custom template fields from post request * * @return void */ public function setCustomFields() { $pdvPercent = $this->altcfg['DOCX_NDS']; if (la_CheckPost(array('customfields'))) { $morph = new UBMorph(); @($this->customFields['CUSTDATE'] = $_POST['customdate']); @($this->customFields['CUSTREALNAME'] = $_POST['customrealname']); @($this->customFields['CUSTPHONE'] = $_POST['customphone']); @($this->customFields['CUSTSERVICE'] = $_POST['customservice']); @($this->customFields['CUSTNOTES'] = $_POST['customnotes']); @($this->customFields['CUSTSUM'] = $_POST['customsum']); @($this->customFields['CUSTPHONE'] = $_POST['customphone']); @($pdv = $this->customFields['CUSTSUM'] / 100 * $pdvPercent); @($this->customFields['PDV'] = $pdv); @($this->customFields['CUSTSUMPDV'] = $this->customFields['CUSTSUM'] + $pdv); @($this->customFields['CUSTSUMLIT'] = $morph->sum2str($this->customFields['CUSTSUM'])); @($this->customFields['CUSTSUMPDVLIT'] = $morph->sum2str($this->customFields['CUSTSUMPDV'])); } }
/** * 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; }
/** * sets some custom template fields from post request * * @return void */ public function setCustomFields() { //ugly debug code $pdvPercent = $this->altcfg['DOCX_NDS']; if (wf_CheckPost(array('customfields'))) { $morph = new UBMorph(); @($this->customFields['CUSTDATE'] = $_POST['customdate']); @($this->customFields['CUSTREALNAME'] = $_POST['customrealname']); @($this->customFields['CUSTPHONE'] = $_POST['customphone']); @($this->customFields['CUSTSERVICE'] = $_POST['customservice']); @($this->customFields['CUSTNOTES'] = $_POST['customnotes']); @($this->customFields['CUSTSUM'] = $_POST['customsum']); @($this->customFields['CUSTPHONE'] = $_POST['customphone']); @($pdv = $this->customFields['CUSTSUM'] / 100 * $pdvPercent); @($this->customFields['PDV'] = $pdv); @($this->customFields['CUSTSUMPDV'] = $this->customFields['CUSTSUM'] + $pdv); @($this->customFields['CUSTSUMPDVLIT'] = $morph->sum2str($this->customFields['CUSTSUMPDV'])); @($this->customFields['CUSTSUMLIT'] = $morph->sum2str($this->customFields['CUSTSUM'])); if ($this->altcfg['CORPS_ENABLED']) { //corporate user fields @($this->customFields['CORPNAME'] = $_POST['corpname']); @($this->customFields['CORPADDRESS'] = $_POST['corpaddress']); @($this->customFields['CORPDOCTYPE'] = $_POST['corpdoctype']); @($this->customFields['CORPDOCNUM'] = $_POST['corpdocnum']); @($this->customFields['CORPDOCDATE'] = $_POST['corpdocdate']); @($this->customFields['CORPBANKACC'] = $_POST['corpbankacc']); @($this->customFields['CORPBANKNAME'] = $_POST['corpbankname']); @($this->customFields['CORPBANKMFO'] = $_POST['corpbankmfo']); @($this->customFields['CORPEDRPOU'] = $_POST['corpedrpou']); @($this->customFields['CORPNDSTAXNUM'] = $_POST['corpndstaxnum']); @($this->customFields['CORPINNCODE'] = $_POST['corpinncode']); @($this->customFields['CORPTAXTYPE'] = $_POST['corptaxtype']); @($this->customFields['CORPNOTES'] = $_POST['corpnotes']); } if ($this->altcfg['NETWORKS_EXT']) { //extended network pools management $extNets = new ExtNets(); @($this->customFields['NETWORKS_EXT'] = $extNets->poolTemplateData($this->userLogin)); } } }
<?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: