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);
|
||||
|
||||
foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
|
||||
if (str_contains($file->getFileName(), '.js') && !strpos($file->getFileName(), '.json')) {
|
||||
if (str_contains($file->getFileName(), 'index.')) {
|
||||
if ($file->getExtension() == 'js') {
|
||||
if (str_contains($file->getFileName(), 'index-')) {
|
||||
$includes .= '<script type="module" crossorigin src="/react/'.$file->getFileName().'"></script>'."\n";
|
||||
} else {
|
||||
$includes .= '<link rel="modulepreload" href="/react/'.$file->getFileName().'">'."\n";
|
||||
|
@ -449,6 +449,8 @@ class CompanySettings extends BaseSettings
|
||||
|
||||
public $mailgun_domain = '';
|
||||
|
||||
public $mailgun_endpoint = 'api.mailgun.net'; //api.eu.mailgun.net
|
||||
|
||||
public $auto_bill_standard_invoices = false;
|
||||
|
||||
public $email_alignment = 'center'; // center , left, right
|
||||
@ -476,6 +478,7 @@ class CompanySettings extends BaseSettings
|
||||
public $sync_invoice_quote_columns = true;
|
||||
|
||||
public static $casts = [
|
||||
'mailgun_endpoint' => 'string',
|
||||
// 'client_initiated_payments_recurring'=> 'bool',
|
||||
'client_initiated_payments' => 'bool',
|
||||
'client_initiated_payments_minimum' => 'float',
|
||||
|
@ -80,8 +80,6 @@ class InvoiceController extends Controller
|
||||
/**
|
||||
* Pay one or more invoices.
|
||||
*
|
||||
* @param ProcessInvoicesInBulkRequest $request
|
||||
* @return mixed
|
||||
*/
|
||||
public function catch_bulk()
|
||||
{
|
||||
|
@ -128,7 +128,13 @@ class NinjaMailerJob implements ShouldQueue
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -50,6 +50,20 @@ class CleanStaleInvoiceOrder implements ShouldQueue
|
||||
$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;
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,7 @@ class PaymentEmailEngine extends BaseEmailEngine
|
||||
$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.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) {
|
||||
$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()
|
||||
{
|
||||
|
@ -106,8 +106,7 @@ class BankTransfer
|
||||
/**
|
||||
* paymentResponse
|
||||
*
|
||||
* @param mixed $request
|
||||
* @return void
|
||||
* @param PaymentResponseRequest $request
|
||||
*/
|
||||
public function paymentResponse(PaymentResponseRequest $request)
|
||||
{
|
||||
|
@ -101,12 +101,12 @@ class AppServiceProvider extends ServiceProvider
|
||||
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([
|
||||
'transport' => 'mailgun',
|
||||
'secret' => $secret,
|
||||
'domain' => $domain,
|
||||
'endpoint' => config('services.mailgun.endpoint'),
|
||||
'endpoint' => $endpoint,
|
||||
'scheme' => config('services.mailgun.scheme'),
|
||||
]));
|
||||
|
||||
@ -114,7 +114,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
});
|
||||
|
||||
/* Extension for custom mailers */
|
||||
|
||||
|
||||
/* Convenience helper for testing s*/
|
||||
ParallelTesting::setUpTestDatabase(function ($database, $token) {
|
||||
|
@ -143,6 +143,8 @@ class Email implements ShouldQueue
|
||||
|
||||
$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();
|
||||
|
||||
return $this;
|
||||
@ -233,7 +235,14 @@ class Email implements ShouldQueue
|
||||
}
|
||||
|
||||
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! */
|
||||
|
@ -76,7 +76,8 @@ class EmailDefaults
|
||||
->setReplyTo()
|
||||
->setBcc()
|
||||
->setAttachments()
|
||||
->setVariables();
|
||||
->setVariables()
|
||||
->setHeaders();
|
||||
|
||||
return $this->email->email_object;
|
||||
}
|
||||
@ -369,7 +370,7 @@ class EmailDefaults
|
||||
private function setHeaders(): self
|
||||
{
|
||||
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;
|
||||
|
@ -8768,8 +8768,6 @@ paths:
|
||||
type: string
|
||||
format: string
|
||||
example: D2J234DFA
|
||||
produces:
|
||||
- application/json
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
@ -8782,7 +8780,8 @@ paths:
|
||||
example: POST
|
||||
documents:
|
||||
type: array
|
||||
format: binary
|
||||
items:
|
||||
format: binary
|
||||
responses:
|
||||
200:
|
||||
description: 'Returns the client object'
|
||||
@ -9784,7 +9783,8 @@ paths:
|
||||
example: POST
|
||||
documents:
|
||||
type: array
|
||||
format: binary
|
||||
items:
|
||||
format: binary
|
||||
responses:
|
||||
200:
|
||||
description: "Returns the Product object"
|
||||
@ -11797,6 +11797,7 @@ paths:
|
||||
type: object
|
||||
properties:
|
||||
action:
|
||||
required: true
|
||||
type: string
|
||||
description: |
|
||||
The action to be performed, options include:
|
||||
@ -11828,7 +11829,6 @@ paths:
|
||||
Emails an array of invoices
|
||||
- `send_email`
|
||||
Emails an array of invoices. Requires additional properties to be sent. `email_type`
|
||||
required: true
|
||||
ids:
|
||||
required: true
|
||||
type: array
|
||||
@ -12386,10 +12386,7 @@ paths:
|
||||
Archives the recurring invoice. The recurring invoice will not fire in this state.
|
||||
- `delete`
|
||||
Deletes a recurring invoice.
|
||||
|
||||
required: true
|
||||
ids:
|
||||
required: true
|
||||
type: array
|
||||
items:
|
||||
description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']"
|
||||
@ -13015,7 +13012,7 @@ components:
|
||||
name: include
|
||||
in: query
|
||||
description: Include child relations of the BankIntegration object. Format is comma separated.
|
||||
require: false
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
examples:
|
||||
|
@ -36,7 +36,7 @@
|
||||
name: include
|
||||
in: query
|
||||
description: Include child relations of the BankIntegration object. Format is comma separated.
|
||||
require: false
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
examples:
|
||||
|
@ -382,8 +382,6 @@
|
||||
type: string
|
||||
format: string
|
||||
example: D2J234DFA
|
||||
produces:
|
||||
- application/json
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
@ -396,7 +394,8 @@
|
||||
example: POST
|
||||
documents:
|
||||
type: array
|
||||
format: binary
|
||||
items:
|
||||
format: binary
|
||||
responses:
|
||||
200:
|
||||
description: 'Returns the client object'
|
||||
|
@ -371,6 +371,7 @@
|
||||
type: object
|
||||
properties:
|
||||
action:
|
||||
required: true
|
||||
type: string
|
||||
description: |
|
||||
The action to be performed, options include:
|
||||
@ -402,7 +403,6 @@
|
||||
Emails an array of invoices
|
||||
- `send_email`
|
||||
Emails an array of invoices. Requires additional properties to be sent. `email_type`
|
||||
required: true
|
||||
ids:
|
||||
required: true
|
||||
type: array
|
||||
|
@ -362,7 +362,8 @@
|
||||
example: POST
|
||||
documents:
|
||||
type: array
|
||||
format: binary
|
||||
items:
|
||||
format: binary
|
||||
responses:
|
||||
200:
|
||||
description: "Returns the Product object"
|
||||
|
@ -333,10 +333,7 @@
|
||||
Archives the recurring invoice. The recurring invoice will not fire in this state.
|
||||
- `delete`
|
||||
Deletes a recurring invoice.
|
||||
|
||||
required: true
|
||||
ids:
|
||||
required: true
|
||||
type: array
|
||||
items:
|
||||
description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']"
|
||||
|
@ -206,7 +206,7 @@
|
||||
gap: 80px;
|
||||
padding-left: 2rem;
|
||||
padding-right: 0rem;
|
||||
page-break-inside:auto;
|
||||
break-inside: avoid;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@
|
||||
|
||||
#footer {
|
||||
margin-top: 1rem;
|
||||
page-break-inside:auto;
|
||||
break-inside: avoid;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
|
@ -2,4 +2,6 @@
|
||||
|
||||
@section('meta_title', ctrans('texts.bank_transfer'))
|
||||
|
||||
@include('portal.ninja2020.gateways.stripe.bank_transfer.bank_details')
|
||||
@section('body')
|
||||
@include('portal.ninja2020.gateways.stripe.bank_transfer.bank_details')
|
||||
@endsection
|
Loading…
x
Reference in New Issue
Block a user