mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #8399 from turbo124/v5-develop
Fixes for react builder
This commit is contained in:
commit
0caba1fdf6
@ -51,8 +51,8 @@ class ReactBuilder extends Command
|
|||||||
$directoryIterator = new \RecursiveDirectoryIterator(public_path('react'), \RecursiveDirectoryIterator::SKIP_DOTS);
|
$directoryIterator = new \RecursiveDirectoryIterator(public_path('react'), \RecursiveDirectoryIterator::SKIP_DOTS);
|
||||||
|
|
||||||
foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
|
foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
|
||||||
if (str_contains($file->getFileName(), '.js') && !strpos($file->getFileName(), '.json')) {
|
if ($file->getExtension() == 'js') {
|
||||||
if (str_contains($file->getFileName(), 'index.')) {
|
if (str_contains($file->getFileName(), 'index-')) {
|
||||||
$includes .= '<script type="module" crossorigin src="/react/'.$file->getFileName().'"></script>'."\n";
|
$includes .= '<script type="module" crossorigin src="/react/'.$file->getFileName().'"></script>'."\n";
|
||||||
} else {
|
} else {
|
||||||
$includes .= '<link rel="modulepreload" href="/react/'.$file->getFileName().'">'."\n";
|
$includes .= '<link rel="modulepreload" href="/react/'.$file->getFileName().'">'."\n";
|
||||||
|
@ -449,6 +449,8 @@ class CompanySettings extends BaseSettings
|
|||||||
|
|
||||||
public $mailgun_domain = '';
|
public $mailgun_domain = '';
|
||||||
|
|
||||||
|
public $mailgun_endpoint = 'api.mailgun.net'; //api.eu.mailgun.net
|
||||||
|
|
||||||
public $auto_bill_standard_invoices = false;
|
public $auto_bill_standard_invoices = false;
|
||||||
|
|
||||||
public $email_alignment = 'center'; // center , left, right
|
public $email_alignment = 'center'; // center , left, right
|
||||||
@ -476,6 +478,7 @@ class CompanySettings extends BaseSettings
|
|||||||
public $sync_invoice_quote_columns = true;
|
public $sync_invoice_quote_columns = true;
|
||||||
|
|
||||||
public static $casts = [
|
public static $casts = [
|
||||||
|
'mailgun_endpoint' => 'string',
|
||||||
// 'client_initiated_payments_recurring'=> 'bool',
|
// 'client_initiated_payments_recurring'=> 'bool',
|
||||||
'client_initiated_payments' => 'bool',
|
'client_initiated_payments' => 'bool',
|
||||||
'client_initiated_payments_minimum' => 'float',
|
'client_initiated_payments_minimum' => 'float',
|
||||||
|
@ -80,8 +80,6 @@ class InvoiceController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Pay one or more invoices.
|
* Pay one or more invoices.
|
||||||
*
|
*
|
||||||
* @param ProcessInvoicesInBulkRequest $request
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function catch_bulk()
|
public function catch_bulk()
|
||||||
{
|
{
|
||||||
|
@ -128,7 +128,13 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->client_mailgun_secret) {
|
if ($this->client_mailgun_secret) {
|
||||||
$mailer->mailgun_config($this->client_mailgun_secret, $this->client_mailgun_domain);
|
|
||||||
|
$endpoint = 'api.mailgun.net';
|
||||||
|
|
||||||
|
if(strpos($this->client_mailgun_secret, 'key') !== false)
|
||||||
|
$endpoint = 'api.eu.mailgun.net';
|
||||||
|
|
||||||
|
$mailer->mailgun_config($this->client_mailgun_secret, $this->client_mailgun_domain, $endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
$mailer
|
$mailer
|
||||||
|
@ -50,6 +50,20 @@ class CleanStaleInvoiceOrder implements ShouldQueue
|
|||||||
$repo->delete($invoice);
|
$repo->delete($invoice);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Invoice::query()
|
||||||
|
->withTrashed()
|
||||||
|
->where('status_id', Invoice::STATUS_SENT)
|
||||||
|
->where('created_at', '<', now()->subHours(2))
|
||||||
|
->where('balance', '>', 0)
|
||||||
|
->cursor()
|
||||||
|
->each(function ($invoice){
|
||||||
|
|
||||||
|
if (collect($invoice->line_items)->contains('type_id', 3)) {
|
||||||
|
$invoice->service()->removeUnpaidGatewayFees();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ class PaymentEmailEngine extends BaseEmailEngine
|
|||||||
$data['$invoices.balance'] = ['value' => $this->formatInvoiceField('balance'), 'label' => ctrans('texts.invoices')];
|
$data['$invoices.balance'] = ['value' => $this->formatInvoiceField('balance'), 'label' => ctrans('texts.invoices')];
|
||||||
$data['$invoices.due_date'] = ['value' => $this->formatInvoiceField('due_date'), 'label' => ctrans('texts.invoices')];
|
$data['$invoices.due_date'] = ['value' => $this->formatInvoiceField('due_date'), 'label' => ctrans('texts.invoices')];
|
||||||
$data['$invoices.po_number'] = ['value' => $this->formatInvoiceField('po_number'), 'label' => ctrans('texts.invoices')];
|
$data['$invoices.po_number'] = ['value' => $this->formatInvoiceField('po_number'), 'label' => ctrans('texts.invoices')];
|
||||||
|
$data['$invoice_numbers'] = ['value' => $this->formatInvoiceNumbersRaw(), 'label' => ctrans('texts.invoices')];
|
||||||
|
|
||||||
if ($this->payment->status_id == 4) {
|
if ($this->payment->status_id == 4) {
|
||||||
$data['$status_logo'] = ['value' => '<div class="stamp is-paid"> ' . ctrans('texts.paid') .'</div>', 'label' => ''];
|
$data['$status_logo'] = ['value' => '<div class="stamp is-paid"> ' . ctrans('texts.paid') .'</div>', 'label' => ''];
|
||||||
@ -347,6 +347,11 @@ class PaymentEmailEngine extends BaseEmailEngine
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function formatInvoiceNumbersRaw(){
|
||||||
|
|
||||||
|
return collect($this->payment->invoices->pluck('number')->toArray())->implode(', ');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private function formatInvoiceReferences()
|
private function formatInvoiceReferences()
|
||||||
{
|
{
|
||||||
|
@ -106,8 +106,7 @@ class BankTransfer
|
|||||||
/**
|
/**
|
||||||
* paymentResponse
|
* paymentResponse
|
||||||
*
|
*
|
||||||
* @param mixed $request
|
* @param PaymentResponseRequest $request
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function paymentResponse(PaymentResponseRequest $request)
|
public function paymentResponse(PaymentResponseRequest $request)
|
||||||
{
|
{
|
||||||
|
@ -101,12 +101,12 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
return $this;
|
return $this;
|
||||||
});
|
});
|
||||||
|
|
||||||
Mailer::macro('mailgun_config', function (string $secret, string $domain) {
|
Mailer::macro('mailgun_config', function (string $secret, string $domain, string $endpoint = 'api.mailgun.net') {
|
||||||
Mailer::setSymfonyTransport(app('mail.manager')->createSymfonyTransport([
|
Mailer::setSymfonyTransport(app('mail.manager')->createSymfonyTransport([
|
||||||
'transport' => 'mailgun',
|
'transport' => 'mailgun',
|
||||||
'secret' => $secret,
|
'secret' => $secret,
|
||||||
'domain' => $domain,
|
'domain' => $domain,
|
||||||
'endpoint' => config('services.mailgun.endpoint'),
|
'endpoint' => $endpoint,
|
||||||
'scheme' => config('services.mailgun.scheme'),
|
'scheme' => config('services.mailgun.scheme'),
|
||||||
]));
|
]));
|
||||||
|
|
||||||
@ -115,7 +115,6 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
/* Extension for custom mailers */
|
/* Extension for custom mailers */
|
||||||
|
|
||||||
|
|
||||||
/* Convenience helper for testing s*/
|
/* Convenience helper for testing s*/
|
||||||
ParallelTesting::setUpTestDatabase(function ($database, $token) {
|
ParallelTesting::setUpTestDatabase(function ($database, $token) {
|
||||||
Artisan::call('db:seed');
|
Artisan::call('db:seed');
|
||||||
|
@ -143,6 +143,8 @@ class Email implements ShouldQueue
|
|||||||
|
|
||||||
$this->email_object->signature = $this->email_object->settings->email_signature;
|
$this->email_object->signature = $this->email_object->settings->email_signature;
|
||||||
|
|
||||||
|
$this->email_object->invitation_key = $this->email_object->invitation ? $this->email_object->invitation->key : null;
|
||||||
|
|
||||||
$this->resolveVariables();
|
$this->resolveVariables();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -233,7 +235,14 @@ class Email implements ShouldQueue
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->client_mailgun_secret) {
|
if ($this->client_mailgun_secret) {
|
||||||
$mailer->mailgun_config($this->client_mailgun_secret, $this->client_mailgun_domain);
|
|
||||||
|
$endpoint = 'api.mailgun.net';
|
||||||
|
|
||||||
|
if (strpos($this->client_mailgun_secret, 'key') !== false) {
|
||||||
|
$endpoint = 'api.eu.mailgun.net';
|
||||||
|
}
|
||||||
|
|
||||||
|
$mailer->mailgun_config($this->client_mailgun_secret, $this->client_mailgun_domain, $endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attempt the send! */
|
/* Attempt the send! */
|
||||||
|
@ -76,7 +76,8 @@ class EmailDefaults
|
|||||||
->setReplyTo()
|
->setReplyTo()
|
||||||
->setBcc()
|
->setBcc()
|
||||||
->setAttachments()
|
->setAttachments()
|
||||||
->setVariables();
|
->setVariables()
|
||||||
|
->setHeaders();
|
||||||
|
|
||||||
return $this->email->email_object;
|
return $this->email->email_object;
|
||||||
}
|
}
|
||||||
@ -369,7 +370,7 @@ class EmailDefaults
|
|||||||
private function setHeaders(): self
|
private function setHeaders(): self
|
||||||
{
|
{
|
||||||
if ($this->email->email_object->invitation_key) {
|
if ($this->email->email_object->invitation_key) {
|
||||||
$this->email->email_object->headers = array_merge($this->email->email_object->headers, ['x-invitation-key' => $this->email->email_object->invitation_key]);
|
$this->email->email_object->headers = array_merge($this->email->email_object->headers, ['x-invitation' => $this->email->email_object->invitation_key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -8768,8 +8768,6 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
format: string
|
format: string
|
||||||
example: D2J234DFA
|
example: D2J234DFA
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@ -8782,6 +8780,7 @@ paths:
|
|||||||
example: POST
|
example: POST
|
||||||
documents:
|
documents:
|
||||||
type: array
|
type: array
|
||||||
|
items:
|
||||||
format: binary
|
format: binary
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
@ -9784,6 +9783,7 @@ paths:
|
|||||||
example: POST
|
example: POST
|
||||||
documents:
|
documents:
|
||||||
type: array
|
type: array
|
||||||
|
items:
|
||||||
format: binary
|
format: binary
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
@ -11797,6 +11797,7 @@ paths:
|
|||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
action:
|
action:
|
||||||
|
required: true
|
||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
The action to be performed, options include:
|
The action to be performed, options include:
|
||||||
@ -11828,7 +11829,6 @@ paths:
|
|||||||
Emails an array of invoices
|
Emails an array of invoices
|
||||||
- `send_email`
|
- `send_email`
|
||||||
Emails an array of invoices. Requires additional properties to be sent. `email_type`
|
Emails an array of invoices. Requires additional properties to be sent. `email_type`
|
||||||
required: true
|
|
||||||
ids:
|
ids:
|
||||||
required: true
|
required: true
|
||||||
type: array
|
type: array
|
||||||
@ -12386,10 +12386,7 @@ paths:
|
|||||||
Archives the recurring invoice. The recurring invoice will not fire in this state.
|
Archives the recurring invoice. The recurring invoice will not fire in this state.
|
||||||
- `delete`
|
- `delete`
|
||||||
Deletes a recurring invoice.
|
Deletes a recurring invoice.
|
||||||
|
|
||||||
required: true
|
|
||||||
ids:
|
ids:
|
||||||
required: true
|
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']"
|
description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']"
|
||||||
@ -13015,7 +13012,7 @@ components:
|
|||||||
name: include
|
name: include
|
||||||
in: query
|
in: query
|
||||||
description: Include child relations of the BankIntegration object. Format is comma separated.
|
description: Include child relations of the BankIntegration object. Format is comma separated.
|
||||||
require: false
|
required: false
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
examples:
|
examples:
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
name: include
|
name: include
|
||||||
in: query
|
in: query
|
||||||
description: Include child relations of the BankIntegration object. Format is comma separated.
|
description: Include child relations of the BankIntegration object. Format is comma separated.
|
||||||
require: false
|
required: false
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
examples:
|
examples:
|
||||||
|
@ -382,8 +382,6 @@
|
|||||||
type: string
|
type: string
|
||||||
format: string
|
format: string
|
||||||
example: D2J234DFA
|
example: D2J234DFA
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@ -396,6 +394,7 @@
|
|||||||
example: POST
|
example: POST
|
||||||
documents:
|
documents:
|
||||||
type: array
|
type: array
|
||||||
|
items:
|
||||||
format: binary
|
format: binary
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
|
@ -371,6 +371,7 @@
|
|||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
action:
|
action:
|
||||||
|
required: true
|
||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
The action to be performed, options include:
|
The action to be performed, options include:
|
||||||
@ -402,7 +403,6 @@
|
|||||||
Emails an array of invoices
|
Emails an array of invoices
|
||||||
- `send_email`
|
- `send_email`
|
||||||
Emails an array of invoices. Requires additional properties to be sent. `email_type`
|
Emails an array of invoices. Requires additional properties to be sent. `email_type`
|
||||||
required: true
|
|
||||||
ids:
|
ids:
|
||||||
required: true
|
required: true
|
||||||
type: array
|
type: array
|
||||||
|
@ -362,6 +362,7 @@
|
|||||||
example: POST
|
example: POST
|
||||||
documents:
|
documents:
|
||||||
type: array
|
type: array
|
||||||
|
items:
|
||||||
format: binary
|
format: binary
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
|
@ -333,10 +333,7 @@
|
|||||||
Archives the recurring invoice. The recurring invoice will not fire in this state.
|
Archives the recurring invoice. The recurring invoice will not fire in this state.
|
||||||
- `delete`
|
- `delete`
|
||||||
Deletes a recurring invoice.
|
Deletes a recurring invoice.
|
||||||
|
|
||||||
required: true
|
|
||||||
ids:
|
ids:
|
||||||
required: true
|
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']"
|
description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']"
|
||||||
|
@ -206,7 +206,7 @@
|
|||||||
gap: 80px;
|
gap: 80px;
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
padding-right: 0rem;
|
padding-right: 0rem;
|
||||||
page-break-inside:auto;
|
break-inside: avoid;
|
||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,7 +271,7 @@
|
|||||||
|
|
||||||
#footer {
|
#footer {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
page-break-inside:auto;
|
break-inside: avoid;
|
||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,4 +2,6 @@
|
|||||||
|
|
||||||
@section('meta_title', ctrans('texts.bank_transfer'))
|
@section('meta_title', ctrans('texts.bank_transfer'))
|
||||||
|
|
||||||
|
@section('body')
|
||||||
@include('portal.ninja2020.gateways.stripe.bank_transfer.bank_details')
|
@include('portal.ninja2020.gateways.stripe.bank_transfer.bank_details')
|
||||||
|
@endsection
|
Loading…
x
Reference in New Issue
Block a user