-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathCron.php
More file actions
27 lines (21 loc) · 697 Bytes
/
Copy pathCron.php
File metadata and controls
27 lines (21 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
namespace FacturaScripts\Plugins\POS;
use FacturaScripts\Core\Template\CronClass;
use FacturaScripts\Core\Tools;
use FacturaScripts\Plugins\POS\Model\BorradorPuntoVenta;
class Cron extends CronClass
{
public function run(): void
{
$this->job('delete-point-of-sale-drafts')
->everySundayAt('23')
->run(function () {
foreach (BorradorPuntoVenta::allCompleted() as $operacion) {
$operacion->editable = true;
if (!$operacion->delete()) {
Tools::log('POS')->warning('Error al eliminar operacion pausada');
}
}
});
}
}