mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Merge branch 'v5-develop' of https://github.com/turbo124/invoiceninja into v5-develop
This commit is contained in:
commit
deb5fe832e
@ -163,7 +163,7 @@ class NinjaPlanController extends Controller
|
||||
|
||||
$recurring_invoice->service()->start();
|
||||
|
||||
return redirect('/');
|
||||
return redirect('https://invoicing.co');
|
||||
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,15 @@ class TrustProxies extends Middleware
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
||||
// protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
||||
|
||||
//07-03-2022 - fixes for symfony 5.2
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
|
||||
/*
|
||||
* Instantiate trusted proxies middleware
|
||||
|
@ -91,8 +91,9 @@ class ZipCredits implements ShouldQueue
|
||||
|
||||
foreach ($this->credits as $credit) {
|
||||
|
||||
$download_file = file_get_contents($credit->pdf_file_path($invitation, 'url', true));
|
||||
$zipFile->addFromString(basename($credit->pdf_file_path($invitation)), $download_file);
|
||||
$file = $credit->service()->getCreditPdf($credit->invitations()->first());
|
||||
$zip_file_name = basename($file);
|
||||
$zipFile->addFromString($zip_file_name, Storage::get($file));
|
||||
|
||||
}
|
||||
|
||||
|
@ -91,8 +91,12 @@ class ZipInvoices implements ShouldQueue
|
||||
|
||||
foreach ($this->invoices as $invoice) {
|
||||
|
||||
$download_file = file_get_contents($invoice->pdf_file_path($invitation, 'url', true));
|
||||
$zipFile->addFromString(basename($invoice->pdf_file_path($invitation)), $download_file);
|
||||
$file = $invoice->service()->getInvoicePdf();
|
||||
$zip_file_name = basename($file);
|
||||
$zipFile->addFromString($zip_file_name, Storage::get($file));
|
||||
|
||||
//$download_file = file_get_contents($invoice->pdf_file_path($invitation, 'url', true));
|
||||
//$zipFile->addFromString(basename($invoice->pdf_file_path($invitation)), $download_file);
|
||||
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,12 @@ class ZipQuotes implements ShouldQueue
|
||||
|
||||
foreach ($this->quotes as $quote) {
|
||||
|
||||
$download_file = file_get_contents($quote->pdf_file_path($invitation, 'url', true));
|
||||
$zipFile->addFromString(basename($quote->pdf_file_path($invitation)), $download_file);
|
||||
$file = $quote->service()->getQuotePdf();
|
||||
$zip_file_name = basename($file);
|
||||
$zipFile->addFromString($zip_file_name, Storage::get($file));
|
||||
|
||||
// $download_file = file_get_contents($quote->pdf_file_path($invitation, 'url', true));
|
||||
// $zipFile->addFromString(basename($quote->pdf_file_path($invitation)), $download_file);
|
||||
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,8 @@ class Import implements ShouldQueue
|
||||
|
||||
//company size check
|
||||
if ($this->company->invoices()->count() > 500 || $this->company->products()->count() > 500 || $this->company->clients()->count() > 500) {
|
||||
$this->company->is_large = true;
|
||||
// $this->company->is_large = true;
|
||||
$this->company->account->companies()->update(['is_large' => true]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ namespace App\PaymentDrivers\Authorize;
|
||||
use App\PaymentDrivers\AuthorizePaymentDriver;
|
||||
use net\authorize\api\contract\v1\CreateTransactionRequest;
|
||||
use net\authorize\api\contract\v1\CustomerProfilePaymentType;
|
||||
use net\authorize\api\contract\v1\OrderType;
|
||||
use net\authorize\api\contract\v1\PaymentProfileType;
|
||||
use net\authorize\api\contract\v1\TransactionRequestType;
|
||||
use net\authorize\api\controller\CreateTransactionController;
|
||||
@ -42,9 +43,21 @@ class ChargePaymentProfile
|
||||
$paymentProfile->setPaymentProfileId($payment_profile_id);
|
||||
$profileToCharge->setPaymentProfile($paymentProfile);
|
||||
|
||||
$invoice_numbers = '';
|
||||
|
||||
if($this->authorize->payment_hash->data)
|
||||
$invoice_numbers = collect($this->authorize->payment_hash->data->invoices)->pluck('invoice_number')->implode(',');
|
||||
|
||||
$description = "Invoices: {$invoice_numbers} for {$amount} for client {$this->authorize->client->present()->name()}";
|
||||
|
||||
$order = new OrderType();
|
||||
$order->setInvoiceNumber($invoice_numbers);
|
||||
$order->setDescription($description);
|
||||
|
||||
$transactionRequestType = new TransactionRequestType();
|
||||
$transactionRequestType->setTransactionType('authCaptureTransaction');
|
||||
$transactionRequestType->setAmount($amount);
|
||||
$transactionRequestType->setOrder($order);
|
||||
$transactionRequestType->setProfile($profileToCharge);
|
||||
$transactionRequestType->setCurrencyCode($this->authorize->client->currency()->code);
|
||||
|
||||
|
@ -198,14 +198,6 @@ class BrowserPay implements MethodInterface
|
||||
return;
|
||||
}
|
||||
|
||||
// $domain = config('ninja.app_url');
|
||||
|
||||
// if (Ninja::isHosted()) {
|
||||
// $domain = isset($this->stripe->company_gateway->company->portal_domain)
|
||||
// ? $this->stripe->company_gateway->company->portal_domain
|
||||
// : $this->stripe->company_gateway->company->domain();
|
||||
// }
|
||||
|
||||
$domain = $this->getAppleDomain();
|
||||
|
||||
if(!$domain)
|
||||
@ -244,12 +236,7 @@ class BrowserPay implements MethodInterface
|
||||
$domain = config('ninja.app_url');
|
||||
}
|
||||
|
||||
$parsed_url = parse_url($domain);
|
||||
|
||||
if(array_key_exists('host', $parsed_url))
|
||||
return $parsed_url['host'];
|
||||
|
||||
return false;
|
||||
return str_replace("https://", "", $domain);
|
||||
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ class GetCreditPdf extends AbstractService
|
||||
public function run()
|
||||
{
|
||||
if (! $this->contact) {
|
||||
$this->contact = $this->credit->client->primary_contact()->first();
|
||||
$this->contact = $this->credit->client->primary_contact()->first() ?: $this->credit->client->contacts()->first();
|
||||
}
|
||||
|
||||
$path = $this->credit->client->credit_filepath($this->invitation);
|
||||
|
@ -30,7 +30,7 @@ class GetInvoicePdf extends AbstractService
|
||||
public function run()
|
||||
{
|
||||
if (! $this->contact) {
|
||||
$this->contact = $this->invoice->client->primary_contact()->first();
|
||||
$this->contact = $this->invoice->client->primary_contact()->first() ?: $this->invoice->client->contacts()->first();
|
||||
}
|
||||
|
||||
$invitation = $this->invoice->invitations->where('client_contact_id', $this->contact->id)->first();
|
||||
|
@ -30,7 +30,7 @@ class GetQuotePdf extends AbstractService
|
||||
public function run()
|
||||
{
|
||||
if (! $this->contact) {
|
||||
$this->contact = $this->quote->client->primary_contact()->first();
|
||||
$this->contact = $this->quote->client->primary_contact()->first() ?: $this->quote->client->contacts()->first();
|
||||
}
|
||||
|
||||
$invitation = $this->quote->invitations->where('client_contact_id', $this->contact->id)->first();
|
||||
|
2
public/js/clients/payments/stripe-sepa.js
vendored
2
public/js/clients/payments/stripe-sepa.js
vendored
File diff suppressed because one or more lines are too long
15022
public/main.next.dart.js
vendored
15022
public/main.next.dart.js
vendored
File diff suppressed because one or more lines are too long
@ -27,7 +27,7 @@
|
||||
"/js/clients/payments/square-credit-card.js": "/js/clients/payments/square-credit-card.js?id=8f05ce6bd2d6cae7e5f2",
|
||||
"/js/clients/statements/view.js": "/js/clients/statements/view.js?id=4ed4c8a09803ddd0a9a7",
|
||||
"/js/clients/payments/razorpay-aio.js": "/js/clients/payments/razorpay-aio.js?id=c36ab5621413ef1de7c8",
|
||||
"/js/clients/payments/stripe-sepa.js": "/js/clients/payments/stripe-sepa.js?id=9134495bcbfdd3e25aef",
|
||||
"/js/clients/payments/stripe-sepa.js": "/js/clients/payments/stripe-sepa.js?id=59ccac6ad75e28e3bbf2",
|
||||
"/js/clients/payment_methods/authorize-checkout-card.js": "/js/clients/payment_methods/authorize-checkout-card.js?id=61becda97682c7909f29",
|
||||
"/js/clients/payments/stripe-giropay.js": "/js/clients/payments/stripe-giropay.js?id=2a973971ed2b890524ee",
|
||||
"/js/clients/payments/stripe-acss.js": "/js/clients/payments/stripe-acss.js?id=41367f4e80e52a0ab436",
|
||||
|
@ -57,7 +57,7 @@
|
||||
<!-- Styles -->
|
||||
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
|
||||
|
||||
@if(!auth()->guard('contact')->user()->user->account->isPaid())
|
||||
@if(auth()->guard('contact')->user() && !auth()->guard('contact')->user()->user->account->isPaid())
|
||||
<link href="{{ asset('favicon.png') }}" rel="shortcut icon" type="image/png">
|
||||
@endif
|
||||
|
||||
|
@ -316,8 +316,8 @@ class CsvImportTest extends TestCase
|
||||
$invoice = Invoice::find($invoice_id);
|
||||
|
||||
$this->assertTrue($invoice->payments()->exists());
|
||||
$this->assertEquals(1, $invoice->payments()->count());
|
||||
$this->assertEquals(400, $invoice->payments()->sum('payments.amount'));
|
||||
$this->assertEquals(3, $invoice->payments()->count());
|
||||
$this->assertEquals(1200, $invoice->payments()->sum('payments.amount'));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user