mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
343bb9aa11
@ -1 +1 @@
|
|||||||
5.10.8
|
5.10.9
|
@ -97,11 +97,6 @@ class Handler extends ExceptionHandler
|
|||||||
{
|
{
|
||||||
if (Ninja::isHosted()) {
|
if (Ninja::isHosted()) {
|
||||||
|
|
||||||
// if($exception instanceof ThrottleRequestsException && class_exists(\Modules\Admin\Events\ThrottledExceptionRaised::class)) {
|
|
||||||
// $uri = urldecode(request()->getRequestUri());
|
|
||||||
// event(new \Modules\Admin\Events\ThrottledExceptionRaised(auth()->user()?->account?->key, $uri, request()->ip()));
|
|
||||||
// }
|
|
||||||
|
|
||||||
Integration::configureScope(function (Scope $scope): void {
|
Integration::configureScope(function (Scope $scope): void {
|
||||||
$name = 'hosted@invoiceninja.com';
|
$name = 'hosted@invoiceninja.com';
|
||||||
|
|
||||||
|
@ -57,6 +57,7 @@ class ActivityExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($resource) {
|
->map(function ($resource) {
|
||||||
|
/** @var \App\Models\Activity $resource */
|
||||||
$row = $this->buildActivityRow($resource);
|
$row = $this->buildActivityRow($resource);
|
||||||
return $this->processMetaData($row, $resource);
|
return $this->processMetaData($row, $resource);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -128,6 +129,9 @@ class ActivityExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($entity) {
|
->each(function ($entity) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Activity $entity */
|
||||||
|
|
||||||
$this->buildRow($entity);
|
$this->buildRow($entity);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -102,6 +102,8 @@ class ClientExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($client) {
|
->map(function ($client) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Client $client */
|
||||||
$row = $this->buildRow($client);
|
$row = $this->buildRow($client);
|
||||||
return $this->processMetaData($row, $client);
|
return $this->processMetaData($row, $client);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -154,6 +156,8 @@ class ClientExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($client) {
|
->each(function ($client) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Client $client */
|
||||||
$this->csv->insertOne($this->buildRow($client));
|
$this->csv->insertOne($this->buildRow($client));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ class ContactExport extends BaseExport
|
|||||||
$this->csv->insertOne($this->buildHeader());
|
$this->csv->insertOne($this->buildHeader());
|
||||||
|
|
||||||
$query->cursor()->each(function ($contact) {
|
$query->cursor()->each(function ($contact) {
|
||||||
|
/** @var \App\Models\ClientContact $contact */
|
||||||
$this->csv->insertOne($this->buildRow($contact));
|
$this->csv->insertOne($this->buildRow($contact));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -101,6 +102,7 @@ class ContactExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($contact) {
|
->map(function ($contact) {
|
||||||
|
/** @var \App\Models\ClientContact $contact */
|
||||||
$row = $this->buildRow($contact);
|
$row = $this->buildRow($contact);
|
||||||
return $this->processMetaData($row, $contact);
|
return $this->processMetaData($row, $contact);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
|
@ -52,6 +52,8 @@ class CreditExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($credit) {
|
->map(function ($credit) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Credit $credit */
|
||||||
$row = $this->buildRow($credit);
|
$row = $this->buildRow($credit);
|
||||||
return $this->processMetaData($row, $credit);
|
return $this->processMetaData($row, $credit);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -139,6 +141,7 @@ class CreditExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($credit) {
|
->each(function ($credit) {
|
||||||
|
/** @var \App\Models\Credit $credit */
|
||||||
$this->csv->insertOne($this->buildRow($credit));
|
$this->csv->insertOne($this->buildRow($credit));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -54,6 +54,8 @@ class DocumentExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($document) {
|
->map(function ($document) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Document $document */
|
||||||
$row = $this->buildRow($document);
|
$row = $this->buildRow($document);
|
||||||
return $this->processMetaData($row, $document);
|
return $this->processMetaData($row, $document);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -99,6 +101,7 @@ class DocumentExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($entity) {
|
->each(function ($entity) {
|
||||||
|
/** @var mixed $entity */
|
||||||
$this->csv->insertOne($this->buildRow($entity));
|
$this->csv->insertOne($this->buildRow($entity));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -52,6 +52,8 @@ class ExpenseExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($resource) {
|
->map(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Expense $resource */
|
||||||
$row = $this->buildRow($resource);
|
$row = $this->buildRow($resource);
|
||||||
return $this->processMetaData($row, $resource);
|
return $this->processMetaData($row, $resource);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -132,6 +134,8 @@ class ExpenseExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($expense) {
|
->each(function ($expense) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Expense $expense */
|
||||||
$this->csv->insertOne($this->buildRow($expense));
|
$this->csv->insertOne($this->buildRow($expense));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -99,6 +99,8 @@ class InvoiceExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($resource) {
|
->map(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Invoice $resource */
|
||||||
$row = $this->buildRow($resource);
|
$row = $this->buildRow($resource);
|
||||||
return $this->processMetaData($row, $resource);
|
return $this->processMetaData($row, $resource);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -119,6 +121,8 @@ class InvoiceExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($invoice) {
|
->each(function ($invoice) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Invoice $invoice */
|
||||||
$this->csv->insertOne($this->buildRow($invoice));
|
$this->csv->insertOne($this->buildRow($invoice));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -113,6 +113,8 @@ class InvoiceItemExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($resource) {
|
->each(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Invoice $resource */
|
||||||
$this->iterateItems($resource);
|
$this->iterateItems($resource);
|
||||||
|
|
||||||
foreach($this->storage_array as $row) {
|
foreach($this->storage_array as $row) {
|
||||||
@ -141,6 +143,8 @@ class InvoiceItemExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($invoice) {
|
->each(function ($invoice) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Invoice $invoice */
|
||||||
$this->iterateItems($invoice);
|
$this->iterateItems($invoice);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -92,6 +92,8 @@ class PaymentExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($resource) {
|
->map(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Payment $resource */
|
||||||
$row = $this->buildRow($resource);
|
$row = $this->buildRow($resource);
|
||||||
return $this->processMetaData($row, $resource);
|
return $this->processMetaData($row, $resource);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -112,6 +114,8 @@ class PaymentExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($entity) {
|
->each(function ($entity) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Payment $entity */
|
||||||
$this->csv->insertOne($this->buildRow($entity));
|
$this->csv->insertOne($this->buildRow($entity));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -51,6 +51,8 @@ class ProductExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($resource) {
|
->map(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Product $resource */
|
||||||
$row = $this->buildRow($resource);
|
$row = $this->buildRow($resource);
|
||||||
return $this->processMetaData($row, $resource);
|
return $this->processMetaData($row, $resource);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -103,6 +105,8 @@ class ProductExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($entity) {
|
->each(function ($entity) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Product $entity */
|
||||||
$this->csv->insertOne($this->buildRow($entity));
|
$this->csv->insertOne($this->buildRow($entity));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -98,6 +98,8 @@ class PurchaseOrderExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($resource) {
|
->map(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\PurchaseOrder $resource */
|
||||||
$row = $this->buildRow($resource);
|
$row = $this->buildRow($resource);
|
||||||
return $this->processMetaData($row, $resource);
|
return $this->processMetaData($row, $resource);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -119,6 +121,8 @@ class PurchaseOrderExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($purchase_order) {
|
->each(function ($purchase_order) {
|
||||||
|
|
||||||
|
/** @var \App\Models\PurchaseOrder $purchase_order */
|
||||||
$this->csv->insertOne($this->buildRow($purchase_order));
|
$this->csv->insertOne($this->buildRow($purchase_order));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -101,6 +101,8 @@ class PurchaseOrderItemExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($resource) {
|
->each(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\PurchaseOrder $resource */
|
||||||
$this->iterateItems($resource);
|
$this->iterateItems($resource);
|
||||||
|
|
||||||
foreach($this->storage_array as $row) {
|
foreach($this->storage_array as $row) {
|
||||||
@ -127,6 +129,8 @@ class PurchaseOrderItemExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($purchase_order) {
|
->each(function ($purchase_order) {
|
||||||
|
|
||||||
|
/** @var \App\Models\PurchaseOrder $purchase_order */
|
||||||
$this->iterateItems($purchase_order);
|
$this->iterateItems($purchase_order);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -103,6 +103,8 @@ class QuoteExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($resource) {
|
->map(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Quote $resource */
|
||||||
$row = $this->buildRow($resource);
|
$row = $this->buildRow($resource);
|
||||||
return $this->processMetaData($row, $resource);
|
return $this->processMetaData($row, $resource);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -125,6 +127,8 @@ class QuoteExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($quote) {
|
->each(function ($quote) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Quote $quote */
|
||||||
$this->csv->insertOne($this->buildRow($quote));
|
$this->csv->insertOne($this->buildRow($quote));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -104,6 +104,8 @@ class QuoteItemExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($resource) {
|
->each(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Quote $resource */
|
||||||
$this->iterateItems($resource);
|
$this->iterateItems($resource);
|
||||||
|
|
||||||
foreach($this->storage_array as $row) {
|
foreach($this->storage_array as $row) {
|
||||||
@ -134,6 +136,8 @@ class QuoteItemExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($quote) {
|
->each(function ($quote) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Quote $quote */
|
||||||
$this->iterateItems($quote);
|
$this->iterateItems($quote);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -93,6 +93,8 @@ class RecurringInvoiceExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($invoice) {
|
->each(function ($invoice) {
|
||||||
|
|
||||||
|
/** @var \App\Models\RecurringInvoice $invoice */
|
||||||
$this->csv->insertOne($this->buildRow($invoice));
|
$this->csv->insertOne($this->buildRow($invoice));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -112,6 +114,8 @@ class RecurringInvoiceExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($resource) {
|
->map(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\RecurringInvoice $resource */
|
||||||
$row = $this->buildRow($resource);
|
$row = $this->buildRow($resource);
|
||||||
return $this->processMetaData($row, $resource);
|
return $this->processMetaData($row, $resource);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
|
@ -106,6 +106,8 @@ class TaskExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($entity) {
|
->each(function ($entity) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Task $entity*/
|
||||||
$this->buildRow($entity);
|
$this->buildRow($entity);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -128,6 +130,7 @@ class TaskExport extends BaseExport
|
|||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($resource) {
|
->each(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Task $resource*/
|
||||||
$this->buildRow($resource);
|
$this->buildRow($resource);
|
||||||
|
|
||||||
foreach($this->storage_array as $row) {
|
foreach($this->storage_array as $row) {
|
||||||
@ -161,7 +164,7 @@ class TaskExport extends BaseExport
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_null($task->time_log) || (is_array(json_decode($task->time_log, 1)) && count(json_decode($task->time_log, 1)) == 0)) {
|
if (is_null($task->time_log) || (is_array(json_decode($task->time_log, true)) && count(json_decode($task->time_log, true)) == 0)) {
|
||||||
$this->storage_array[] = $entity;
|
$this->storage_array[] = $entity;
|
||||||
} else {
|
} else {
|
||||||
$this->iterateLogs($task, $entity);
|
$this->iterateLogs($task, $entity);
|
||||||
@ -178,7 +181,7 @@ class TaskExport extends BaseExport
|
|||||||
$timezone_name = $timezone->name;
|
$timezone_name = $timezone->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$logs = json_decode($task->time_log, 1);
|
$logs = json_decode($task->time_log, true);
|
||||||
|
|
||||||
$date_format_default = $this->date_format;
|
$date_format_default = $this->date_format;
|
||||||
|
|
||||||
|
@ -90,6 +90,8 @@ class VendorExport extends BaseExport
|
|||||||
|
|
||||||
$report = $query->cursor()
|
$report = $query->cursor()
|
||||||
->map(function ($resource) {
|
->map(function ($resource) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Vendor $resource */
|
||||||
$row = $this->buildRow($resource);
|
$row = $this->buildRow($resource);
|
||||||
return $this->processMetaData($row, $resource);
|
return $this->processMetaData($row, $resource);
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -107,6 +109,8 @@ class VendorExport extends BaseExport
|
|||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
->each(function ($vendor) {
|
->each(function ($vendor) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Vendor $vendor */
|
||||||
$this->csv->insertOne($this->buildRow($vendor));
|
$this->csv->insertOne($this->buildRow($vendor));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class TaskDecorator extends Decorator implements DecoratorInterface
|
|||||||
$timezone_name = $timezone->name;
|
$timezone_name = $timezone->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$logs = json_decode($task->time_log, 1);
|
$logs = json_decode($task->time_log, true);
|
||||||
|
|
||||||
$date_format_default = 'Y-m-d';
|
$date_format_default = 'Y-m-d';
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class TaskDecorator extends Decorator implements DecoratorInterface
|
|||||||
$timezone_name = $timezone->name;
|
$timezone_name = $timezone->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$logs = json_decode($task->time_log, 1);
|
$logs = json_decode($task->time_log, true);
|
||||||
|
|
||||||
$date_format_default = 'Y-m-d';
|
$date_format_default = 'Y-m-d';
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ class RecurringExpenseToExpenseFactory
|
|||||||
|
|
||||||
$_value = explode($_operation, $right); // [MONTHYEAR, 4]
|
$_value = explode($_operation, $right); // [MONTHYEAR, 4]
|
||||||
|
|
||||||
$_right = Carbon::createFromDate(now()->year, now()->month)->addMonths($_value[1])->translatedFormat('F Y');
|
$_right = Carbon::createFromDate(now()->year, now()->month)->addMonths($_value[1])->translatedFormat('F Y'); //@phpstan-ignore-line
|
||||||
}
|
}
|
||||||
|
|
||||||
$replacement = sprintf('%s to %s', $_left, $_right);
|
$replacement = sprintf('%s to %s', $_left, $_right);
|
||||||
|
@ -97,7 +97,8 @@ class CreditFilters extends QueryFilters
|
|||||||
$q->where('first_name', 'like', '%'.$filter.'%')
|
$q->where('first_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('last_name', 'like', '%'.$filter.'%')
|
->orWhere('last_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('email', 'like', '%'.$filter.'%');
|
->orWhere('email', 'like', '%'.$filter.'%');
|
||||||
});
|
})
|
||||||
|
->orWhereRaw("JSON_UNQUOTE(JSON_EXTRACT(line_items, '$[*].notes')) LIKE ?", ['%'.$filter.'%']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,8 @@ class InvoiceFilters extends QueryFilters
|
|||||||
$q->where('first_name', 'like', '%'.$filter.'%')
|
$q->where('first_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('last_name', 'like', '%'.$filter.'%')
|
->orWhere('last_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('email', 'like', '%'.$filter.'%');
|
->orWhere('email', 'like', '%'.$filter.'%');
|
||||||
});
|
})
|
||||||
|
->orWhereRaw("JSON_UNQUOTE(JSON_EXTRACT(line_items, '$[*].notes')) LIKE ?", ['%'.$filter.'%']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,8 @@ class QuoteFilters extends QueryFilters
|
|||||||
$q->where('first_name', 'like', '%'.$filter.'%')
|
$q->where('first_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('last_name', 'like', '%'.$filter.'%')
|
->orWhere('last_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('email', 'like', '%'.$filter.'%');
|
->orWhere('email', 'like', '%'.$filter.'%');
|
||||||
});
|
})
|
||||||
|
->orWhereRaw("JSON_UNQUOTE(JSON_EXTRACT(line_items, '$[*].notes')) LIKE ?", ['%'.$filter.'%']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,8 @@ class RecurringInvoiceFilters extends QueryFilters
|
|||||||
$q->where('first_name', 'like', '%'.$filter.'%')
|
$q->where('first_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('last_name', 'like', '%'.$filter.'%')
|
->orWhere('last_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('email', 'like', '%'.$filter.'%');
|
->orWhere('email', 'like', '%'.$filter.'%');
|
||||||
});
|
})
|
||||||
|
->orWhereRaw("JSON_UNQUOTE(JSON_EXTRACT(line_items, '$[*].notes')) LIKE ?", ['%'.$filter.'%']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ function nlog($output, $context = []): void
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gettype($output) == 'object') {
|
if (gettype($output) == 'object') {
|
||||||
$output = print_r($output, 1);
|
$output = print_r($output, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $trace = debug_backtrace();
|
// $trace = debug_backtrace();
|
||||||
@ -53,7 +53,7 @@ function nrlog($output, $context = []): void
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gettype($output) == 'object') {
|
if (gettype($output) == 'object') {
|
||||||
$output = print_r($output, 1);
|
$output = print_r($output, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $trace = debug_backtrace();
|
// $trace = debug_backtrace();
|
||||||
|
@ -31,7 +31,7 @@ class GmailTransport extends AbstractTransport
|
|||||||
protected function doSend(SentMessage $message): void
|
protected function doSend(SentMessage $message): void
|
||||||
{
|
{
|
||||||
nlog("In Do Send");
|
nlog("In Do Send");
|
||||||
$message = MessageConverter::toEmail($message->getOriginalMessage());
|
$message = MessageConverter::toEmail($message->getOriginalMessage()); //@phpstan-ignore-line
|
||||||
|
|
||||||
/** @phpstan-ignore-next-line **/
|
/** @phpstan-ignore-next-line **/
|
||||||
$token = $message->getHeaders()->get('gmailtoken')->getValue(); // @phpstan-ignore-line
|
$token = $message->getHeaders()->get('gmailtoken')->getValue(); // @phpstan-ignore-line
|
||||||
|
@ -25,7 +25,8 @@ class Office365MailTransport extends AbstractTransport
|
|||||||
|
|
||||||
protected function doSend(SentMessage $message): void
|
protected function doSend(SentMessage $message): void
|
||||||
{
|
{
|
||||||
$symfony_message = MessageConverter::toEmail($message->getOriginalMessage());
|
$symfony_message = MessageConverter::toEmail($message->getOriginalMessage()); //@phpstan-ignore-line
|
||||||
|
|
||||||
|
|
||||||
$graph = new Graph();
|
$graph = new Graph();
|
||||||
|
|
||||||
|
@ -376,6 +376,7 @@ class LoginController extends BaseController
|
|||||||
/** @var \App\Models\User $user */
|
/** @var \App\Models\User $user */
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
|
/** @var Builder $cu */
|
||||||
$cu = CompanyUser::query()->where('user_id', $user->id);
|
$cu = CompanyUser::query()->where('user_id', $user->id);
|
||||||
|
|
||||||
if ($cu->count() == 0) {
|
if ($cu->count() == 0) {
|
||||||
@ -398,18 +399,15 @@ class LoginController extends BaseController
|
|||||||
$truth->setCompany($set_company);
|
$truth->setCompany($set_company);
|
||||||
|
|
||||||
//21-03-2024
|
//21-03-2024
|
||||||
|
|
||||||
|
|
||||||
$cu->each(function ($cu) {
|
$cu->each(function ($cu) {
|
||||||
if(CompanyToken::where('company_id', $cu->company_id)->where('user_id', $cu->user_id)->where('is_system', true)->doesntExist()) {
|
/** @var \App\Models\CompanyUser $cu */
|
||||||
|
if(CompanyToken::query()->where('company_id', $cu->company_id)->where('user_id', $cu->user_id)->where('is_system', true)->doesntExist()) {
|
||||||
(new CreateCompanyToken($cu->company, $cu->user, request()->server('HTTP_USER_AGENT')))->handle();
|
(new CreateCompanyToken($cu->company, $cu->user, request()->server('HTTP_USER_AGENT')))->handle();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// $user->account->companies->each(function ($company) use ($user) {
|
|
||||||
// if ($company->tokens()->where('user_id',$user->id)->where('is_system', true)->count() == 0) {
|
|
||||||
// (new CreateCompanyToken($company, $user, request()->server('HTTP_USER_AGENT')))->handle();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
$truth->setCompanyToken(CompanyToken::where('user_id', $user->id)->where('company_id', $set_company->id)->where('is_system', true)->first());
|
$truth->setCompanyToken(CompanyToken::where('user_id', $user->id)->where('company_id', $set_company->id)->where('is_system', true)->first());
|
||||||
|
|
||||||
return CompanyUser::query()->where('user_id', $user->id);
|
return CompanyUser::query()->where('user_id', $user->id);
|
||||||
|
@ -97,7 +97,7 @@ class YodleeController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$company->account->bank_integrations->where("integration_type", BankIntegration::INTEGRATION_TYPE_YODLEE)->where('auto_sync', true)->each(function ($bank_integration) use ($company) { // TODO: filter to yodlee only
|
$company->account->bank_integrations->where("integration_type", BankIntegration::INTEGRATION_TYPE_YODLEE)->where('auto_sync', true)->each(function ($bank_integration) use ($company) { // TODO: filter to yodlee only
|
||||||
ProcessBankTransactionsYodlee::dispatch($company->account->id, $bank_integration);
|
ProcessBankTransactionsYodlee::dispatch($company->account->bank_integration_account_id, $bank_integration);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,6 +197,7 @@ class BankIntegrationController extends BaseController
|
|||||||
/** @var \App\Models\User $user */
|
/** @var \App\Models\User $user */
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
|
/** @var \App\Models\Account $user_account */
|
||||||
$user_account = $user->account;
|
$user_account = $user->account;
|
||||||
|
|
||||||
$this->refreshAccountsYodlee($user);
|
$this->refreshAccountsYodlee($user);
|
||||||
@ -210,12 +211,14 @@ class BankIntegrationController extends BaseController
|
|||||||
// Processing transactions for each bank account
|
// Processing transactions for each bank account
|
||||||
if (Ninja::isHosted() && $user->account->bank_integration_account_id) {
|
if (Ninja::isHosted() && $user->account->bank_integration_account_id) {
|
||||||
$user_account->bank_integrations->where("integration_type", BankIntegration::INTEGRATION_TYPE_YODLEE)->each(function ($bank_integration) use ($user_account) {
|
$user_account->bank_integrations->where("integration_type", BankIntegration::INTEGRATION_TYPE_YODLEE)->each(function ($bank_integration) use ($user_account) {
|
||||||
ProcessBankTransactionsYodlee::dispatch($user_account->id, $bank_integration);
|
/** @var \App\Models\BankIntegration $bank_integration */
|
||||||
|
ProcessBankTransactionsYodlee::dispatch($user_account->bank_integration_account_id, $bank_integration);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config('ninja.nordigen.secret_id') && config('ninja.nordigen.secret_key') && (Ninja::isSelfHost() || (Ninja::isHosted() && $user_account->isEnterprisePaidClient()))) {
|
if (config('ninja.nordigen.secret_id') && config('ninja.nordigen.secret_key') && (Ninja::isSelfHost() || (Ninja::isHosted() && $user_account->isEnterprisePaidClient()))) {
|
||||||
$user_account->bank_integrations->where("integration_type", BankIntegration::INTEGRATION_TYPE_NORDIGEN)->each(function ($bank_integration) {
|
$user_account->bank_integrations->where("integration_type", BankIntegration::INTEGRATION_TYPE_NORDIGEN)->each(function ($bank_integration) {
|
||||||
|
/** @var \App\Models\BankIntegration $bank_integration */
|
||||||
ProcessBankTransactionsNordigen::dispatch($bank_integration);
|
ProcessBankTransactionsNordigen::dispatch($bank_integration);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -345,7 +348,7 @@ class BankIntegrationController extends BaseController
|
|||||||
|
|
||||||
if (Ninja::isHosted() && $account->isPaid() && $account->plan == 'enterprise') {
|
if (Ninja::isHosted() && $account->isPaid() && $account->plan == 'enterprise') {
|
||||||
$account->bank_integrations()->where('integration_type', BankIntegration::INTEGRATION_TYPE_YODLEE)->where('auto_sync', true)->cursor()->each(function ($bank_integration) use ($account) {
|
$account->bank_integrations()->where('integration_type', BankIntegration::INTEGRATION_TYPE_YODLEE)->where('auto_sync', true)->cursor()->each(function ($bank_integration) use ($account) {
|
||||||
(new ProcessBankTransactionsYodlee($account->id, $bank_integration))->handle();
|
(new ProcessBankTransactionsYodlee($account->bank_integration_account_id, $bank_integration))->handle();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -654,7 +654,7 @@ class BaseController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Passes back the miniloaded data response
|
* Passes back the miniloaded data response
|
||||||
*
|
*
|
||||||
* @param Builder $query
|
* @param mixed $query
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected function timeConstrainedResponse($query)
|
protected function timeConstrainedResponse($query)
|
||||||
@ -895,11 +895,7 @@ class BaseController extends Controller
|
|||||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||||
}
|
}
|
||||||
|
|
||||||
// else {
|
return $this->response($this->manager->createData($resource)->toArray()); //@phpstan-ignore-line
|
||||||
// $resource = new Collection($query, $transformer, $this->entity_type);
|
|
||||||
// }
|
|
||||||
|
|
||||||
return $this->response($this->manager->createData($resource)->toArray());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -209,7 +209,7 @@ class PaymentController extends Controller
|
|||||||
|
|
||||||
if (property_exists($payment_hash->data, 'billing_context')) {
|
if (property_exists($payment_hash->data, 'billing_context')) {
|
||||||
$billing_subscription = \App\Models\Subscription::find($this->decodePrimaryKey($payment_hash->data->billing_context->subscription_id));
|
$billing_subscription = \App\Models\Subscription::find($this->decodePrimaryKey($payment_hash->data->billing_context->subscription_id));
|
||||||
|
/** @var \App\Models\Subscription $billing_subscription */
|
||||||
return (new SubscriptionService($billing_subscription))->completePurchase($payment_hash);
|
return (new SubscriptionService($billing_subscription))->completePurchase($payment_hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ class DocumentController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'download') {
|
if ($action == 'download') {
|
||||||
ZipDocuments::dispatch($documents->pluck('id'), $user->company(), auth()->user());
|
ZipDocuments::dispatch($documents->pluck('id'), $user->company(), auth()->user()); //@phpstan-ignore-line
|
||||||
|
|
||||||
return response()->json(['message' => ctrans('texts.sent_message')], 200);
|
return response()->json(['message' => ctrans('texts.sent_message')], 200);
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ class MigrationController extends BaseController
|
|||||||
|
|
||||||
if ($request->companies) {
|
if ($request->companies) {
|
||||||
//handle Laravel 5.5 UniHTTP
|
//handle Laravel 5.5 UniHTTP
|
||||||
$companies = json_decode($request->companies, 1);
|
$companies = json_decode($request->companies, true);
|
||||||
} else {
|
} else {
|
||||||
//handle Laravel 6 Guzzle
|
//handle Laravel 6 Guzzle
|
||||||
$companies = [];
|
$companies = [];
|
||||||
@ -275,7 +275,7 @@ class MigrationController extends BaseController
|
|||||||
foreach ($request->all() as $input) {
|
foreach ($request->all() as $input) {
|
||||||
if ($input instanceof UploadedFile) {
|
if ($input instanceof UploadedFile) {
|
||||||
} else {
|
} else {
|
||||||
$companies[] = json_decode($input, 1);
|
$companies[] = json_decode($input, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,9 @@ class PaymentNotificationWebhookController extends Controller
|
|||||||
public function __invoke(PaymentNotificationWebhookRequest $request, string $company_key, string $company_gateway_id, string $client_hash)
|
public function __invoke(PaymentNotificationWebhookRequest $request, string $company_key, string $company_gateway_id, string $client_hash)
|
||||||
{
|
{
|
||||||
/** @var \App\Models\CompanyGateway $company_gateway */
|
/** @var \App\Models\CompanyGateway $company_gateway */
|
||||||
|
|
||||||
$company_gateway = CompanyGateway::find($this->decodePrimaryKey($company_gateway_id));
|
$company_gateway = CompanyGateway::find($this->decodePrimaryKey($company_gateway_id));
|
||||||
|
|
||||||
|
/** @var \App\Models\Client $client */
|
||||||
$client = Client::find($this->decodePrimaryKey($client_hash));
|
$client = Client::find($this->decodePrimaryKey($client_hash));
|
||||||
|
|
||||||
return $company_gateway
|
return $company_gateway
|
||||||
|
@ -125,7 +125,7 @@ class PreviewController extends BaseController
|
|||||||
|
|
||||||
$response = Response::make($pdf, 200);
|
$response = Response::make($pdf, 200);
|
||||||
$response->header('Content-Type', 'application/pdf');
|
$response->header('Content-Type', 'application/pdf');
|
||||||
$response->header('Server-Timing', microtime(true) - $start);
|
$response->header('Server-Timing', (string) (microtime(true) - $start));
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
@ -288,7 +288,7 @@ class PreviewController extends BaseController
|
|||||||
/** @var \App\Models\Company $company */
|
/** @var \App\Models\Company $company */
|
||||||
$company = $user->company();
|
$company = $user->company();
|
||||||
|
|
||||||
$design_object = json_decode(json_encode(request()->input('design')), 1);
|
$design_object = json_decode(json_encode(request()->input('design')), true);
|
||||||
|
|
||||||
$ts = (new TemplateService());
|
$ts = (new TemplateService());
|
||||||
|
|
||||||
|
@ -145,8 +145,8 @@ class SetupController extends Controller
|
|||||||
|
|
||||||
Artisan::call('config:clear');
|
Artisan::call('config:clear');
|
||||||
|
|
||||||
|
|
||||||
Artisan::call('key:generate', ['--force' => true]);
|
Artisan::call('key:generate', ['--force' => true]);
|
||||||
|
|
||||||
Artisan::call('migrate', ['--force' => true]);
|
Artisan::call('migrate', ['--force' => true]);
|
||||||
Artisan::call('db:seed', ['--force' => true]);
|
Artisan::call('db:seed', ['--force' => true]);
|
||||||
Artisan::call('config:clear');
|
Artisan::call('config:clear');
|
||||||
|
@ -11,13 +11,14 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\Client;
|
namespace App\Http\Requests\Client;
|
||||||
|
|
||||||
use App\DataMapper\CompanySettings;
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
use App\Http\ValidationRules\ValidClientGroupSettingsRule;
|
|
||||||
use App\Utils\Traits\ChecksEntityStatus;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Support\Facades\Cache;
|
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
use App\DataMapper\CompanySettings;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
use App\Utils\Traits\ChecksEntityStatus;
|
||||||
|
use App\Http\ValidationRules\EInvoice\ValidClientScheme;
|
||||||
|
use App\Http\ValidationRules\ValidClientGroupSettingsRule;
|
||||||
|
|
||||||
class UpdateClientRequest extends Request
|
class UpdateClientRequest extends Request
|
||||||
{
|
{
|
||||||
@ -66,6 +67,8 @@ class UpdateClientRequest extends Request
|
|||||||
$rules['id_number'] = ['sometimes', 'bail', 'nullable', Rule::unique('clients')->where('company_id', $user->company()->id)->ignore($this->client->id)];
|
$rules['id_number'] = ['sometimes', 'bail', 'nullable', Rule::unique('clients')->where('company_id', $user->company()->id)->ignore($this->client->id)];
|
||||||
$rules['number'] = ['sometimes', 'bail', Rule::unique('clients')->where('company_id', $user->company()->id)->ignore($this->client->id)];
|
$rules['number'] = ['sometimes', 'bail', Rule::unique('clients')->where('company_id', $user->company()->id)->ignore($this->client->id)];
|
||||||
|
|
||||||
|
$rules['e_invoice'] = ['sometimes','nullable', new ValidClientScheme()];
|
||||||
|
|
||||||
$rules['settings'] = new ValidClientGroupSettingsRule();
|
$rules['settings'] = new ValidClientGroupSettingsRule();
|
||||||
$rules['contacts'] = 'array';
|
$rules['contacts'] = 'array';
|
||||||
$rules['contacts.*.email'] = 'bail|nullable|distinct|sometimes|email';
|
$rules['contacts.*.email'] = 'bail|nullable|distinct|sometimes|email';
|
||||||
|
@ -29,7 +29,7 @@ class CreatePaymentMethodRequest extends FormRequest
|
|||||||
$available_methods = [];
|
$available_methods = [];
|
||||||
|
|
||||||
collect($client->service()->getPaymentMethods(-1))
|
collect($client->service()->getPaymentMethods(-1))
|
||||||
->filter(function ($method) use (&$available_methods) {
|
->filter(function ($method) use (&$available_methods) { //@phpstan-ignore-line
|
||||||
$available_methods[] = $method['gateway_type_id'];
|
$available_methods[] = $method['gateway_type_id'];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class UpdateCompanyRequest extends Request
|
|||||||
$rules['smtp_local_domain'] = 'sometimes|string|nullable';
|
$rules['smtp_local_domain'] = 'sometimes|string|nullable';
|
||||||
// $rules['smtp_verify_peer'] = 'sometimes|string';
|
// $rules['smtp_verify_peer'] = 'sometimes|string';
|
||||||
|
|
||||||
$rules['e_invoice'] = ['sometimes','nullable', new ValidCompanyScheme()];
|
// $rules['e_invoice'] = ['sometimes','nullable', new ValidCompanyScheme()];
|
||||||
|
|
||||||
if (isset($input['portal_mode']) && ($input['portal_mode'] == 'domain' || $input['portal_mode'] == 'iframe')) {
|
if (isset($input['portal_mode']) && ($input['portal_mode'] == 'domain' || $input['portal_mode'] == 'iframe')) {
|
||||||
$rules['portal_domain'] = 'bail|nullable|sometimes|url';
|
$rules['portal_domain'] = 'bail|nullable|sometimes|url';
|
||||||
|
@ -48,7 +48,7 @@ class StoreCompanyGatewayRequest extends Request
|
|||||||
{
|
{
|
||||||
$input = $this->all();
|
$input = $this->all();
|
||||||
|
|
||||||
if ($gateway = Gateway::where('key', $input['gateway_key'])->first()) {
|
if ($gateway = Gateway::query()->where('key', $input['gateway_key'])->first()) {
|
||||||
$default_gateway_fields = json_decode($gateway->fields);
|
$default_gateway_fields = json_decode($gateway->fields);
|
||||||
|
|
||||||
/*Force gateway properties */
|
/*Force gateway properties */
|
||||||
|
@ -48,7 +48,7 @@ class UpdateCompanyGatewayRequest extends Request
|
|||||||
|
|
||||||
/*Force gateway properties */
|
/*Force gateway properties */
|
||||||
if (isset($input['config']) && is_object(json_decode($input['config'])) && array_key_exists('gateway_key', $input)) {
|
if (isset($input['config']) && is_object(json_decode($input['config'])) && array_key_exists('gateway_key', $input)) {
|
||||||
$gateway = Gateway::where('key', $input['gateway_key'])->first();
|
$gateway = Gateway::query()->where('key', $input['gateway_key'])->first();
|
||||||
$default_gateway_fields = json_decode($gateway->fields);
|
$default_gateway_fields = json_decode($gateway->fields);
|
||||||
|
|
||||||
foreach (json_decode($input['config']) as $key => $value) {
|
foreach (json_decode($input['config']) as $key => $value) {
|
||||||
|
@ -34,7 +34,10 @@ class BulkRecurringExpenseRequest extends Request
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return auth()->user()->can(auth()->user()->isAdmin(), RecurringExpense::class);
|
/** @var \App\Models\User $user */
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
return $user->can('edit', RecurringExpense::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,7 +69,7 @@ class StoreTaskRequest extends Request
|
|||||||
|
|
||||||
foreach ($values as $k) {
|
foreach ($values as $k) {
|
||||||
if (!is_int($k[0]) || !is_int($k[1])) {
|
if (!is_int($k[0]) || !is_int($k[1])) {
|
||||||
return $fail('The '.$attribute.' - '.print_r($k, 1).' is invalid. Unix timestamps only.');
|
return $fail('The '.$attribute.' - '.print_r($k, true).' is invalid. Unix timestamps only.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ class UpdateTaskRequest extends Request
|
|||||||
|
|
||||||
foreach ($values as $k) {
|
foreach ($values as $k) {
|
||||||
if (!is_int($k[0]) || !is_int($k[1])) {
|
if (!is_int($k[0]) || !is_int($k[1])) {
|
||||||
return $fail('The '.$attribute.' - '.print_r($k, 1).' is invalid. Unix timestamps only.');
|
return $fail('The '.$attribute.' - '.print_r($k, true).' is invalid. Unix timestamps only.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,11 @@ class BulkVendorRequest extends Request
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return auth()->user()->can(auth()->user()->isAdmin(), Vendor::class);
|
/** @var \App\Models\User $user */
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
return $user->can('edit', Vendor::class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
61
app/Http/ValidationRules/EInvoice/ValidClientScheme.php
Normal file
61
app/Http/ValidationRules/EInvoice/ValidClientScheme.php
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*1`
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Http\ValidationRules\EInvoice;
|
||||||
|
|
||||||
|
use App\Services\EDocument\Standards\Validation\Peppol\ClientLevel;
|
||||||
|
use Closure;
|
||||||
|
use InvoiceNinja\EInvoice\EInvoice;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\Invoice;
|
||||||
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Illuminate\Contracts\Validation\ValidatorAwareRule;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ValidClientScheme.
|
||||||
|
*/
|
||||||
|
class ValidClientScheme implements ValidationRule, ValidatorAwareRule
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The validator instance.
|
||||||
|
*
|
||||||
|
* @var Validator
|
||||||
|
*/
|
||||||
|
protected $validator;
|
||||||
|
|
||||||
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
|
{
|
||||||
|
|
||||||
|
$r = new EInvoice();
|
||||||
|
$errors = $r->validateRequest($value['Invoice'], ClientLevel::class);
|
||||||
|
|
||||||
|
foreach ($errors as $key => $msg) {
|
||||||
|
|
||||||
|
$this->validator->errors()->add(
|
||||||
|
"e_invoice.{$key}",
|
||||||
|
"{$key} - {$msg}"
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the current validator.
|
||||||
|
*/
|
||||||
|
public function setValidator(Validator $validator): static
|
||||||
|
{
|
||||||
|
$this->validator = $validator;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -31,7 +31,10 @@ class ProductMap
|
|||||||
12 => 'product.custom_value2',
|
12 => 'product.custom_value2',
|
||||||
13 => 'product.custom_value3',
|
13 => 'product.custom_value3',
|
||||||
14 => 'product.custom_value4',
|
14 => 'product.custom_value4',
|
||||||
15 => 'product.image_url'
|
15 => 'product.image_url',
|
||||||
|
16 => 'product.in_stock_quantity',
|
||||||
|
17 => 'product.tax_category',
|
||||||
|
18 => 'product.max_quantity',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +57,9 @@ class ProductMap
|
|||||||
13 => 'texts.custom_value',
|
13 => 'texts.custom_value',
|
||||||
14 => 'texts.custom_value',
|
14 => 'texts.custom_value',
|
||||||
15 => 'texts.image_url',
|
15 => 'texts.image_url',
|
||||||
|
16 => 'texts.in_stock_quantity',
|
||||||
|
17 => 'texts.tax_category',
|
||||||
|
18 => 'texts.max_quantity',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class ExpenseTransformer extends BaseTransformer
|
|||||||
'client_id' => isset($data['expense.client'])
|
'client_id' => isset($data['expense.client'])
|
||||||
? $this->getClientId($data['expense.client'])
|
? $this->getClientId($data['expense.client'])
|
||||||
: null,
|
: null,
|
||||||
'date' => strlen($this->getString($data, 'expense.date') > 1) ? $this->parseDate($data['expense.date']) : now()->format('Y-m-d'),
|
'date' => strlen($this->getString($data, 'expense.date')) > 1 ? $this->parseDate($data['expense.date']) : now()->format('Y-m-d'),
|
||||||
'public_notes' => $this->getString($data, 'expense.public_notes'),
|
'public_notes' => $this->getString($data, 'expense.public_notes'),
|
||||||
'private_notes' => $this->getString($data, 'expense.private_notes'),
|
'private_notes' => $this->getString($data, 'expense.private_notes'),
|
||||||
'category_id' => isset($data['expense.category'])
|
'category_id' => isset($data['expense.category'])
|
||||||
|
@ -43,6 +43,7 @@ class ProductTransformer extends BaseTransformer
|
|||||||
'custom_value3' => $this->getString($data, 'product.custom_value3'),
|
'custom_value3' => $this->getString($data, 'product.custom_value3'),
|
||||||
'custom_value4' => $this->getString($data, 'product.custom_value4'),
|
'custom_value4' => $this->getString($data, 'product.custom_value4'),
|
||||||
'product_image' => $this->getString($data, 'product.image_url'),
|
'product_image' => $this->getString($data, 'product.image_url'),
|
||||||
|
'in_stock_quantity' => $this->getFloat($data, 'product.in_stock_quantity'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -448,6 +448,6 @@ class MatchBankTransactions implements ShouldQueue
|
|||||||
|
|
||||||
public function middleware()
|
public function middleware()
|
||||||
{
|
{
|
||||||
return [new WithoutOverlapping($this->company_id)];
|
return [new WithoutOverlapping($this->company->account->bank_integration_account_id)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,10 +35,6 @@ class ProcessBankTransactionsYodlee implements ShouldQueue
|
|||||||
use Queueable;
|
use Queueable;
|
||||||
use SerializesModels;
|
use SerializesModels;
|
||||||
|
|
||||||
private string $bank_integration_account_id;
|
|
||||||
|
|
||||||
private BankIntegration $bank_integration;
|
|
||||||
|
|
||||||
private ?string $from_date;
|
private ?string $from_date;
|
||||||
|
|
||||||
private bool $stop_loop = true;
|
private bool $stop_loop = true;
|
||||||
@ -50,10 +46,8 @@ class ProcessBankTransactionsYodlee implements ShouldQueue
|
|||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*/
|
*/
|
||||||
public function __construct(string $bank_integration_account_id, BankIntegration $bank_integration)
|
public function __construct(private string $bank_integration_account_id, private BankIntegration $bank_integration)
|
||||||
{
|
{
|
||||||
$this->bank_integration_account_id = $bank_integration_account_id;
|
|
||||||
$this->bank_integration = $bank_integration;
|
|
||||||
$this->from_date = $bank_integration->from_date;
|
$this->from_date = $bank_integration->from_date;
|
||||||
$this->company = $this->bank_integration->company;
|
$this->company = $this->bank_integration->company;
|
||||||
}
|
}
|
||||||
|
@ -93,8 +93,7 @@ class ProcessBrevoWebhook implements ShouldQueue
|
|||||||
{
|
{
|
||||||
MultiDB::findAndSetDbByCompanyKey($this->request['tags'][0]);
|
MultiDB::findAndSetDbByCompanyKey($this->request['tags'][0]);
|
||||||
|
|
||||||
/** @phpstan-ignore-next-line */
|
$this->company = Company::query()->where('company_key', $this->request['tags'][0])->first();
|
||||||
$this->company = Company::where('company_key', $this->request['tags'][0])->first();
|
|
||||||
|
|
||||||
$this->invitation = $this->discoverInvitation($this->request['message-id']);
|
$this->invitation = $this->discoverInvitation($this->request['message-id']);
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class CheckVat implements ShouldQueue
|
|||||||
|
|
||||||
public function middleware()
|
public function middleware()
|
||||||
{
|
{
|
||||||
return [new WithoutOverlapping($this->client->id)];
|
return [new WithoutOverlapping($this->client->client_hash)];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,8 @@ class CompanyExport implements ShouldQueue
|
|||||||
|
|
||||||
|
|
||||||
$this->export_data['users'] = $this->company->users()->withTrashed()->cursor()->map(function ($user) {
|
$this->export_data['users'] = $this->company->users()->withTrashed()->cursor()->map(function ($user) {
|
||||||
$user->account_id = $this->encodePrimaryKey($user->account_id);
|
/** @var \App\Models\User $user */
|
||||||
|
$user->account_id = $this->encodePrimaryKey($user->account_id); //@phpstan-ignore-line
|
||||||
return $user;
|
return $user;
|
||||||
})->all();
|
})->all();
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ class CompanyTaxRate implements ShouldQueue
|
|||||||
|
|
||||||
public function middleware()
|
public function middleware()
|
||||||
{
|
{
|
||||||
return [new WithoutOverlapping($this->company->id)];
|
return [new WithoutOverlapping($this->company->company_key)];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function failed($e)
|
public function failed($e)
|
||||||
|
@ -65,7 +65,7 @@ class AutoBillCron
|
|||||||
|
|
||||||
$auto_bill_partial_invoices->chunk(400, function ($invoices) {
|
$auto_bill_partial_invoices->chunk(400, function ($invoices) {
|
||||||
foreach ($invoices as $invoice) {
|
foreach ($invoices as $invoice) {
|
||||||
AutoBill::dispatch($invoice->id, false);
|
AutoBill::dispatch($invoice->id, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep(2);
|
sleep(2);
|
||||||
@ -87,7 +87,7 @@ class AutoBillCron
|
|||||||
|
|
||||||
$auto_bill_invoices->chunk(400, function ($invoices) {
|
$auto_bill_invoices->chunk(400, function ($invoices) {
|
||||||
foreach ($invoices as $invoice) {
|
foreach ($invoices as $invoice) {
|
||||||
AutoBill::dispatch($invoice->id, false);
|
AutoBill::dispatch($invoice->id, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep(2);
|
sleep(2);
|
||||||
|
@ -47,10 +47,12 @@ class CopyDocs implements ShouldQueue
|
|||||||
{
|
{
|
||||||
MultiDB::setDb($this->db);
|
MultiDB::setDb($this->db);
|
||||||
|
|
||||||
Document::whereIn('id', $this->document_ids)
|
Document::query()
|
||||||
|
->whereIn('id', $this->document_ids)
|
||||||
->where('company_id', $this->entity->company_id)
|
->where('company_id', $this->entity->company_id)
|
||||||
->each(function ($document) {
|
->each(function ($document) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Document $document */
|
||||||
$file = $document->getFile();
|
$file = $document->getFile();
|
||||||
|
|
||||||
$extension = pathinfo($document->name, PATHINFO_EXTENSION);
|
$extension = pathinfo($document->name, PATHINFO_EXTENSION);
|
||||||
|
@ -63,7 +63,7 @@ class CreateUbl implements ShouldQueue
|
|||||||
// invoice
|
// invoice
|
||||||
$ubl_invoice->setId($invoice->number);
|
$ubl_invoice->setId($invoice->number);
|
||||||
$ubl_invoice->setIssueDate(date_create($invoice->date));
|
$ubl_invoice->setIssueDate(date_create($invoice->date));
|
||||||
$ubl_invoice->setInvoiceTypeCode($invoice->amount < 0 ? self::INVOICE_TYPE_CREDIT : self::INVOICE_TYPE_STANDARD);
|
$ubl_invoice->setInvoiceTypeCode($invoice->amount < 0 ? (string)self::INVOICE_TYPE_CREDIT : (string)self::INVOICE_TYPE_STANDARD);
|
||||||
|
|
||||||
$supplier_party = $this->createParty($company, $invoice->user);
|
$supplier_party = $this->createParty($company, $invoice->user);
|
||||||
$ubl_invoice->setAccountingSupplierParty($supplier_party);
|
$ubl_invoice->setAccountingSupplierParty($supplier_party);
|
||||||
|
@ -75,6 +75,6 @@ class ClientLedgerBalanceUpdate implements ShouldQueue
|
|||||||
|
|
||||||
public function middleware()
|
public function middleware()
|
||||||
{
|
{
|
||||||
return [(new WithoutOverlapping($this->client->id))->dontRelease()];
|
return [(new WithoutOverlapping($this->client->client_hash))->dontRelease()];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ class ProcessMailgunWebhook implements ShouldQueue
|
|||||||
}
|
}
|
||||||
|
|
||||||
MultiDB::findAndSetDbByCompanyKey($this->request['event-data']['tags'][0]);
|
MultiDB::findAndSetDbByCompanyKey($this->request['event-data']['tags'][0]);
|
||||||
$company = Company::where('company_key', $this->request['event-data']['tags'][0])->first();
|
$company = Company::query()->where('company_key', $this->request['event-data']['tags'][0])->first();
|
||||||
|
|
||||||
if ($company && $this->request['event-data']['event'] == 'complained' && config('ninja.notification.slack')) {
|
if ($company && $this->request['event-data']['event'] == 'complained' && config('ninja.notification.slack')) {
|
||||||
$company->notification(new EmailSpamNotification($company))->ninja();
|
$company->notification(new EmailSpamNotification($company))->ninja();
|
||||||
|
@ -87,7 +87,7 @@ class ProcessPostmarkWebhook implements ShouldQueue
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
MultiDB::findAndSetDbByCompanyKey($this->request['Tag']);
|
MultiDB::findAndSetDbByCompanyKey($this->request['Tag']);
|
||||||
$this->company = Company::where('company_key', $this->request['Tag'])->first(); /** @phpstan-ignore-line */
|
$this->company = Company::query()->where('company_key', $this->request['Tag'])->first(); /** @phpstan-ignore-line */
|
||||||
|
|
||||||
$this->invitation = $this->discoverInvitation($this->request['MessageID']);
|
$this->invitation = $this->discoverInvitation($this->request['MessageID']);
|
||||||
|
|
||||||
|
@ -140,6 +140,6 @@ class UpdateOrCreateProduct implements ShouldQueue
|
|||||||
public function failed($exception = null)
|
public function failed($exception = null)
|
||||||
{
|
{
|
||||||
info('update create failed with = ');
|
info('update create failed with = ');
|
||||||
info(print_r($exception->getMessage(), 1));
|
nlog($exception->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,6 +202,6 @@ class SendRecurring implements ShouldQueue
|
|||||||
LightLogs::create($job_failure)
|
LightLogs::create($job_failure)
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
nlog(print_r($exception->getMessage(), 1));
|
nlog($exception->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@ class Import implements ShouldQueue
|
|||||||
|
|
||||||
$user->setCompany($this->company);
|
$user->setCompany($this->company);
|
||||||
|
|
||||||
$array = json_decode(file_get_contents($this->file_path), 1);
|
$array = json_decode(file_get_contents($this->file_path), true);
|
||||||
$data = $array['data'];
|
$data = $array['data'];
|
||||||
|
|
||||||
foreach ($this->available_imports as $import) {
|
foreach ($this->available_imports as $import) {
|
||||||
@ -253,7 +253,7 @@ class Import implements ShouldQueue
|
|||||||
$this->setInitialCompanyLedgerBalances();
|
$this->setInitialCompanyLedgerBalances();
|
||||||
|
|
||||||
// $this->fixClientBalances();
|
// $this->fixClientBalances();
|
||||||
$check_data = (new CheckCompanyData($this->company, md5(time())))->handle();
|
$check_data = (new CheckCompanyData($this->company, md5(time())))->handle(); //@phpstan-ignore-line
|
||||||
|
|
||||||
// if(Ninja::isHosted() && array_key_exists('ninja_tokens', $data))
|
// if(Ninja::isHosted() && array_key_exists('ninja_tokens', $data))
|
||||||
$this->processNinjaTokens($data['ninja_tokens']);
|
$this->processNinjaTokens($data['ninja_tokens']);
|
||||||
@ -1545,7 +1545,6 @@ class Import implements ShouldQueue
|
|||||||
$file_path,
|
$file_path,
|
||||||
$file_name,
|
$file_name,
|
||||||
$file_info,
|
$file_info,
|
||||||
filesize($file_path),
|
|
||||||
0,
|
0,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
@ -2010,7 +2009,7 @@ class Import implements ShouldQueue
|
|||||||
public function transformId($resource, string $old): int
|
public function transformId($resource, string $old): int
|
||||||
{
|
{
|
||||||
if (! array_key_exists($resource, $this->ids)) {
|
if (! array_key_exists($resource, $this->ids)) {
|
||||||
info(print_r($resource, 1));
|
nlog($resource);
|
||||||
throw new Exception("Resource {$resource} not available.");
|
throw new Exception("Resource {$resource} not available.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2067,11 +2066,10 @@ class Import implements ShouldQueue
|
|||||||
LightLogs::create($job_failure)
|
LightLogs::create($job_failure)
|
||||||
->queue();
|
->queue();
|
||||||
|
|
||||||
nlog(print_r($exception->getMessage(), 1));
|
nlog($exception->getMessage());
|
||||||
|
|
||||||
// if (Ninja::isHosted()) {
|
|
||||||
app('sentry')->captureException($exception);
|
app('sentry')->captureException($exception);
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -168,6 +168,6 @@ class StartMigration implements ShouldQueue
|
|||||||
|
|
||||||
public function failed($exception = null)
|
public function failed($exception = null)
|
||||||
{
|
{
|
||||||
info(print_r($exception->getMessage(), 1));
|
nlog($exception->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class UploadAvatar implements ShouldQueue
|
|||||||
|
|
||||||
public function handle(): ?string
|
public function handle(): ?string
|
||||||
{
|
{
|
||||||
$tmp_file = sha1(time()).'.png';
|
$tmp_file = sha1(time()).'.png'; //@phpstan-ignore-line
|
||||||
|
|
||||||
$im = imagecreatefromstring(file_get_contents($this->file));
|
$im = imagecreatefromstring(file_get_contents($this->file));
|
||||||
imagealphablending($im, false);
|
imagealphablending($im, false);
|
||||||
|
@ -94,7 +94,7 @@ class VersionCheck implements ShouldQueue
|
|||||||
|
|
||||||
Client::doesntHave('contacts')
|
Client::doesntHave('contacts')
|
||||||
->cursor()
|
->cursor()
|
||||||
->each(function (Client $client) {
|
->each(function (Client $client) { //@phpstan-ignore-line
|
||||||
|
|
||||||
$new_contact = ClientContactFactory::create($client->company_id, $client->user_id);
|
$new_contact = ClientContactFactory::create($client->company_id, $client->user_id);
|
||||||
$new_contact->client_id = $client->id;
|
$new_contact->client_id = $client->id;
|
||||||
@ -107,7 +107,7 @@ class VersionCheck implements ShouldQueue
|
|||||||
|
|
||||||
Vendor::doesntHave('contacts')
|
Vendor::doesntHave('contacts')
|
||||||
->cursor()
|
->cursor()
|
||||||
->each(function (Vendor $vendor) {
|
->each(function (Vendor $vendor) { //@phpstan-ignore-line
|
||||||
|
|
||||||
$new_contact = VendorContactFactory::create($vendor->company_id, $vendor->user_id);
|
$new_contact = VendorContactFactory::create($vendor->company_id, $vendor->user_id);
|
||||||
$new_contact->vendor_id = $vendor->id;
|
$new_contact->vendor_id = $vendor->id;
|
||||||
|
2
app/Jobs/Vendor/CreatePurchaseOrderPdf.php
vendored
2
app/Jobs/Vendor/CreatePurchaseOrderPdf.php
vendored
@ -199,7 +199,7 @@ class CreatePurchaseOrderPdf implements ShouldQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
nlog(print_r($e->getMessage(), 1));
|
nlog($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config('ninja.log_pdf_html')) {
|
if (config('ninja.log_pdf_html')) {
|
||||||
|
@ -58,7 +58,7 @@ class Apple
|
|||||||
'bid' => $this->bundle_id,
|
'bid' => $this->bundle_id,
|
||||||
];
|
];
|
||||||
|
|
||||||
$jwt = JWT::encode($payload, $this->private_key, $this->alg, $header);
|
$jwt = JWT::encode($payload, $this->private_key, $this->alg, null, $header);
|
||||||
|
|
||||||
$decoded = JWT::decode($jwt, new Key($this->private_key, $this->alg));
|
$decoded = JWT::decode($jwt, new Key($this->private_key, $this->alg));
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class MailSentListener implements ShouldQueue
|
|||||||
try {
|
try {
|
||||||
$message_id = $event->sent->getMessageId();
|
$message_id = $event->sent->getMessageId();
|
||||||
|
|
||||||
$message = MessageConverter::toEmail($event->sent->getOriginalMessage());
|
$message = MessageConverter::toEmail($event->sent->getOriginalMessage()); //@phpstan-ignore-line
|
||||||
|
|
||||||
if (!$message->getHeaders()->get('x-invitation')) {
|
if (!$message->getHeaders()->get('x-invitation')) {
|
||||||
return;
|
return;
|
||||||
|
@ -39,7 +39,7 @@ class StripeConnectFailed extends Mailable
|
|||||||
return new Envelope(
|
return new Envelope(
|
||||||
subject: "Stripe Connect not configured, please login and connect.",
|
subject: "Stripe Connect not configured, please login and connect.",
|
||||||
from: config('ninja.contact.email'),
|
from: config('ninja.contact.email'),
|
||||||
to: $this->user->email,
|
to: $this->user->email, //@phpstan-ignore-line
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class Backup extends BaseModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
$path = $client_or_vendor->backup_path().'/';
|
$path = $client_or_vendor->backup_path().'/';
|
||||||
$filename = now()->format('Y_m_d').'_'.md5(time()).'.html';
|
$filename = now()->format('Y_m_d').'_'.md5(time()).'.html'; //@phpstan-ignore-line
|
||||||
$file_path = $path.$filename;
|
$file_path = $path.$filename;
|
||||||
|
|
||||||
Storage::disk(config('filesystems.default'))->put($file_path, $html);
|
Storage::disk(config('filesystems.default'))->put($file_path, $html);
|
||||||
|
@ -38,7 +38,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property string|null $participant
|
* @property string|null $participant
|
||||||
* @property string|null $participant_name
|
* @property string|null $participant_name
|
||||||
* @property string $invoice_ids
|
* @property string $invoice_ids
|
||||||
* @property int|null $expense_id
|
* @property string|null $expense_id
|
||||||
* @property int|null $vendor_id
|
* @property int|null $vendor_id
|
||||||
* @property int $status_id
|
* @property int $status_id
|
||||||
* @property bool $is_deleted
|
* @property bool $is_deleted
|
||||||
|
@ -573,7 +573,7 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
if ($pm['gateway_type_id'] == GatewayType::BACS) {
|
if ($pm['gateway_type_id'] == GatewayType::BACS) {
|
||||||
$cg = CompanyGateway::query()->find($pm['company_gateway_id']);
|
$cg = CompanyGateway::query()->find($pm['company_gateway_id']);
|
||||||
|
|
||||||
if ($cg && ! property_exists($cg->fees_and_limits, GatewayType::BACS)) {
|
if ($cg && ! property_exists($cg->fees_and_limits, GatewayType::BACS)) { //@phpstan-ignore-line
|
||||||
$fees_and_limits = $cg->fees_and_limits;
|
$fees_and_limits = $cg->fees_and_limits;
|
||||||
$fees_and_limits->{GatewayType::BACS} = new FeesAndLimits();
|
$fees_and_limits->{GatewayType::BACS} = new FeesAndLimits();
|
||||||
$cg->fees_and_limits = $fees_and_limits;
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
@ -597,7 +597,7 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
if ($pm['gateway_type_id'] == GatewayType::ACSS) {
|
if ($pm['gateway_type_id'] == GatewayType::ACSS) {
|
||||||
$cg = CompanyGateway::query()->find($pm['company_gateway_id']);
|
$cg = CompanyGateway::query()->find($pm['company_gateway_id']);
|
||||||
|
|
||||||
if ($cg && ! property_exists($cg->fees_and_limits, GatewayType::ACSS)) {
|
if ($cg && ! property_exists($cg->fees_and_limits, GatewayType::ACSS)) { //@phpstan-ignore-line
|
||||||
$fees_and_limits = $cg->fees_and_limits;
|
$fees_and_limits = $cg->fees_and_limits;
|
||||||
$fees_and_limits->{GatewayType::ACSS} = new FeesAndLimits();
|
$fees_and_limits->{GatewayType::ACSS} = new FeesAndLimits();
|
||||||
$cg->fees_and_limits = $fees_and_limits;
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
@ -624,7 +624,7 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
if ($pm['gateway_type_id'] == GatewayType::BANK_TRANSFER) {
|
if ($pm['gateway_type_id'] == GatewayType::BANK_TRANSFER) {
|
||||||
$cg = CompanyGateway::query()->find($pm['company_gateway_id']);
|
$cg = CompanyGateway::query()->find($pm['company_gateway_id']);
|
||||||
|
|
||||||
if ($cg && ! property_exists($cg->fees_and_limits, GatewayType::BANK_TRANSFER)) {
|
if ($cg && ! property_exists($cg->fees_and_limits, GatewayType::BANK_TRANSFER)) { //@phpstan-ignore-line
|
||||||
$fees_and_limits = $cg->fees_and_limits;
|
$fees_and_limits = $cg->fees_and_limits;
|
||||||
$fees_and_limits->{GatewayType::BANK_TRANSFER} = new FeesAndLimits();
|
$fees_and_limits->{GatewayType::BANK_TRANSFER} = new FeesAndLimits();
|
||||||
$cg->fees_and_limits = $fees_and_limits;
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
@ -822,6 +822,20 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function utc_offset(): int
|
||||||
|
{
|
||||||
|
|
||||||
|
$offset = 0;
|
||||||
|
$timezone = $this->timezone();
|
||||||
|
|
||||||
|
date_default_timezone_set('GMT');
|
||||||
|
$date = new \DateTime("now", new \DateTimeZone($timezone->name));
|
||||||
|
$offset = $date->getOffset();
|
||||||
|
|
||||||
|
return $offset;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function timezone_offset(): int
|
public function timezone_offset(): int
|
||||||
{
|
{
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
|
@ -59,7 +59,7 @@ class DateFormat extends StaticModel
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
$date = mktime(0, 0, 0, 12, 31, date('Y'));
|
$date = mktime(0, 0, 0, 12, 31, date('Y')); //@phpstan-ignore-line
|
||||||
|
|
||||||
return date($this->format, $date);
|
return date($this->format, $date);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class DatetimeFormat extends StaticModel
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
$date = mktime(0, 0, 0, 12, 31, date('Y'));
|
$date = mktime(0, 0, 0, 12, 31, date('Y')); //@phpstan-ignore-line
|
||||||
|
|
||||||
return date($this->format, $date);
|
return date($this->format, $date);
|
||||||
}
|
}
|
||||||
|
@ -245,9 +245,9 @@ class Document extends BaseModel
|
|||||||
try {
|
try {
|
||||||
$file = base64_encode($image);
|
$file = base64_encode($image);
|
||||||
|
|
||||||
$img = new \Imagick();
|
$img = new \Imagick(); //@phpstan-ignore-line
|
||||||
$img->readImageBlob($file);
|
$img->readImageBlob($file);
|
||||||
$img->setImageCompression(true);
|
$img->setImageCompression(true); //@phpstan-ignore-line
|
||||||
$img->setImageCompressionQuality(40);
|
$img->setImageCompressionQuality(40);
|
||||||
|
|
||||||
return $img->getImageBlob();
|
return $img->getImageBlob();
|
||||||
|
@ -24,7 +24,7 @@ namespace App\Models;
|
|||||||
* @property string|null $site_url
|
* @property string|null $site_url
|
||||||
* @property bool $is_offsite
|
* @property bool $is_offsite
|
||||||
* @property bool $is_secure
|
* @property bool $is_secure
|
||||||
* @property object|null $fields
|
* @property object|null|string $fields
|
||||||
* @property string $default_gateway_type_id
|
* @property string $default_gateway_type_id
|
||||||
* @property int|null $created_at
|
* @property int|null $created_at
|
||||||
* @property int|null $updated_at
|
* @property int|null $updated_at
|
||||||
|
@ -375,6 +375,7 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
// To access campaign data => Cache::get(CAMPAIGN_HASH)
|
// To access campaign data => Cache::get(CAMPAIGN_HASH)
|
||||||
// To access utm data => session()->get('utm-' . CAMPAIGN_HASH);
|
// To access utm data => session()->get('utm-' . CAMPAIGN_HASH);
|
||||||
|
|
||||||
|
/** @var \App\Models\Subscription $billing_subscription */
|
||||||
(new SubscriptionService($billing_subscription))->completePurchase($this->payment_hash);
|
(new SubscriptionService($billing_subscription))->completePurchase($this->payment_hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class CreditCard
|
|||||||
|
|
||||||
if ($this->braintree->company_gateway->getConfigField('merchantAccountId')) {
|
if ($this->braintree->company_gateway->getConfigField('merchantAccountId')) {
|
||||||
/** https://developer.paypal.com/braintree/docs/reference/request/client-token/generate#merchant_account_id */
|
/** https://developer.paypal.com/braintree/docs/reference/request/client-token/generate#merchant_account_id */
|
||||||
$data['client_token'] = $this->braintree->gateway->clientToken()->generate([
|
$data['client_token'] = $this->braintree->gateway->clientToken()->generate([ //@phpstan-ignore-line
|
||||||
'merchantAccountId' => $this->braintree->company_gateway->getConfigField('merchantAccountId'),
|
'merchantAccountId' => $this->braintree->company_gateway->getConfigField('merchantAccountId'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ class CreditCard
|
|||||||
$token = $this->getPaymentToken($request->all(), $customer->id);
|
$token = $this->getPaymentToken($request->all(), $customer->id);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'amount' => $this->braintree->payment_hash->data->amount_with_fee,
|
'amount' => $this->braintree->payment_hash->data->amount_with_fee, //@phpstan-ignore-line
|
||||||
'paymentMethodToken' => $token,
|
'paymentMethodToken' => $token,
|
||||||
'deviceData' => $state['client-data'],
|
'deviceData' => $state['client-data'],
|
||||||
'options' => [
|
'options' => [
|
||||||
|
@ -387,7 +387,7 @@ class BraintreePaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
foreach($cards as $card) {
|
foreach($cards as $card) {
|
||||||
|
|
||||||
if($this->getToken($card->token, $card->customerId) || Carbon::createFromDate($card->expirationYear, $card->expirationMonth, '1')->lt(now())) {
|
if($this->getToken($card->token, $card->customerId) || Carbon::createFromDate($card->expirationYear, $card->expirationMonth, '1')->lt(now())) { //@phpstan-ignore-line
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -592,7 +592,7 @@ class CheckoutComPaymentDriver extends BaseDriver
|
|||||||
foreach($customer['instruments'] as $card) {
|
foreach($customer['instruments'] as $card) {
|
||||||
if(
|
if(
|
||||||
$card['type'] != 'card' ||
|
$card['type'] != 'card' ||
|
||||||
Carbon::createFromDate($card['expiry_year'], $card['expiry_month'], '1')->lt(now()) ||
|
Carbon::createFromDate($card['expiry_year'], $card['expiry_month'], '1')->lt(now()) || //@phpstan-ignore-line
|
||||||
$this->getToken($card['id'], $customer['id'])
|
$this->getToken($card['id'], $customer['id'])
|
||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -297,8 +297,7 @@ class PayPalWebhook implements ShouldQueue
|
|||||||
$gateway = CompanyGateway::query()
|
$gateway = CompanyGateway::query()
|
||||||
->where('company_id', $company->id)
|
->where('company_id', $company->id)
|
||||||
->where('gateway_key', $this->gateway_key)
|
->where('gateway_key', $this->gateway_key)
|
||||||
->cursor()
|
->first(function ($cg) use ($merchant_id) { //@phpstan-ignore-line
|
||||||
->first(function ($cg) use ($merchant_id) {
|
|
||||||
$config = $cg->getConfig();
|
$config = $cg->getConfig();
|
||||||
|
|
||||||
if($config->merchantId == $merchant_id) {
|
if($config->merchantId == $merchant_id) {
|
||||||
|
@ -188,7 +188,7 @@ class SquarePaymentDriver extends BaseDriver
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
/** @var \Square\Models\Error $error */
|
/** @var \Square\Models\Error $error */
|
||||||
$error = end($apiResponse->getErrors());
|
$error = end($apiResponse->getErrors()); //@phpstan-ignore-line
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'transaction_reference' => $payment->transaction_reference,
|
'transaction_reference' => $payment->transaction_reference,
|
||||||
|
@ -267,6 +267,7 @@ class ACSS
|
|||||||
|
|
||||||
$gateway_response = json_decode($request->gateway_response);
|
$gateway_response = json_decode($request->gateway_response);
|
||||||
|
|
||||||
|
/** @var \App\Models\ClientGatewayToken $cgt */
|
||||||
$cgt = ClientGatewayToken::find($this->decodePrimaryKey($request->token));
|
$cgt = ClientGatewayToken::find($this->decodePrimaryKey($request->token));
|
||||||
|
|
||||||
/** @var \Stripe\PaymentIntent $intent */
|
/** @var \Stripe\PaymentIntent $intent */
|
||||||
|
@ -208,7 +208,7 @@ class ImportCustomers
|
|||||||
if (! $cgt) {
|
if (! $cgt) {
|
||||||
nlog('customer '.$searchResults->data[0]->id.' does not exist.');
|
nlog('customer '.$searchResults->data[0]->id.' does not exist.');
|
||||||
|
|
||||||
$this->update_payment_methods->updateMethods($searchResults->data[0], $client);
|
$this->update_payment_methods->updateMethods($searchResults->data[0], $client); //@phpstan-ignore-line
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ class ActivityRepository extends BaseRepository
|
|||||||
* Save the Activity.
|
* Save the Activity.
|
||||||
*
|
*
|
||||||
* @param \stdClass $fields The fields
|
* @param \stdClass $fields The fields
|
||||||
* @param \App\Models\Invoice | \App\Models\Quote | \App\Models\Credit | \App\Models\PurchaseOrder | \App\Models\Expense $entity
|
* @param \App\Models\Invoice | \App\Models\Quote | \App\Models\Credit | \App\Models\PurchaseOrder | \App\Models\Expense | \App\Models\Payment $entity
|
||||||
* @param array $event_vars
|
* @param array $event_vars
|
||||||
*/
|
*/
|
||||||
public function save($fields, $entity, $event_vars)
|
public function save($fields, $entity, $event_vars)
|
||||||
|
@ -87,7 +87,7 @@ class PaymentMigrationRepository extends BaseRepository
|
|||||||
|
|
||||||
if (! array_key_exists('status_id', $data)) {
|
if (! array_key_exists('status_id', $data)) {
|
||||||
info('payment with no status id?');
|
info('payment with no status id?');
|
||||||
info(print_r($data, 1));
|
info(print_r($data, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
$payment->status_id = $data['status_id'];
|
$payment->status_id = $data['status_id'];
|
||||||
|
@ -124,13 +124,13 @@ class SubscriptionRepository extends BaseRepository
|
|||||||
*
|
*
|
||||||
* Removing the nested keys of the items array
|
* Removing the nested keys of the items array
|
||||||
*
|
*
|
||||||
* @param array $bundle
|
* @param mixed $bundle
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function convertV3Bundle($bundle): array
|
private function convertV3Bundle($bundle): array
|
||||||
{
|
{
|
||||||
if(is_object($bundle)) {
|
if(is_object($bundle)) {
|
||||||
$bundle = json_decode(json_encode($bundle), 1);
|
$bundle = json_decode(json_encode($bundle), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$items = [];
|
$items = [];
|
||||||
|
@ -180,10 +180,12 @@ class ClientService
|
|||||||
|
|
||||||
public function updatePaymentBalance()
|
public function updatePaymentBalance()
|
||||||
{
|
{
|
||||||
$amount = Payment::query()->where('client_id', $this->client->id)
|
$amount = Payment::query()
|
||||||
|
->withTrashed()
|
||||||
|
->where('client_id', $this->client->id)
|
||||||
->where('is_deleted', 0)
|
->where('is_deleted', 0)
|
||||||
->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED])
|
->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED])
|
||||||
->selectRaw('SUM(payments.amount - payments.applied) as amount')->first()->amount ?? 0;
|
->selectRaw('SUM(payments.amount - payments.applied - payments.refunded) as amount')->first()->amount ?? 0;
|
||||||
|
|
||||||
DB::connection(config('database.default'))->transaction(function () use ($amount) {
|
DB::connection(config('database.default'))->transaction(function () use ($amount) {
|
||||||
$this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first();
|
$this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first();
|
||||||
|
@ -166,7 +166,7 @@ class PaymentMethod
|
|||||||
//note we have to use GatewayType::CREDIT_CARD as alias for CUSTOM
|
//note we have to use GatewayType::CREDIT_CARD as alias for CUSTOM
|
||||||
foreach ($this->gateways as $gateway) {
|
foreach ($this->gateways as $gateway) {
|
||||||
foreach ($gateway->driver($this->client)->gatewayTypes() as $type) {
|
foreach ($gateway->driver($this->client)->gatewayTypes() as $type) {
|
||||||
if (isset($gateway->fees_and_limits) && is_object($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, GatewayType::CREDIT_CARD)) {
|
if (isset($gateway->fees_and_limits) && is_object($gateway->fees_and_limits) && property_exists($gateway->fees_and_limits, GatewayType::CREDIT_CARD)) { //@phpstan-ignore-line
|
||||||
if ($this->validGatewayForAmount($gateway->fees_and_limits->{GatewayType::CREDIT_CARD}, $this->amount)) {
|
if ($this->validGatewayForAmount($gateway->fees_and_limits->{GatewayType::CREDIT_CARD}, $this->amount)) {
|
||||||
// $this->payment_methods[] = [$gateway->id => $type];
|
// $this->payment_methods[] = [$gateway->id => $type];
|
||||||
//@15-06-2024
|
//@15-06-2024
|
||||||
|
@ -187,7 +187,7 @@ class Statement
|
|||||||
$pdf = $this->makePdf(null, null, $html);
|
$pdf = $this->makePdf(null, null, $html);
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
nlog(print_r($e->getMessage(), 1));
|
nlog(print_r($e->getMessage(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -385,7 +385,6 @@ class Statement
|
|||||||
/**
|
/**
|
||||||
* Get correct invitation ID.
|
* Get correct invitation ID.
|
||||||
*
|
*
|
||||||
* @return int|bool
|
|
||||||
*/
|
*/
|
||||||
protected function getInvitation()
|
protected function getInvitation()
|
||||||
{
|
{
|
||||||
|
148
app/Services/EDocument/Gateway/Storecove/Storecove.php
Normal file
148
app/Services/EDocument/Gateway/Storecove/Storecove.php
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Services\EDocument\Gateway;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
||||||
|
|
||||||
|
enum HttpVerb: string
|
||||||
|
{
|
||||||
|
case POST = 'post';
|
||||||
|
case PUT = 'put';
|
||||||
|
case GET = 'get';
|
||||||
|
case PATCH = 'patch';
|
||||||
|
case DELETE = 'delete';
|
||||||
|
}
|
||||||
|
|
||||||
|
class Storecove {
|
||||||
|
|
||||||
|
private array $peppol_discovery = [
|
||||||
|
"documentTypes" => ["invoice"],
|
||||||
|
"network" => "peppol",
|
||||||
|
"metaScheme" => "iso6523-actorid-upis",
|
||||||
|
"scheme" => "de:lwid",
|
||||||
|
"identifier" => "10101010-STO-10"
|
||||||
|
];
|
||||||
|
|
||||||
|
private array $dbn_discovery = [
|
||||||
|
"documentTypes" => ["invoice"],
|
||||||
|
"network" => "dbnalliance",
|
||||||
|
"metaScheme" => "iso6523-actorid-upis",
|
||||||
|
"scheme" => "gln",
|
||||||
|
"identifier" => "1200109963131"
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
public function __construct(){}
|
||||||
|
|
||||||
|
//config('ninja.storecove_api_key');
|
||||||
|
|
||||||
|
|
||||||
|
//https://app.storecove.com/en/docs#_test_identifiers
|
||||||
|
//check if identifier is able to send on the network.
|
||||||
|
|
||||||
|
|
||||||
|
//response = { "code": "OK", "email": false}
|
||||||
|
public function discovery($identifier, $scheme, $network = 'peppol')
|
||||||
|
{
|
||||||
|
$network_data = [];
|
||||||
|
|
||||||
|
match ($network) {
|
||||||
|
'peppol' => $network_data = array_merge($this->peppol_discovery, ['scheme' => $scheme, 'identifier' => $identifier]),
|
||||||
|
'dbn' => $network_data = array_merge($this->dbn_discovery, ['scheme' => $scheme, 'identifier' => $identifier]),
|
||||||
|
default => $network_data = array_merge($this->peppol_discovery, ['scheme' => $scheme, 'identifier' => $identifier]),
|
||||||
|
};
|
||||||
|
|
||||||
|
$uri = "https://api.storecove.com/api/v2/discovery/receives";
|
||||||
|
|
||||||
|
$r = $this->httpClient($uri, (HttpVerb::POST)->value, $network_data, $this->getHeaders());
|
||||||
|
|
||||||
|
return ($r->successful() && $r->json()['code'] == 'OK') ? true : false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//response = "guid" : "xx",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the receiver cannot be found, then an
|
||||||
|
* email is sent to that user if a appropriate
|
||||||
|
* email is included in the document payload
|
||||||
|
*
|
||||||
|
* {
|
||||||
|
"routing": {
|
||||||
|
"emails": [
|
||||||
|
"test@example.com"
|
||||||
|
],
|
||||||
|
"eIdentifiers": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
// documentType : invoice/invoice_response/order
|
||||||
|
// rawDocumentData : {
|
||||||
|
// document: base64_encode($ubl)
|
||||||
|
// parse: true
|
||||||
|
// parseStrategy: ubl
|
||||||
|
// }
|
||||||
|
*/
|
||||||
|
public function sendDocument($document)
|
||||||
|
{
|
||||||
|
|
||||||
|
$payload = [
|
||||||
|
'documentType' => 'invoice',
|
||||||
|
'rawDocumentData' => base64_encode($document),
|
||||||
|
'parse' => true,
|
||||||
|
'parseStrategy', 'ubl'
|
||||||
|
];
|
||||||
|
|
||||||
|
$uri = "https://api.storecove.com/api/v2/document_submissions";
|
||||||
|
|
||||||
|
$r = $this->httpClient($uri, (HttpVerb::POST)->value, $payload, $this->getHeaders());
|
||||||
|
|
||||||
|
if($r->successful())
|
||||||
|
return $r->json()['guid'];
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//document submission sending evidence
|
||||||
|
public function getSendingEvidence(string $guid)
|
||||||
|
{
|
||||||
|
$uri = "https://api.storecove.com/api/v2/document_submissions/{$guid}";
|
||||||
|
$r = $this->httpClient($uri, (HttpVerb::GET)->value, [], $this->getHeaders());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getHeaders(array $headers = [])
|
||||||
|
{
|
||||||
|
|
||||||
|
return array_merge([
|
||||||
|
'Accept' => 'application/json',
|
||||||
|
'Content-type' => 'application/json',
|
||||||
|
], $headers);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function httpClient(string $uri, string $verb, array $data, ?array $headers = [])
|
||||||
|
{
|
||||||
|
|
||||||
|
$r = Http::withToken(config('ninja.storecove_api_key'))
|
||||||
|
->withHeaders($this->getHeaders($headers))
|
||||||
|
->{$verb}($uri, $data);
|
||||||
|
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -188,7 +188,7 @@ class RoEInvoice extends AbstractService
|
|||||||
|
|
||||||
$ubl_invoice->setCustomizationID("urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1");
|
$ubl_invoice->setCustomizationID("urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1");
|
||||||
// invoice
|
// invoice
|
||||||
$ubl_invoice->setId($invoice->number);
|
$ubl_invoice->setId($invoice->number); //@phpstan-ignore-line
|
||||||
$ubl_invoice->setIssueDate(date_create($invoice->date));
|
$ubl_invoice->setIssueDate(date_create($invoice->date));
|
||||||
$ubl_invoice->setDueDate(date_create($invoice->due_date));
|
$ubl_invoice->setDueDate(date_create($invoice->due_date));
|
||||||
$ubl_invoice->setInvoiceTypeCode("380");
|
$ubl_invoice->setInvoiceTypeCode("380");
|
||||||
|
@ -0,0 +1,303 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Services\EDocument\Standards\Validation\Peppol;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\AllowanceChargeType\AllowanceCharge;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\BillingReferenceType\BillingReference;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\CodeType\AccountingCostCode;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\CodeType\DocumentCurrencyCode;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\CodeType\InvoiceTypeCode;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\CodeType\PaymentAlternativeCurrencyCode;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\CodeType\PaymentCurrencyCode;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\CodeType\PricingCurrencyCode;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\CodeType\TaxCurrencyCode;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\CustomerPartyType\AccountingCustomerParty;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\CustomerPartyType\BuyerCustomerParty;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\DeliveryTermsType\DeliveryTerms;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\DeliveryType\Delivery;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\DocumentReferenceType\AdditionalDocumentReference;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\DocumentReferenceType\ContractDocumentReference;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\DocumentReferenceType\DespatchDocumentReference;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\DocumentReferenceType\OriginatorDocumentReference;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\DocumentReferenceType\ReceiptDocumentReference;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\DocumentReferenceType\StatementDocumentReference;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\ExchangeRateType\PaymentAlternativeExchangeRate;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\ExchangeRateType\PaymentExchangeRate;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\ExchangeRateType\PricingExchangeRate;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\ExchangeRateType\TaxExchangeRate;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\IdentifierType\CustomizationID;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\IdentifierType\ID;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\IdentifierType\ProfileExecutionID;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\IdentifierType\ProfileID;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\IdentifierType\UBLVersionID;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\IdentifierType\UUID;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\InvoiceLineType\InvoiceLine;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\MonetaryTotalType\LegalMonetaryTotal;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\NumericType\LineCountNumeric;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\OrderReferenceType\OrderReference;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\PartyType\PayeeParty;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\PartyType\TaxRepresentativeParty;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\PaymentMeansType\PaymentMeans;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\PaymentTermsType\PaymentTerms;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\PaymentType\PrepaidPayment;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\PeriodType\InvoicePeriod;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\ProjectReferenceType\ProjectReference;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\SignatureType\Signature;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\SupplierPartyType\AccountingSupplierParty;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\SupplierPartyType\SellerSupplierParty;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\TaxTotalType\TaxTotal;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\TaxTotalType\WithholdingTaxTotal;
|
||||||
|
use Symfony\Component\Serializer\Attribute\Context;
|
||||||
|
use Symfony\Component\Serializer\Attribute\SerializedName;
|
||||||
|
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
|
||||||
|
use Symfony\Component\Validator\Constraints\Date;
|
||||||
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
|
use Symfony\Component\Validator\Constraints\NotNull;
|
||||||
|
use Symfony\Component\Validator\Constraints\Valid;
|
||||||
|
|
||||||
|
class ClientLevel
|
||||||
|
{
|
||||||
|
// /** @var UBLVersionID */
|
||||||
|
// #[SerializedName('cbc:UBLVersionID')]
|
||||||
|
// public $UBLVersionID;
|
||||||
|
|
||||||
|
// /** @var CustomizationID */
|
||||||
|
// #[SerializedName('cbc:CustomizationID')]
|
||||||
|
// public $CustomizationID;
|
||||||
|
|
||||||
|
// /** @var ProfileID */
|
||||||
|
// #[SerializedName('cbc:ProfileID')]
|
||||||
|
// public $ProfileID;
|
||||||
|
|
||||||
|
// /** @var ProfileExecutionID */
|
||||||
|
// #[SerializedName('cbc:ProfileExecutionID')]
|
||||||
|
// public $ProfileExecutionID;
|
||||||
|
|
||||||
|
// /** @var ID */
|
||||||
|
// #[NotNull]
|
||||||
|
// #[NotBlank]
|
||||||
|
// #[Valid]
|
||||||
|
// #[SerializedName('cbc:ID')]
|
||||||
|
// public $ID;
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
#[SerializedName('cbc:CopyIndicator')]
|
||||||
|
public bool $CopyIndicator;
|
||||||
|
|
||||||
|
/** @var UUID */
|
||||||
|
#[SerializedName('cbc:UUID')]
|
||||||
|
public $UUID;
|
||||||
|
|
||||||
|
// /** @var ?\DateTime */
|
||||||
|
// #[NotNull]
|
||||||
|
// #[NotBlank]
|
||||||
|
// #[Valid]
|
||||||
|
// #[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'])]
|
||||||
|
// #[SerializedName('cbc:IssueDate')]
|
||||||
|
// public ?DateTime $IssueDate;
|
||||||
|
|
||||||
|
// /** @var ?\DateTime */
|
||||||
|
// #[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d\TH:i:s.uP'])]
|
||||||
|
// #[SerializedName('cbc:IssueTime')]
|
||||||
|
// public ?DateTime $IssueTime;
|
||||||
|
|
||||||
|
// /** @var ?\DateTime */
|
||||||
|
// #[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'])]
|
||||||
|
// #[SerializedName('cbc:DueDate')]
|
||||||
|
// public ?DateTime $DueDate;
|
||||||
|
|
||||||
|
/** @var InvoiceTypeCode */
|
||||||
|
#[SerializedName('cbc:InvoiceTypeCode')]
|
||||||
|
public $InvoiceTypeCode;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
#[SerializedName('cbc:Note')]
|
||||||
|
public string $Note;
|
||||||
|
|
||||||
|
/** @var ?\DateTime */
|
||||||
|
#[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'])]
|
||||||
|
#[SerializedName('cbc:TaxPointDate')]
|
||||||
|
public ?DateTime $TaxPointDate;
|
||||||
|
|
||||||
|
/** @var DocumentCurrencyCode */
|
||||||
|
#[SerializedName('cbc:DocumentCurrencyCode')]
|
||||||
|
public $DocumentCurrencyCode;
|
||||||
|
|
||||||
|
/** @var TaxCurrencyCode */
|
||||||
|
#[SerializedName('cbc:TaxCurrencyCode')]
|
||||||
|
public $TaxCurrencyCode;
|
||||||
|
|
||||||
|
/** @var PricingCurrencyCode */
|
||||||
|
#[SerializedName('cbc:PricingCurrencyCode')]
|
||||||
|
public $PricingCurrencyCode;
|
||||||
|
|
||||||
|
/** @var PaymentCurrencyCode */
|
||||||
|
#[SerializedName('cbc:PaymentCurrencyCode')]
|
||||||
|
public $PaymentCurrencyCode;
|
||||||
|
|
||||||
|
/** @var PaymentAlternativeCurrencyCode */
|
||||||
|
#[SerializedName('cbc:PaymentAlternativeCurrencyCode')]
|
||||||
|
public $PaymentAlternativeCurrencyCode;
|
||||||
|
|
||||||
|
// /** @var AccountingCostCode */
|
||||||
|
// #[SerializedName('cbc:AccountingCostCode')]
|
||||||
|
// public $AccountingCostCode;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
#[SerializedName('cbc:AccountingCost')]
|
||||||
|
public string $AccountingCost;
|
||||||
|
|
||||||
|
// /** @var LineCountNumeric */
|
||||||
|
// #[SerializedName('cbc:LineCountNumeric')]
|
||||||
|
// public $LineCountNumeric;
|
||||||
|
|
||||||
|
// /** @var string */
|
||||||
|
// #[SerializedName('cbc:BuyerReference')]
|
||||||
|
// public string $BuyerReference;
|
||||||
|
|
||||||
|
// /** @var InvoicePeriod[] */
|
||||||
|
// #[SerializedName('cac:InvoicePeriod')]
|
||||||
|
// public array $InvoicePeriod;
|
||||||
|
|
||||||
|
// /** @var OrderReference */
|
||||||
|
// #[SerializedName('cac:OrderReference')]
|
||||||
|
// public $OrderReference;
|
||||||
|
|
||||||
|
// /** @var BillingReference[] */
|
||||||
|
// #[SerializedName('cac:BillingReference')]
|
||||||
|
// public array $BillingReference;
|
||||||
|
|
||||||
|
/** @var DespatchDocumentReference[] */
|
||||||
|
#[SerializedName('cac:DespatchDocumentReference')]
|
||||||
|
public array $DespatchDocumentReference;
|
||||||
|
|
||||||
|
/** @var ReceiptDocumentReference[] */
|
||||||
|
#[SerializedName('cac:ReceiptDocumentReference')]
|
||||||
|
public array $ReceiptDocumentReference;
|
||||||
|
|
||||||
|
/** @var StatementDocumentReference[] */
|
||||||
|
#[SerializedName('cac:StatementDocumentReference')]
|
||||||
|
public array $StatementDocumentReference;
|
||||||
|
|
||||||
|
/** @var OriginatorDocumentReference[] */
|
||||||
|
#[SerializedName('cac:OriginatorDocumentReference')]
|
||||||
|
public array $OriginatorDocumentReference;
|
||||||
|
|
||||||
|
/** @var ContractDocumentReference[] */
|
||||||
|
#[SerializedName('cac:ContractDocumentReference')]
|
||||||
|
public array $ContractDocumentReference;
|
||||||
|
|
||||||
|
/** @var AdditionalDocumentReference[] */
|
||||||
|
#[SerializedName('cac:AdditionalDocumentReference')]
|
||||||
|
public array $AdditionalDocumentReference;
|
||||||
|
|
||||||
|
/** @var ProjectReference[] */
|
||||||
|
#[SerializedName('cac:ProjectReference')]
|
||||||
|
public array $ProjectReference;
|
||||||
|
|
||||||
|
// /** @var Signature[] */
|
||||||
|
// #[SerializedName('cac:Signature')]
|
||||||
|
// public array $Signature;
|
||||||
|
|
||||||
|
// /** @var AccountingSupplierParty */
|
||||||
|
// #[NotNull]
|
||||||
|
// #[NotBlank]
|
||||||
|
// #[Valid]
|
||||||
|
// #[SerializedName('cac:AccountingSupplierParty')]
|
||||||
|
// public $AccountingSupplierParty;
|
||||||
|
|
||||||
|
// /** @var AccountingCustomerParty */
|
||||||
|
// #[NotNull]
|
||||||
|
// #[NotBlank]
|
||||||
|
// #[Valid]
|
||||||
|
// #[SerializedName('cac:AccountingCustomerParty')]
|
||||||
|
// public $AccountingCustomerParty;
|
||||||
|
|
||||||
|
/** @var PayeeParty */
|
||||||
|
#[SerializedName('cac:PayeeParty')]
|
||||||
|
public $PayeeParty;
|
||||||
|
|
||||||
|
/** @var BuyerCustomerParty */
|
||||||
|
#[SerializedName('cac:BuyerCustomerParty')]
|
||||||
|
public $BuyerCustomerParty;
|
||||||
|
|
||||||
|
// /** @var SellerSupplierParty */
|
||||||
|
// #[SerializedName('cac:SellerSupplierParty')]
|
||||||
|
// public $SellerSupplierParty;
|
||||||
|
|
||||||
|
/** @var TaxRepresentativeParty */
|
||||||
|
#[SerializedName('cac:TaxRepresentativeParty')]
|
||||||
|
public $TaxRepresentativeParty;
|
||||||
|
|
||||||
|
/** @var Delivery[] */
|
||||||
|
#[SerializedName('cac:Delivery')]
|
||||||
|
public array $Delivery;
|
||||||
|
|
||||||
|
/** @var DeliveryTerms */
|
||||||
|
#[SerializedName('cac:DeliveryTerms')]
|
||||||
|
public $DeliveryTerms;
|
||||||
|
|
||||||
|
/** @var PaymentMeans[] */
|
||||||
|
#[SerializedName('cac:PaymentMeans')]
|
||||||
|
public array $PaymentMeans;
|
||||||
|
|
||||||
|
/** @var PaymentTerms[] */
|
||||||
|
#[SerializedName('cac:PaymentTerms')]
|
||||||
|
public array $PaymentTerms;
|
||||||
|
|
||||||
|
// /** @var PrepaidPayment[] */
|
||||||
|
// #[SerializedName('cac:PrepaidPayment')]
|
||||||
|
// public array $PrepaidPayment;
|
||||||
|
|
||||||
|
// /** @var AllowanceCharge[] */
|
||||||
|
// #[SerializedName('cac:AllowanceCharge')]
|
||||||
|
// public array $AllowanceCharge;
|
||||||
|
|
||||||
|
// /** @var TaxExchangeRate */
|
||||||
|
// #[SerializedName('cac:TaxExchangeRate')]
|
||||||
|
// public $TaxExchangeRate;
|
||||||
|
|
||||||
|
// /** @var PricingExchangeRate */
|
||||||
|
// #[SerializedName('cac:PricingExchangeRate')]
|
||||||
|
// public $PricingExchangeRate;
|
||||||
|
|
||||||
|
// /** @var PaymentExchangeRate */
|
||||||
|
// #[SerializedName('cac:PaymentExchangeRate')]
|
||||||
|
// public $PaymentExchangeRate;
|
||||||
|
|
||||||
|
// /** @var PaymentAlternativeExchangeRate */
|
||||||
|
// #[SerializedName('cac:PaymentAlternativeExchangeRate')]
|
||||||
|
// public $PaymentAlternativeExchangeRate;
|
||||||
|
|
||||||
|
// /** @var TaxTotal[] */
|
||||||
|
// #[SerializedName('cac:TaxTotal')]
|
||||||
|
// public array $TaxTotal;
|
||||||
|
|
||||||
|
// /** @var WithholdingTaxTotal[] */
|
||||||
|
// #[SerializedName('cac:WithholdingTaxTotal')]
|
||||||
|
// public array $WithholdingTaxTotal;
|
||||||
|
|
||||||
|
// /** @var LegalMonetaryTotal */
|
||||||
|
// #[NotNull]
|
||||||
|
// #[NotBlank]
|
||||||
|
// #[Valid]
|
||||||
|
// #[SerializedName('cac:LegalMonetaryTotal')]
|
||||||
|
// public $LegalMonetaryTotal;
|
||||||
|
|
||||||
|
// /** @var InvoiceLine[] */
|
||||||
|
// #[NotNull]
|
||||||
|
// #[NotBlank]
|
||||||
|
// #[Valid]
|
||||||
|
// #[SerializedName('cac:InvoiceLine')]
|
||||||
|
// public array $InvoiceLine;
|
||||||
|
}
|
@ -153,9 +153,9 @@ class CompanyLevel
|
|||||||
// #[SerializedName('cbc:AccountingCostCode')]
|
// #[SerializedName('cbc:AccountingCostCode')]
|
||||||
// public $AccountingCostCode;
|
// public $AccountingCostCode;
|
||||||
|
|
||||||
// /** @var string */
|
/** @var string */
|
||||||
// #[SerializedName('cbc:AccountingCost')]
|
#[SerializedName('cbc:AccountingCost')]
|
||||||
// public string $AccountingCost;
|
public string $AccountingCost;
|
||||||
|
|
||||||
// /** @var LineCountNumeric */
|
// /** @var LineCountNumeric */
|
||||||
// #[SerializedName('cbc:LineCountNumeric')]
|
// #[SerializedName('cbc:LineCountNumeric')]
|
||||||
@ -231,9 +231,9 @@ class CompanyLevel
|
|||||||
// #[SerializedName('cac:BuyerCustomerParty')]
|
// #[SerializedName('cac:BuyerCustomerParty')]
|
||||||
// public $BuyerCustomerParty;
|
// public $BuyerCustomerParty;
|
||||||
|
|
||||||
// /** @var SellerSupplierParty */
|
/** @var SellerSupplierParty */
|
||||||
// #[SerializedName('cac:SellerSupplierParty')]
|
#[SerializedName('cac:SellerSupplierParty')]
|
||||||
// public $SellerSupplierParty;
|
public $SellerSupplierParty;
|
||||||
|
|
||||||
/** @var TaxRepresentativeParty */
|
/** @var TaxRepresentativeParty */
|
||||||
#[SerializedName('cac:TaxRepresentativeParty')]
|
#[SerializedName('cac:TaxRepresentativeParty')]
|
||||||
|
@ -433,7 +433,7 @@ class AutoBillInvoice extends AbstractService
|
|||||||
$company_gateway = $gateway_token->gateway;
|
$company_gateway = $gateway_token->gateway;
|
||||||
|
|
||||||
//check if fees and limits are set
|
//check if fees and limits are set
|
||||||
if (isset($company_gateway->fees_and_limits) && ! is_array($company_gateway->fees_and_limits) && property_exists($company_gateway->fees_and_limits, $gateway_token->gateway_type_id)) {
|
if (isset($company_gateway->fees_and_limits) && ! is_array($company_gateway->fees_and_limits) && property_exists($company_gateway->fees_and_limits, $gateway_token->gateway_type_id)) { //@phpstan-ignore-line
|
||||||
//if valid we keep this gateway_token
|
//if valid we keep this gateway_token
|
||||||
if ($this->invoice->client->validGatewayForAmount($company_gateway->fees_and_limits->{$gateway_token->gateway_type_id}, $amount)) {
|
if ($this->invoice->client->validGatewayForAmount($company_gateway->fees_and_limits->{$gateway_token->gateway_type_id}, $amount)) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -306,7 +306,7 @@ class PdfConfiguration
|
|||||||
$decimal = $this->country->decimal_separator;
|
$decimal = $this->country->decimal_separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->country->swap_currency_symbol) && strlen($this->country->swap_currency_symbol) >= 1) {
|
if (isset($this->country->swap_currency_symbol) && $this->country->swap_currency_symbol) {
|
||||||
$swapSymbol = $this->country->swap_currency_symbol;
|
$swapSymbol = $this->country->swap_currency_symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ class PdfConfiguration
|
|||||||
$decimal = $this->country->decimal_separator;
|
$decimal = $this->country->decimal_separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->country->swap_currency_symbol) && strlen($this->country->swap_currency_symbol) >= 1) {
|
if (isset($this->country->swap_currency_symbol) && $this->country->swap_currency_symbol == 1) {
|
||||||
$swapSymbol = $this->country->swap_currency_symbol;
|
$swapSymbol = $this->country->swap_currency_symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,7 +410,7 @@ class PdfConfiguration
|
|||||||
$precision = 0;
|
$precision = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$value = number_format($v, $precision, $decimal, $thousand);
|
$value = number_format($v, $precision, $decimal, $thousand); //@phpstan-ignore-line
|
||||||
$symbol = $this->currency->symbol;
|
$symbol = $this->currency->symbol;
|
||||||
|
|
||||||
if ($this->settings->show_currency_code === true && $this->currency->code == 'CHF') {
|
if ($this->settings->show_currency_code === true && $this->currency->code == 'CHF') {
|
||||||
@ -427,7 +427,7 @@ class PdfConfiguration
|
|||||||
|
|
||||||
return "{$symbol}{$value}";
|
return "{$symbol}{$value}";
|
||||||
} else {
|
} else {
|
||||||
return $this->formatValue($value);
|
return $this->formatValue($value); // @phpstan-ignore-line
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user