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