mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 02:04:30 -04:00
Fixes for type checks
This commit is contained in:
parent
9e12e32e29
commit
c472e8ce68
@ -255,6 +255,9 @@ class BaseImport
|
||||
|
||||
unset($record['']);
|
||||
|
||||
if(!is_array($record))
|
||||
continue;
|
||||
|
||||
try {
|
||||
$entity = $this->transformer->transform($record);
|
||||
|
||||
@ -310,6 +313,11 @@ class BaseImport
|
||||
$count = 0;
|
||||
|
||||
foreach ($data as $key => $record) {
|
||||
|
||||
if(!is_array($record)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$entity = $this->transformer->transform($record);
|
||||
$validator = $this->request_name::runFormRequest($entity);
|
||||
@ -372,6 +380,11 @@ class BaseImport
|
||||
$invoices = $this->groupInvoices($invoices, $invoice_number_key);
|
||||
|
||||
foreach ($invoices as $raw_invoice) {
|
||||
|
||||
if(!is_array($raw_invoice)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$invoice_data = $invoice_transformer->transform($raw_invoice);
|
||||
|
||||
@ -459,6 +472,11 @@ class BaseImport
|
||||
|
||||
foreach ($tasks as $raw_task) {
|
||||
$task_data = [];
|
||||
|
||||
if(!is_array($raw_task)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$task_data = $task_transformer->transform($raw_task);
|
||||
$task_data['user_id'] = $this->company->owner()->id;
|
||||
@ -527,6 +545,11 @@ class BaseImport
|
||||
$invoices = $this->groupInvoices($invoices, $invoice_number_key);
|
||||
|
||||
foreach ($invoices as $raw_invoice) {
|
||||
|
||||
if(!is_array($raw_invoice)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$invoice_data = $invoice_transformer->transform($raw_invoice);
|
||||
$invoice_data['user_id'] = $this->company->owner()->id;
|
||||
@ -742,6 +765,11 @@ class BaseImport
|
||||
$quotes = $this->groupInvoices($quotes, $quote_number_key);
|
||||
|
||||
foreach ($quotes as $raw_quote) {
|
||||
|
||||
if(!is_array($raw_quote)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$quote_data = $quote_transformer->transform($raw_quote);
|
||||
$quote_data['line_items'] = $this->cleanItems(
|
||||
|
@ -232,6 +232,11 @@ class Wave extends BaseImport implements ImportInterface
|
||||
$expenses = $this->groupExpenses($data);
|
||||
|
||||
foreach ($expenses as $raw_expense) {
|
||||
|
||||
if(!is_array($raw_expense)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$expense_data = $expense_transformer->transform($raw_expense);
|
||||
|
||||
|
@ -115,7 +115,7 @@ class BaseTransformer
|
||||
return isset($data[$field]) && $data[$field] ? $data[$field] : null;
|
||||
}
|
||||
|
||||
public function getCurrencyByCode($data, $key = 'client.currency_id')
|
||||
public function getCurrencyByCode(array $data, string $key = 'client.currency_id')
|
||||
{
|
||||
$code = array_key_exists($key, $data) ? $data[$key] : false;
|
||||
|
||||
|
@ -119,6 +119,7 @@ class Number
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a given value based on the clients currency
|
||||
* BACK to a float.
|
||||
|
Loading…
x
Reference in New Issue
Block a user