Enhanced PDF generation with dynamic booking, department, and customer data, improving template variability. Introduced a new cron job and script to sync Economic invoice statuses, ensuring data consistency and error handling in automated tasks.
31 lines
805 B
PHP
31 lines
805 B
PHP
<?php
|
|
/**
|
|
* This script is used to sync the economic invoice status with the database.
|
|
* It is run as a cron job.
|
|
*
|
|
* index.php runs this script.
|
|
*/
|
|
|
|
// prevent direct access
|
|
|
|
use classes\economic;
|
|
|
|
if (!defined('WD')) {
|
|
exit;
|
|
}
|
|
$start = microtime(true);
|
|
// Sync the economic invoice status
|
|
$economic = new economic();
|
|
try {
|
|
$economic->getTasks()->runCheckErrors();
|
|
} catch (Exception $e) {
|
|
// This is automatically running, so we don't need to log the error
|
|
}
|
|
try {
|
|
$economic->getTasks()->runCheckDrafts();
|
|
} catch (Exception $e) {
|
|
// This is automatically running, so we don't need to log the error
|
|
}
|
|
$end = microtime(true);
|
|
//$slack = new \classes\slack();
|
|
//$slack->send_message("The booking sync script has finished. It took " . round($end - $start, 2) . " seconds to run.");
|