minor fixes
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Logic\Dividends;
|
||||
|
||||
use App\Helper\Currency;
|
||||
use App\Helper\DataNeed\DividendValues;
|
||||
use ClearTypes;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
|
||||
class SheetData extends SheetDataAll
|
||||
@@ -45,21 +46,27 @@ class SheetData extends SheetDataAll
|
||||
if (count($row) < 1) {
|
||||
continue;
|
||||
}
|
||||
$tmpDate = intval($row['date']);
|
||||
$date = &$row['date'];
|
||||
if (is_int($date)) {
|
||||
if ($tmpDate > 2100) {
|
||||
$date = Date::excelToDateTimeObject($date);
|
||||
} else if (is_string($date)) {
|
||||
} else {
|
||||
$date = new \DateTime(str_replace(".", "-", $date));
|
||||
}
|
||||
if (is_float($row['tax'])) {
|
||||
$row['tax'] = intval(round($row['tax']*100));
|
||||
}
|
||||
|
||||
$dividendObj = new DividendsData();
|
||||
$dividendObj->setCount($row['count']);
|
||||
$dividendObj->setIsin($row['isin']);
|
||||
$dividendObj->setCurrency($row['currency']);
|
||||
$dividendObj->setTax($row['tax']);
|
||||
$dividendObj->setValue($row['value']);
|
||||
|
||||
|
||||
$dividendObj->setTax(ClearTypes::clearInt($row['tax']));
|
||||
$dividendObj->setCount(ClearTypes::clearInt($row['count']));
|
||||
$dividendObj->setValue(ClearTypes::clearFloat($row['value']));
|
||||
|
||||
|
||||
$dividendObj->setDateTime($date);
|
||||
$ret[] = $dividendObj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user