mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-11 15:34:21 -04:00
commit
cd60cc8b93
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@ -35,7 +35,6 @@ jobs:
|
||||
php artisan key:generate
|
||||
php artisan optimize
|
||||
php artisan storage:link
|
||||
php artisan livewire:publish
|
||||
sudo php artisan cache:clear
|
||||
sudo find ./vendor/bin/ -type f -exec chmod +x {} \;
|
||||
sudo find ./ -type d -exec chmod 755 {} \;
|
||||
|
@ -1 +1 @@
|
||||
5.3.79
|
||||
5.3.80
|
@ -37,6 +37,15 @@ class ClientSettings extends BaseSettings
|
||||
'size_id' => 'string',
|
||||
];
|
||||
|
||||
public static $property_casts = [
|
||||
'language_id' => 'string',
|
||||
'currency_id' => 'string',
|
||||
'payment_terms' => 'string',
|
||||
'valid_until' => 'string',
|
||||
'default_task_rate' => 'float',
|
||||
'send_reminders' => 'bool',
|
||||
];
|
||||
|
||||
/**
|
||||
* Cast object values and return entire class
|
||||
* prevents missing properties from not being returned
|
||||
|
@ -503,6 +503,7 @@ class CompanySettings extends BaseSettings
|
||||
'language_id' => 'string',
|
||||
'show_currency_code' => 'bool',
|
||||
'website' => 'string',
|
||||
'default_task_rate' => 'float',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace App\Export\CSV;
|
||||
|
||||
use App\Http\Controllers\ClientPortal\setLocale;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
@ -112,8 +111,7 @@ class ClientExport
|
||||
});
|
||||
|
||||
|
||||
echo $this->csv->toString();
|
||||
|
||||
return $this->csv->toString();
|
||||
|
||||
}
|
||||
|
||||
|
175
app/Export/CSV/ContactExport.php
Normal file
175
app/Export/CSV/ContactExport.php
Normal file
@ -0,0 +1,175 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Export\CSV;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\Company;
|
||||
use App\Transformers\ClientContactTransformer;
|
||||
use App\Transformers\ClientTransformer;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use League\Csv\Writer;
|
||||
|
||||
class ContactExport
|
||||
{
|
||||
private $company;
|
||||
|
||||
private $report_keys;
|
||||
|
||||
private $client_transformer;
|
||||
|
||||
private $contact_transformer;
|
||||
|
||||
private array $entity_keys = [
|
||||
'address1' => 'client.address1',
|
||||
'address2' => 'client.address2',
|
||||
'balance' => 'client.balance',
|
||||
'city' => 'client.city',
|
||||
'country' => 'client.country_id',
|
||||
'credit_balance' => 'client.credit_balance',
|
||||
'custom_value1' => 'client.custom_value1',
|
||||
'custom_value2' => 'client.custom_value2',
|
||||
'custom_value3' => 'client.custom_value3',
|
||||
'custom_value4' => 'client.custom_value4',
|
||||
'id_number' => 'client.id_number',
|
||||
'industry' => 'client.industry_id',
|
||||
'last_login' => 'client.last_login',
|
||||
'name' => 'client.name',
|
||||
'number' => 'client.number',
|
||||
'paid_to_date' => 'client.paid_to_date',
|
||||
'phone' => 'client.phone',
|
||||
'postal_code' => 'client.postal_code',
|
||||
'private_notes' => 'client.private_notes',
|
||||
'public_notes' => 'client.public_notes',
|
||||
'shipping_address1' => 'client.shipping_address1',
|
||||
'shipping_address2' => 'client.shipping_address2',
|
||||
'shipping_city' => 'client.shipping_city',
|
||||
'shipping_country' => 'client.shipping_country_id',
|
||||
'shipping_postal_code' => 'client.shipping_postal_code',
|
||||
'shipping_state' => 'client.shipping_state',
|
||||
'state' => 'client.state',
|
||||
'vat_number' => 'client.vat_number',
|
||||
'website' => 'client.website',
|
||||
'currency' => 'client.currency',
|
||||
'first_name' => 'contact.first_name',
|
||||
'last_name' => 'contact.last_name',
|
||||
'phone' => 'contact.phone',
|
||||
'contact_custom_value1' => 'contact.custom_value1',
|
||||
'contact_custom_value2' => 'contact.custom_value2',
|
||||
'contact_custom_value3' => 'contact.custom_value3',
|
||||
'contact_custom_value4' => 'contact.custom_value4',
|
||||
'email' => 'contact.email',
|
||||
];
|
||||
|
||||
private array $decorate_keys = [
|
||||
'client.country_id',
|
||||
'client.shipping_country_id',
|
||||
'client.currency',
|
||||
'client.industry',
|
||||
];
|
||||
|
||||
public function __construct(Company $company, array $report_keys)
|
||||
{
|
||||
$this->company = $company;
|
||||
$this->report_keys = $report_keys;
|
||||
$this->client_transformer = new ClientTransformer();
|
||||
$this->contact_transformer = new ClientContactTransformer();
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
|
||||
MultiDB::setDb($this->company->db);
|
||||
App::forgetInstance('translator');
|
||||
App::setLocale($this->company->locale());
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->company->settings));
|
||||
|
||||
//load the CSV document from a string
|
||||
$this->csv = Writer::createFromString();
|
||||
|
||||
//insert the header
|
||||
$this->csv->insertOne($this->buildHeader());
|
||||
|
||||
ClientContact::where('company_id', $this->company->id)
|
||||
->cursor()
|
||||
->each(function ($contact){
|
||||
|
||||
$this->csv->insertOne($this->buildRow($contact));
|
||||
|
||||
});
|
||||
|
||||
|
||||
return $this->csv->toString();
|
||||
|
||||
}
|
||||
|
||||
private function buildHeader() :array
|
||||
{
|
||||
|
||||
$header = [];
|
||||
|
||||
foreach(array_keys($this->report_keys) as $key)
|
||||
$header[] = ctrans("texts.{$key}");
|
||||
|
||||
return $header;
|
||||
}
|
||||
|
||||
private function buildRow(ClientContact $contact) :array
|
||||
{
|
||||
|
||||
$transformed_contact = false;
|
||||
|
||||
$transformed_client = $this->client_transformer->transform($contact->client);
|
||||
$transformed_contact = $this->contact_transformer->transform($contact);
|
||||
|
||||
$entity = [];
|
||||
|
||||
foreach(array_values($this->report_keys) as $key){
|
||||
|
||||
$parts = explode(".",$key);
|
||||
$entity[$parts[1]] = "";
|
||||
|
||||
if($parts[0] == 'client') {
|
||||
$entity[$parts[1]] = $transformed_client[$parts[1]];
|
||||
}
|
||||
elseif($parts[0] == 'contact') {
|
||||
$entity[$parts[1]] = $transformed_contact[$parts[1]];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this->decorateAdvancedFields($contact->client, $entity);
|
||||
|
||||
}
|
||||
|
||||
private function decorateAdvancedFields(Client $client, array $entity) :array
|
||||
{
|
||||
|
||||
if(array_key_exists('country_id', $entity))
|
||||
$entity['country_id'] = $client->country ? ctrans("texts.country_{$client->country->name}") : "";
|
||||
|
||||
if(array_key_exists('shipping_country_id', $entity))
|
||||
$entity['shipping_country_id'] = $client->shipping_country ? ctrans("texts.country_{$client->shipping_country->name}") : "";
|
||||
|
||||
if(array_key_exists('currency', $entity))
|
||||
$entity['currency'] = $client->currency()->code;
|
||||
|
||||
if(array_key_exists('industry_id', $entity))
|
||||
$entity['industry_id'] = $client->industry ? ctrans("texts.industry_{$client->industry->name}") : "";
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
}
|
157
app/Export/CSV/CreditExport.php
Normal file
157
app/Export/CSV/CreditExport.php
Normal file
@ -0,0 +1,157 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Export\CSV;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Credit;
|
||||
use App\Transformers\CreditTransformer;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use League\Csv\Writer;
|
||||
|
||||
class CreditExport
|
||||
{
|
||||
private $company;
|
||||
|
||||
private $report_keys;
|
||||
|
||||
private $credit_transformer;
|
||||
|
||||
private array $entity_keys = [
|
||||
'amount' => 'amount',
|
||||
'balance' => 'balance',
|
||||
'client' => 'client_id',
|
||||
'custom_surcharge1' => 'custom_surcharge1',
|
||||
'custom_surcharge2' => 'custom_surcharge2',
|
||||
'custom_surcharge3' => 'custom_surcharge3',
|
||||
'custom_surcharge4' => 'custom_surcharge4',
|
||||
'country' => 'country_id',
|
||||
'custom_value1' => 'custom_value1',
|
||||
'custom_value2' => 'custom_value2',
|
||||
'custom_value3' => 'custom_value3',
|
||||
'custom_value4' => 'custom_value4',
|
||||
'date' => 'date',
|
||||
'discount' => 'discount',
|
||||
'due_date' => 'due_date',
|
||||
'exchange_rate' => 'exchange_rate',
|
||||
'footer' => 'footer',
|
||||
'invoice' => 'invoice_id',
|
||||
'number' => 'number',
|
||||
'paid_to_date' => 'paid_to_date',
|
||||
'partial' => 'partial',
|
||||
'partial_due_date' => 'partial_due_date',
|
||||
'po_number' => 'po_number',
|
||||
'private_notes' => 'private_notes',
|
||||
'public_notes' => 'public_notes',
|
||||
'status' => 'status_id',
|
||||
'tax_name1' => 'tax_name1',
|
||||
'tax_name2' => 'tax_name2',
|
||||
'tax_name3' => 'tax_name3',
|
||||
'tax_rate1' => 'tax_rate1',
|
||||
'tax_rate2' => 'tax_rate2',
|
||||
'tax_rate3' => 'tax_rate3',
|
||||
'terms' => 'terms',
|
||||
'total_taxes' => 'total_taxes',
|
||||
'currency' => 'currency'
|
||||
];
|
||||
|
||||
private array $decorate_keys = [
|
||||
'country',
|
||||
'client',
|
||||
'invoice',
|
||||
'currency',
|
||||
];
|
||||
|
||||
public function __construct(Company $company, array $report_keys)
|
||||
{
|
||||
$this->company = $company;
|
||||
$this->report_keys = $report_keys;
|
||||
$this->credit_transformer = new CreditTransformer();
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
|
||||
MultiDB::setDb($this->company->db);
|
||||
App::forgetInstance('translator');
|
||||
App::setLocale($this->company->locale());
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->company->settings));
|
||||
|
||||
//load the CSV document from a string
|
||||
$this->csv = Writer::createFromString();
|
||||
|
||||
//insert the header
|
||||
$this->csv->insertOne($this->buildHeader());
|
||||
|
||||
Credit::with('client')->where('company_id', $this->company->id)
|
||||
->where('is_deleted',0)
|
||||
->cursor()
|
||||
->each(function ($credit){
|
||||
|
||||
$this->csv->insertOne($this->buildRow($credit));
|
||||
|
||||
});
|
||||
|
||||
|
||||
return $this->csv->toString();
|
||||
|
||||
}
|
||||
|
||||
private function buildHeader() :array
|
||||
{
|
||||
|
||||
$header = [];
|
||||
|
||||
foreach(array_keys($this->report_keys) as $key)
|
||||
$header[] = ctrans("texts.{$key}");
|
||||
|
||||
return $header;
|
||||
}
|
||||
|
||||
private function buildRow(Credit $credit) :array
|
||||
{
|
||||
|
||||
$transformed_credit = $this->credit_transformer->transform($credit);
|
||||
|
||||
$entity = [];
|
||||
|
||||
foreach(array_values($this->report_keys) as $key){
|
||||
|
||||
$entity[$key] = $transformed_credit[$key];
|
||||
}
|
||||
|
||||
return $this->decorateAdvancedFields($credit, $entity);
|
||||
|
||||
}
|
||||
|
||||
private function decorateAdvancedFields(Credit $credit, array $entity) :array
|
||||
{
|
||||
|
||||
if(array_key_exists('country_id', $entity))
|
||||
$entity['country_id'] = $credit->client->country ? ctrans("texts.country_{$credit->client->country->name}") : "";
|
||||
|
||||
if(array_key_exists('currency', $entity))
|
||||
$entity['currency'] = $credit->client->currency()->code;
|
||||
|
||||
if(array_key_exists('invoice_id', $entity))
|
||||
$entity['invoice_id'] = $credit->invoice ? $credit->invoice->number : "";
|
||||
|
||||
if(array_key_exists('client_id', $entity))
|
||||
$entity['client_id'] = $credit->client->present()->name();
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
}
|
119
app/Export/CSV/DocumentExport.php
Normal file
119
app/Export/CSV/DocumentExport.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Export\CSV;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Credit;
|
||||
use App\Models\Document;
|
||||
use App\Transformers\DocumentTransformer;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use League\Csv\Writer;
|
||||
|
||||
class DocumentExport
|
||||
{
|
||||
private $company;
|
||||
|
||||
private $report_keys;
|
||||
|
||||
private $entity_transformer;
|
||||
|
||||
private array $entity_keys = [
|
||||
'record_type' => 'record_type',
|
||||
'record_name' => 'record_name',
|
||||
'name' => 'name',
|
||||
'type' => 'type',
|
||||
'created_at' => 'created_at',
|
||||
];
|
||||
|
||||
private array $decorate_keys = [
|
||||
|
||||
];
|
||||
|
||||
public function __construct(Company $company, array $report_keys)
|
||||
{
|
||||
$this->company = $company;
|
||||
$this->report_keys = $report_keys;
|
||||
$this->entity_transformer = new DocumentTransformer();
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
|
||||
MultiDB::setDb($this->company->db);
|
||||
App::forgetInstance('translator');
|
||||
App::setLocale($this->company->locale());
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->company->settings));
|
||||
|
||||
//load the CSV document from a string
|
||||
$this->csv = Writer::createFromString();
|
||||
|
||||
//insert the header
|
||||
$this->csv->insertOne($this->buildHeader());
|
||||
|
||||
Document::where('company_id', $this->company->id)
|
||||
->cursor()
|
||||
->each(function ($entity){
|
||||
|
||||
$this->csv->insertOne($this->buildRow($entity));
|
||||
|
||||
});
|
||||
|
||||
|
||||
return $this->csv->toString();
|
||||
|
||||
}
|
||||
|
||||
private function buildHeader() :array
|
||||
{
|
||||
|
||||
$header = [];
|
||||
|
||||
foreach(array_keys($this->report_keys) as $key)
|
||||
$header[] = ctrans("texts.{$key}");
|
||||
|
||||
return $header;
|
||||
}
|
||||
|
||||
private function buildRow(Document $document) :array
|
||||
{
|
||||
|
||||
$transformed_entity = $this->entity_transformer->transform($document);
|
||||
|
||||
$entity = [];
|
||||
|
||||
foreach(array_values($this->report_keys) as $key){
|
||||
|
||||
$entity[$key] = $transformed_entity[$key];
|
||||
|
||||
}
|
||||
|
||||
return $this->decorateAdvancedFields($document, $entity);
|
||||
|
||||
}
|
||||
|
||||
private function decorateAdvancedFields(Document $document, array $entity) :array
|
||||
{
|
||||
|
||||
if(array_key_exists('record_type', $entity))
|
||||
$entity['record_type'] = class_basename($document->documentable);
|
||||
|
||||
if(array_key_exists('record_name', $entity))
|
||||
$entity['record_name'] = $document->hashed_id;
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
}
|
164
app/Export/CSV/ExpenseExport.php
Normal file
164
app/Export/CSV/ExpenseExport.php
Normal file
@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/**
|
||||
* Expense Ninja (https://expenseninja.com).
|
||||
*
|
||||
* @link https://github.com/expenseninja/expenseninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Expense Ninja LLC (https://expenseninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Export\CSV;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Expense;
|
||||
use App\Transformers\ExpenseTransformer;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use League\Csv\Writer;
|
||||
|
||||
class ExpenseExport
|
||||
{
|
||||
private $company;
|
||||
|
||||
private $report_keys;
|
||||
|
||||
private $expense_transformer;
|
||||
|
||||
private array $entity_keys = [
|
||||
'amount' => 'amount',
|
||||
'category' => 'category_id',
|
||||
'client' => 'client_id',
|
||||
'custom_value1' => 'custom_value1',
|
||||
'custom_value2' => 'custom_value2',
|
||||
'custom_value3' => 'custom_value3',
|
||||
'custom_value4' => 'custom_value4',
|
||||
'currency' => 'currency_id',
|
||||
'date' => 'date',
|
||||
'exchange_rate' => 'exchange_rate',
|
||||
'converted_amount' => 'foreign_amount',
|
||||
'invoice_currency_id' => 'invoice_currency_id',
|
||||
'payment_date' => 'payment_date',
|
||||
'number' => 'number',
|
||||
'payment_type_id' => 'payment_type_id',
|
||||
'private_notes' => 'private_notes',
|
||||
'project' => 'project_id',
|
||||
'public_notes' => 'public_notes',
|
||||
'tax_amount1' => 'tax_amount1',
|
||||
'tax_amount2' => 'tax_amount2',
|
||||
'tax_amount3' => 'tax_amount3',
|
||||
'tax_name1' => 'tax_name1',
|
||||
'tax_name2' => 'tax_name2',
|
||||
'tax_name3' => 'tax_name3',
|
||||
'tax_rate1' => 'tax_rate1',
|
||||
'tax_rate2' => 'tax_rate2',
|
||||
'tax_rate3' => 'tax_rate3',
|
||||
'transaction_reference' => 'transaction_reference',
|
||||
'vendor' => 'vendor_id',
|
||||
'invoice' => 'invoice_id',
|
||||
];
|
||||
|
||||
private array $decorate_keys = [
|
||||
'client',
|
||||
'currency',
|
||||
'invoice',
|
||||
'category',
|
||||
'vendor',
|
||||
'project',
|
||||
'payment_type_id',
|
||||
];
|
||||
|
||||
public function __construct(Company $company, array $report_keys)
|
||||
{
|
||||
$this->company = $company;
|
||||
$this->report_keys = $report_keys;
|
||||
$this->expense_transformer = new ExpenseTransformer();
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
|
||||
MultiDB::setDb($this->company->db);
|
||||
App::forgetInstance('translator');
|
||||
App::setLocale($this->company->locale());
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->company->settings));
|
||||
|
||||
//load the CSV document from a string
|
||||
$this->csv = Writer::createFromString();
|
||||
|
||||
//insert the header
|
||||
$this->csv->insertOne($this->buildHeader());
|
||||
|
||||
Expense::with('client')->where('company_id', $this->company->id)
|
||||
->where('is_deleted',0)
|
||||
->cursor()
|
||||
->each(function ($expense){
|
||||
|
||||
$this->csv->insertOne($this->buildRow($expense));
|
||||
|
||||
});
|
||||
|
||||
|
||||
return $this->csv->toString();
|
||||
|
||||
}
|
||||
|
||||
private function buildHeader() :array
|
||||
{
|
||||
|
||||
$header = [];
|
||||
|
||||
foreach(array_keys($this->report_keys) as $key)
|
||||
$header[] = ctrans("texts.{$key}");
|
||||
|
||||
return $header;
|
||||
}
|
||||
|
||||
private function buildRow(Expense $expense) :array
|
||||
{
|
||||
|
||||
$transformed_expense = $this->expense_transformer->transform($expense);
|
||||
|
||||
$entity = [];
|
||||
|
||||
foreach(array_values($this->report_keys) as $key){
|
||||
|
||||
$entity[$key] = $transformed_expense[$key];
|
||||
}
|
||||
|
||||
return $this->decorateAdvancedFields($expense, $entity);
|
||||
|
||||
}
|
||||
|
||||
private function decorateAdvancedFields(Expense $expense, array $entity) :array
|
||||
{
|
||||
if(array_key_exists('currency_id', $entity))
|
||||
$entity['currency_id'] = $expense->currency ? $expense->currency->code : "";
|
||||
|
||||
if(array_key_exists('client_id', $entity))
|
||||
$entity['client_id'] = $expense->client ? $expense->client->present()->name() : "";
|
||||
|
||||
if(array_key_exists('invoice_id', $entity))
|
||||
$entity['invoice_id'] = $expense->invoice ? $expense->invoice->number : "";
|
||||
|
||||
if(array_key_exists('category_id', $entity))
|
||||
$entity['category_id'] = $expense->category ? $expense->category->name : "";
|
||||
|
||||
if(array_key_exists('vendor_id', $entity))
|
||||
$entity['vendor_id'] = $expense->vendor ? $expense->vendor->name : "";
|
||||
|
||||
if(array_key_exists('payment_type_id', $entity))
|
||||
$entity['payment_type_id'] = $expense->payment_type ? $expense->payment_type->name : "";
|
||||
|
||||
if(array_key_exists('project_id', $entity))
|
||||
$entity['project_id'] = $expense->project ? $expense->project->name : "";
|
||||
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
}
|
@ -11,28 +11,141 @@
|
||||
|
||||
namespace App\Export\CSV;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use Excel;
|
||||
use App\Models\Invoice;
|
||||
use App\Transformers\InvoiceTransformer;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use League\Csv\Writer;
|
||||
|
||||
class InvoiceExport
|
||||
{
|
||||
private $company;
|
||||
|
||||
public function __construct(Company $company)
|
||||
private $report_keys;
|
||||
|
||||
private $invoice_transformer;
|
||||
|
||||
private array $entity_keys = [
|
||||
'amount' => 'amount',
|
||||
'balance' => 'balance',
|
||||
'client' => 'client_id',
|
||||
'custom_surcharge1' => 'custom_surcharge1',
|
||||
'custom_surcharge2' => 'custom_surcharge2',
|
||||
'custom_surcharge3' => 'custom_surcharge3',
|
||||
'custom_surcharge4' => 'custom_surcharge4',
|
||||
'custom_value1' => 'custom_value1',
|
||||
'custom_value2' => 'custom_value2',
|
||||
'custom_value3' => 'custom_value3',
|
||||
'custom_value4' => 'custom_value4',
|
||||
'date' => 'date',
|
||||
'discount' => 'discount',
|
||||
'due_date' => 'due_date',
|
||||
'exchange_rate' => 'exchange_rate',
|
||||
'footer' => 'footer',
|
||||
'number' => 'number',
|
||||
'paid_to_date' => 'paid_to_date',
|
||||
'partial' => 'partial',
|
||||
'partial_due_date' => 'partial_due_date',
|
||||
'po_number' => 'po_number',
|
||||
'private_notes' => 'private_notes',
|
||||
'public_notes' => 'public_notes',
|
||||
'status' => 'status_id',
|
||||
'tax_name1' => 'tax_name1',
|
||||
'tax_name2' => 'tax_name2',
|
||||
'tax_name3' => 'tax_name3',
|
||||
'tax_rate1' => 'tax_rate1',
|
||||
'tax_rate2' => 'tax_rate2',
|
||||
'tax_rate3' => 'tax_rate3',
|
||||
'terms' => 'terms',
|
||||
'total_taxes' => 'total_taxes',
|
||||
'currency' => 'client_id'
|
||||
];
|
||||
|
||||
private array $decorate_keys = [
|
||||
'country',
|
||||
'client',
|
||||
'currency',
|
||||
'status',
|
||||
];
|
||||
|
||||
public function __construct(Company $company, array $report_keys)
|
||||
{
|
||||
$this->company = $company;
|
||||
$this->report_keys = $report_keys;
|
||||
$this->invoice_transformer = new InvoiceTransformer();
|
||||
}
|
||||
|
||||
public function export()
|
||||
public function run()
|
||||
{
|
||||
// $fileName = 'test.csv';
|
||||
|
||||
// $data = $this->company->invoices->get();
|
||||
|
||||
// return Excel::create($fileName, function ($excel) use ($data) {
|
||||
// $excel->sheet('', function ($sheet) use ($data) {
|
||||
// $sheet->loadView('export', $data);
|
||||
// });
|
||||
// })->download('csv');
|
||||
MultiDB::setDb($this->company->db);
|
||||
App::forgetInstance('translator');
|
||||
App::setLocale($this->company->locale());
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->company->settings));
|
||||
|
||||
//load the CSV document from a string
|
||||
$this->csv = Writer::createFromString();
|
||||
|
||||
//insert the header
|
||||
$this->csv->insertOne($this->buildHeader());
|
||||
|
||||
Invoice::with('client')->where('company_id', $this->company->id)
|
||||
->where('is_deleted',0)
|
||||
->cursor()
|
||||
->each(function ($invoice){
|
||||
|
||||
$this->csv->insertOne($this->buildRow($invoice));
|
||||
|
||||
});
|
||||
|
||||
|
||||
return $this->csv->toString();
|
||||
|
||||
}
|
||||
|
||||
private function buildHeader() :array
|
||||
{
|
||||
|
||||
$header = [];
|
||||
|
||||
foreach(array_keys($this->report_keys) as $key)
|
||||
$header[] = ctrans("texts.{$key}");
|
||||
|
||||
return $header;
|
||||
}
|
||||
|
||||
private function buildRow(Invoice $invoice) :array
|
||||
{
|
||||
|
||||
$transformed_invoice = $this->invoice_transformer->transform($invoice);
|
||||
|
||||
$entity = [];
|
||||
|
||||
foreach(array_values($this->report_keys) as $key){
|
||||
|
||||
$entity[$key] = $transformed_invoice[$key];
|
||||
}
|
||||
|
||||
return $this->decorateAdvancedFields($invoice, $entity);
|
||||
|
||||
}
|
||||
|
||||
private function decorateAdvancedFields(Invoice $invoice, array $entity) :array
|
||||
{
|
||||
if(array_key_exists('currency', $entity))
|
||||
$entity['currency'] = $invoice->client->currency()->code;
|
||||
|
||||
if(array_key_exists('client_id', $entity))
|
||||
$entity['client_id'] = $invoice->client->present()->name();
|
||||
|
||||
if(array_key_exists('status_id', $entity))
|
||||
$entity['status_id'] = $invoice->stringStatus($invoice->status_id);
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
}
|
||||
|
207
app/Export/CSV/InvoiceItemExport.php
Normal file
207
app/Export/CSV/InvoiceItemExport.php
Normal file
@ -0,0 +1,207 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Export\CSV;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Invoice;
|
||||
use App\Transformers\InvoiceTransformer;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use League\Csv\Writer;
|
||||
|
||||
class InvoiceItemExport
|
||||
{
|
||||
private $company;
|
||||
|
||||
private $report_keys;
|
||||
|
||||
private $invoice_transformer;
|
||||
|
||||
private array $entity_keys = [
|
||||
'amount' => 'amount',
|
||||
'balance' => 'balance',
|
||||
'client' => 'client_id',
|
||||
'custom_surcharge1' => 'custom_surcharge1',
|
||||
'custom_surcharge2' => 'custom_surcharge2',
|
||||
'custom_surcharge3' => 'custom_surcharge3',
|
||||
'custom_surcharge4' => 'custom_surcharge4',
|
||||
'custom_value1' => 'custom_value1',
|
||||
'custom_value2' => 'custom_value2',
|
||||
'custom_value3' => 'custom_value3',
|
||||
'custom_value4' => 'custom_value4',
|
||||
'date' => 'date',
|
||||
'discount' => 'discount',
|
||||
'due_date' => 'due_date',
|
||||
'exchange_rate' => 'exchange_rate',
|
||||
'footer' => 'footer',
|
||||
'number' => 'number',
|
||||
'paid_to_date' => 'paid_to_date',
|
||||
'partial' => 'partial',
|
||||
'partial_due_date' => 'partial_due_date',
|
||||
'po_number' => 'po_number',
|
||||
'private_notes' => 'private_notes',
|
||||
'public_notes' => 'public_notes',
|
||||
'status' => 'status_id',
|
||||
'tax_name1' => 'tax_name1',
|
||||
'tax_name2' => 'tax_name2',
|
||||
'tax_name3' => 'tax_name3',
|
||||
'tax_rate1' => 'tax_rate1',
|
||||
'tax_rate2' => 'tax_rate2',
|
||||
'tax_rate3' => 'tax_rate3',
|
||||
'terms' => 'terms',
|
||||
'total_taxes' => 'total_taxes',
|
||||
'currency' => 'currency_id',
|
||||
'qty' => 'item.quantity',
|
||||
'unit_cost' => 'item.cost',
|
||||
'product_key' => 'item.product_key',
|
||||
'cost' => 'item.product_cost',
|
||||
'notes' => 'item.notes',
|
||||
'discount' => 'item.discount',
|
||||
'is_amount_discount' => 'item.is_amount_discount',
|
||||
'tax_rate1' => 'item.tax_rate1',
|
||||
'tax_rate2' => 'item.tax_rate2',
|
||||
'tax_rate3' => 'item.tax_rate3',
|
||||
'tax_name1' => 'item.tax_name1',
|
||||
'tax_name2' => 'item.tax_name2',
|
||||
'tax_name3' => 'item.tax_name3',
|
||||
'line_total' => 'item.line_total',
|
||||
'gross_line_total' => 'item.gross_line_total',
|
||||
'invoice1' => 'item.custom_value1',
|
||||
'invoice2' => 'item.custom_value2',
|
||||
'invoice3' => 'item.custom_value3',
|
||||
'invoice4' => 'item.custom_value4',
|
||||
];
|
||||
|
||||
private array $decorate_keys = [
|
||||
'client',
|
||||
'currency',
|
||||
];
|
||||
|
||||
public function __construct(Company $company, array $report_keys)
|
||||
{
|
||||
$this->company = $company;
|
||||
$this->report_keys = $report_keys;
|
||||
$this->invoice_transformer = new InvoiceTransformer();
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
|
||||
MultiDB::setDb($this->company->db);
|
||||
App::forgetInstance('translator');
|
||||
App::setLocale($this->company->locale());
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->company->settings));
|
||||
|
||||
//load the CSV document from a string
|
||||
$this->csv = Writer::createFromString();
|
||||
|
||||
//insert the header
|
||||
$this->csv->insertOne($this->buildHeader());
|
||||
|
||||
Invoice::with('client')->where('company_id', $this->company->id)
|
||||
->where('is_deleted',0)
|
||||
->cursor()
|
||||
->each(function ($invoice){
|
||||
|
||||
$this->iterateItems($invoice);
|
||||
|
||||
});
|
||||
|
||||
return $this->csv->toString();
|
||||
|
||||
}
|
||||
|
||||
private function buildHeader() :array
|
||||
{
|
||||
|
||||
$header = [];
|
||||
|
||||
foreach(array_keys($this->report_keys) as $key)
|
||||
$header[] = ctrans("texts.{$key}");
|
||||
|
||||
return $header;
|
||||
}
|
||||
|
||||
private function iterateItems(Invoice $invoice)
|
||||
{
|
||||
$transformed_invoice = $this->buildRow($invoice);
|
||||
|
||||
$transformed_items = [];
|
||||
|
||||
foreach($invoice->line_items as $item)
|
||||
{
|
||||
$item_array = [];
|
||||
|
||||
foreach(array_values($this->report_keys) as $key){
|
||||
|
||||
if(str_contains($key, "item.")){
|
||||
|
||||
$key = str_replace("item.", "", $key);
|
||||
$item_array[$key] = $item->{$key};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$entity = [];
|
||||
|
||||
$transformed_items = array_merge($transformed_invoice, $item_array);
|
||||
|
||||
$transformed_items = $this->decorateAdvancedFields($invoice, $transformed_items);
|
||||
|
||||
foreach(array_values($this->report_keys) as $key)
|
||||
{
|
||||
$key = str_replace("item.", "", $key);
|
||||
$entity[$key] = $transformed_items[$key];
|
||||
}
|
||||
|
||||
$this->csv->insertOne($entity);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function buildRow(Invoice $invoice) :array
|
||||
{
|
||||
|
||||
$transformed_invoice = $this->invoice_transformer->transform($invoice);
|
||||
|
||||
$entity = [];
|
||||
|
||||
foreach(array_values($this->report_keys) as $key){
|
||||
|
||||
if(!str_contains($key, "item."))
|
||||
$entity[$key] = $transformed_invoice[$key];
|
||||
|
||||
}
|
||||
|
||||
return $this->decorateAdvancedFields($invoice, $entity);
|
||||
|
||||
}
|
||||
|
||||
private function decorateAdvancedFields(Invoice $invoice, array $entity) :array
|
||||
{
|
||||
if(array_key_exists('currency_id', $entity))
|
||||
$entity['currency_id'] = $invoice->client->currency()->code;
|
||||
|
||||
if(array_key_exists('client_id', $entity))
|
||||
$entity['client_id'] = $invoice->client->present()->name();
|
||||
|
||||
if(array_key_exists('status_id', $entity))
|
||||
$entity['status_id'] = $invoice->stringStatus($invoice->status_id);
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
}
|
151
app/Export/CSV/QuoteExport.php
Normal file
151
app/Export/CSV/QuoteExport.php
Normal file
@ -0,0 +1,151 @@
|
||||
<?php
|
||||
/**
|
||||
* Quote Ninja (https://quoteninja.com).
|
||||
*
|
||||
* @link https://github.com/quoteninja/quoteninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Quote Ninja LLC (https://quoteninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Export\CSV;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Quote;
|
||||
use App\Transformers\QuoteTransformer;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use League\Csv\Writer;
|
||||
|
||||
class QuoteExport
|
||||
{
|
||||
private $company;
|
||||
|
||||
private $report_keys;
|
||||
|
||||
private $quote_transformer;
|
||||
|
||||
private array $entity_keys = [
|
||||
'amount' => 'amount',
|
||||
'balance' => 'balance',
|
||||
'client' => 'client_id',
|
||||
'custom_surcharge1' => 'custom_surcharge1',
|
||||
'custom_surcharge2' => 'custom_surcharge2',
|
||||
'custom_surcharge3' => 'custom_surcharge3',
|
||||
'custom_surcharge4' => 'custom_surcharge4',
|
||||
'custom_value1' => 'custom_value1',
|
||||
'custom_value2' => 'custom_value2',
|
||||
'custom_value3' => 'custom_value3',
|
||||
'custom_value4' => 'custom_value4',
|
||||
'date' => 'date',
|
||||
'discount' => 'discount',
|
||||
'due_date' => 'due_date',
|
||||
'exchange_rate' => 'exchange_rate',
|
||||
'footer' => 'footer',
|
||||
'number' => 'number',
|
||||
'paid_to_date' => 'paid_to_date',
|
||||
'partial' => 'partial',
|
||||
'partial_due_date' => 'partial_due_date',
|
||||
'po_number' => 'po_number',
|
||||
'private_notes' => 'private_notes',
|
||||
'public_notes' => 'public_notes',
|
||||
'status' => 'status_id',
|
||||
'tax_name1' => 'tax_name1',
|
||||
'tax_name2' => 'tax_name2',
|
||||
'tax_name3' => 'tax_name3',
|
||||
'tax_rate1' => 'tax_rate1',
|
||||
'tax_rate2' => 'tax_rate2',
|
||||
'tax_rate3' => 'tax_rate3',
|
||||
'terms' => 'terms',
|
||||
'total_taxes' => 'total_taxes',
|
||||
'currency' => 'client_id',
|
||||
'invoice' => 'invoice_id',
|
||||
];
|
||||
|
||||
private array $decorate_keys = [
|
||||
'client',
|
||||
'currency',
|
||||
'invoice'
|
||||
];
|
||||
|
||||
public function __construct(Company $company, array $report_keys)
|
||||
{
|
||||
$this->company = $company;
|
||||
$this->report_keys = $report_keys;
|
||||
$this->quote_transformer = new QuoteTransformer();
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
|
||||
MultiDB::setDb($this->company->db);
|
||||
App::forgetInstance('translator');
|
||||
App::setLocale($this->company->locale());
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations($this->company->settings));
|
||||
|
||||
//load the CSV document from a string
|
||||
$this->csv = Writer::createFromString();
|
||||
|
||||
//insert the header
|
||||
$this->csv->insertOne($this->buildHeader());
|
||||
|
||||
Quote::with('client')->where('company_id', $this->company->id)
|
||||
->where('is_deleted',0)
|
||||
->cursor()
|
||||
->each(function ($quote){
|
||||
|
||||
$this->csv->insertOne($this->buildRow($quote));
|
||||
|
||||
});
|
||||
|
||||
|
||||
return $this->csv->toString();
|
||||
|
||||
}
|
||||
|
||||
private function buildHeader() :array
|
||||
{
|
||||
|
||||
$header = [];
|
||||
|
||||
foreach(array_keys($this->report_keys) as $key)
|
||||
$header[] = ctrans("texts.{$key}");
|
||||
|
||||
return $header;
|
||||
}
|
||||
|
||||
private function buildRow(Quote $quote) :array
|
||||
{
|
||||
|
||||
$transformed_quote = $this->quote_transformer->transform($quote);
|
||||
|
||||
$entity = [];
|
||||
|
||||
foreach(array_values($this->report_keys) as $key){
|
||||
|
||||
$entity[$key] = $transformed_quote[$key];
|
||||
}
|
||||
|
||||
return $this->decorateAdvancedFields($quote, $entity);
|
||||
|
||||
}
|
||||
|
||||
private function decorateAdvancedFields(Quote $quote, array $entity) :array
|
||||
{
|
||||
if(array_key_exists('currency', $entity))
|
||||
$entity['currency'] = $quote->client->currency()->code;
|
||||
|
||||
if(array_key_exists('client_id', $entity))
|
||||
$entity['client_id'] = $quote->client->present()->name();
|
||||
|
||||
if(array_key_exists('invoice', $entity))
|
||||
$entity['invoice'] = $quote->invoice ? $quote->invoice->number : "";
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
}
|
@ -28,7 +28,11 @@ class CloneQuoteToInvoiceFactory
|
||||
unset($quote_array['invoice_id']);
|
||||
unset($quote_array['id']);
|
||||
unset($quote_array['invitations']);
|
||||
unset($quote_array['terms']);
|
||||
|
||||
//preserve terms if they exist on Quotes
|
||||
if(array_key_exists('terms', $quote_array) && strlen($quote_array['terms']) < 2)
|
||||
unset($quote_array['terms']);
|
||||
|
||||
// unset($quote_array['public_notes']);
|
||||
unset($quote_array['footer']);
|
||||
unset($quote_array['design_id']);
|
||||
|
@ -23,7 +23,7 @@ class CompanyGatewayFactory
|
||||
$company_gateway->user_id = $user_id;
|
||||
$company_gateway->require_billing_address = false;
|
||||
$company_gateway->require_shipping_address = false;
|
||||
// $company_gateway->fees_and_limits = new FeesAndLimits;
|
||||
$company_gateway->config = encrypt(json_encode(new \stdClass));
|
||||
|
||||
return $company_gateway;
|
||||
}
|
||||
|
@ -48,6 +48,16 @@ class RecurringInvoiceToInvoiceFactory
|
||||
$invoice->custom_value4 = $recurring_invoice->custom_value4;
|
||||
$invoice->amount = $recurring_invoice->amount;
|
||||
$invoice->uses_inclusive_taxes = $recurring_invoice->uses_inclusive_taxes;
|
||||
|
||||
$invoice->custom_surcharge1 = $recurring_invoice->custom_surcharge1;
|
||||
$invoice->custom_surcharge2 = $recurring_invoice->custom_surcharge2;
|
||||
$invoice->custom_surcharge3 = $recurring_invoice->custom_surcharge3;
|
||||
$invoice->custom_surcharge4 = $recurring_invoice->custom_surcharge4;
|
||||
$invoice->custom_surcharge_tax1 = $recurring_invoice->custom_surcharge_tax1;
|
||||
$invoice->custom_surcharge_tax2 = $recurring_invoice->custom_surcharge_tax2;
|
||||
$invoice->custom_surcharge_tax3 = $recurring_invoice->custom_surcharge_tax3;
|
||||
$invoice->custom_surcharge_tax4 = $recurring_invoice->custom_surcharge_tax4;
|
||||
|
||||
// $invoice->balance = $recurring_invoice->balance;
|
||||
$invoice->user_id = $recurring_invoice->user_id;
|
||||
$invoice->assigned_user_id = $recurring_invoice->assigned_user_id;
|
||||
|
@ -168,7 +168,7 @@ abstract class QueryFilters
|
||||
|
||||
public function created_at($value)
|
||||
{
|
||||
$created_at = $value ? $value : 0;
|
||||
$created_at = $value ? (int)$value : 0;
|
||||
|
||||
$created_at = date('Y-m-d H:i:s', $value);
|
||||
|
||||
|
@ -218,7 +218,7 @@ class BaseController extends Controller
|
||||
$query->with(
|
||||
[
|
||||
'company' => function ($query) use ($updated_at, $user) {
|
||||
$query->whereNotNull('updated_at')->with('documents')->with('users');
|
||||
$query->whereNotNull('updated_at')->with('documents','users');
|
||||
},
|
||||
'company.clients' => function ($query) use ($updated_at, $user) {
|
||||
$query->where('clients.updated_at', '>=', $updated_at)->with('contacts.company', 'gateway_tokens', 'documents');
|
||||
@ -392,7 +392,7 @@ class BaseController extends Controller
|
||||
$query->with(
|
||||
[
|
||||
'company' => function ($query) use ($created_at, $user) {
|
||||
$query->whereNotNull('created_at')->with('documents');
|
||||
$query->whereNotNull('created_at')->with('documents','users');
|
||||
},
|
||||
'company.designs'=> function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('company');
|
||||
@ -466,7 +466,7 @@ class BaseController extends Controller
|
||||
$query->with(
|
||||
[
|
||||
'company' => function ($query) use ($created_at, $user) {
|
||||
$query->whereNotNull('created_at')->with('documents');
|
||||
$query->whereNotNull('created_at')->with('documents','users');
|
||||
},
|
||||
'company.clients' => function ($query) use ($created_at, $user) {
|
||||
$query->where('clients.created_at', '>=', $created_at)->with('contacts.company', 'gateway_tokens', 'documents');
|
||||
@ -500,9 +500,6 @@ class BaseController extends Controller
|
||||
},
|
||||
'company.groups' => function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('documents');
|
||||
|
||||
// if(!$user->isAdmin())
|
||||
// $query->where('group_settings.user_id', $user->id);
|
||||
},
|
||||
'company.invoices'=> function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('invitations', 'documents');
|
||||
@ -583,13 +580,30 @@ class BaseController extends Controller
|
||||
$query->where('activities.user_id', $user->id);
|
||||
|
||||
},
|
||||
'company.webhooks'=> function ($query) use($user) {
|
||||
|
||||
if(!$user->isAdmin())
|
||||
$query->where('webhooks.user_id', $user->id);
|
||||
|
||||
},
|
||||
'company.tokens'=> function ($query) use($user) {
|
||||
$query->where('company_tokens.user_id', $user->id);
|
||||
},
|
||||
'company.system_logs',
|
||||
'company.subscriptions'=> function ($query) use($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at);
|
||||
|
||||
if(!$user->isAdmin())
|
||||
$query->where('subscriptions.user_id', $user->id);
|
||||
|
||||
}
|
||||
},
|
||||
'company.recurring_expenses'=> function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('documents');
|
||||
|
||||
if(!$user->hasPermission('view_recurring_expense'))
|
||||
$query->where('recurring_expenses.user_id', $user->id)->orWhere('recurring_expenses.assigned_user_id', $user->id);
|
||||
|
||||
},
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -21,6 +21,15 @@ class SelfUpdateController extends BaseController
|
||||
{
|
||||
use DispatchesJobs;
|
||||
|
||||
private array $purge_file_list = [
|
||||
'bootstrap/cache/compiled.php',
|
||||
'bootstrap/cache/config.php',
|
||||
'bootstrap/cache/packages.php',
|
||||
'bootstrap/cache/services.php',
|
||||
'bootstrap/cache/routes-v7.php',
|
||||
'bootstrap/cache/livewire-components.php',
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
@ -117,10 +126,12 @@ class SelfUpdateController extends BaseController
|
||||
|
||||
unlink($file);
|
||||
|
||||
$cacheCompiled = base_path('bootstrap/cache/compiled.php');
|
||||
if (file_exists($cacheCompiled)) { unlink ($cacheCompiled); }
|
||||
$cacheServices = base_path('bootstrap/cache/services.php');
|
||||
if (file_exists($cacheServices)) { unlink ($cacheServices); }
|
||||
foreach($this->purge_file_list as $purge_file_path)
|
||||
{
|
||||
$purge_file = base_path($purge_file_path);
|
||||
if (file_exists($purge_file)) { unlink ($purge_file); }
|
||||
|
||||
}
|
||||
|
||||
Artisan::call('clear-compiled');
|
||||
Artisan::call('route:clear');
|
||||
|
@ -36,7 +36,7 @@ class StoreClientRequest extends Request
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
{nlog($this->input);
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
|
||||
@ -95,6 +95,10 @@ class StoreClientRequest extends Request
|
||||
|
||||
if (array_key_exists('settings', $input) && ! empty($input['settings'])) {
|
||||
foreach ($input['settings'] as $key => $value) {
|
||||
|
||||
if($key == 'default_task_rate')
|
||||
$value = floatval($value);
|
||||
|
||||
$settings->{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
@ -157,6 +157,10 @@ class UpdateClientRequest extends Request
|
||||
if (! array_key_exists($key, $saveable_casts)) {
|
||||
unset($settings->{$key});
|
||||
}
|
||||
|
||||
if($key == 'default_task_rate'){
|
||||
$settings->default_task_rate = floatval($value);
|
||||
}
|
||||
}
|
||||
|
||||
return $settings;
|
||||
|
@ -81,13 +81,13 @@ class ValidInvoicesRules implements Rule
|
||||
if($inv->status_id == Invoice::STATUS_DRAFT && $invoice['amount'] <= $inv->amount){
|
||||
//catch here nothing to do - we need this to prevent the last elseif triggering
|
||||
}
|
||||
else if($inv->status_id == Invoice::STATUS_DRAFT && $invoice['amount'] > $inv->amount){
|
||||
else if($inv->status_id == Invoice::STATUS_DRAFT && floatval($invoice['amount']) > floatval($inv->amount)){
|
||||
|
||||
$this->error_msg = 'Amount cannot be greater than invoice balance';
|
||||
|
||||
return false;
|
||||
}
|
||||
else if($invoice['amount'] > $inv->balance) {
|
||||
else if(floatval($invoice['amount']) > floatval($inv->balance)) {
|
||||
|
||||
$this->error_msg = ctrans('texts.amount_greater_than_balance_v5');
|
||||
|
||||
|
@ -140,7 +140,7 @@ class CompanyImport implements ShouldQueue
|
||||
'expenses',
|
||||
'tasks',
|
||||
'payments',
|
||||
'activities',
|
||||
// 'activities',
|
||||
// 'backups',
|
||||
'company_ledger',
|
||||
'designs',
|
||||
|
@ -84,7 +84,7 @@ class ReminderJob implements ShouldQueue
|
||||
|
||||
//check if this reminder needs to be emailed
|
||||
//15-01-2022 - insert addition if block if send_reminders is definitely set
|
||||
if(in_array($reminder_template, ['reminder1','reminder2','reminder3','reminder_endless']) && $invoice->client->getSetting("enable_".$reminder_template) && $invoice->client->getSetting("send_reminders"))
|
||||
if(in_array($reminder_template, ['reminder1','reminder2','reminder3','reminder_endless']) && $invoice->client->getSetting("enable_".$reminder_template) && $invoice->client->getSetting("send_reminders") && $invoice->company->account->isPaidHostedClient())
|
||||
{
|
||||
$invoice->invitations->each(function ($invitation) use ($invoice, $reminder_template) {
|
||||
EmailEntity::dispatch($invitation, $invitation->company, $reminder_template);
|
||||
|
@ -190,7 +190,7 @@ class BaseModel extends Model
|
||||
|
||||
public function numberFormatter()
|
||||
{
|
||||
$number = strlen($this->number) >= 1 ? $this->number : class_basename($this) . "_" . Str::random(5); ;
|
||||
$number = strlen($this->number) >= 1 ? $this->number : class_basename($this) . "_" . Str::random(5);
|
||||
|
||||
$formatted_number = mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $number);
|
||||
// Remove any runs of periods (thanks falstro!)
|
||||
|
@ -250,7 +250,7 @@ class CompanyGateway extends BaseModel
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
if ($this->gateway->provider == 'Stripe' && property_exists($config, 'publishableKey') && strpos($config->publishableKey, 'test')) {
|
||||
if ($this->gateway && $this->gateway->provider == 'Stripe' && property_exists($config, 'publishableKey') && strpos($config->publishableKey, 'test')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,8 @@ class CompanyUser extends Pivot
|
||||
|
||||
protected $touches = ['user'];
|
||||
|
||||
protected $with = ['user','account'];
|
||||
|
||||
public function getEntityType()
|
||||
{
|
||||
return self::class;
|
||||
|
@ -106,4 +106,24 @@ class Expense extends BaseModel
|
||||
{
|
||||
return ctrans('texts.expense');
|
||||
}
|
||||
|
||||
public function currency()
|
||||
{
|
||||
return $this->belongsTo(Currency::class);
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(ExpenseCategory::class);
|
||||
}
|
||||
|
||||
public function payment_type()
|
||||
{
|
||||
return $this->belongsTo(PaymentType::class);
|
||||
}
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo(Project::class);
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,10 @@ class Webhook extends BaseModel
|
||||
const EVENT_LATE_INVOICE = 22;
|
||||
const EVENT_EXPIRED_QUOTE = 23;
|
||||
const EVENT_REMIND_INVOICE = 24;
|
||||
const EVENT_PROJECT_CREATE = 25;
|
||||
const EVENT_PROJECT_UPDATE = 26;
|
||||
|
||||
|
||||
public static $valid_events = [
|
||||
self::EVENT_CREATE_CLIENT,
|
||||
self::EVENT_CREATE_INVOICE,
|
||||
@ -68,6 +71,8 @@ class Webhook extends BaseModel
|
||||
self::EVENT_LATE_INVOICE,
|
||||
self::EVENT_EXPIRED_QUOTE,
|
||||
self::EVENT_REMIND_INVOICE,
|
||||
self::EVENT_PROJECT_CREATE,
|
||||
self::EVENT_PROJECT_UPDATE
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
|
89
app/Observers/ProjectObserver.php
Normal file
89
app/Observers/ProjectObserver.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Jobs\Util\WebhookHandler;
|
||||
use App\Models\Project;
|
||||
use App\Models\Webhook;
|
||||
|
||||
class ProjectObserver
|
||||
{
|
||||
public $afterCommit = true;
|
||||
/**
|
||||
* Handle the product "created" event.
|
||||
*
|
||||
* @param Project $project
|
||||
* @return void
|
||||
*/
|
||||
public function created(Project $project)
|
||||
{
|
||||
$subscriptions = Webhook::where('company_id', $project->company_id)
|
||||
->where('event_id', Webhook::EVENT_PROJECT_CREATE)
|
||||
->exists();
|
||||
|
||||
if ($subscriptions) {
|
||||
|
||||
WebhookHandler::dispatch(Webhook::EVENT_PROJECT_CREATE, $project, $project->company, 'client');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the product "updated" event.
|
||||
*
|
||||
* @param Project $project
|
||||
* @return void
|
||||
*/
|
||||
public function updated(Project $project)
|
||||
{
|
||||
$subscriptions = Webhook::where('company_id', $project->company_id)
|
||||
->where('event_id', Webhook::EVENT_PROJECT_UPDATE)
|
||||
->exists();
|
||||
|
||||
if ($subscriptions) {
|
||||
|
||||
WebhookHandler::dispatch(Webhook::EVENT_PROJECT_UPDATE, $project, $project->company, 'client');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the product "deleted" event.
|
||||
*
|
||||
* @param Project $project
|
||||
* @return void
|
||||
*/
|
||||
public function deleted(Project $project)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the product "restored" event.
|
||||
*
|
||||
* @param Project $project
|
||||
* @return void
|
||||
*/
|
||||
public function restored(Project $project)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the product "force deleted" event.
|
||||
*
|
||||
* @param Project $project
|
||||
* @return void
|
||||
*/
|
||||
public function forceDeleted(Project $project)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -164,13 +164,13 @@ class AuthorizePaymentMethod
|
||||
if ($contact) {
|
||||
// Create the Bill To info for new payment type
|
||||
$billto = new CustomerAddressType();
|
||||
$billto->setFirstName($contact->present()->first_name());
|
||||
$billto->setLastName($contact->present()->last_name());
|
||||
$billto->setCompany($this->authorize->client->present()->name());
|
||||
$billto->setAddress($this->authorize->client->address1);
|
||||
$billto->setCity($this->authorize->client->city);
|
||||
$billto->setState($this->authorize->client->state);
|
||||
$billto->setZip($this->authorize->client->postal_code);
|
||||
$billto->setFirstName(substr(0,50,$contact->present()->first_name()));
|
||||
$billto->setLastName(substr(0,50,$contact->present()->last_name()));
|
||||
$billto->setCompany(substr(0,50,$this->authorize->client->present()->name()));
|
||||
$billto->setAddress(substr(0,60,$this->authorize->client->address1));
|
||||
$billto->setCity(substr(0,40,$this->authorize->client->city));
|
||||
$billto->setState(substr(0,40,$this->authorize->client->state));
|
||||
$billto->setZip(substr(0,20,$this->authorize->client->postal_code));
|
||||
|
||||
if ($this->authorize->client->country_id) {
|
||||
$billto->setCountry($this->authorize->client->country->name);
|
||||
|
@ -170,16 +170,52 @@ class CreditCard
|
||||
|
||||
$this->logResponse($response);
|
||||
|
||||
$response_status = ErrorCode::getStatus($response->ResponseMessage);
|
||||
// if(!$response || !property_exists($response, 'ResponseMessage'))
|
||||
// throw new PaymentFailed('The gateway did not return a valid response. Please check your gateway credentials.', 400);
|
||||
|
||||
if(!$response_status['success']){
|
||||
// $response_status = ErrorCode::getStatus($response->ResponseMessage);
|
||||
|
||||
$this->eway_driver->sendFailureMail($response_status['message']);
|
||||
// if(!$response_status['success']){
|
||||
|
||||
throw new PaymentFailed($response_status['message'], 400);
|
||||
}
|
||||
// if($response->getErrors())
|
||||
// {
|
||||
// $message = false;
|
||||
|
||||
// foreach ($response->getErrors() as $error) {
|
||||
// $message = \Eway\Rapid::getMessage($error);
|
||||
// }
|
||||
|
||||
// $return_message = $message ?: $response_status['message'];
|
||||
// }
|
||||
|
||||
// $this->eway_driver->sendFailureMail($response_status['message']);
|
||||
|
||||
// throw new PaymentFailed($response_status['message'], 400);
|
||||
// }
|
||||
|
||||
if($response->TransactionStatus)
|
||||
$payment = $this->storePayment($response);
|
||||
else {
|
||||
|
||||
$message = 'Error processing payment.';
|
||||
|
||||
if(isset($response->ResponseMessage))
|
||||
$message .= " Gateway Error Code = {$response->ResponseMessage}";
|
||||
|
||||
if($response->getErrors())
|
||||
{
|
||||
|
||||
foreach ($response->getErrors() as $error) {
|
||||
$message = \Eway\Rapid::getMessage($error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->eway_driver->sendFailureMail($message);
|
||||
|
||||
throw new PaymentFailed($message, 400);
|
||||
}
|
||||
|
||||
$payment = $this->storePayment($response);
|
||||
|
||||
return redirect()->route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)]);
|
||||
|
||||
@ -257,20 +293,32 @@ class CreditCard
|
||||
|
||||
$response = $this->eway_driver->init()->eway->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);
|
||||
|
||||
$response_status = ErrorCode::getStatus($response->ResponseMessage);
|
||||
if($response->TransactionStatus){
|
||||
$this->logResponse($response, true);
|
||||
$payment = $this->storePayment($response);
|
||||
}
|
||||
else {
|
||||
|
||||
if(!$response_status['success']){
|
||||
$message = 'Error processing payment.';
|
||||
|
||||
$this->logResponse($response, false);
|
||||
if(isset($response->ResponseMessage))
|
||||
$message .= " Gateway Error Code = {$response->ResponseMessage}";
|
||||
|
||||
$this->eway_driver->sendFailureMail($response_status['message']);
|
||||
if($response->getErrors())
|
||||
{
|
||||
|
||||
foreach ($response->getErrors() as $error) {
|
||||
$message = \Eway\Rapid::getMessage($error);
|
||||
}
|
||||
|
||||
throw new PaymentFailed($response_status['message'], 400);
|
||||
}
|
||||
}
|
||||
|
||||
$this->logResponse($response, true);
|
||||
$this->logResponse($response, false);
|
||||
|
||||
$payment = $this->storePayment($response);
|
||||
$this->eway_driver->sendFailureMail($message);
|
||||
|
||||
throw new PaymentFailed($message, 400);
|
||||
}
|
||||
|
||||
return $payment;
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ class PayPalExpressPaymentDriver extends BaseDriver
|
||||
|
||||
private $omnipay_gateway;
|
||||
|
||||
private float $fee = 0;
|
||||
|
||||
const SYSTEM_LOG_TYPE = SystemLog::TYPE_PAYPAL;
|
||||
|
||||
public function gatewayTypes()
|
||||
@ -173,11 +175,17 @@ class PayPalExpressPaymentDriver extends BaseDriver
|
||||
|
||||
public function generatePaymentDetails(array $data)
|
||||
{
|
||||
|
||||
$_invoice = collect($this->payment_hash->data->invoices)->first();
|
||||
$invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id));
|
||||
|
||||
$this->fee = $this->feeCalc($invoice, $data['total']['amount_with_fee']);
|
||||
|
||||
return [
|
||||
'currency' => $this->client->getCurrencyCode(),
|
||||
'transactionType' => 'Purchase',
|
||||
'clientIp' => request()->getClientIp(),
|
||||
'amount' => $data['total']['amount_with_fee'],
|
||||
'amount' => $data['total']['amount_with_fee'] + $this->fee,
|
||||
'returnUrl' => route('client.payments.response', [
|
||||
'company_gateway_id' => $this->company_gateway->id,
|
||||
'payment_hash' => $this->payment_hash->hash,
|
||||
@ -200,8 +208,6 @@ class PayPalExpressPaymentDriver extends BaseDriver
|
||||
$_invoice = collect($this->payment_hash->data->invoices)->first();
|
||||
$invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id));
|
||||
|
||||
$line_item = collect($invoice->line_items)->first();
|
||||
|
||||
$items = [];
|
||||
|
||||
$items[] = new Item([
|
||||
@ -211,8 +217,44 @@ class PayPalExpressPaymentDriver extends BaseDriver
|
||||
'quantity' => 1,
|
||||
]);
|
||||
|
||||
|
||||
if($this->fee > 0.1){
|
||||
|
||||
$items[] = new Item([
|
||||
'name' => " ",
|
||||
'description' => ctrans('texts.gateway_fee_description'),
|
||||
'price' => $this->fee,
|
||||
'quantity' => 1,
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $items;
|
||||
|
||||
}
|
||||
|
||||
private function feeCalc($invoice, $invoice_total)
|
||||
{
|
||||
|
||||
$invoice->service()->removeUnpaidGatewayFees();
|
||||
$invoice = $invoice->fresh();
|
||||
|
||||
$balance = floatval($invoice->balance);
|
||||
|
||||
$_updated_invoice = $invoice->service()->addGatewayFee($this->company_gateway, GatewayType::PAYPAL, $invoice_total)->save();
|
||||
|
||||
if(floatval($_updated_invoice->balance) > $balance){
|
||||
|
||||
$fee = floatval($_updated_invoice->balance) - $balance;
|
||||
|
||||
$this->payment_hash->fee_total = $fee;
|
||||
$this->payment_hash->save();
|
||||
|
||||
return $fee;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ use Illuminate\Support\Facades\Queue;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Livewire\Livewire;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@ -69,6 +70,11 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
app()->instance(TruthSource::class, new TruthSource());
|
||||
|
||||
|
||||
// Model::preventLazyLoading(
|
||||
// !$this->app->isProduction()
|
||||
// );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -213,6 +213,7 @@ use App\Models\Expense;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Product;
|
||||
use App\Models\Project;
|
||||
use App\Models\Proposal;
|
||||
use App\Models\Quote;
|
||||
use App\Models\Subscription;
|
||||
@ -228,6 +229,7 @@ use App\Observers\ExpenseObserver;
|
||||
use App\Observers\InvoiceObserver;
|
||||
use App\Observers\PaymentObserver;
|
||||
use App\Observers\ProductObserver;
|
||||
use App\Observers\ProjectObserver;
|
||||
use App\Observers\ProposalObserver;
|
||||
use App\Observers\QuoteObserver;
|
||||
use App\Observers\SubscriptionObserver;
|
||||
@ -586,6 +588,7 @@ class EventServiceProvider extends ServiceProvider
|
||||
Invoice::observe(InvoiceObserver::class);
|
||||
Payment::observe(PaymentObserver::class);
|
||||
Product::observe(ProductObserver::class);
|
||||
Project::observe(ProjectObserver::class);
|
||||
Proposal::observe(ProposalObserver::class);
|
||||
Quote::observe(QuoteObserver::class);
|
||||
Task::observe(TaskObserver::class);
|
||||
|
@ -19,20 +19,14 @@ use App\Models\Client;
|
||||
use App\Models\Design;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Product;
|
||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
||||
use App\Services\PdfMaker\PdfMaker;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\HtmlEngine;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Number;
|
||||
use App\Utils\PhantomJS\Phantom;
|
||||
use App\Utils\Traits\Pdf\PdfMaker as PdfMakerTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class Statement
|
||||
{
|
||||
@ -231,7 +225,7 @@ class Statement
|
||||
->where('client_id', $this->client->id)
|
||||
->whereIn('status_id', $this->invoiceStatuses())
|
||||
->whereBetween('date', [Carbon::parse($this->options['start_date']), Carbon::parse($this->options['end_date'])])
|
||||
->orderBy('date', 'ASC')
|
||||
->orderBy('due_date', 'ASC')
|
||||
->cursor();
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ class CompanyUserTransformer extends EntityTransformer
|
||||
|
||||
public function includeToken(CompanyUser $company_user)
|
||||
{
|
||||
$token = $company_user->tokens->where('company_id', $company_user->company_id)->where('user_id', $company_user->user_id)->first();
|
||||
$token = $company_user->tokens()->where('company_id', $company_user->company_id)->where('user_id', $company_user->user_id)->first();
|
||||
|
||||
$transformer = new CompanyTokenTransformer($this->serializer);
|
||||
|
||||
|
@ -13,11 +13,13 @@ namespace App\Transformers;
|
||||
|
||||
use App\Models\Activity;
|
||||
use App\Models\Backup;
|
||||
use App\Models\Client;
|
||||
use App\Models\Document;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\RecurringInvoice;
|
||||
use App\Models\RecurringInvoiceInvitation;
|
||||
use App\Transformers\ActivityTransformer;
|
||||
use App\Transformers\ClientTransformer;
|
||||
use App\Transformers\InvoiceHistoryTransformer;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
|
||||
@ -32,6 +34,7 @@ class RecurringInvoiceTransformer extends EntityTransformer
|
||||
|
||||
protected $availableIncludes = [
|
||||
'activities',
|
||||
'client',
|
||||
];
|
||||
|
||||
public function includeHistory(RecurringInvoice $invoice)
|
||||
@ -62,6 +65,13 @@ class RecurringInvoiceTransformer extends EntityTransformer
|
||||
return $this->includeCollection($invoice->documents, $transformer, Document::class);
|
||||
}
|
||||
|
||||
public function includeClient(RecurringInvoice $invoice)
|
||||
{
|
||||
$transformer = new ClientTransformer($this->serializer);
|
||||
|
||||
return $this->includeItem($invoice->client, $transformer, Client::class);
|
||||
}
|
||||
|
||||
public function transform(RecurringInvoice $invoice)
|
||||
{
|
||||
|
||||
|
@ -30,7 +30,7 @@ class NinjaPdf
|
||||
$response = $client->post($this->url,[
|
||||
RequestOptions::JSON => ['html' => $html]
|
||||
]);
|
||||
|
||||
|
||||
return $response->getBody();
|
||||
}
|
||||
|
||||
|
@ -122,6 +122,9 @@ class HtmlEngine
|
||||
$data['$invoice.date'] = &$data['$date'];
|
||||
$data['$invoiceDate'] = &$data['$date'];
|
||||
$data['$due_date'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')];
|
||||
|
||||
$data['$partial_due_date'] = ['value' => $this->translateDate($this->entity->partial_due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')];
|
||||
|
||||
$data['$dueDate'] = &$data['$due_date'];
|
||||
|
||||
$data['$payment_due'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.payment_due')];
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace App\Utils\Traits;
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use stdClass;
|
||||
|
||||
@ -63,15 +64,6 @@ trait ClientGroupSettingsSaver
|
||||
$entity_settings->{$key} = $value;
|
||||
}
|
||||
|
||||
//this pass will handle any null values that are in the translations
|
||||
// foreach ($settings->translations as $key => $value) {
|
||||
// if (is_null($settings->translations[$key])) {
|
||||
// $settings->translations[$key] = '';
|
||||
// }
|
||||
// }
|
||||
|
||||
// $entity_settings->translations = $settings->translations;
|
||||
|
||||
$entity->settings = $entity_settings;
|
||||
$entity->save();
|
||||
|
||||
@ -121,8 +113,12 @@ trait ClientGroupSettingsSaver
|
||||
continue;
|
||||
}
|
||||
/*Separate loop if it is a _id field which is an integer cast as a string*/
|
||||
elseif (substr($key, -3) == '_id' || substr($key, -14) == 'number_counter') {
|
||||
$value = 'integer';
|
||||
elseif (substr($key, -3) == '_id' ||
|
||||
substr($key, -14) == 'number_counter' ||
|
||||
($key == 'payment_terms' && property_exists($settings, 'payment_terms') && strlen($settings->{$key}) >= 1) ||
|
||||
($key == 'valid_until' && property_exists($settings, 'valid_until') && strlen($settings->{$key}) >= 1)) {
|
||||
|
||||
$value = 'integer';
|
||||
|
||||
if (! property_exists($settings, $key)) {
|
||||
continue;
|
||||
@ -170,7 +166,11 @@ trait ClientGroupSettingsSaver
|
||||
}
|
||||
|
||||
/*Separate loop if it is a _id field which is an integer cast as a string*/
|
||||
if (substr($key, -3) == '_id' || substr($key, -14) == 'number_counter') {
|
||||
if (substr($key, -3) == '_id' ||
|
||||
substr($key, -14) == 'number_counter' ||
|
||||
($key == 'payment_terms' && property_exists($settings, 'payment_terms') && strlen($settings->{$key}) >= 1) ||
|
||||
($key == 'valid_until' && property_exists($settings, 'valid_until') && strlen($settings->{$key}) >= 1)) {
|
||||
|
||||
$value = 'integer';
|
||||
|
||||
if (! property_exists($settings, $key)) {
|
||||
@ -219,8 +219,7 @@ trait ClientGroupSettingsSaver
|
||||
switch ($key) {
|
||||
case 'int':
|
||||
case 'integer':
|
||||
// return ctype_digit(strval(abs($value)));
|
||||
return ctype_digit(strval($value));
|
||||
return is_numeric($value) && ctype_digit(strval(abs($value)));
|
||||
case 'real':
|
||||
case 'float':
|
||||
case 'double':
|
||||
|
@ -32,7 +32,7 @@ trait UserNotifies
|
||||
$notifiable_methods = [];
|
||||
$notifications = $company_user->notifications;
|
||||
|
||||
if ($company_user->company->is_disabled && is_array($notifications->email) || $company_user->trashed() || $company_user->user->trashed()) {
|
||||
if ($invitation->company->is_disabled && is_array($notifications->email) || $company_user->trashed() || $company_user->user->trashed()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ trait UserNotifies
|
||||
$notifiable_methods = [];
|
||||
$notifications = $company_user->notifications;
|
||||
|
||||
if ($company_user->company->is_disabled || ! $notifications || $company_user->trashed() || $company_user->user->trashed()) {
|
||||
if ($entity->company->is_disabled || ! $notifications || $company_user->trashed() || $company_user->user->trashed()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ trait SettingsSaver
|
||||
continue;
|
||||
}
|
||||
/*Separate loop if it is a _id field which is an integer cast as a string*/
|
||||
elseif (substr($key, -3) == '_id' || substr($key, -14) == 'number_counter') {
|
||||
elseif (substr($key, -3) == '_id' || substr($key, -14) == 'number_counter' || ($key == 'payment_terms' && strlen($settings->{$key}) >= 1) || ($key == 'valid_until' && strlen($settings->{$key}) >= 1)) {
|
||||
$value = 'integer';
|
||||
|
||||
if($key == 'gmail_sending_user_id')
|
||||
@ -94,12 +94,11 @@ trait SettingsSaver
|
||||
switch ($key) {
|
||||
case 'int':
|
||||
case 'integer':
|
||||
return ctype_digit(strval(abs($value)));
|
||||
return is_numeric($value) && ctype_digit(strval(abs($value)));
|
||||
case 'real':
|
||||
case 'float':
|
||||
case 'double':
|
||||
return !is_string($value) && (is_float($value) || is_numeric(strval($value)));
|
||||
// return is_float($value) || is_numeric(strval($value));
|
||||
case 'string':
|
||||
return !is_int($value) || ( is_string( $value ) && method_exists($value, '__toString') ) || is_null($value) || is_string($value);
|
||||
case 'bool':
|
||||
|
@ -54,7 +54,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'asset_url' => null,
|
||||
'asset_url' => env('ASSET_URL', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -14,8 +14,8 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_version' => '5.3.79',
|
||||
'app_tag' => '5.3.79',
|
||||
'app_version' => '5.3.80',
|
||||
'app_tag' => '5.3.80',
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', ''),
|
||||
|
@ -2358,6 +2358,186 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
barcode
|
||||
pdf
|
||||
printing
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
boardview
|
||||
|
||||
@ -5783,6 +5963,8 @@ cross_file
|
||||
flutter_lints
|
||||
flutter_plugin_android_lifecycle
|
||||
google_sign_in
|
||||
google_sign_in_android
|
||||
google_sign_in_ios
|
||||
google_sign_in_platform_interface
|
||||
google_sign_in_web
|
||||
image_picker_for_web
|
||||
@ -5794,11 +5976,14 @@ path_provider_android
|
||||
path_provider_ios
|
||||
path_provider_linux
|
||||
path_provider_macos
|
||||
path_provider_platform_interface
|
||||
path_provider_windows
|
||||
plugin_platform_interface
|
||||
pointer_interceptor
|
||||
share
|
||||
shared_preferences
|
||||
shared_preferences_android
|
||||
shared_preferences_ios
|
||||
shared_preferences_linux
|
||||
shared_preferences_macos
|
||||
shared_preferences_web
|
||||
@ -5813,6 +5998,7 @@ url_launcher_windows
|
||||
webview_flutter
|
||||
webview_flutter_platform_interface
|
||||
webview_flutter_wkwebview
|
||||
xdg_directories
|
||||
|
||||
Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
|
||||
@ -6426,66 +6612,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
device_info_plus
|
||||
device_info_plus_platform_interface
|
||||
device_info_plus_web
|
||||
package_info_plus
|
||||
|
||||
// Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
device_info_plus_linux
|
||||
device_info_plus_macos
|
||||
device_info_plus_windows
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 The Flutter Community Plus Plugin Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
--------------------------------------------------------------------------------
|
||||
diacritic
|
||||
|
||||
@ -7514,31 +7640,6 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
extension
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
faker
|
||||
|
||||
@ -8023,7 +8124,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
--------------------------------------------------------------------------------
|
||||
flutter_styled_toast
|
||||
injector
|
||||
webdriver
|
||||
|
||||
Apache License
|
||||
@ -12698,7 +12798,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
js
|
||||
markdown
|
||||
|
||||
Copyright 2012, the Dart project authors. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -14723,6 +14822,37 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
markdown
|
||||
|
||||
Copyright 2012, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
material_design_icons_flutter
|
||||
|
||||
@ -14860,55 +14990,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
native_pdf_renderer
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 RBC, Serge Shkurko
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
native_pdf_view
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 RBC, Serge Shkurko
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
--------------------------------------------------------------------------------
|
||||
node_preamble
|
||||
|
||||
The MIT License (MIT)
|
||||
@ -15011,6 +15092,37 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
package_info_plus
|
||||
|
||||
// Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
package_info_plus_linux
|
||||
package_info_plus_windows
|
||||
@ -15105,33 +15217,27 @@ package_info_plus_web
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
path_provider_platform_interface
|
||||
path_parsing
|
||||
|
||||
Copyright 2020 The Chromium Authors. All rights reserved.
|
||||
Copyright (c) 2018 Dan Field
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
permission_handler
|
||||
@ -18329,18 +18435,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
--------------------------------------------------------------------------------
|
||||
universal_platform
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 gskinner.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
--------------------------------------------------------------------------------
|
||||
uuid
|
||||
|
||||
Copyright (c) 2021 Yulian Kuncheff
|
||||
@ -18541,37 +18635,6 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
--------------------------------------------------------------------------------
|
||||
xdg_directories
|
||||
|
||||
Copyright 2020 The Flutter Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
xxhash
|
||||
|
||||
|
Binary file not shown.
52
public/flutter_service_worker.js
vendored
52
public/flutter_service_worker.js
vendored
@ -3,42 +3,42 @@ const MANIFEST = 'flutter-app-manifest';
|
||||
const TEMP = 'flutter-temp-cache';
|
||||
const CACHE_NAME = 'flutter-app-cache';
|
||||
const RESOURCES = {
|
||||
"assets/NOTICES": "cf43cdaf5dacbabcdacd7a402a0a7cb2",
|
||||
"assets/assets/images/icon.png": "090f69e23311a4b6d851b3880ae52541",
|
||||
"assets/assets/images/logo_dark.png": "a233ed1d4d0f7414bf97a9a10f11fb0a",
|
||||
"main.dart.js": "490e9bf677a08a199d133d81b6284ae3",
|
||||
"/": "76a4ee7a4c831007fe570334d3ae66d9",
|
||||
"favicon.png": "dca91c54388f52eded692718d5a98b8b",
|
||||
"assets/fonts/MaterialIcons-Regular.otf": "7e7a6cccddf6d7b20012a548461d5d81",
|
||||
"assets/AssetManifest.json": "38d9aea341601f3a5c6fa7b5a1216ea5",
|
||||
"assets/packages/material_design_icons_flutter/lib/fonts/materialdesignicons-webfont.ttf": "b62641afc9ab487008e996a5c5865e56",
|
||||
"assets/FontManifest.json": "cf3c681641169319e61b61bd0277378f",
|
||||
"assets/assets/images/payment_types/paypal.png": "8e06c094c1871376dfea1da8088c29d1",
|
||||
"assets/assets/images/payment_types/ach.png": "7433f0aff779dc98a649b7a2daf777cf",
|
||||
"assets/assets/images/payment_types/switch.png": "4fa11c45327f5fdc20205821b2cfd9cc",
|
||||
"assets/assets/images/payment_types/carteblanche.png": "d936e11fa3884b8c9f1bd5c914be8629",
|
||||
"assets/assets/images/payment_types/laser.png": "b4e6e93dd35517ac429301119ff05868",
|
||||
"assets/assets/images/payment_types/solo.png": "2030c3ccaccf5d5e87916a62f5b084d6",
|
||||
"assets/assets/images/payment_types/discover.png": "6c0a386a00307f87db7bea366cca35f5",
|
||||
"assets/assets/images/payment_types/maestro.png": "e533b92bfb50339fdbfa79e3dfe81f08",
|
||||
"assets/assets/images/payment_types/unionpay.png": "7002f52004e0ab8cc0b7450b0208ccb2",
|
||||
"assets/assets/images/payment_types/mastercard.png": "6f6cdc29ee2e22e06b1ac029cb52ef71",
|
||||
"assets/assets/images/payment_types/visa.png": "3ddc4a4d25c946e8ad7e6998f30fd4e3",
|
||||
"assets/assets/images/payment_types/other.png": "d936e11fa3884b8c9f1bd5c914be8629",
|
||||
"assets/assets/images/payment_types/solo.png": "2030c3ccaccf5d5e87916a62f5b084d6",
|
||||
"assets/assets/images/payment_types/paypal.png": "8e06c094c1871376dfea1da8088c29d1",
|
||||
"assets/assets/images/payment_types/jcb.png": "07e0942d16c5592118b72e74f2f7198c",
|
||||
"assets/assets/images/payment_types/dinerscard.png": "06d85186ba858c18ab7c9caa42c92024",
|
||||
"assets/assets/images/payment_types/ach.png": "7433f0aff779dc98a649b7a2daf777cf",
|
||||
"assets/assets/images/payment_types/carteblanche.png": "d936e11fa3884b8c9f1bd5c914be8629",
|
||||
"assets/assets/images/payment_types/amex.png": "c49a4247984b3732a4af50a3390aa978",
|
||||
"assets/assets/images/logo_light.png": "e5f46d5a78e226e7a9553d4ca6f69219",
|
||||
"assets/assets/images/payment_types/other.png": "d936e11fa3884b8c9f1bd5c914be8629",
|
||||
"assets/assets/images/payment_types/unionpay.png": "7002f52004e0ab8cc0b7450b0208ccb2",
|
||||
"assets/assets/images/payment_types/dinerscard.png": "06d85186ba858c18ab7c9caa42c92024",
|
||||
"assets/assets/images/payment_types/jcb.png": "07e0942d16c5592118b72e74f2f7198c",
|
||||
"assets/assets/images/payment_types/laser.png": "b4e6e93dd35517ac429301119ff05868",
|
||||
"assets/assets/images/payment_types/maestro.png": "e533b92bfb50339fdbfa79e3dfe81f08",
|
||||
"assets/assets/images/google_logo.png": "0f118259ce403274f407f5e982e681c3",
|
||||
"assets/FontManifest.json": "cf3c681641169319e61b61bd0277378f",
|
||||
"assets/AssetManifest.json": "38d9aea341601f3a5c6fa7b5a1216ea5",
|
||||
"assets/packages/material_design_icons_flutter/lib/fonts/materialdesignicons-webfont.ttf": "015400679694f1f51047e46da0e1dc98",
|
||||
"assets/fonts/MaterialIcons-Regular.otf": "7e7a6cccddf6d7b20012a548461d5d81",
|
||||
"manifest.json": "ef43d90e57aa7682d7e2cfba2f484a40",
|
||||
"/": "b3825b5f497060ce95ca30b78dbcade5",
|
||||
"assets/assets/images/logo_dark.png": "a233ed1d4d0f7414bf97a9a10f11fb0a",
|
||||
"assets/assets/images/logo_light.png": "e5f46d5a78e226e7a9553d4ca6f69219",
|
||||
"assets/assets/images/icon.png": "090f69e23311a4b6d851b3880ae52541",
|
||||
"assets/NOTICES": "e85d9402df435f95cdc3e10e32a7a6b5",
|
||||
"icons/Icon-192.png": "bb1cf5f6982006952211c7c8404ffbed",
|
||||
"icons/Icon-512.png": "0f9aff01367f0a0c69773d25ca16ef35",
|
||||
"manifest.json": "ef43d90e57aa7682d7e2cfba2f484a40",
|
||||
"version.json": "9e90029341433397a98f5a0478aa31b7",
|
||||
"favicon.ico": "51636d3a390451561744c42188ccd628",
|
||||
"canvaskit/canvaskit.js": "c2b4e5f3d7a3d82aed024e7249a78487",
|
||||
"canvaskit/canvaskit.wasm": "4b83d89d9fecbea8ca46f2f760c5a9ba",
|
||||
"canvaskit/profiling/canvaskit.js": "ae2949af4efc61d28a4a80fffa1db900",
|
||||
"canvaskit/profiling/canvaskit.wasm": "95e736ab31147d1b2c7b25f11d4c32cd",
|
||||
"main.dart.js": "16a91e6b57fce3b06e7935f0a2019b5b",
|
||||
"favicon.png": "dca91c54388f52eded692718d5a98b8b",
|
||||
"version.json": "9e90029341433397a98f5a0478aa31b7"
|
||||
"canvaskit/profiling/canvaskit.js": "ae2949af4efc61d28a4a80fffa1db900",
|
||||
"canvaskit/canvaskit.wasm": "4b83d89d9fecbea8ca46f2f760c5a9ba",
|
||||
"canvaskit/canvaskit.js": "c2b4e5f3d7a3d82aed024e7249a78487"
|
||||
};
|
||||
|
||||
// The application shell files that are downloaded before a service worker can
|
||||
|
286302
public/main.dart.js
vendored
286302
public/main.dart.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
277067
public/main.foss.dart.js
vendored
277067
public/main.foss.dart.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
281263
public/main.html.dart.js
vendored
281263
public/main.html.dart.js
vendored
File diff suppressed because one or more lines are too long
143430
public/main.next.dart.js
vendored
143430
public/main.next.dart.js
vendored
File diff suppressed because one or more lines are too long
26777
public/main.profile.dart.js
vendored
26777
public/main.profile.dart.js
vendored
File diff suppressed because one or more lines are too long
@ -50,7 +50,7 @@
|
||||
@include('portal.ninja2020.gateways.includes.save_card')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element-single')
|
||||
<div class="w-screen items-center" id="paytrace--credit-card-container">
|
||||
<div class="items-center" id="paytrace--credit-card-container">
|
||||
<div id="pt_hpf_form"></div>
|
||||
</div>
|
||||
@endcomponent
|
||||
|
@ -70,9 +70,12 @@
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let toggleWithToken = document.querySelector('.toggle-payment-with-token');
|
||||
let toggleWithCard = document.querySelector('#toggle-payment-with-credit-card');
|
||||
|
||||
if (toggleWithToken) {
|
||||
toggleWithToken.click();
|
||||
} else if (toggleWithCard) {
|
||||
toggleWithCard.click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -50,8 +50,6 @@ class CompanySettingsTest extends TestCase
|
||||
|
||||
$this->company->saveSettings($settings, $this->company);
|
||||
|
||||
//$this->withoutExceptionHandling();
|
||||
|
||||
$response = false;
|
||||
|
||||
try {
|
||||
|
@ -36,7 +36,7 @@ class UpdateCompanyUserTest extends TestCase
|
||||
|
||||
public function testUpdatingCompanyUserAsAdmin()
|
||||
{
|
||||
User::unguard();
|
||||
// User::unguard();
|
||||
|
||||
$settings = new \stdClass;
|
||||
$settings->invoice = 'ninja';
|
||||
@ -59,7 +59,7 @@ class UpdateCompanyUserTest extends TestCase
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
$this->assertNotNull($message);
|
||||
}
|
||||
|
||||
|
||||
$response->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
|
337
tests/Unit/ClientSettingsTest.php
Normal file
337
tests/Unit/ClientSettingsTest.php
Normal file
@ -0,0 +1,337 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Tests\MockAccountData;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
class ClientSettingsTest extends TestCase
|
||||
{
|
||||
use MockAccountData;
|
||||
use DatabaseTransactions;
|
||||
|
||||
public function setUp() :void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->makeTestData();
|
||||
|
||||
$this->faker = \Faker\Factory::create();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function testClientBaseline()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'name' => $this->faker->firstName,
|
||||
'id_number' => 'Coolio',
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
||||
try{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/clients/', $data);
|
||||
} catch (ValidationException $e) {
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
nlog($message);
|
||||
}
|
||||
|
||||
$response->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
|
||||
$this->assertEquals("1", $arr['data']['settings']['currency_id']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function testClientValidSettings()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'name' => $this->faker->firstName,
|
||||
'id_number' => 'Coolio',
|
||||
'settings' => [
|
||||
'currency_id' => '1',
|
||||
'language_id' => '1',
|
||||
'payment_terms' => '1',
|
||||
'valid_until' => '1',
|
||||
'default_task_rate' => 10,
|
||||
'send_reminders' => true
|
||||
]
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
||||
try{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/clients/', $data);
|
||||
} catch (ValidationException $e) {
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
nlog($message);
|
||||
}
|
||||
|
||||
$response->assertStatus(200);
|
||||
|
||||
$arr = $response->json();
|
||||
|
||||
$this->assertEquals("1", $arr['data']['settings']['currency_id']);
|
||||
$this->assertEquals("1", $arr['data']['settings']['language_id']);
|
||||
$this->assertEquals("1", $arr['data']['settings']['payment_terms']);
|
||||
$this->assertEquals(10, $arr['data']['settings']['default_task_rate']);
|
||||
$this->assertEquals(true, $arr['data']['settings']['send_reminders']);
|
||||
$this->assertEquals("1", $arr['data']['settings']['valid_until']);
|
||||
|
||||
}
|
||||
|
||||
public function testClientIllegalCurrency()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'name' => $this->faker->firstName,
|
||||
'id_number' => 'Coolio',
|
||||
'settings' => [
|
||||
'currency_id' => 'a',
|
||||
'language_id' => '1',
|
||||
'payment_terms' => '1',
|
||||
'valid_until' => '1',
|
||||
'default_task_rate' => 10,
|
||||
'send_reminders' => true
|
||||
]
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
||||
try{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/clients/', $data);
|
||||
} catch (ValidationException $e) {
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
nlog($message);
|
||||
}
|
||||
|
||||
$response->assertStatus(302);
|
||||
|
||||
}
|
||||
|
||||
public function testClientIllegalLanguage()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'name' => $this->faker->firstName,
|
||||
'id_number' => 'Coolio',
|
||||
'settings' => [
|
||||
'currency_id' => '1',
|
||||
'language_id' => 'a',
|
||||
'payment_terms' => '1',
|
||||
'valid_until' => '1',
|
||||
'default_task_rate' => 10,
|
||||
'send_reminders' => true
|
||||
]
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
||||
try{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/clients/', $data);
|
||||
} catch (ValidationException $e) {
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
nlog($message);
|
||||
}
|
||||
|
||||
$response->assertStatus(302);
|
||||
|
||||
}
|
||||
|
||||
public function testClientIllegalPaymenTerms()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'name' => $this->faker->firstName,
|
||||
'id_number' => 'Coolio',
|
||||
'settings' => [
|
||||
'currency_id' => '1',
|
||||
'language_id' => '1',
|
||||
'payment_terms' => 'a',
|
||||
'valid_until' => '1',
|
||||
'default_task_rate' => 10,
|
||||
'send_reminders' => true
|
||||
]
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
||||
try{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/clients/', $data);
|
||||
} catch (ValidationException $e) {
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
nlog($message);
|
||||
}
|
||||
|
||||
$response->assertStatus(302);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function testClientIllegalValidUntil()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'name' => $this->faker->firstName,
|
||||
'id_number' => 'Coolio',
|
||||
'settings' => [
|
||||
'currency_id' => '1',
|
||||
'language_id' => '1',
|
||||
'payment_terms' => '1',
|
||||
'valid_until' => 'a',
|
||||
'default_task_rate' => 10,
|
||||
'send_reminders' => true
|
||||
]
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
||||
try{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/clients/', $data);
|
||||
} catch (ValidationException $e) {
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
nlog($message);
|
||||
}
|
||||
|
||||
$response->assertStatus(302);
|
||||
|
||||
}
|
||||
|
||||
public function testClientIllegalDefaultTaskRate()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'name' => $this->faker->firstName,
|
||||
'id_number' => 'Coolio',
|
||||
'settings' => [
|
||||
'currency_id' => '1',
|
||||
'language_id' => '1',
|
||||
'payment_terms' => '1',
|
||||
'valid_until' => '1',
|
||||
'default_task_rate' => "a",
|
||||
'send_reminders' => true
|
||||
]
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
||||
try{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/clients/', $data);
|
||||
} catch (ValidationException $e) {
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
nlog($message);
|
||||
}
|
||||
|
||||
$response->assertStatus(200);
|
||||
$arr = $response->json();
|
||||
|
||||
$this->assertFalse(array_key_exists('default_task_rate', $arr));
|
||||
|
||||
}
|
||||
|
||||
public function testClientIllegalSendReminderBool()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'name' => $this->faker->firstName,
|
||||
'id_number' => 'Coolio',
|
||||
'settings' => [
|
||||
'currency_id' => '1',
|
||||
'language_id' => '1',
|
||||
'payment_terms' => '1',
|
||||
'valid_until' => '1',
|
||||
'default_task_rate' => "a",
|
||||
'send_reminders' => "faaalse"
|
||||
]
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
||||
try{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/clients/', $data);
|
||||
} catch (ValidationException $e) {
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
nlog($message);
|
||||
}
|
||||
|
||||
$response->assertStatus(302);
|
||||
|
||||
}
|
||||
|
||||
public function testClientSettingBools()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'name' => $this->faker->firstName,
|
||||
'id_number' => 'Coolio',
|
||||
'settings' => [
|
||||
'currency_id' => '1',
|
||||
'language_id' => '1',
|
||||
'payment_terms' => '1',
|
||||
'valid_until' => '1',
|
||||
'default_task_rate' => "a",
|
||||
'send_reminders' => "true"
|
||||
]
|
||||
];
|
||||
|
||||
$response = false;
|
||||
|
||||
try{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/clients/', $data);
|
||||
} catch (ValidationException $e) {
|
||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||
nlog($message);
|
||||
}
|
||||
|
||||
$response->assertStatus(200);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user