Static analysis
This commit is contained in:
parent
09f1eb634c
commit
0c68bbe594
|
|
@ -1 +1 @@
|
|||
5.11.69
|
||||
5.11.70
|
||||
|
|
@ -40,6 +40,8 @@ class BaseTransformer
|
|||
{
|
||||
protected $company;
|
||||
|
||||
public array $error_array = [];
|
||||
|
||||
public function __construct($company)
|
||||
{
|
||||
$this->company = $company;
|
||||
|
|
|
|||
|
|
@ -39,12 +39,8 @@ class InvoiceTransformer extends BaseTransformer
|
|||
'sent' => Invoice::STATUS_SENT,
|
||||
'draft' => Invoice::STATUS_DRAFT,
|
||||
'paid' => Invoice::STATUS_PAID,
|
||||
1 => Invoice::STATUS_PAID,
|
||||
'1' => Invoice::STATUS_PAID,
|
||||
0 => Invoice::STATUS_SENT,
|
||||
'0' => Invoice::STATUS_SENT,
|
||||
true => Invoice::STATUS_PAID,
|
||||
false => Invoice::STATUS_SENT,
|
||||
'true' => Invoice::STATUS_PAID,
|
||||
'false' => Invoice::STATUS_SENT,
|
||||
'' => Invoice::STATUS_SENT,
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ class QuotesTable extends Component
|
|||
|
||||
public string $db;
|
||||
|
||||
public string $sort_field = 'date';
|
||||
|
||||
public function mount()
|
||||
{
|
||||
MultiDB::setDb($this->db);
|
||||
|
|
|
|||
|
|
@ -147,24 +147,25 @@ class BlockonomicsPaymentDriver extends BaseDriver
|
|||
return $this->payment_method->refund($payment, $amount); //this is your custom implementation from here
|
||||
}
|
||||
|
||||
public function testNewAddressGen($crypto = 'btc', $response): string
|
||||
{
|
||||
$api_key = $this->company_gateway->getConfigField('apiKey');
|
||||
$new_address_reset_url = $this->NEW_ADDRESS_URL . '?reset=1';
|
||||
$new_address_response = Http::withToken($api_key)
|
||||
->post($new_address_reset_url, []);
|
||||
if ($new_address_response->response_code != 200) {
|
||||
return isset($new_address_response->response_message) && $new_address_response->response_message
|
||||
? $new_address_response->response_message
|
||||
: 'Could not generate new address';
|
||||
}
|
||||
//dead code? //2025-04-23
|
||||
// public function testNewAddressGen($crypto = 'btc', $response): string
|
||||
// {
|
||||
// $api_key = $this->company_gateway->getConfigField('apiKey');
|
||||
// $new_address_reset_url = $this->NEW_ADDRESS_URL . '?reset=1';
|
||||
// $new_address_response = Http::withToken($api_key)
|
||||
// ->post($new_address_reset_url, []);
|
||||
// if ($new_address_response->response_code != 200) {
|
||||
// return isset($new_address_response->response_message) && $new_address_response->response_message
|
||||
// ? $new_address_response->response_message
|
||||
// : 'Could not generate new address';
|
||||
// }
|
||||
|
||||
if (empty($new_address_response->address)) {
|
||||
return 'No address returned from Blockonomics API';
|
||||
}
|
||||
// if (empty($new_address_response->address)) {
|
||||
// return 'No address returned from Blockonomics API';
|
||||
// }
|
||||
|
||||
return 'ok';
|
||||
}
|
||||
// return 'ok';
|
||||
// }
|
||||
|
||||
public function checkStores($stores): string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,9 +34,7 @@ class Statement
|
|||
use MakesHash;
|
||||
use MakesDates;
|
||||
|
||||
/**
|
||||
* @var ?Invoice
|
||||
*/
|
||||
/** @var Invoice|null */
|
||||
protected $entity;
|
||||
|
||||
private array $variables = [];
|
||||
|
|
@ -216,7 +214,7 @@ class Statement
|
|||
$this->client->settings = $settings;
|
||||
|
||||
$this->entity = \App\Models\Invoice::factory()->make(); //@phpstan-ignore-line
|
||||
$this->entity->client =$this->client;
|
||||
$this->entity->client =$this->client;//@phpstan-ignore-line
|
||||
$ii = \App\Models\InvoiceInvitation::factory()->make(); //@phpstan-ignore-line
|
||||
$ii->setRelation('invoice', $this->entity); //@phpstan-ignore-line
|
||||
$ii->setRelation('contact', $this->client->contacts->first()); //@phpstan-ignore-line
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ class Mutator implements MutatorInterface
|
|||
//Regardless, always include the client email address as a route - Storecove will only use this as a fallback.
|
||||
$client_email = $this->getIndividualEmailRoute();
|
||||
|
||||
if(strlen($client_email ?? '') > 2)
|
||||
if(strlen($client_email) > 2)
|
||||
$this->setEmailRouting($client_email);
|
||||
|
||||
$code = $this->getClientRoutingCode();
|
||||
|
|
|
|||
|
|
@ -1651,7 +1651,7 @@ class PdfBuilder
|
|||
]],
|
||||
['element' => 'tr', 'properties' => [], 'elements' => [
|
||||
['element' => 'th', 'properties' => [], 'content' => ctrans('texts.statement_date')],
|
||||
['element' => 'th', 'properties' => [], 'content' => $s_date ?? ''],
|
||||
['element' => 'th', 'properties' => [], 'content' => $s_date],
|
||||
]],
|
||||
['element' => 'tr', 'properties' => [], 'elements' => [
|
||||
['element' => 'th', 'properties' => [], 'content' => '$balance_due_label'],
|
||||
|
|
|
|||
|
|
@ -95,16 +95,18 @@ class ProjectReport extends BaseExport
|
|||
|
||||
$ts = new TemplateService();
|
||||
|
||||
/** @var Project $_project */
|
||||
$_project = $query->first();
|
||||
|
||||
$ts_instance = $ts->setCompany($this->company)
|
||||
// ->setData($data)
|
||||
->processData($data)
|
||||
->setRawTemplate(file_get_contents(resource_path($this->template)))
|
||||
->addGlobal(['currency_code' => $query->first()->client->company->currency()->code])
|
||||
->addGlobal(['currency_code' => $_project->client->company->currency()->code])
|
||||
->setGlobals()
|
||||
->parseNinjaBlocks()
|
||||
->save();
|
||||
|
||||
nlog($ts_instance->getHtml());
|
||||
|
||||
return $ts_instance->getPdf();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ return [
|
|||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_version' => env('APP_VERSION', '5.11.69'),
|
||||
'app_tag' => env('APP_TAG', '5.11.69'),
|
||||
'app_version' => env('APP_VERSION', '5.11.70'),
|
||||
'app_tag' => env('APP_TAG', '5.11.70'),
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', false),
|
||||
|
|
|
|||
Loading…
Reference in New Issue