<?php
 namespace Modules\Documents\ImportedDocuments\ProcessDocument\Model\InvoiceSuggestions; class Corporate extends GeneralAbstract { protected $partnerDbFieldName = 'inv.idCorporate'; public function search() { $invEntList = new \App\EntityList\Invoices(); $invEntList->setColumns(['invoiceDate']); $invEntList->applyUserRestriction(false); $invEntList->setFilter($this->partnerDbFieldName, '=', $this->idPartner); $invEntList->setFilter('inv.cashedStatus', 'IN', ['n', 'p']); $invEntList->setFilter('inv.voidTime', '=', '0'); $invEntList->setFilter('inv.temporary', '=', '0'); if ($this->invoiceSign=='1') { $invEntList->setFilter('inv.printTotal', '>=', 0); } elseif ($this->invoiceSign=='-1') { $invEntList->setFilter('inv.printTotal', '<', 0); } if (!\App\UserAccess\CurrentUserAccessFast::getInstance()->hasAccessToOption('Modules/Invoices/Cashings/Listing-cashInvoiceNotIssued')) { $invEntList->setFilter('inv.issueTime', '!=', '0'); } $invEntList->setOrderBy('invoiceDate', 'ASC'); $this->invoiceSuggestions = $invEntList->exportRecordsByColumn('id'); } }