Exemple #1
0
echo $data->description;
?>
" />
								</div>
							</div>
							<?php 
if ($id == '') {
    ?>
							<div class="form-group">
								<label class="col-sm-4"><?php 
    echo lang('settings_payment_admin_add_choose_payment');
    ?>
</label>
								<div class="col-sm-4">
									<?php 
    $folder_payment = getPayment();
    ?>
									<select name="data[type]" class="form-control input-sm" >
										<?php 
    foreach ($folder_payment as $k => $v) {
        ?>
											<option value='<?php 
        echo $k;
        ?>
'><?php 
        echo $v;
        ?>
</option>
										<?php 
    }
    ?>
Exemple #2
0
<?php

//stop the direct browsing to this file - let index.php handle which files get displayed
checkLogin();
$menu = false;
$payment = getPayment($_GET['id']);
/*Code to get the Invoice preference - so can link from this screen back to the invoice - START */
$invoice = getInvoice($payment['ac_inv_id']);
$biller = getBiller($payment['biller_id']);
$logo = getLogo($biller);
$logo = str_replace(" ", "%20", $logo);
$customer = getCustomer($payment['customer_id']);
$invoiceType = getInvoiceType($invoice['type_id']);
$customFieldLabels = getCustomFieldLabels();
$paymentType = getPaymentType($payment['ac_payment_type']);
$preference = getPreference($invoice['preference_id']);
$smarty->assign("payment", $payment);
$smarty->assign("invoice", $invoice);
$smarty->assign("biller", $biller);
$smarty->assign("logo", $logo);
$smarty->assign("customer", $customer);
$smarty->assign("invoiceType", $invoiceType);
$smarty->assign("paymentType", $paymentType);
$smarty->assign("preference", $preference);
$smarty->assign("customFieldLabels", $customFieldLabels);
$smarty->assign('pageActive', 'payment');
$smarty->assign('active_tab', '#money');
 $room = check_availablestandard($from, $to);
 $stand_single = getAvailablerooms($from, $to, 1, 1);
 $stand_double = getAvailablerooms($from, $to, 1, 2);
 $stand_triple = getAvailablerooms($from, $to, 1, 3);
 $deluxe_single = getAvailablerooms($from, $to, 2, 1);
 $deluxe_double = getAvailablerooms($from, $to, 2, 2);
 $sup_single = getAvailablerooms($from, $to, 3, 1);
 $sup_double = getAvailablerooms($from, $to, 3, 2);
 $sup_triple = getAvailablerooms($from, $to, 3, 3);
 $query = "select * from invoice where cust_id={$cust} and section_id=5";
 $invoice = getData($query);
 $invoice_no = $invoice[0]['invoice_number'];
 $amnt = $invoice[0]['amount'] + $totalamnt;
 $query = "update invoice set amount={$amnt} where cust_id='" . $cust . "' and section_id='5'";
 update($query);
 $payid = getPayment();
 if ($payment > 0) {
     //insert amount paid into payment
     $query = "insert into payment (pay_id, amount, section_id,cust_id) values ('" . $payid . "','" . $payment . "','5','" . $cust . "')";
     update($query);
 }
 $cust_id = $cust;
 //Standard single rooms
 if (isset($_POST['standard_single'])) {
     $adult_single = $_POST['adult_single'];
     $child_single = $_POST['child_single'];
     $child_singleb = $_POST['child_singleB'];
     $rooms_single = $_POST['stand_single'];
     for ($x = 0; $x < $rooms_single; $x++) {
         $room_no = $stand_single[$x]['room_no'];
         //$no=getReserveId();
Exemple #4
0
 private function renderPaymentLink($array = [])
 {
     $order = $array;
     $transaction_details = array('order_id' => Order::max('order_id') + 1, 'gross_amount' => $order['total']);
     $i = 0;
     foreach ($order['product'] as $product) {
         $items_details = [$i => ['id' => $product['id'], 'price' => $product['product_price'], 'quantity' => $product['product_qty'], 'name' => $product['product_name']]];
         $i++;
     }
     $shipping_fee = ['id' => 'shipping', 'price' => $order['shipping']['fee'], 'quantity' => '1', 'name' => $order['shipping']['service']];
     array_push($items_details, $shipping_fee);
     // Optional
     $billing_address = array('first_name' => $order['user']['first_name'], 'last_name' => $order['user']['last_name'], 'address' => $order['user']['address'], 'city' => getCity($order['user']['city']), 'postal_code' => "55281", 'phone' => $order['user']['mob_phone'], 'country_code' => 'IDN');
     // Optional
     $customer_details = array('first_name' => $order['user']['first_name'], 'last_name' => $order['user']['last_name'], 'email' => $order['user']['email'], 'phone' => $order['user']['mob_phone'], 'billing_address' => $billing_address, 'shipping_address' => $billing_address);
     // Fill transaction details
     $transaction = array('payment_type' => 'vtweb', "vtweb" => array("enabled_payments" => getPayment(), "credit_card_3d_secure" => true, "finish_redirect_url" => url('checkout/complete'), "unfinish_redirect_url" => url('checkout/uncomplete'), "error_redirect_url" => url('checkout/error')), 'transaction_details' => $transaction_details, 'customer_details' => $customer_details, 'item_details' => $items_details);
     $vtweb_url = Veritrans_VtWeb::getRedirectionUrl($transaction);
     return $vtweb_url;
 }
Exemple #5
0
        echo $result;
    } catch (Exception $e) {
        trigger_error(sprintf('Curl failed with error #%d: %s', $e->getCode(), $e->getMessage()), E_USER_ERROR);
    }
    curl_close($ch);
}
// Globals
$config = array("callbackUrl" => "https://example.com/api/swishcb/paymentrequests", "payeeAlias" => "1231181189", "currency" => "SEK", "CAINFO" => 'C:\\wamp\\bin\\apache\\apache2.4.9\\conf\\ssl\\ca.pem', "SSLCERT" => 'C:\\wamp\\bin\\apache\\apache2.4.9\\conf\\ssl\\client.pem', "SSLKEY" => 'C:\\wamp\\bin\\apache\\apache2.4.9\\conf\\ssl\\key.pem', "SSLCERTPASSWD" => 'swish', "SSLKEYPASSWD" => 'swish');
// createPayment("davidBet01", "", "2435", "Test 1", $config);
// getPayment("693717E1BAED4E47B715AF5514BFE615", $config);
// Location: http://172.31.21.186:8580/swish-cpcapi/api/v1/paymentrequests/693717E1BAED4E47B715AF5514BFE615
// PaymentRequestToken: dFJ4QhlZSqia9RHO1O0D2qHbaGzSjYVz
if (isset($_GET["orderId"]) && isset($_GET["phone"])) {
    echo createPayment($_GET["orderId"], $_GET["phone"], "100", "Test 1", $config);
} else {
    if (isset($_GET["transactionId"])) {
        // getPayment($_GET["transactionId"], $config);
        if (isset($_GET["action"]) && $_GET["action"] == "update") {
            getPayment($_GET["transactionId"], $config);
        } else {
            if (isset($_SESSION[$_GET["transactionId"]])) {
                echo '{"transactionId":"' . $_GET["transactionId"] . '","status":"' . $_SESSION[$_GET["transactionId"]]["status"] . '"}';
            } else {
                echo '{"error":"Callback not received yet", "transactionId":"' . $_GET["transactionId"] . '","status":"unknown"}';
            }
        }
    } else {
        // echo '{"transactionId":"693717E1BAED4E47B715AF5514BFE615","status":"unknown"}';
        echo '{"error":"Parameter missing"}';
    }
}
require_once 'lib.php';
if (isset($_SESSION["last_acted_on"]) && time() - $_SESSION["last_acted_on"] > 60 * 15 || !isset($_SESSION['user_name'])) {
    session_unset();
    // unset $_SESSION variable for the run-time
    session_destroy();
    // destroy session data in storage
    header('Location:index.php');
} else {
    session_regenerate_id(true);
    $_SESSION["last_acted_on"] = time();
    if (isset($_GET['number'])) {
        $invoice = $_GET['number'];
    }
    if (isset($_POST['add'])) {
        $no = getPayment();
        $amount = $_POST['amount'];
        $code = $_POST['code'];
        $invoice_id = $_POST['invoice'];
        $payment_date = $_POST['payment_date'];
        $payment_date = date_format(date_create($payment_date), "Y-m-d");
        $query = "insert into payment values ('" . $no . "','" . $payment_date . "' , '" . $code . "' , '" . $amount . "','" . $invoice_id . "' )";
        Update($query);
        header('Location:payment.php?number=' . $invoice_id . '');
    }
    ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Accommodation</title>
function vartpl(&$t, $daten, $typ, $msg, $btn1, $btn2, $tpl, $suchmaske = false, $ui = false)
{
    $jscal = "<style type='text/css'>@import url(../js/jscalendar/calendar-win2k-1.css);</style>\n";
    $jscal .= "<script type='text/javascript' src='../js/jscalendar/calendar.js'></script>\n";
    $jscal .= "<script type='text/javascript' src='../js/jscalendar/lang/calendar-de.js'></script>\n";
    $jscal .= "<script type='text/javascript' src='../js/jscalendar/calendar-setup.js'></script>\n";
    if (isset($daten["grafik"])) {
        if ($typ == "C") {
            $DIR = "C" . $daten["customernumber"];
        } else {
            $DIR = "V" . $daten["vendornumber"];
        }
        if (file_exists("dokumente/" . $_SESSION["dbname"] . "/{$DIR}/logo." . $daten["grafik"])) {
            $Image = "<img src='dokumente/" . $_SESSION["dbname"] . "/{$DIR}/logo." . $daten["grafik"] . "' " . $daten["icon"] . ">";
        } else {
            $Image = "Bild ({$DIR}/logo." . $daten["grafik"] . ") nicht<br>im Verzeichnis";
        }
    } else {
        $Image = '';
    }
    $tmp = false;
    if (!$suchmaske) {
        $tmp = getVariablen($daten["id"]);
    }
    $varablen = $tmp > 0 ? count($tmp) . " Variablen" : "";
    if ($ui) {
        $t->set_file(array("fa1" => "companies" . $tpl . ".tpl"));
    } else {
        $t->set_file(array("fa1" => "firmen" . $tpl . ".tpl"));
    }
    if (isset($daten["employee"]) and $daten['employee'] > 0) {
        $employee = $daten["employee"];
    } else {
        if (isset($daten["modemployee"])) {
            $employee = "ERP " . $daten["modemployee"];
        } else {
            $employee = '';
        }
    }
    $t->set_var(array('FAART' => $typ == "C" ? ".:Customer:." : ".:Vendor:.", 'FAART2' => $typ == "C" ? ".:Customer Name:." : ".:Vendor Name:.", 'mtime' => isset($daten["mtime"]) ? $daten['mtime'] : '', 'Q' => $typ, 'Btn1' => $btn1, 'Btn2' => $btn2, 'Msg' => $msg, 'preon' => isset($daten["pre"]) ? "checked" : '', 'action' => $ui ? "" : "firmen" . $tpl . ".php?Q={$typ}", 'id' => isset($daten["id"]) ? $daten['id'] : '', 'customernumber' => isset($daten["customernumber"]) ? $daten["customernumber"] : '', 'vendornumber' => isset($daten["vendornumber"]) ? $daten["vendornumber"] : '', 'kdnr' => isset($daten["nummer"]) ? $daten["nummer"] : '', 'v_customer_id' => isset($daten["v_customer_id"]) ? $daten["v_customer_id"] : '', 'name' => isset($daten["name"]) ? $daten["name"] : '', 'greeting_' => isset($daten["greeting_"]) ? $daten["greeting_"] : '', 'department_1' => isset($daten["department_1"]) ? $daten["department_1"] : '', 'department_2' => isset($daten["department_2"]) ? $daten["department_2"] : '', 'street' => isset($daten["street"]) ? $daten["street"] : '', 'country' => isset($daten["country"]) ? $daten["country"] : '', 'zipcode' => isset($daten["zipcode"]) ? $daten["zipcode"] : '', 'city' => isset($daten["city"]) ? $daten["city"] : '', 'phone' => isset($daten["phone"]) ? $daten["phone"] : '', 'fax' => isset($daten["fax"]) ? $daten["fax"] : '', 'email' => isset($daten["email"]) ? $daten["email"] : '', 'homepage' => isset($daten["homepage"]) ? $daten["homepage"] : '', 'sw' => isset($daten["sw"]) ? $daten["sw"] : '', 'konzern' => isset($daten["konzern"]) ? $daten["konzern"] : '', 'konzernname' => isset($daten["konzernname"]) ? $daten["konzernname"] : '', 'branche_' => isset($daten["branche_"]) ? $daten["branche_"] : '', 'ustid' => isset($daten["ustid"]) ? $daten["ustid"] : '', 'taxnumber' => isset($daten["taxnumber"]) ? $daten["taxnumber"] : '', 'contact' => isset($daten["contact"]) ? $daten["contact"] : '', 'leadsrc' => isset($daten["leadsrc"]) ? $daten["leadsrc"] : '', 'notes' => isset($daten["notes"]) ? $daten["notes"] : '', 'bank' => isset($daten["bank"]) ? $daten["bank"] : '', 'bank_code' => isset($daten["bank_code"]) ? $daten["bank_code"] : '', 'iban' => isset($daten["iban"]) ? $daten["iban"] : '', 'bic' => isset($daten["bic"]) ? $daten["bic"] : '', 'headcount' => isset($daten["headcount"]) ? $daten["headcount"] : '', 'direct_debit' . (isset($daten['direct_debit']) ? $daten['direct_debit'] : '') => "checked", 'account_number' => isset($daten["account_number"]) ? $daten["account_number"] : '', 'terms' => isset($daten["terms"]) ? $daten["terms"] : '', 'kreditlim' => isset($daten["creditlimit"]) ? $daten["creditlimit"] : '', 'umsatz' => isset($daten["umsatz"]) ? $daten["umsatz"] : '', 'op' => isset($daten["op"]) ? $daten["op"] : '', 'preisgrp' => isset($daten["preisgroup"]) ? $daten["preisgroup"] : '', 'IMG' => $Image, 'grafik' => isset($daten["grafik"]) ? $daten["grafik"] : '', 'init' => $employee, 'login' => $_SESSION["login"], 'employee' => $_SESSION["loginCRM"], 'password' => isset($_SESSION["password"]) ? $_SESSION["password"] : '', 'txid' . (isset($daten["taxzone_id"]) ? $daten["taxzone_id"] : '') => "selected", 'GEODB' => $_SESSION['GEODB'] == 't' ? '1==1' : '1>2', 'GEOS' => $_SESSION['GEODB'] == 't' ? "visible" : "hidden", 'GEO1' => $_SESSION['GEODB'] == 't' ? '' : "!--", 'GEO2' => $_SESSION['GEODB'] == 't' ? '' : "--", 'BLZ1' => $_SESSION['BLZDB'] == 't' ? '' : "!--", 'BLZ2' => $_SESSION['BLZDB'] == 't' ? '' : "--", 'cvars' => isset($daten['id']) ? cvar_edit($daten["id"]) : '', 'variablen' => $varablen));
    $jahre = getUmsatzJahre($typ == "C" ? "ar" : "ap");
    doBlock($t, "fa1", "YearListe", "YL", $jahre, "year", "year", $daten["year"]);
    $lang = getLanguage();
    doBlock($t, "fa1", "LAnguage", "LA", $lang, "id", "description", $daten["language_id"]);
    $kdtyp = getBusiness();
    doBlock($t, "fa1", "TypListe", "BT", $kdtyp, "id", "description", $daten["business_id"]);
    $lead = getLeads();
    doBlock($t, "fa1", "LeadListe", "LL", $lead, "id", "lead", $daten["lead"]);
    if (isset($daten['id'])) {
        $shiptos = getAllShipto($daten["id"], $typ);
        doBlock($t, "fa1", "shiptos", "ST", $shiptos, "shipto_id", array("shiptoname", "shiptostreet", "shiptocity"), false);
    }
    $anreden = getAnreden();
    doBlock($t, "fa1", "anreden", "A", $anreden, "greeting", "greeting", isset($daten["greeting"]) ? $daten["greeting"] : '');
    $payment = getPayment();
    doBlock($t, "fa1", "payment", "P", $payment, "id", "description", isset($daten["payment_id"]) ? $daten["payment_id"] : '');
    $branchen = getBranchen();
    doBlock($t, "fa1", "branchen", "BR", $branchen, "branche", "branche", isset($daten["branche"]) ? $daten["branche"] : '');
    $bundesland = getBundesland(strtoupper($daten["country"]));
    doBlock($t, "fa1", "buland", "BL", $bundesland, "id", "bundesland", isset($daten["bland"]) ? $daten["bland"] : '');
    $curr = getCurrencies();
    doBlock($t, "fa1", "currency", "C", $curr, "id", "name", isset($daten["currency_id"]) ? $daten["currency_id"] : '');
    $cvars = getCvars();
    $t->set_block('fa1', 'cvarListe', 'BlockCV');
    if ($cvars) {
        $i = 1;
        foreach ($cvars as $cvar) {
            switch ($cvar["type"]) {
                case "bool":
                    $fld = "<input type='checkbox' name='vc_cvar_" . $cvar["name"] . "' value='t'";
                    if (isset($daten["vc_cvar_" . $cvar["name"]]) and $daten["vc_cvar_" . $cvar["name"]] == "t") {
                        $fld .= " checked";
                    }
                    $fld .= ">";
                    break;
                case "date":
                    $fld = "<input type='text' name='vc_cvar_" . $cvar["name"] . "' size='10' value='";
                    $fld .= db2date($daten["vc_cvar_" . $cvar["name"]]) . "' id='cvar_" . $cvar["name"] . "'>";
                    $fld .= "<input name='cvar_" . $cvar["name"] . "_button' id='cvar_" . $cvar["name"] . "_trigger' type='button' value='?'>";
                    $fld .= '<script type="text/javascript"><!-- ' . "\n";
                    $fld .= 'Calendar.setup({ inputField : "cvar_' . $cvar["name"] . '",';
                    $fld .= 'ifFormat   : "%d.%m.%Y",';
                    $fld .= 'align      : "BL",';
                    $fld .= 'button     : "cvar_' . $cvar["name"] . '_trigger"});';
                    $fld .= "\n" . '--></script>' . "\n";
                    break;
                case "select":
                    $o = explode("##", $cvar["options"]);
                    $fld = "<select name='vc_cvar_" . $cvar["name"] . "'>\n<option value=''>---------\n";
                    foreach ($o as $tmp) {
                        $fld .= "<option value='{$tmp}'";
                        if ($daten["vc_cvar_" . $cvar["name"]] == $tmp) {
                            $fld .= " selected";
                        }
                        $fld .= ">{$tmp}\n";
                    }
                    $fld .= "</select>";
                    break;
                case "customer":
                    $name = getCvarName($daten['vc_cvar_' . $cvar['name']]);
                    $fld = "<input type='hidden' name='vc_cvar_" . $cvar["name"] . "' value='";
                    $fld .= $daten['vc_cvar_' . $cvar['name']] . "'>";
                    $fld .= $name . ' (' . $daten['vc_cvar_' . $cvar['name']] . ')';
                    break;
                default:
                    $fld = '<input type="text" name="vc_cvar_' . $cvar['name'] . '" value="';
                    $fld .= $daten['vc_cvar_' . $cvar['name']] . '">';
            }
            $t->set_var(array('varlable' . $i => $cvar["description"], 'varfld' . $i => $fld));
            if ($i == 1) {
                $i = 2;
            } else {
                $i = 1;
                $t->parse('BlockCV', 'cvarListe', true);
            }
        }
        if ($i == 2) {
            $t->set_var(array('varlable2' => "", 'varfld2' => ""));
            $t->parse('BlockCV', 'cvarListe', true);
        }
    }
    if (!$suchmaske) {
        $bundesland = getBundesland(strtoupper($daten["shiptocountry"]));
        doBlock($t, "fa1", "buland2", "BS", $bundesland, "id", "bundesland", $daten["shiptobland"]);
        $employees = getAllUser(array(0 => true, 1 => "%"));
        doBlock($t, "fa1", "SalesmanListe", "SM", $employees, "id", "name", $daten["salesman_id"]);
        /* Check if the user is allowed to change the access group - Behaviour changed by DO:
           Let (all) users change the group if none is set yet */
        if (!isset($daten["employee"]) || $daten["employee"] == $_SESSION["loginCRM"] || $daten["modemployee"] == $_SESSION["loginCRM"]) {
            $first[] = array("grpid" => "", "rechte" => "w", "grpname" => ".:public:.");
            $first[] = array("grpid" => $_SESSION["loginCRM"], "rechte" => "w", "grpname" => ".:personal:.");
            $grps = getGruppen();
            if ($grps) {
                $user = array_merge($first, $grps);
            } else {
                $user = $first;
            }
            doBlock($t, "fa1", "OwenerListe", "OL", $user, "grpid", "grpname", $daten["owener"]);
        } else {
            $user[0] = array("grpid" => $daten["owener"], "grpname" => $daten["owener"] ? getOneGrp($daten["owener"]) : ".:public:.");
            doBlock($t, "fa1", "OwenerListe", "OL", $user, "grpid", "grpname", $daten["owener"]);
            /*$t->set_var(array(
                  grpid => $daten["owener"],
                  Gsel => "selected",
                  Gname => ($daten["owener"])?getOneGrp($daten["owener"]):".:public:.",
              ));
              $t->parse("Block","OwenerListe",true);*/
        }
    }
    //if (!$suchmaske)
}
Exemple #8
-1
 function getData()
 {
     //echo "export - get data";
     global $smarty;
     global $siUrl;
     switch ($this->module) {
         case "statement":
             $invoice = new invoice();
             $invoice->biller = $this->biller_id;
             $invoice->customer = $this->customer_id;
             if ($this->filter_by_date == "yes") {
                 if (isset($this->start_date)) {
                     $invoice->start_date = $this->start_date;
                 }
                 if (isset($this->end_date)) {
                     $invoice->end_date = $this->end_date;
                 }
                 if (isset($this->start_date) and isset($this->end_date)) {
                     $invoice->having = "date_between";
                 }
                 $having_count = 1;
             }
             if ($this->show_only_unpaid == "yes") {
                 if ($having_count == 1) {
                     $invoice->having_and = "money_owed";
                 } else {
                     $invoice->having = "money_owed";
                 }
             }
             $invoice_all = $invoice->select_all('count');
             $invoices = $invoice_all->fetchAll();
             foreach ($invoices as $i => $row) {
                 $statement['total'] = $statement['total'] + $row['invoice_total'];
                 $statement['owing'] = $statement['owing'] + $row['owing'];
                 $statement['paid'] = $statement['paid'] + $row['INV_PAID'];
             }
             $templatePath = "./templates/default/statement/index.tpl";
             $biller_details = getBiller($this->biller_id);
             $customer_details = getCustomer($this->customer_id);
             $this->file_name = "statement_" . $this->biller_id . "_" . $this->customer_id . "_" . $invoice->start_date . "_" . $invoice->end_date;
             $smarty->assign('biller_id', $biller_id);
             $smarty->assign('biller_details', $biller_details);
             $smarty->assign('customer_id', $customer_id);
             $smarty->assign('customer_details', $customer_details);
             $smarty->assign('show_only_unpaid', $show_only_unpaid);
             $smarty->assign('filter_by_date', $this->filter_by_date);
             $smarty->assign('invoices', $invoices);
             $smarty->assign('start_date', $this->start_date);
             $smarty->assign('end_date', $this->end_date);
             $smarty->assign('invoices', $invoices);
             $smarty->assign('statement', $statement);
             $data = $smarty->fetch("." . $templatePath);
             break;
         case "payment":
             $payment = getPayment($this->id);
             /*Code to get the Invoice preference - so can link from this screen back to the invoice - START */
             $invoice = getInvoice($payment['ac_inv_id']);
             $biller = getBiller($payment['biller_id']);
             $logo = getLogo($biller);
             $logo = str_replace(" ", "%20", $logo);
             $customer = getCustomer($payment['customer_id']);
             $invoiceType = getInvoiceType($invoice['type_id']);
             $customFieldLabels = getCustomFieldLabels();
             $paymentType = getPaymentType($payment['ac_payment_type']);
             $preference = getPreference($invoice['preference_id']);
             $smarty->assign("payment", $payment);
             $smarty->assign("invoice", $invoice);
             $smarty->assign("biller", $biller);
             $smarty->assign("logo", $logo);
             $smarty->assign("customer", $customer);
             $smarty->assign("invoiceType", $invoiceType);
             $smarty->assign("paymentType", $paymentType);
             $smarty->assign("preference", $preference);
             $smarty->assign("customFieldLabels", $customFieldLabels);
             $smarty->assign('pageActive', 'payment');
             $smarty->assign('active_tab', '#money');
             $css = $siUrl . "/templates/invoices/default/style.css";
             $smarty->assign('css', $css);
             $templatePath = "./templates/default/payments/print.tpl";
             $data = $smarty->fetch("." . $templatePath);
             break;
         case "invoice":
             $invoice = invoice::select($this->id);
             $invoice_number_of_taxes = numberOfTaxesForInvoice($this->id);
             $customer = getCustomer($invoice['customer_id']);
             $biller = biller::select($invoice['biller_id']);
             $preference = getPreference($invoice['preference_id']);
             $defaults = getSystemDefaults();
             $logo = getLogo($biller);
             $logo = str_replace(" ", "%20", $logo);
             $invoiceItems = invoice::getInvoiceItems($this->id);
             $spc2us_pref = str_replace(" ", "_", $invoice['index_name']);
             $this->file_name = $spc2us_pref;
             $customFieldLabels = getCustomFieldLabels();
             /*Set the template to the default*/
             $template = $defaults['template'];
             $templatePath = "./templates/invoices/{$template}/template.tpl";
             $template_path = "../templates/invoices/{$template}";
             $css = $siUrl . "/templates/invoices/{$template}/style.css";
             $pluginsdir = "./templates/invoices/{$template}/plugins/";
             //$smarty = new Smarty();
             $smarty->plugins_dir = $pluginsdir;
             $pageActive = "invoices";
             $smarty->assign('pageActive', $pageActive);
             if (file_exists($templatePath)) {
                 //echo "test";
                 $smarty->assign('biller', $biller);
                 $smarty->assign('customer', $customer);
                 $smarty->assign('invoice', $invoice);
                 $smarty->assign('invoice_number_of_taxes', $invoice_number_of_taxes);
                 $smarty->assign('preference', $preference);
                 $smarty->assign('logo', $logo);
                 $smarty->assign('template', $template);
                 $smarty->assign('invoiceItems', $invoiceItems);
                 $smarty->assign('template_path', $template_path);
                 $smarty->assign('css', $css);
                 $smarty->assign('customFieldLabels', $customFieldLabels);
                 $data = $smarty->fetch("." . $templatePath);
             }
             break;
     }
     return $data;
 }