Invoice optival change & Voicenumber billing fix

This commit is contained in:
Frank Schubert
2024-07-07 14:57:41 +02:00
parent 564d5c53b5
commit 02d50ab835
6 changed files with 141 additions and 120 deletions
+5 -1
View File
@@ -1,6 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head><title>Xinon Rechnung</title></head> <head>
<title>Xinon Rechnung</title>
<meta charset="utf-8" />
</head>
<body style="border:0; margin: 0;font-family: sans-serif, Verdana;font-size: 11px;" onload="subst()"> <body style="border:0; margin: 0;font-family: sans-serif, Verdana;font-size: 11px;" onload="subst()">
<script> <script>
@@ -30,6 +33,7 @@
<span>XINON GmbH | Fladnitz 150 | 8322 Studenzen</span><br> <span>XINON GmbH | Fladnitz 150 | 8322 Studenzen</span><br>
<span>Tel.: +43 3115 40800 | E-Mail: office@xinon.at</span><br> <span>Tel.: +43 3115 40800 | E-Mail: office@xinon.at</span><br>
<span>UID: ATU68711968 | FN: 416556h | LG: Feldbach</span><br> <span>UID: ATU68711968 | FN: 416556h | LG: Feldbach</span><br>
<span>IBAN: {{ bank_iban }} | BIC: {{ bank_bic }}</span><br>
</div> </div>
<div style="text-align: right">Seite <span class="page"></span> von <span class="topage"></span></div> <div style="text-align: right">Seite <span class="page"></span> von <span class="topage"></span></div>
+1
View File
@@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<title>XINON Invoice Header</title> <title>XINON Invoice Header</title>
<meta charset="utf-8" />
<style> <style>
body { body {
border: 0; border: 0;
+95 -108
View File
@@ -18,7 +18,7 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
<html> <html>
<head> <head>
<title>Rechnung</title> <title>Rechnung</title>
<meta charset="utf-8"/> <meta charset="utf-8" />
<!-- <link href="--> <!-- <link href="-->
<?php //= self::getResourcePath() ?><!--assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />--> <?php //= self::getResourcePath() ?><!--assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />-->
@@ -26,7 +26,7 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
body { body {
margin-top: 0; margin-top: 0;
/*padding-top: 20pt;*/ /*padding-top: 20pt;*/
font-family: sans-serif, Verdana; font-family: "Open Sans", sans-serif, Verdana;
font-size: 12px; font-size: 12px;
} }
@@ -35,7 +35,7 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
} }
.uneven { .uneven {
background-color: #e1e1e1; background-color: #ebebeb;
} }
@@ -66,6 +66,15 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
font-size: 11px; font-size: 11px;
} }
tr.position td {
vertical-align: top;
}
tr.position td:first-child {
vertical-align: middle !important;
padding-left: 2pt;
}
#invoiceTable tr td:first-child { #invoiceTable tr td:first-child {
max-width: 200pt; max-width: 200pt;
} }
@@ -77,21 +86,22 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
<body> <body>
<div> <div>
<h2 style="text-align: center;color: #005384">Ihre Xinon Rechnung vom <?=date("d.m.Y",$invoice->invoice_date)?></h2> <h2 style="text-align: center;color: #005384">Ihre Xinon <?=($is_credit) ? "Gutschrift" : "Rechnung"?> vom <?=date("d.m.Y",$invoice->invoice_date)?></h2>
<table style="border-collapse: collapse; width: 100%;" id="invoiceTable"> <table style="border-collapse: collapse; width: 100%;" id="invoiceTable">
<tr style="font-weight: bold; border-bottom: 1px solid black;" class="uneven"> <tr style="font-weight: bold; border-bottom: 1px solid black;" class="uneven">
<th style="text-align: center">Dienstleistung</th> <th style="text-align: center">Dienstleistung</th>
<th style="text-align: center">Zeitraum</th> <th style="text-align: center">Zeitraum</th>
<th style="text-align: center">Preis</th> <th style="text-align: right">Preis</th>
<th style="text-align: center;">Menge</th> <th style="text-align: center;">Menge</th>
<th style="text-align: center">Netto €</th> <th style="text-align: right">Netto €</th>
<th style="text-align: center">Ust. %</th> <th style="text-align: right">Ust. %</th>
<th style="text-align: center;">Brutto €</th> <th style="text-align: right; padding-right: 4pt">Brutto €</th>
</tr> </tr>
<?php <?php
$i = 0; $i = 0;
foreach($invoice->positions as $p): foreach($invoice->positions as $p):
$timerange_month_only = $p->getOption('timerange_month_only');
$start_date = new DateTime($p->start_date); $start_date = new DateTime($p->start_date);
$end_date = new DateTime($p->end_date); $end_date = new DateTime($p->end_date);
$amount = (float) number_format($p->amount, 3, ",", "."); $amount = (float) number_format($p->amount, 3, ",", ".");
@@ -102,140 +112,117 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
?> ?>
<tr class="<?=($i%2 == 0) ? "even" : "uneven" ?>"> <tr class="position <?=($i%2 == 0) ? "even" : "uneven" ?>">
<td><?=$p->product_name?></td> <td>
<?=$p->product_name?>
<?php if($p->matchcode): ?>
<div style="padding-left: 12pt"><?=$p->matchcode?></div>
<?php endif; ?>
</td>
<td style="text-align: center;"> <td style="text-align: center;">
<?= $p->billing_period > 1 ? <?php if($timerange_month_only): ?>
$start_date->format("m.Y") . " - " . $end_date->format("m.Y") : <?=$start_date->format("m.Y")?>
$start_date->format("d.m.Y") . " - " . $end_date->format("d.m.Y") <?php elseif($p->billing_period > 1): ?>
?> <?=$start_date->format("m.Y")?> - <?=$end_date->format("m.Y") ?>
<?php else: ?>
<?php if($start_date->format("d.m.Y") == $end_date->format("d.m.Y")): ?>
<?=$start_date->format("d.m.Y")?>
<?php else: ?>
<?=$start_date->format("d.m.Y")?> - <?=$end_date->format("d.m.Y") ?>
<?php endif; ?>
<?php endif; ?>
</td> </td>
<td><?=$price?> €</td> <td><?=$price?> €</td>
<td style="text-align: center"><?=$amount?></td> <td style="text-align: center"><?=$amount?></td>
<td><?=$price_total?> €</td> <td><?=$price_total?> €</td>
<td style="text-align: right;"><?=$vatrate?>%</td> <td style="text-align: right;"><?=$vatrate?>%</td>
<td><?=$price_gross?> €</td> <td style="padding-right: 2pt;"><?=$price_gross?> €</td>
</tr> </tr>
<?php if($p->matchcode): ?> <?php if($p->matchcode): ?>
<tr class="additionalRow <?=($i%2 == 0) ? "even" : "uneven" ?>"> <!--tr class="additionalRow <?=($i%2 == 0) ? "even" : "uneven" ?>">
<td colspan="7"><?=$p->matchcode?></td> <td colspan="7"><?=$p->matchcode?></td>
</tr> </tr-->
<?php endif; <?php endif;
$i++; $i++;
endforeach; endforeach;
?> ?>
<tr style="font-weight: bold; background-color: #e1e1e1; border-bottom: 1px solid black;border-top: 1px solid black"> <tr style="font-weight: bold; background-color: #ebebeb; border-bottom: 1px solid black;border-top: 1px solid black">
<td colspan="5">Gesamt Netto:</td> <td colspan="5">Gesamt Netto:</td>
<td colspan="2" style="text-align: right;"><?=number_format($net_total, 2, ",","."). " €"?></td> <td colspan="2" style="text-align: right; padding-right: 2pt;"><?=number_format($net_total, 2, ",","."). " €"?></td>
</tr> </tr>
<?php foreach ($vat as $rate => $vat_total): ?> <?php foreach ($vat as $rate => $vat_total): ?>
<?php if($vat_total > 0): ?> <?php if($rate > 0): ?>
<tr style="font-size: 11px;border-bottom: 1px solid black;"> <tr style="font-size: 11px;border-bottom: 1px solid black;">
<td colspan="5">USt. <?=$rate?>%:</td> <td colspan="5">USt. <?=$rate?>%:</td>
<td colspan="2" style="text-align: right"><?=number_format($vat_total, 2, ",","."). " €"?></td> <td colspan="2" style="text-align: right; padding-right: 2pt;"><?=number_format($vat_total, 2, ",","."). " €"?></td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
<!-- double underline border on bottom --> <!-- double underline border on bottom -->
<tr style="font-weight: bold; border-bottom: 3px double black; background-color: #e1e1e1;"> <tr style="font-weight: bold; border-bottom: 3px double black; background-color: #ebebeb;">
<td colspan="5">Gesamt Brutto:</td> <td colspan="5">Gesamt Brutto:</td>
<td colspan="2" style="text-align: right"><?=number_format($gross_total, 2, ",","."). " €"?></td> <td colspan="2" style="text-align: right; padding-right: 2pt;"><?=number_format($gross_total, 2, ",","."). " €"?></td>
</tr> </tr>
</table> </table>
<!-- TODO: ADD CALL DETAIL SECTION-->
<!--
<div style="margin-top: 20pt;">
<h3 style="color: #005384;margin-bottom: 0">Zusammenfassung für 0800 / 498748</h3>
<div style="margin-bottom: 16px">(01.01.2021 - 31.01.2021)</div>
<table style="border-collapse: collapse; width: 100%;">
<tr style="text-align: left;" class="uneven">
<th>Ziel</th>
<th>Preis pro Minute</th>
<th>Dauer</th>
<th style="text-align: right">Netto €</th>
<th style="text-align: right">Brutto €</th>
</tr>
<tr>
<td>Österreich Festnetz</td>
<td>0,05 €</td>
<td>01:40:00</td>
<td style="text-align: right">5,00 €</td>
<td>6,00 €</td>
</tr>
<tr class="uneven">
<td>Österreich Festnetz</td>
<td>0,05 €</td>
<td>01:40:00</td>
<td style="text-align: right">5,00 €</td>
<td>6,00 €</td>
</tr>
<tr>
<td>Österreich Festnetz</td>
<td>0,05 €</td>
<td>01:40:00</td>
<td style="text-align: right">5,00 €</td>
<td>6,00 €</td>
</tr>
<tr class="uneven">
<td>Österreich Festnetz</td>
<td>0,05 €</td>
<td>01:40:00</td>
<td style="text-align: right">5,00 €</td>
<td>6,00 €</td>
</tr>
</table>
</div>
<div style="margin-top: 20pt;"> <div style="margin-top: 20pt;">
<h3 style="color: #005384;margin-bottom: 0">Zusammenfassung für 0800 / 498748</h3> <?php if($invoice->tax_text): ?>
<div style="margin-bottom: 16px">(01.01.2021 - 31.01.2021)</div> <p style="font-weight: bold;"><?=$invoice->tax_text?></p>
<?php endif; ?>
<table style="border-collapse: collapse; width: 100%;"> <?php if($is_credit): ?>
<tr style="text-align: left;" class="uneven"> <p style="color: #FF0000; font-weight: bold">Gutschrift! Bitte nicht überweisen.</p>
<th>Ziel</th> <?php elseif($invoice->billing_type == "sepa"): ?>
<th>Preis pro Minute</th> <p style="color: #FF0000; font-weight: bold">BITTE NICHT EINZAHLEN, DER BETRAG WIRD AUTOMATISCH VON IHREM KONTO ABGEBUCHT !</p>
<th>Dauer</th> <?php else: ?>
<th style="text-align: right">Netto €</th> Bitte <b>überweisen</b> Sie den Rechnungsbetrag bis zum <b><?=(new DateTime("@".$invoice->invoice_date))->modify("+14 days")->format("d.m.Y")?></b> auf folgendes Konto:<br />
<th style="text-align: right">Brutto €</th> <b style="padding-left: 4pt;">IBAN: <?=$bank_iban?></b><br />
</tr> <b style="padding-left: 4pt;">BIC: <?=$bank_bic?></b><br /><br />
<tr> Bitte geben Sie als Verwendungszweck unbedingt die Rechnungsnummer an, nur so können wir Ihre Zahlung eindeutig zuordnen
<td>Österreich Festnetz</td> <?php endif; ?>
<td>0,05 €</td>
<td>01:40:00</td>
<td style="text-align: right">5,00 €</td>
<td>6,00 €</td>
</tr>
<tr class="uneven">
<td>Österreich Festnetz</td>
<td>0,05 €</td>
<td>01:40:00</td>
<td style="text-align: right">5,00 €</td>
<td>6,00 €</td>
</tr>
<tr>
<td>Österreich Festnetz</td>
<td>0,05 €</td>
<td>01:40:00</td>
<td style="text-align: right">5,00 €</td>
<td>6,00 €</td>
</tr>
<tr class="uneven">
<td>Österreich Festnetz</td>
<td>0,05 €</td>
<td>01:40:00</td>
<td style="text-align: right">5,00 €</td>
<td>6,00 €</td>
</tr>
</table>
</div> </div>
-->
<?php if(count($invoice->voicenumbers)): ?>
<?php foreach($invoice->voicenumbers as $voicenumber): ?>
<?php $start_date = new DateTime($voicenumber->start_date); ?>
<div style="margin-top: 20pt;">
<h3 style="color: #005384;margin-bottom: 0">Gesprächsgebühren für <?=preg_replace('/^43/','0', $voicenumber->voicenumber)?></h3>
<div style="margin-bottom: 16px">(<?=$start_date->format("m.Y")?>)</div>
<table style="border-collapse: collapse; width: 100%;">
<tr style="text-align: left;" class="uneven">
<th>Ziel</th>
<th style="text-align: right">Preis pro Minute</th>
<th style="text-align: right; padding-right: 8pt;">Anzahl</th>
<th style="text-align: right;">Dauer</th>
<th style="text-align: right">Netto €</th>
<th style="text-align: right">Brutto €</th>
</tr>
<?php $v = 0; ?>
<?php foreach($voicenumber->zones as $zone): ?>
<?php if($zone->price_total < 0.000000001) continue; ?>
<tr class="<?=($v%2 == 0) ? "even" : "uneven" ?>">
<td><?=$zone->zone?></td>
<td style="text-align: right"><?=number_format($zone->price * 60, 4, ",",".")?> €</td>
<td style="text-align: right; padding-right: 8pt;"><?=number_format($zone->call_count, 0, ",",".")?></td>
<td style="text-align: right"><?=self::getHumanReadableInterval($zone->duration)?></td>
<td style="text-align: right"><?=number_format($zone->price_total, 4, ",",".")?> €</td>
<td style="text-align: right"><?=$zone->price_total_gross?> €</td>
</tr>
<?php $v++; ?>
<?php endforeach; ?>
</table>
</div>
<?php endforeach; ?>
<?php endif; ?>
</body> </body>
</html> </html>
+12 -4
View File
@@ -125,7 +125,7 @@ class BillingController extends mfBaseController {
$this->log->notice(__METHOD__.": $del Billing records deleted"); $this->log->notice(__METHOD__.": $del Billing records deleted");
//$stop = false; //$stop = false;
foreach(ContractModel::search(["finish_date<" => mktime(0,1,0,$now_month, $now_day, $now_year), "cancel_date" => null]) as $contract) { foreach(ContractModel::search(["owner_id" => 783, "finish_date<" => mktime(0,1,0,$now_month, $now_day, $now_year), "cancel_date" => null]) as $contract) {
//while(!$stop) { //while(!$stop) {
//$stop = true; //$stop = true;
//$contract = new Contract(1475); //$contract = new Contract(1475);
@@ -420,14 +420,16 @@ class BillingController extends mfBaseController {
$voicenumbers = VoicenumberModel::search(["contract_id" => $contract->id]); $voicenumbers = VoicenumberModel::search(["contract_id" => $contract->id]);
if(count($voicenumbers)) { if(count($voicenumbers)) {
//var_dump($voicenumbers);exit; //var_dump($voicenumbers);exit;
$voice_start_date = clone $start_date; $voice_start_date = clone $start_date;
$voice_start_date->modify("-1 month"); $voice_start_date->modify("-1 month");
$voice_start_date->setTime(0,0,0); $voice_start_date->setTime(0,0,0);
if($voice_start_date->format("Y-m-d") < "2024-06-01") {
continue;
}
$voice_end_date = clone $voice_start_date; $voice_end_date = clone $voice_start_date;
$voice_end_date->modify("first day of this month"); $voice_end_date->modify("first day of this month");
$voice_end_date->modify("+1 months"); $voice_end_date->modify("+1 months");
@@ -461,7 +463,7 @@ class BillingController extends mfBaseController {
//var_dump($vbill);exit; //var_dump($vbill);exit;
continue; // number was already billed in this period continue; // number was already billed in this period
} }
$calls = VoiceCallHistoryModel::getVoiceCallHistoryAsEntity(["contract_id" => $contract->id, "start" => ["from" => $voice_start_date->getTimestamp(), "to" => $voice_end_date->getTimestamp()]]); $calls = VoiceCallHistoryModel::getVoiceCallHistoryAsEntity(["contract_id" => $contract->id, "voice_account" => $voicenumber->number, "start" => ["from" => $voice_start_date->getTimestamp(), "to" => $voice_end_date->getTimestamp()]]);
foreach ($calls as $call) { foreach ($calls as $call) {
//var_dump($call); //var_dump($call);
$number = $call->voice_account; $number = $call->voice_account;
@@ -487,6 +489,10 @@ class BillingController extends mfBaseController {
$zone = $destination->voiceplanzone; $zone = $destination->voiceplanzone;
if(!$zone) {
die("Keine Zone für Destination ".$dest_nummer." gefunden");
}
//var_dump($zone); //var_dump($zone);
// inc_first - first minimumm duration to bill // inc_first - first minimumm duration to bill
@@ -533,6 +539,7 @@ class BillingController extends mfBaseController {
// save to BillingVoicenumber // save to BillingVoicenumber
foreach($voicebills as $vbnumber => $zones) { foreach($voicebills as $vbnumber => $zones) {
foreach($zones as $zone_id => $vb) { foreach($zones as $zone_id => $vb) {
$vbdata = []; $vbdata = [];
$vbdata["billing_id"] = $billing->id; $vbdata["billing_id"] = $billing->id;
@@ -556,6 +563,7 @@ class BillingController extends mfBaseController {
} }
} }
} }
$v++; $v++;
//var_dump($voicebills);exit; //var_dump($voicebills);exit;
+27 -6
View File
@@ -106,7 +106,14 @@ class InvoiceController extends mfBaseController {
$vat[$p->vatrate] += $p->price_gross - ($p->price * $p->amount); $vat[$p->vatrate] += $p->price_gross - ($p->price * $p->amount);
} }
$pdf_vars = ["invoice" => $invoice, "vat" => $vat]; $pdf_vars = [
"invoice" => $invoice,
"vat" => $vat,
"bank_iban" => TT_INVOICE_BANK_IBAN,
"bank_bic" => TT_INVOICE_BANK_BIC,
"bank_bank"=> TT_INVOICE_BANK_BANK,
"bank_owner" => TT_INVOICE_BANK_OWNER
];
// Replace placeholders in header // Replace placeholders in header
$headerHtml = file_get_contents(BASEDIR . "/Layout/default/Invoice/PDF_HEADER.html"); $headerHtml = file_get_contents(BASEDIR . "/Layout/default/Invoice/PDF_HEADER.html");
@@ -123,25 +130,39 @@ class InvoiceController extends mfBaseController {
$headerHtml = str_replace("{{ vatHtml }}", $invoice->uid ? "<tr><td>Ihre UID:</td><td>" . $invoice->uid . "</td></tr>" : "", $headerHtml); $headerHtml = str_replace("{{ vatHtml }}", $invoice->uid ? "<tr><td>Ihre UID:</td><td>" . $invoice->uid . "</td></tr>" : "", $headerHtml);
$headerHtml = str_replace("{{ qrCodeSrc }}", $this->getBankQRCode($invoice->invoice_number, $invoice->total_gross), $headerHtml); $headerHtml = str_replace("{{ qrCodeSrc }}", $this->getBankQRCode($invoice->invoice_number, $invoice->total_gross), $headerHtml);
$headerFile = BASEDIR . "/var/temp/" . date("U") . "-" . rand(1000, 9999) . ".html"; $headerFile = BASEDIR . "/var/temp/invoice_header-" . date("U") . "-" . rand(1000, 9999) . ".html";
file_put_contents($headerFile, $headerHtml); file_put_contents($headerFile, $headerHtml);
// Replace placeholders in header
$footerHtml = file_get_contents(BASEDIR . "/Layout/default/Invoice/PDF_FOOTER.html");
$footerHtml = str_replace("{{ bank_iban }}", TT_INVOICE_BANK_IBAN_FORMATTED, $footerHtml);
$footerHtml = str_replace("{{ bank_bic }}", TT_INVOICE_BANK_BIC, $footerHtml);
$footerHtml = str_replace("{{ bank_bank }}", TT_INVOICE_BANK_BANK, $footerHtml);
$footerHtml = str_replace("{{ bank_owner }}", TT_INVOICE_BANK_OWNER, $footerHtml);
$footerFile = BASEDIR . "/var/temp/invoice_footer-" . date("U") . "-" . rand(1000, 9999) . ".html";
file_put_contents($footerFile, $footerHtml);
$pdf = new PdfForm("Invoice/PDF_MAIN", $pdf_vars); $pdf = new PdfForm("Invoice/PDF_MAIN", $pdf_vars);
$wkhtmltopdfArgs = "--header-html $headerFile --footer-html " . BASEDIR . "/Layout/default/Invoice/PDF_FOOTER.html"; $wkhtmltopdfArgs = "--header-html $headerFile --footer-html $footerFile";
$pdf->download($invoice->invoice_number . ".pdf", $wkhtmltopdfArgs); $pdf->download($invoice->invoice_number . ".pdf", $wkhtmltopdfArgs);
} }
public function getBankQRCode($paymentReference, $amount) { public function getBankQRCode($paymentReference, $amount) {
$xinonIBAN = "DE89370400440532013000"; $xinonIBAN = TT_INVOICE_BANK_IBAN;
$xinonBIC = "COBADEFFXXX"; $xinonBIC = TT_INVOICE_BANK_BIC;
$xinonOwner = TT_INVOICE_BANK_OWNER;
$epc = "BCD $epc = "BCD
001 001
1 1
SCT SCT
$xinonBIC $xinonBIC
Xinon GmbH $xinonOwner
$xinonIBAN $xinonIBAN
EUR$amount EUR$amount
XINO XINO
@@ -104,7 +104,7 @@ class VoiceCallHistoryModel {
$sql = " AND `start` >= FROM_UNIXTIME(" . $filters['start']['from'] . ") AND `start` <= FROM_UNIXTIME(" . $filters['start']['to'] . ")"; $sql = " AND `start` >= FROM_UNIXTIME(" . $filters['start']['from'] . ") AND `start` <= FROM_UNIXTIME(" . $filters['start']['to'] . ")";
} }
$sql .= isset($filters['uid']) ? Helper::generateFilterCondition($filters['uid'], "uid") : ""; $sql .= isset($filters['uid']) ? Helper::generateFilterCondition($filters['uid'], "uid") : "";
$sql .= isset($filters['voice_account']) ? Helper::generateFilterCondition($filters['voice_account'], "voice_account") : ""; $sql .= isset($filters['voice_account']) ? Helper::generateFilterCondition($filters['voice_account'], "voice_account", true) : "";
$sql .= isset($filters['end']) ? " AND `start` <= '" . $filters['end'] . "'" : ""; $sql .= isset($filters['end']) ? " AND `start` <= '" . $filters['end'] . "'" : "";
$sql .= isset($filters['source']) ? Helper::generateFilterCondition($filters['source'], "source") : ""; $sql .= isset($filters['source']) ? Helper::generateFilterCondition($filters['source'], "source") : "";
$sql .= isset($filters['destination']) ? Helper::generateFilterCondition($filters['destination'], "destination") : ""; $sql .= isset($filters['destination']) ? Helper::generateFilterCondition($filters['destination'], "destination") : "";