use EasyFlow\Master\Controllers\MailController;
use EasyFlow\Novopan\Models\RecepcionDocumentos\Documento;
use EasyFlow\Novopan\Models\RecepcionDocumentos\Responsable;
use EasyFlow\Novopan\Models\RecepcionDocumentos\OtroDocumento;
use EasyFlow\Novopan\Models\RecepcionDocumentos\DocumentoLinea;
require_once dirname(dirname(__DIR__)) . '/includes/configuration.php';
try {
    error_reporting(E_ALL);
    // ======================================================
    // Cron de recepción de facturas de proveedor
    // ======================================================
    // Ejecución de función principal
    generateCronOutput();
    LogController::logCron('Cron ejecutado con éxito (JobDocElecMailChecker.php)', [], 'INFO');
} catch (Exception $e) {
    LogController::logCron('Error al ejecutar cron (JobDocElecMailChecker.php)', ['error' => $e->getMessage()], 'ERROR');
}
//---------------------------------------------------------------------
// Main function
//---------------------------------------------------------------------
function generateCronOutput()
{
    $handlerCommonCore = new \CommonCore();
    // Armar Wrapper HTML
    echo $handlerCommonCore->getPageHeaderHtml("Lector de Correos - Recepción de facturas XML");
    // Armar sección de prerequisitos
    $html = '   <header id="header" class="container">
                    <h1><span class="awe-envelope"></span> Lector de Correos - Recepción de facturas XML</h1>
                    <p>' . date("Y") . '</p>
                </header>
                <section class="container">
Beispiel #2
0
<?php

use EasyFlow\Master\Models\Flow;
use EasyFlow\Master\Models\Task;
use EasyFlow\Master\Models\User;
use EasyFlow\Master\Controllers\LogController;
use EasyFlow\Master\Controllers\MailController;
require_once dirname(__DIR__) . "/includes/configuration.php";
try {
    $flows = Flow::all();
    foreach ($flows as $flow) {
        $admin = User::find($flow->flow_administrator);
        $open_tasks = Task::where('task_flow', $flow->flow_id)->where(function ($query) {
            $query->open();
        })->with(['request', 'step', 'user'])->get();
        $html = view('email.daily_admin_summary', compact('flow', 'admin', 'open_tasks'));
        MailController::sendGeneralMail([["email" => $admin->user_email]], "Resumen de tareas abiertas - " . $flow->flow_name . " - " . date("Y-m-d"), $html);
    }
    LogController::logCron('Cron ejecutado con éxito (JobDailyAdminSummary.php)', [], 'INFO');
} catch (Exception $e) {
    LogController::logCron('Error al ejecutar cron (JobDailyAdminSummary.php)', ['error' => $e->getMessage()], 'ERROR');
}