<?php
 namespace App\Reports\Sources\SupplierInvoices; class PopulateLoopRecords extends \App\Reports\Sources\PopulateLoopRecordsAbstract { protected array $processStandardColumns = [ 'supplierBankAccountNumber', 'supplierBankAccountBankId', 'supplierBankAccountBankName', 'supplierBankAccountBankOfficeId', 'supplierBankAccountBankOfficeName', ]; protected function updateReportStdColumns(array $currentRow) :array { $tableColumns = $this->columnsManager->getStdColumns(); $updateColumns = []; if ($currentRow['supplierBankAccountId']) { $suppObj = new \App\ReportsData\EntityFields\Supplier($currentRow['supplierOriginalId']); $suppBas = $suppObj->getValue('bankAccounts'); $baDet = $suppBas[$currentRow['supplierBankAccountId']]; if ($suppBas and $baDet) { if ($tableColumns['supplierBankAccountNumber']) { $updateColumns['supplierBankAccountNumber'] = $baDet['account']; } if ($tableColumns['supplierBankAccountBankId']) { $updateColumns['supplierBankAccountBankId'] = $baDet['idBank']; } if ($tableColumns['supplierBankAccountBankName'] and $baDet['idBank']) { $bankObj = new \App\ReportsData\EntityFields\Bank($baDet['idBank']); $updateColumns['supplierBankAccountBankName'] = $bankObj->getValue('nameStd'); } if ($tableColumns['supplierBankAccountBankOfficeId']) { $updateColumns['supplierBankAccountBankOfficeId'] = $baDet['idBankOffice']; } if ($tableColumns['supplierBankAccountBankOfficeName'] and $baDet['idBankOffice']) { $bankOffObj = new \App\ReportsData\EntityFields\BankOffice($baDet['idBankOffice']); $updateColumns['supplierBankAccountBankOfficeName'] = $bankOffObj->getValue('nameStd'); } } } return $updateColumns; } } 