function generate_bill($order_id)
{
    global $profile;
    //echo "<pre>"; print_r($profile); echo "</pre>";
    $pdf = new pdfbill($profile, $order_id, true);
    $pdf->max_height = 280;
    $pdf->doc_name = "catalog_" . $_POST['profilename'];
    //DokumentName
    $pdf->LoadData($order_id);
    $pdf->format();
    $pdf->Output($pdf->doc_name . ".pdf", "D");
    //    $pdf->Output();
    die;
}
Exemplo n.º 2
0
 // Rechnungsnummer erzeugen (Fakturieren)
 if ($order->info['ibn_billnr'] == 0) {
     require_once DIR_FS_INC . 'xtc_get_next_ibillnr.inc.php';
     require_once DIR_FS_INC . 'xtc_set_ibillnr.inc.php';
     require_once DIR_FS_INC . 'xtc_inc_next_ibillnr.inc.php';
     $ibillnr = xtc_get_next_ibillnr();
     xtc_set_ibillnr($oID, $ibillnr);
     xtc_inc_next_ibillnr();
 }
 // PDF erzeugen
 $profile = profile_load_n(profile_automatic_select($order));
 $profile = $profile['profile_parameter_arr'];
 $pdf = new pdfbill($profile, $oID);
 $pdf->max_height = 280;
 $pdf->doc_name = get_pdf_invoice_filename($oID);
 $pdf->LoadData($oID);
 // lieferdatum diskret eintragen
 $pdf->data['delivery_date'] = '';
 $pdf->format();
 $pdf->Output($pdf->doc_name, "F");
 // Rechnung per Mail verschicken
 $check_status_query = xtc_db_query("select customers_name, customers_email_address, orders_status, date_purchased, ibn_billdate, ibn_billnr from " . TABLE_ORDERS . " where orders_id = '" . xtc_db_input($oID) . "'");
 $check_status = xtc_db_fetch_array($check_status_query);
 $billnr = make_billnr($check_status['ibn_billdate'], $check_status['ibn_billnr']);
 // assign language to template for caching
 $smarty->assign('language', $_SESSION['language']);
 $smarty->caching = false;
 // set dirs manual
 $smarty->template_dir = DIR_FS_CATALOG . 'templates';
 $smarty->compile_dir = DIR_FS_CATALOG . 'templates_c';
 $smarty->config_dir = DIR_FS_CATALOG . 'lang';