This commit is contained in:
2022-03-29 16:08:41 +02:00
parent 5cd788c765
commit 98c6814863
4 changed files with 172 additions and 39 deletions
+9 -4
View File
@@ -11,20 +11,25 @@ use Doctrine\ORM\EntityManager;
class CryptoService extends MasterServices
{
public function generate() : DividendsSummary
public function generate() : array
{
$summaryObj = new DividendsSummary($this->manager);
$sum = 0;
$errorArr = [];
foreach ($this->allFiles as $file) {
$extension = pathinfo($file)['extension'];
$tmp = new ReadSheet($file);
$tmp->takeFile();
$a = new Crypto($tmp->getAll()[0]);
dd($a->takeSumTransactions());
$sum += array_sum($a->takeSumTransactions());
$errorArr = array_merge($errorArr, $a->getNotCounted());
}
return $summaryObj;
return [
"sum" => $sum,
"error" => $errorArr
];
}
}