Added Address Invoice view

This commit is contained in:
Frank Schubert
2024-07-10 19:10:51 +02:00
parent bf4b294ca6
commit 2094fd66a2
5 changed files with 164 additions and 11 deletions

View File

@@ -15,6 +15,9 @@ class InvoiceController extends mfBaseController {
}
protected function indexAction() {
if(!$this->me->is("Billing")) {
$this->redirect("Dashboard");
}
$this->layout()->setTemplate("Invoice/Index");
if ($this->request->resetFilter) {
@@ -99,6 +102,7 @@ class InvoiceController extends mfBaseController {
$ifile = InvoiceFileModel::createFromInvoice($invoice);
if(!$ifile) {
$this->layout()->setFlash("Fehler beim PDF erstellen");
$this->redirect("Invoice");
}
$pdf = $ifile->file;
}
@@ -106,8 +110,9 @@ class InvoiceController extends mfBaseController {
$pdf_path = $pdf->getFullPath();
$filename = $pdf->filename;
if(!file_exists($filename)) {
if(!file_exists($pdf_path)) {
$this->layout()->setFlash("PDF-Datei nicht gefunden");
$this->redirect("Invoice");
}
header('Content-Type: application/octet-stream');
@@ -177,6 +182,10 @@ class InvoiceController extends mfBaseController {
protected function runInvoicingAction() {
if(!$this->me->is("Billing")) {
$this->redirect("Dashboard");
}
$i = 0;
$p = 0;
@@ -564,6 +573,9 @@ class InvoiceController extends mfBaseController {
}
protected function exportBmdAction() {
if(!$this->me->is("Billing")) {
$this->redirect("Dashboard");
}
/*
* satzart;konto;gkonto;belegnr;belegdatum;buchsymbol;buchcode;prozent;steuercode;betrag;steuer;text;kost;bank-iban-nr;bank-swiftcode;bank-mandatsid;bank-mandatsdatum;bank-mandatskz;bank-letztereinzug;zvsperre;bankeinzug
* 0;234941;40010;TEST-1;23.01.2024;AR;1;20;1;1,2;-0,2;RNTEST-01;;AT293828200003027919;RZSTAT2G282;KJ2813;13.01.2023;0;;0;1
@@ -695,6 +707,10 @@ class InvoiceController extends mfBaseController {
}
protected function sendInvoicesAction() {
if(!$this->me->is("Billing")) {
$this->redirect("Dashboard");
}
$r = $this->request;
$type = $r->type;
@@ -751,6 +767,10 @@ class InvoiceController extends mfBaseController {
}
public function printInvoices() {
if(!$this->me->is("Billing")) {
$this->redirect("Dashboard");
}
$start = $this->request->delivery_start_date;
$end = $this->request->delivery_end_date;
@@ -819,19 +839,15 @@ class InvoiceController extends mfBaseController {
$pdf_unite_cmd = PDFUNITE_BIN_PATH." '$src_file' '$file' '$tmp_file'";
}
//echo "$pdf_unite_cmd\n<br />";
shell_exec($pdf_unite_cmd);
$i++;
}
//exit;
rename($tmp_file, $output_filepath);
unlink($tmp_file1);
unlink($tmp_file2);
//exit;
if(!file_exists($output_filepath)) {
$this->layout()->setFlash("Fehler beim PDFs zusammenführen: Ausgabedatei nicht gefunden", "error");
$this->redirect("Invoice");