<?php
 namespace App\Reports\Sources\SupplierInvoiceRows; class PopulateLoopRecords extends \App\Reports\Sources\PopulateLoopRecordsAbstract { protected array $processStandardColumns = [ 'supp_bankAccountNumber', 'supp_bankAccountBankId', 'supp_bankAccountBankName', 'supp_bankAccountBankOfficeId', 'supp_bankAccountBankOfficeName', ]; protected function updateReportStdColumns(array $currentRow) :array { $tableColumns = $this->columnsManager->getStdColumns(); $updateColumns = []; if ($currentRow['supp_bankAccountId']) { $suppObj = new \App\ReportsData\EntityFields\Supplier($currentRow['supp_originalId']); $suppBas = $suppObj->getValue('bankAccounts'); $baDet = $suppBas[$currentRow['supp_bankAccountId']]; if ($suppBas and $baDet) { if ($tableColumns['supp_bankAccountNumber']) { $updateColumns['supp_bankAccountNumber'] = $baDet['account']; } if ($tableColumns['supp_bankAccountBankId']) { $updateColumns['supp_bankAccountBankId'] = $baDet['idBank']; } if ($tableColumns['supp_bankAccountBankName'] and $baDet['idBank']) { $bankObj = new \App\ReportsData\EntityFields\Bank($baDet['idBank']); $updateColumns['supp_bankAccountBankName'] = $bankObj->getValue('nameStd'); } if ($tableColumns['supp_bankAccountBankOfficeId']) { $updateColumns['supp_bankAccountBankOfficeId'] = $baDet['idBankOffice']; } if ($tableColumns['supp_bankAccountBankOfficeName'] and $baDet['idBankOffice']) { $bankOffObj = new \App\ReportsData\EntityFields\BankOffice($baDet['idBankOffice']); $updateColumns['supp_bankAccountBankOfficeName'] = $bankOffObj->getValue('nameStd'); } } } return $updateColumns; } } 