function get_pdf_invoice_download_filename($ordes_id)
{
    $check_status_query = xtc_db_query("select ibn_billdate, ibn_billnr from " . TABLE_ORDERS . " where orders_id = '" . $ordes_id . "'");
    $check_status = xtc_db_fetch_array($check_status_query);
    $billnr = make_billnr($check_status['ibn_billdate'], $check_status['ibn_billnr']);
    return sprintf(PDF_INVOICE_NAME, $billnr);
}
 function replace_data($txt)
 {
     //echo "<pre>"; print_r( $this->products_data ); echo "</pre>";
     $billnr = make_billnr($this->products_data['ibn_billdate'], $this->products_data['ibn_billnr']);
     $date_now = date(DATE_FORMAT);
     $raw_date = $this->products_data['ibn_billdate'];
     $year = substr($raw_date, 0, 4);
     $month = (int) substr($raw_date, 5, 2);
     $day = (int) substr($raw_date, 8, 2);
     $date_invoice = date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
     $raw_date = $this->products_data['order']->info['date_purchased'];
     $year = substr($raw_date, 0, 4);
     $month = (int) substr($raw_date, 5, 2);
     $day = (int) substr($raw_date, 8, 2);
     $date_order = date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
     $txt = str_replace('*date*', $date_now, $txt);
     $txt = str_replace('*date_order*', $date_order, $txt);
     $txt = str_replace('*date_invoice*', $this->products_data['DATE_INVOICE'], $txt);
     $txt = str_replace('*payment_method*', $this->products_data['PAYMENT_METHOD'], $txt);
     $txt = str_replace('*vat_id*', $this->products_data['order']->customer['vat_id'], $txt);
     $txt = str_replace('*ust_id*', $this->products_data['order']->customer['vat_id'], $txt);
     //echo "<pre>"; print_r($this->products_data['oID']); echo "</pre>"; die;
     $txt = str_replace('*date_delivery*', $this->products_data['delivery_date'], $txt);
     //    $txt = str_replace( '*orders_id*',     $this->products_data['oID'], $txt );
     $txt = str_replace('*orders_id*', $billnr, $txt);
     $txt = str_replace('*orders_id_sys*', $this->products_data['oID'], $txt);
     $txt = str_replace('*customers_id*', $this->products_data['order']->customer['id'], $txt);
     $txt = strip_tags($txt);
     $txt = decode_entities($txt);
     return $txt;
 }
Exemplo n.º 3
0
 $orders_split = new splitPageResults($_GET['page'], MAX_DISPLAY_ORDER_RESULTS, $orders_query_raw, $orders_query_numrows);
 $orders_query = xtc_db_query($orders_query_raw);
 while ($orders = xtc_db_fetch_array($orders_query)) {
     if ((!xtc_not_null($oID) || isset($oID) && $oID == $orders['orders_id']) && !isset($oInfo)) {
         //web28 - 2012-04-14 - FIX !xtc_not_null($oID)
         $oInfo = new objectInfo($orders);
     }
     if (isset($oInfo) && is_object($oInfo) && $orders['orders_id'] == $oInfo->orders_id) {
         echo '                      <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'pointer\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . PHP_EOL;
     } else {
         echo '                      <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . PHP_EOL;
     }
     // --- bof -- ipdfbill --------
     $bn = $orders['ibn_fullbillnr'];
     if ($bn == '') {
         $bn = make_billnr($orders['ibn_billdate'], $orders['ibn_billnr']);
     }
     if ($orders['ibn_billnr'] > 0) {
         $fakt = '<img src="includes/ipdfbill/images/fakt_logo_16x16.gif" />&nbsp;' . $bn;
     } else {
         $fakt = '&nbsp;';
     }
     if (pdfbill_invoice_exists($orders['orders_id'])) {
         $pdfgen = '&nbsp;<img src="includes/ipdfbill/images/pdf_logo_16x16.gif" />';
     } else {
         $pdfgen = '';
     }
     // --- eof -- ipdfbill --------
     $orders_link = xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit');
     $orders_image_preview = xtc_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW);
     $orders['customers_name'] = isset($orders['customers_company']) && $orders['customers_company'] != '' ? $orders['customers_company'] : $orders['customers_name'];
$order = new order((int) $_GET['oID']);
$smarty->assign('address_label_shop', STORE_NAME_ADDRESS);
$smarty->assign('address_label_customer', xtc_address_format($order->customer['format_id'], $order->customer, 1, '', '<br />'));
$smarty->assign('address_label_shipping', xtc_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />'));
$smarty->assign('address_label_payment', xtc_address_format($order->billing['format_id'], $order->billing, 1, '', '<br />'));
$smarty->assign('csID', $order->customer['csID']);
$smarty->assign('vat_id', $order->customer['vat_id']);
// get products data
include_once DIR_FS_CATALOG . DIR_WS_CLASSES . 'xtcPrice.php';
$xtPrice = new xtcPrice($order->info['currency'], $order->info['status']);
$order_total = $order->getTotalData($order->info['order_id']);
$order_data = $order->getOrderData($order->info['order_id']);
$smarty->assign('order_data', $order_data);
$smarty->assign('order_total', $order_total['data']);
// --- bof -- ipdfbill --------
$d = make_billnr($order->info['ibn_billdate'], $order->info['ibn_billnr']);
$smarty->assign('IBN_BILLNUMBER', $d);
$smarty->assign('IBN_BILLDATE', xtc_date_short($order->info['ibn_billdate'] . ' 00:00:00'));
// --- eof -- ipdfbill --------
// assign language to template for caching
$languages_query = xtc_db_query("select code, language_charset from " . TABLE_LANGUAGES . " WHERE directory ='" . $order->info['language'] . "'");
$langcode = xtc_db_fetch_array($languages_query);
$smarty->assign('langcode', $langcode['code']);
$smarty->assign('charset', $langcode['language_charset']);
$smarty->assign('language', $order->info['language']);
$smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
$smarty->assign('oID', $order->info['order_id']);
if ($order->info['payment_method'] != '' && $order->info['payment_method'] != 'no_payment') {
    include DIR_FS_CATALOG . 'lang/' . $_SESSION['language'] . '/modules/payment/' . $order->info['payment_method'] . '.php';
    $payment_method = constant(strtoupper('MODULE_PAYMENT_' . $order->info['payment_method'] . '_TEXT_TITLE'));
    $smarty->assign('PAYMENT_METHOD', $payment_method);