function catv_PaymentsShow($query) { $alter_conf = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini'); $alladrs = catv_GetFullAddressList(); $allrealnames = catv_GetAllRealnames(); $alltypes = zb_CashGetAllCashTypes(); $allapayments = simple_queryall($query); $total = 0; $result = '<table width="100%" border="0" class="sortable">'; $result .= ' <tr class="row1"> <td>' . __('ID') . '</td> <td>' . __('IDENC') . '</td> <td>' . __('Date') . '</td> <td>' . __('Cash') . '</td> <td>' . __('User') . '</td> <td>' . __('Full address') . '</td> <td>' . __('Notes') . '</td> <td>' . __('Admin') . '</td> </tr> '; if (!empty($allapayments)) { foreach ($allapayments as $io => $eachpayment) { if ($alter_conf['TRANSLATE_PAYMENTS_NOTES']) { if ($eachpayment['notes'] == '') { $eachpayment['notes'] = __('CaTV'); } $eachpayment['notes'] = zb_TranslatePaymentNote($eachpayment['notes'], array()); } $result .= ' <tr class="row3"> <td>' . $eachpayment['id'] . '</td> <td>' . zb_NumEncode($eachpayment['id']) . '</td> <td>' . $eachpayment['date'] . '</td> <td>' . $eachpayment['summ'] . '</td> <td> <a href="?module=catv_profile&userid=' . $eachpayment['userid'] . '">' . web_profile_icon() . '</a> ' . @$allrealnames[$eachpayment['userid']] . '</td> <td>' . @$alladrs[$eachpayment['userid']] . '</td> <td>' . $eachpayment['notes'] . '</td> <td>' . $eachpayment['admin'] . '</td> </tr> '; if ($eachpayment['summ'] > 0) { $total = $total + $eachpayment['summ']; } } } $result .= '</table>'; $result .= '<strong>' . __('Total') . ': ' . $total . '</strong>'; return $result; }
/** * Renders NDS users payments list * * @param string $query * @return string */ function web_NdsPaymentsShow($query) { $alter_conf = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini'); $alladrs = zb_AddressGetFulladdresslist(); $alltypes = zb_CashGetAllCashTypes(); $allapayments = simple_queryall($query); $ndstax = $alter_conf['NDS_TAX_PERCENT']; $allndsusers = zb_NdsGetAllUsers(); $ndspercent = zb_NdsGetPercent(); $allservicenames = zb_VservicesGetAllNamesLabeled(); $total = 0; $ndstotal = 0; $tablecells = wf_TableCell(__('ID')); $tablecells .= wf_TableCell(__('IDENC')); $tablecells .= wf_TableCell(__('Date')); $tablecells .= wf_TableCell(__('Cash')); $tablecells .= wf_TableCell(__('NDS')); $tablecells .= wf_TableCell(__('Without NDS')); $tablecells .= wf_TableCell(__('Login')); $tablecells .= wf_TableCell(__('Full address')); $tablecells .= wf_TableCell(__('Cash type')); $tablecells .= wf_TableCell(__('Notes')); $tablecells .= wf_TableCell(__('Admin')); $tablerows = wf_TableRow($tablecells, 'row1'); if (!empty($allapayments)) { foreach ($allapayments as $io => $eachpayment) { if (zb_NdsCheckUser($eachpayment['login'], $allndsusers)) { if ($alter_conf['TRANSLATE_PAYMENTS_NOTES']) { if ($eachpayment['note'] == '') { $eachpayment['note'] = __('Internet'); } if (isset($allservicenames[$eachpayment['note']])) { $eachpayment['note'] = $allservicenames[$eachpayment['note']]; } if (ispos($eachpayment['note'], 'CARD:')) { $cardnum = explode(':', $eachpayment['note']); $eachpayment['note'] = __('Card') . " " . $cardnum[1]; } if (ispos($eachpayment['note'], 'SCFEE')) { $eachpayment['note'] = __('Credit fee'); } if (ispos($eachpayment['note'], 'TCHANGE:')) { $tariff = explode(':', $eachpayment['note']); $eachpayment['note'] = __('Tariff change') . " " . $tariff[1]; } if (ispos($eachpayment['note'], 'BANKSTA:')) { $banksta = explode(':', $eachpayment['note']); $eachpayment['note'] = __('Bank statement') . " " . $banksta[1]; } } $tablecells = wf_TableCell($eachpayment['id']); $tablecells .= wf_TableCell(zb_NumEncode($eachpayment['id'])); $tablecells .= wf_TableCell($eachpayment['date']); $tablecells .= wf_TableCell($eachpayment['summ']); $paynds = zb_NdsCalc($eachpayment['summ'], $ndspercent); $tablecells .= wf_TableCell($paynds); $tablecells .= wf_TableCell($eachpayment['summ'] - $paynds); $profilelink = wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachpayment['login'], false); $tablecells .= wf_TableCell($profilelink); $tablecells .= wf_TableCell(@$alladrs[$eachpayment['login']]); $tablecells .= wf_TableCell(@__($alltypes[$eachpayment['cashtypeid']])); $tablecells .= wf_TableCell($eachpayment['note']); $tablecells .= wf_TableCell($eachpayment['admin']); $tablerows .= wf_TableRow($tablecells, 'row3'); if ($eachpayment['summ'] > 0) { $total = $total + $eachpayment['summ']; $ndstotal = $ndstotal + $paynds; } } } } $tablecells = wf_TableCell(''); $tablecells .= wf_TableCell(''); $tablecells .= wf_TableCell(''); $tablecells .= wf_TableCell($total); $tablecells .= wf_TableCell($ndstotal); $tablecells .= wf_TableCell($total - $ndstotal); $tablecells .= wf_TableCell(''); $tablecells .= wf_TableCell(''); $tablecells .= wf_TableCell(''); $tablecells .= wf_TableCell(''); $tablecells .= wf_TableCell(''); $tablerows .= wf_TableRow($tablecells, 'row2'); $result = wf_TableBody($tablerows, '100%', '0', 'sortable'); $result .= '' . __('Total') . ': <strong>' . $total . '</strong> ' . __('ELVs for all payments of') . ': <strong>' . $ndstotal . '</strong>'; return $result; }
/** * Renders payments extracted from database with some query * * @param string $query * @return string */ function web_PaymentsShow($query) { $alter_conf = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini'); $alladrs = zb_AddressGetFulladdresslist(); $allrealnames = zb_UserGetAllRealnames(); $alltypes = zb_CashGetAllCashTypes(); $allapayments = simple_queryall($query); $allservicenames = zb_VservicesGetAllNamesLabeled(); //getting full contract list if ($alter_conf['FINREP_CONTRACT']) { $allcontracts = zb_UserGetAllContracts(); $allcontracts = array_flip($allcontracts); } //getting all users tariffs if ($alter_conf['FINREP_TARIFF']) { $alltariffs = zb_TariffsGetAllUsers(); } $total = 0; $totalPaycount = 0; $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('IDENC')); $cells .= wf_TableCell(__('Date')); $cells .= wf_TableCell(__('Cash')); //optional contract display if ($alter_conf['FINREP_CONTRACT']) { $cells .= wf_TableCell(__('Contract')); } $cells .= wf_TableCell(__('Login')); $cells .= wf_TableCell(__('Full address')); $cells .= wf_TableCell(__('Real Name')); //optional tariff display if ($alter_conf['FINREP_TARIFF']) { $cells .= wf_TableCell(__('Tariff')); } $cells .= wf_TableCell(__('Cash type')); $cells .= wf_TableCell(__('Notes')); $cells .= wf_TableCell(__('Admin')); $rows = wf_TableRow($cells, 'row1'); if (!empty($allapayments)) { foreach ($allapayments as $io => $eachpayment) { if ($alter_conf['TRANSLATE_PAYMENTS_NOTES']) { $eachpayment['note'] = zb_TranslatePaymentNote($eachpayment['note'], $allservicenames); } $cells = wf_TableCell($eachpayment['id']); $cells .= wf_TableCell(zb_NumEncode($eachpayment['id'])); $cells .= wf_TableCell($eachpayment['date']); $cells .= wf_TableCell($eachpayment['summ']); //optional contract display if ($alter_conf['FINREP_CONTRACT']) { $cells .= wf_TableCell(@$allcontracts[$eachpayment['login']]); } $cells .= wf_TableCell(wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachpayment['login'], false, '')); $cells .= wf_TableCell(@$alladrs[$eachpayment['login']]); $cells .= wf_TableCell(@$allrealnames[$eachpayment['login']]); //optional tariff display if ($alter_conf['FINREP_TARIFF']) { $cells .= wf_TableCell(@$alltariffs[$eachpayment['login']]); } $cells .= wf_TableCell(@__($alltypes[$eachpayment['cashtypeid']])); $cells .= wf_TableCell($eachpayment['note']); $cells .= wf_TableCell($eachpayment['admin']); $rows .= wf_TableRow($cells, 'row3'); if ($eachpayment['summ'] > 0) { $total = $total + $eachpayment['summ']; $totalPaycount++; } } } $result = wf_TableBody($rows, '100%', '0', 'sortable'); $result .= wf_tag('strong') . __('Cash') . ': ' . $total . wf_tag('strong', true) . wf_tag('br'); $result .= wf_tag('strong') . __('Count') . ': ' . $totalPaycount . wf_tag('strong', true); return $result; }
/** * Returns form for payments by city within some month (by default - current month) * * @return string */ public function PaymentsShow() { $total = 0; $totalPayCount = 0; $this->LoadCashTypes(); $cells = wf_TableCell(__('IDENC')); $cells .= wf_TableCell(__('Date')); $cells .= wf_TableCell(__('Cash')); if ($this->altCfg['FINREP_CONTRACT']) { $cells .= wf_TableCell(__('Contract')); $this->LoadAllContracts(); } if ($this->altCfg['TRANSLATE_PAYMENTS_NOTES']) { $this->LoadAllServiceNames(); } $cells .= wf_TableCell(__('Login')); $cells .= wf_TableCell(__('Full address')); $cells .= wf_TableCell(__('Real Name')); if ($this->altCfg['FINREP_TARIFF']) { $cells .= wf_TableCell(__('Tariff')); $this->LoadAllTariffs(); } $cells .= wf_TableCell(__('Cash type')); $cells .= wf_TableCell(__('Was credited')); $cells .= wf_TableCell(__('Notes')); $cells .= wf_TableCell(__('Admin')); $rows = wf_TableRow($cells, 'row1'); if (!empty($this->allData)) { foreach ($this->allData as $io => $eachpayment) { if ($this->altCfg['TRANSLATE_PAYMENTS_NOTES']) { $eachpayment['note'] = zb_TranslatePaymentNote($eachpayment['note'], $this->allServiceNames); } $cells = wf_TableCell(zb_NumEncode($eachpayment['id'])); $cells .= wf_TableCell($eachpayment['date']); $cells .= wf_TableCell($eachpayment['summ']); if ($this->altCfg['FINREP_CONTRACT']) { $cells .= wf_TableCell(@$this->allContracts[$eachpayment['login']]); } $cells .= wf_TableCell(wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachpayment['login'], false, '')); $cells .= wf_TableCell(@$this->allAddresses[$eachpayment['login']]); $cells .= wf_TableCell(@$this->allRealNames[$eachpayment['login']]); if ($this->altCfg['FINREP_TARIFF']) { $cells .= wf_TableCell(@$this->allTariffs[$eachpayment['login']]); } $cells .= wf_TableCell(@__($this->allCashTypes[$eachpayment['cashtypeid']])); $cells .= wf_TableCell(@$this->allCredited[$eachpayment['login']]); $cells .= wf_TableCell($eachpayment['note']); $cells .= wf_TableCell($eachpayment['admin']); $rows .= wf_TableRow($cells, 'row4'); $total = $total + $eachpayment['summ']; $totalPayCount++; } } $result = wf_TableBody($rows, '100%', '0', 'sortable id'); $result .= wf_tag('strong') . __('Cash') . ': ' . $total . wf_tag('strong', true) . wf_tag('br'); $result .= wf_tag('strong') . __('Count') . ': ' . $totalPayCount . wf_tag('strong', true); return $result; }
<?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: