small changes to invoice & removed debugging
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
<div id="topSpacer"></div>
|
||||
|
||||
<div style="height: 50px; margin-bottom: 8px">
|
||||
<img alt="Xinon Logo" src="{{ basedir }}/public/assets/images/xinon-full.jpg" style="text-align:left;height: 85px;">
|
||||
<img alt="Xinon Logo" src="{{ basedir }}/public/assets/images/xinon-full.png" style="text-align:left;height: 85px;">
|
||||
</div>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@@ -92,8 +92,8 @@
|
||||
</table>
|
||||
</td>
|
||||
|
||||
<td style="float: right;margin-top:18px">
|
||||
<img alt="QR-Code" src="{{ qrCodeSrc }}" style="text-align:right;height: 85px;">
|
||||
<td style="float: right; vertical-align: top; margin-top: 0; padding-top: 0">
|
||||
<img alt="QR-Code" src="{{ qrCodeSrc }}" style="text-align:right;height: 3.5cm;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -72,7 +72,7 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
|
||||
|
||||
tr.position td:first-child {
|
||||
vertical-align: middle !important;
|
||||
padding-left: 2pt;
|
||||
padding-left: 4pt;
|
||||
}
|
||||
|
||||
#invoiceTable tr td:first-child {
|
||||
@@ -108,7 +108,7 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
|
||||
$price = number_format($p->price, 2, ",",".");
|
||||
$price_total = number_format($p->price_total, 2, ",",".");
|
||||
$price_gross = number_format($p->price_gross, 2, ",",".");
|
||||
$vatrate = number_format($p->vatrate, 2, ",",".");
|
||||
$vatrate = number_format($p->vatrate, 0, ",",".");
|
||||
|
||||
?>
|
||||
|
||||
@@ -137,7 +137,7 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
|
||||
<td style="text-align: center"><?=$amount?></td>
|
||||
<td><?=$price_total?> €</td>
|
||||
<td style="text-align: right;"><?=$vatrate?>%</td>
|
||||
<td style="padding-right: 2pt;"><?=$price_gross?> €</td>
|
||||
<td style="padding-right: 4pt;"><?=$price_gross?> €</td>
|
||||
</tr>
|
||||
<?php if($p->matchcode): ?>
|
||||
<!--tr class="additionalRow <?=($i%2 == 0) ? "even" : "uneven" ?>">
|
||||
@@ -149,15 +149,15 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
|
||||
?>
|
||||
<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="2" style="text-align: right; padding-right: 2pt;"><?=number_format($net_total, 2, ",","."). " €"?></td>
|
||||
<td colspan="2" style="text-align: right; padding-right: 4pt;"><?=number_format($net_total, 2, ",","."). " €"?></td>
|
||||
</tr>
|
||||
|
||||
<?php foreach ($vat as $rate => $vat_total): ?>
|
||||
|
||||
<?php if($rate > 0): ?>
|
||||
<tr style="font-size: 11px;border-bottom: 1px solid black;">
|
||||
<td colspan="5">USt. <?=$rate?>%:</td>
|
||||
<td colspan="2" style="text-align: right; padding-right: 2pt;"><?=number_format($vat_total, 2, ",","."). " €"?></td>
|
||||
<td colspan="5">USt. <?=number_format($rate, 0, ",", ".")?>%:</td>
|
||||
<td colspan="2" style="text-align: right; padding-right: 4pt;"><?=number_format($vat_total, 2, ",","."). " €"?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -166,7 +166,7 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
|
||||
<!-- double underline border on bottom -->
|
||||
<tr style="font-weight: bold; border-bottom: 3px double black; background-color: #ebebeb;">
|
||||
<td colspan="5">Gesamt Brutto:</td>
|
||||
<td colspan="2" style="text-align: right; padding-right: 2pt;"><?=number_format($gross_total, 2, ",","."). " €"?></td>
|
||||
<td colspan="2" style="text-align: right; padding-right: 4pt;"><?=number_format($gross_total, 2, ",","."). " €"?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -180,7 +180,7 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
|
||||
<?php elseif($invoice->billing_type == "sepa"): ?>
|
||||
<p style="color: #FF0000; font-weight: bold">BITTE NICHT EINZAHLEN, DER BETRAG WIRD AUTOMATISCH VON IHREM KONTO ABGEBUCHT !</p>
|
||||
<?php else: ?>
|
||||
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 />
|
||||
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 />
|
||||
<b style="padding-left: 4pt;">IBAN: <?=$bank_iban?></b><br />
|
||||
<b style="padding-left: 4pt;">BIC: <?=$bank_bic?></b><br /><br />
|
||||
Bitte geben Sie als Verwendungszweck unbedingt die Rechnungsnummer an, nur so können wir Ihre Zahlung eindeutig zuordnen
|
||||
@@ -197,23 +197,23 @@ $this->setReturnValue(['filename' => $invoice->invoice_number . ".pdf"]);
|
||||
|
||||
<table style="border-collapse: collapse; width: 100%;">
|
||||
<tr style="text-align: left;" class="uneven">
|
||||
<th>Ziel</th>
|
||||
<th style="padding-left: 4px;">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>
|
||||
<th style="text-align: right; padding-right: 4pt;">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="padding-left: 4px;"><?=$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>
|
||||
<td style="text-align: right; padding-right: 4pt;"><?=$zone->price_total_gross?> €</td>
|
||||
</tr>
|
||||
<?php $v++; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -94,48 +94,43 @@ class BillingController extends mfBaseController {
|
||||
protected function importContractsAction() {
|
||||
$r = $this->request;
|
||||
|
||||
$today = new DateTime("now");
|
||||
$today->setTime(0,0,0);
|
||||
|
||||
//$tomorrow = new DateTime("tomorrow");
|
||||
//$tomorrow->setTime(0,0,0);
|
||||
|
||||
$i = 0;
|
||||
$v = 0;
|
||||
|
||||
//$yearly_not_before = new DateTime("2023-06-01");
|
||||
$today = new DateTime("now");
|
||||
$today->setTime(0,0,0);
|
||||
|
||||
$now_year = date("Y");
|
||||
$now_month = date("m");
|
||||
$now_day = date("d");
|
||||
|
||||
//$now_year = 2024;
|
||||
//$now_month = 6;
|
||||
//$now_day = 3; // XXX for debugging only, must be removed
|
||||
|
||||
// XXX only for 1st Billing after IVT Import
|
||||
//$yearly_not_before = new DateTime("$now_year-$now_month-01");
|
||||
$yearly_not_before = new DateTime("$now_year-06-01");
|
||||
$yearly_not_before = new DateTime("$now_year-$now_month-01");
|
||||
|
||||
$del = 0;
|
||||
// first delete all non-invoiced billing records
|
||||
/*foreach(BillingModel::search(["invoice_id" => null]) as $bill) {
|
||||
foreach(BillingModel::search(["invoice_id" => null]) as $bill) {
|
||||
$bill->delete();
|
||||
$del++;
|
||||
}*/
|
||||
}
|
||||
|
||||
$this->log->notice(__METHOD__.": $del Billing records deleted");
|
||||
//$stop = false;
|
||||
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) {
|
||||
//$stop = true;
|
||||
//$contract = new Contract(1475);
|
||||
|
||||
//var_dump($contract);exit;
|
||||
$contract_search = [
|
||||
"finish_date<" => mktime(2,0,0,$now_month, $now_day, $now_year),
|
||||
"cancel_date_null_or_gte" => mktime(0,0,0,$now_month, 1, $now_year)
|
||||
];
|
||||
|
||||
foreach(ContractModel::search($contract_search) as $contract) {
|
||||
$bill_month = $now_month;
|
||||
$bill_year = $now_year;
|
||||
//$bill_day = $now_day;
|
||||
$bill_date = new DateTime("$bill_year-$bill_month-01");
|
||||
//echo $bill_date->format("Y-m-d H:i:s")."<br>";
|
||||
|
||||
$monthly_bill_period_to = clone($bill_date);
|
||||
$monthly_bill_period_to->modify("last day of this month");
|
||||
|
||||
@@ -165,6 +160,7 @@ class BillingController extends mfBaseController {
|
||||
$cancel_date = false;
|
||||
if($contract->cancel_date) {
|
||||
$cancel_date = new DateTime("@".$contract->cancel_date);
|
||||
$cancel_date->setTimezone(new DateTimeZone("Europe/Vienna"));
|
||||
$cancel_date->setTime(0,0,0);
|
||||
if($cancel_date->format("Y") != $now_year || $cancel_date->format("m") != $now_month) {
|
||||
$cancel_date = false;
|
||||
@@ -301,9 +297,7 @@ class BillingController extends mfBaseController {
|
||||
$eday = $end_date->format("d");
|
||||
|
||||
if ($contract->price && ($sday > 1 || $cancel_date)) {
|
||||
// aliquoter preis
|
||||
$days = ($eday - $sday) + 1;
|
||||
|
||||
// Aliquoten Preis errechnen
|
||||
$first_of_period = clone $start_date;
|
||||
$first_of_period->modify("first day of this month");
|
||||
|
||||
@@ -379,7 +373,7 @@ class BillingController extends mfBaseController {
|
||||
$data["billing_period"] = $contract->billing_period;
|
||||
|
||||
$matchcode = $contract->matchcode;
|
||||
// if voice product and matchcode consists oh phonenumbers only, remove matchcode
|
||||
// if voice product and matchcode consists of phonenumbers only, remove matchcode
|
||||
if(array_key_exists("needs_number", $contract->product->attributes) && $contract->product->attributes["needs_number"] == 1 && preg_match('/^[0-9, ]+$]/', $matchcode)) {
|
||||
$matchcode = "";
|
||||
}
|
||||
@@ -416,8 +410,6 @@ class BillingController extends mfBaseController {
|
||||
/*
|
||||
* Create Voice Billing, if contract has voicenumbers
|
||||
*/
|
||||
|
||||
|
||||
$voicenumbers = VoicenumberModel::search(["contract_id" => $contract->id]);
|
||||
|
||||
if(count($voicenumbers)) {
|
||||
|
||||
@@ -32,7 +32,6 @@ class BillingModel {
|
||||
public $price;
|
||||
public $price_setup;
|
||||
public $vatarea;
|
||||
public $vatrate;
|
||||
public $vatgroup_id;
|
||||
public $billing_period;
|
||||
|
||||
|
||||
@@ -500,12 +500,26 @@ class ContractModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("cancel_date_null_or_gte", $filter)) {
|
||||
$cancel_date = $filter['cancel_date_null_or_gte'];
|
||||
if(is_numeric($cancel_date)) {
|
||||
$where .= " AND (Contract.cancel_date IS NULL OR Contract.cancel_date >= $cancel_date)";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("cancel_date<", $filter)) {
|
||||
$cancel_date = $filter['cancel_date<'];
|
||||
if(is_numeric($cancel_date)) {
|
||||
$where .= " AND Contract.cancel_date <= $cancel_date";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("cancel_date_null_or_lte", $filter)) {
|
||||
$cancel_date = $filter['cancel_date_null_or_lte'];
|
||||
if(is_numeric($cancel_date)) {
|
||||
$where .= " AND (Contract.cancel_date IS NULL OR Contract.cancel_date <= $cancel_date)";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("add-where", $filter)) {
|
||||
$where .= " ".$filter['add-where'];
|
||||
|
||||
|
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.9 MiB |
BIN
public/assets/images/xinon-full.png
Normal file
BIN
public/assets/images/xinon-full.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
Reference in New Issue
Block a user