Started Invoice Email Delivery
This commit is contained in:
25
scripts/invoice/send-invoice-pdfs.php
Normal file
25
scripts/invoice/send-invoice-pdfs.php
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
//require 'vendor/autoload.php';
|
||||
require("../../config/config.php");
|
||||
|
||||
define('FRONKDB_SQLDEBUG',false);
|
||||
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
|
||||
|
||||
require_once(LIBDIR."/mvcfronk/mfRouter/mfRouter.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseModel.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseController.php");
|
||||
|
||||
$me = new User(1);
|
||||
|
||||
define("INTERNAL_USER_ID", $me->id);
|
||||
define("INTERNAL_USER_USERNAME", $me->username);
|
||||
|
||||
$invoice = InvoiceModel::getFirst(["invoice_number" => "RN2024-X026813"]);
|
||||
var_dump($invoice);
|
||||
$invoice->sendByEmail("jantscher@xinon.at");
|
||||
exit;
|
||||
|
||||
$ic = new InvoiceController();
|
||||
$ic->_sendEmailInvoices();
|
||||
29
scripts/invoice/test-for-missing-pdfs.php
Normal file
29
scripts/invoice/test-for-missing-pdfs.php
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
//require 'vendor/autoload.php';
|
||||
require("../../config/config.php");
|
||||
|
||||
define('FRONKDB_SQLDEBUG',false);
|
||||
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
|
||||
|
||||
require_once(LIBDIR."/mvcfronk/mfRouter/mfRouter.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseModel.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseController.php");
|
||||
|
||||
$me = new User(1);
|
||||
|
||||
|
||||
|
||||
foreach(InvoiceModel::getAll() as $invoice) {
|
||||
$pdf = $invoice->pdf;
|
||||
|
||||
if(!$pdf || !$pdf->id || !$pdf->file_id) {
|
||||
echo $invoice->invoice_number." missing pdf file link\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!file_exists($pdf->file->getFullPath())) {
|
||||
echo $invoice->invoice_number." PDF (".$pdf->file->getFullPath().") file does not exist\n";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user