updated Invoice PDF generation task for more performance

This commit is contained in:
Frank Schubert
2024-09-01 19:08:11 +02:00
parent c56b7c238a
commit e770f32bc3
3 changed files with 23 additions and 6 deletions

View File

@@ -837,7 +837,7 @@ class InvoiceController extends mfBaseController {
public function createPDFs($limit = false) {
$invoice_path_base = MFUPLOAD_FILE_SAVE_PATH."/".TT_INVOICE_SAVE_SUBFOLDER;
$created = 0;
foreach(InvoiceModel::getAll() as $invoice) {
foreach(InvoiceModel::search(["invoice_file" => false]) as $invoice) {
if($limit && $created >= $limit) {
return $created;
}