Added Address Invoice view
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -301,13 +301,27 @@ class InvoiceModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("owner_id", $filter)) {
|
||||
$owner_id = $filter['owner_id'];
|
||||
if(is_numeric($owner_id)) {
|
||||
$where .= " AND Invoice.owner_id=$owner_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("billingaddress_id", $filter)) {
|
||||
$Invoiceaddress_id = $filter['billingaddress_id'];
|
||||
if(is_numeric($Invoiceaddress_id)) {
|
||||
$where .= " AND Invoice.billingaddress_id=$Invoiceaddress_id";
|
||||
$billingaddress_id = $filter['billingaddress_id'];
|
||||
if(is_numeric($billingaddress_id)) {
|
||||
$where .= " AND Invoice.billingaddress_id=$billingaddress_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("owner_or_billingaddress_id", $filter)) {
|
||||
$address_id = $filter['owner_or_billingaddress_id'];
|
||||
if(is_numeric($address_id)) {
|
||||
$where .= " AND (Invoice.owner_id=$address_id OR Invoice.billingaddress_id=$address_id)";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("customer_number", $filter)) {
|
||||
$customer_number = $filter['customer_number'];
|
||||
if(is_numeric($customer_number)) {
|
||||
|
||||
Reference in New Issue
Block a user