mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
1b5b757a95
65
.env.cypress
65
.env.cypress
@ -1,65 +0,0 @@
|
|||||||
APP_NAME="Invoice Ninja"
|
|
||||||
APP_ENV=local
|
|
||||||
APP_KEY=base64:xV0ixUbXIGjeWImmcjCYL8/XespgcEk+dTTPlM17dNE=
|
|
||||||
APP_DEBUG=true
|
|
||||||
APP_DOMAIN=ninja.test:8000
|
|
||||||
|
|
||||||
APP_URL=http://ninja.test:8000/
|
|
||||||
#APP_URL=https://ninja.test
|
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
|
||||||
MULTI_DB_ENABLED=false
|
|
||||||
|
|
||||||
DB_HOST1=127.0.0.1
|
|
||||||
DB_DATABASE1=db-ninja-01
|
|
||||||
DB_USERNAME1=ninja
|
|
||||||
DB_PASSWORD1=ninja
|
|
||||||
DB_PORT1=3306
|
|
||||||
|
|
||||||
DB_HOST2=127.0.0.1
|
|
||||||
DB_DATABASE2=db-ninja-02
|
|
||||||
DB_USERNAME2=ninja
|
|
||||||
DB_PASSWORD2=ninja
|
|
||||||
DB_PORT2=3306
|
|
||||||
|
|
||||||
DEMO_MODE=false
|
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
|
||||||
REQUIRE_HTTPS=false
|
|
||||||
BROADCAST_DRIVER=pusher
|
|
||||||
CACHE_DRIVER=redis
|
|
||||||
QUEUE_CONNECTION=database
|
|
||||||
SESSION_DRIVER=redis
|
|
||||||
SESSION_DOMAIN=.ninja.test
|
|
||||||
SESSION_LIFETIME=120
|
|
||||||
|
|
||||||
REDIS_HOST=127.0.0.1
|
|
||||||
REDIS_PASSWORD=null
|
|
||||||
REDIS_PORT=6379
|
|
||||||
|
|
||||||
PUSHER_APP_ID="ninja"
|
|
||||||
PUSHER_APP_KEY="ninja"
|
|
||||||
PUSHER_APP_SECRET="ninja"
|
|
||||||
PUSHER_APP_CLUSTER="ninja1"
|
|
||||||
|
|
||||||
MAIL_MAILER=log
|
|
||||||
MAIL_HOST=localhost
|
|
||||||
MAIL_PORT=1025
|
|
||||||
MAIL_USERNAME=null
|
|
||||||
MAIL_PASSWORD=null
|
|
||||||
MAIL_ENCRYPTION=null
|
|
||||||
|
|
||||||
MAIL_FROM_ADDRESS=''
|
|
||||||
MAIL_FROM_NAME=''
|
|
||||||
|
|
||||||
GOOGLE_MAPS_API_KEY=
|
|
||||||
|
|
||||||
NINJA_ENVIRONMENT=selfhost
|
|
||||||
|
|
||||||
HASH_SALT=
|
|
||||||
|
|
||||||
FILESYSTEM_DRIVER=public
|
|
||||||
|
|
||||||
PDF_GENERATOR=snappdf
|
|
||||||
|
|
||||||
MIX_ASSET_URL=false
|
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -24,6 +24,7 @@ _ide_helper.php
|
|||||||
/resources/assets/bower
|
/resources/assets/bower
|
||||||
/public/logo
|
/public/logo
|
||||||
.env.dusk.local
|
.env.dusk.local
|
||||||
|
.env.cypress
|
||||||
/public/vendors/*
|
/public/vendors/*
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
5.5.87
|
5.5.88
|
@ -109,6 +109,7 @@ class EmailDefaults
|
|||||||
$this->template = $this->email->email_object->settings->email_style;
|
$this->template = $this->email->email_object->settings->email_style;
|
||||||
|
|
||||||
match ($this->email->email_object->settings->email_style) {
|
match ($this->email->email_object->settings->email_style) {
|
||||||
|
'plain' => $this->template = 'email.template.plain',
|
||||||
'light' => $this->template = 'email.template.client',
|
'light' => $this->template = 'email.template.client',
|
||||||
'dark' => $this->template = 'email.template.client',
|
'dark' => $this->template = 'email.template.client',
|
||||||
'custom' => $this->template = 'email.template.custom',
|
'custom' => $this->template = 'email.template.custom',
|
||||||
@ -272,24 +273,41 @@ class EmailDefaults
|
|||||||
$documents = [];
|
$documents = [];
|
||||||
|
|
||||||
/* Return early if the user cannot attach documents */
|
/* Return early if the user cannot attach documents */
|
||||||
if (!$this->email->email_object->settings->document_email_attachment || !$this->email->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
if (!$this->email->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Purchase Order / Invoice / Credit / Quote PDF */
|
/** Purchase Order / Invoice / Credit / Quote PDF */
|
||||||
if ($this->email->email_object->entity instanceof PurchaseOrder) {
|
if ($this->email->email_object->settings->pdf_email_attachment && $this->email->email_object->entity instanceof PurchaseOrder) {
|
||||||
|
|
||||||
$pdf = (new CreatePurchaseOrderPdf($this->email->email_object->invitation))->rawPdf();
|
$pdf = (new CreatePurchaseOrderPdf($this->email->email_object->invitation))->rawPdf();
|
||||||
|
|
||||||
$this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]);
|
$this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]);
|
||||||
|
|
||||||
} elseif ($this->email->email_object->settings->pdf_email_attachment &&
|
} elseif ($this->email->email_object->settings->pdf_email_attachment &&
|
||||||
($this->email->email_object->entity instanceof Invoice ||
|
($this->email->email_object->entity instanceof Invoice ||
|
||||||
$this->email->email_object->entity instanceof Quote ||
|
$this->email->email_object->entity instanceof Quote ||
|
||||||
$this->email->email_object->entity instanceof Credit)) {
|
$this->email->email_object->entity instanceof Credit)) {
|
||||||
|
|
||||||
$pdf = ((new CreateRawPdf($this->email->email_object->invitation, $this->email->company->db))->handle());
|
$pdf = ((new CreateRawPdf($this->email->email_object->invitation, $this->email->company->db))->handle());
|
||||||
|
|
||||||
$this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]);
|
$this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** UBL xml file */
|
||||||
|
if ($this->email->email_object->entity instanceof Invoice && $this->email->email_object->settings->ubl_email_attachment) {
|
||||||
|
$ubl_string = (new CreateUbl($this->email->email_object->entity))->handle();
|
||||||
|
|
||||||
|
if ($ubl_string) {
|
||||||
|
$this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($ubl_string), 'name' => $this->email->email_object->entity->getFileName('xml')]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$this->email->email_object->settings->document_email_attachment)
|
||||||
|
return $this;
|
||||||
|
|
||||||
|
|
||||||
/* Company Documents */
|
/* Company Documents */
|
||||||
$this->email->email_object->documents = array_merge($this->email->email_object->documents, $this->email->company->documents->pluck('id')->toArray());
|
$this->email->email_object->documents = array_merge($this->email->email_object->documents, $this->email->company->documents->pluck('id')->toArray());
|
||||||
|
|
||||||
@ -336,15 +354,6 @@ class EmailDefaults
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** UBL xml file */
|
|
||||||
if ($this->email->email_object->entity instanceof Invoice && $this->email->email_object->settings->ubl_email_attachment) {
|
|
||||||
$ubl_string = (new CreateUbl($this->email->email_object->entity))->handle();
|
|
||||||
|
|
||||||
if ($ubl_string) {
|
|
||||||
$this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($ubl_string), 'name' => $this->email->email_object->entity->getFileName('xml')]]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -984,6 +984,10 @@ html {
|
|||||||
*/
|
*/
|
||||||
private function buildViewButton(string $link, string $text): string
|
private function buildViewButton(string $link, string $text): string
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if($this->settings->email_style == 'plain')
|
||||||
|
return '<a href="'. $link .'" target="_blank">'. $text .'</a>';
|
||||||
|
|
||||||
return '
|
return '
|
||||||
<div>
|
<div>
|
||||||
<!--[if (gte mso 9)|(IE)]>
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
|
@ -14,8 +14,8 @@ return [
|
|||||||
'require_https' => env('REQUIRE_HTTPS', true),
|
'require_https' => env('REQUIRE_HTTPS', true),
|
||||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||||
'app_version' => '5.5.87',
|
'app_version' => '5.5.88',
|
||||||
'app_tag' => '5.5.87',
|
'app_tag' => '5.5.88',
|
||||||
'minimum_client_version' => '5.0.16',
|
'minimum_client_version' => '5.0.16',
|
||||||
'terms_version' => '1.0.1',
|
'terms_version' => '1.0.1',
|
||||||
'api_secret' => env('API_SECRET', ''),
|
'api_secret' => env('API_SECRET', ''),
|
||||||
|
@ -30,8 +30,11 @@ use App\Models\GroupSetting;
|
|||||||
use App\Models\ClientContact;
|
use App\Models\ClientContact;
|
||||||
use App\Models\VendorContact;
|
use App\Models\VendorContact;
|
||||||
use App\Models\CompanyGateway;
|
use App\Models\CompanyGateway;
|
||||||
|
use App\Models\BankIntegration;
|
||||||
|
use App\Models\BankTransaction;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use App\Models\RecurringInvoice;
|
use App\Models\RecurringInvoice;
|
||||||
|
use App\DataMapper\FeesAndLimits;
|
||||||
use App\DataMapper\ClientSettings;
|
use App\DataMapper\ClientSettings;
|
||||||
use App\DataMapper\CompanySettings;
|
use App\DataMapper\CompanySettings;
|
||||||
use App\Helpers\Invoice\InvoiceSum;
|
use App\Helpers\Invoice\InvoiceSum;
|
||||||
@ -44,8 +47,6 @@ use App\Repositories\InvoiceRepository;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use App\Events\Payment\PaymentWasCreated;
|
use App\Events\Payment\PaymentWasCreated;
|
||||||
use App\Helpers\Invoice\InvoiceSumInclusive;
|
use App\Helpers\Invoice\InvoiceSumInclusive;
|
||||||
use App\Models\BankIntegration;
|
|
||||||
use App\Models\BankTransaction;
|
|
||||||
|
|
||||||
class RandomDataSeeder extends Seeder
|
class RandomDataSeeder extends Seeder
|
||||||
{
|
{
|
||||||
@ -374,6 +375,13 @@ class RandomDataSeeder extends Seeder
|
|||||||
$cg->require_shipping_address = true;
|
$cg->require_shipping_address = true;
|
||||||
$cg->update_details = true;
|
$cg->update_details = true;
|
||||||
$cg->config = encrypt(config('ninja.testvars.stripe'));
|
$cg->config = encrypt(config('ninja.testvars.stripe'));
|
||||||
|
|
||||||
|
$gateway_types = $cg->driver()->gatewayTypes();
|
||||||
|
|
||||||
|
$fees_and_limits = new \stdClass;
|
||||||
|
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
|
||||||
|
|
||||||
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
$cg->save();
|
$cg->save();
|
||||||
|
|
||||||
$cg = new CompanyGateway;
|
$cg = new CompanyGateway;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@
|
|||||||
"/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=4bd34a0b160f6f29b3096d870ac4d308",
|
"/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=4bd34a0b160f6f29b3096d870ac4d308",
|
||||||
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=0af9e4910d17cd5c67ceae955488b950",
|
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=0af9e4910d17cd5c67ceae955488b950",
|
||||||
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=2cb18f2df99d0eca47fa34f1d652c34f",
|
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=2cb18f2df99d0eca47fa34f1d652c34f",
|
||||||
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=809de47258a681f0ffebe787dd6a9a93",
|
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=cdcc94a3abdd08dfd981870eaa9d2a85",
|
||||||
"/js/setup/setup.js": "/js/setup/setup.js?id=27560b012f166f8b9417ced2188aab70",
|
"/js/setup/setup.js": "/js/setup/setup.js?id=27560b012f166f8b9417ced2188aab70",
|
||||||
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=8ce33c3deae058ad314fb8357e5be63b",
|
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=8ce33c3deae058ad314fb8357e5be63b",
|
||||||
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=be5307abc990bb44f2f92628103b1d98",
|
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=be5307abc990bb44f2f92628103b1d98",
|
||||||
|
@ -198,6 +198,8 @@ class StripeCreditCard {
|
|||||||
document
|
document
|
||||||
.getElementById('pay-now')
|
.getElementById('pay-now')
|
||||||
.addEventListener('click', () => {
|
.addEventListener('click', () => {
|
||||||
|
|
||||||
|
try {
|
||||||
let tokenInput = document.querySelector('input[name=token]');
|
let tokenInput = document.querySelector('input[name=token]');
|
||||||
|
|
||||||
if (tokenInput.value) {
|
if (tokenInput.value) {
|
||||||
@ -205,6 +207,10 @@ class StripeCreditCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return this.completePaymentWithoutToken();
|
return this.completePaymentWithoutToken();
|
||||||
|
}catch(error){
|
||||||
|
console.log(error.message);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,16 @@
|
|||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
@if(\App\Utils\Ninja::isHosted())
|
||||||
|
<!-- Google Tag Manager -->
|
||||||
|
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||||
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||||
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||||
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||||
|
})(window,document,'script','dataLayer','GTM-WMJ5W23');</script>
|
||||||
|
<!-- End Google Tag Manager -->
|
||||||
|
@endif
|
||||||
|
|
||||||
<!-- Error: {{ session('error') }} -->
|
<!-- Error: {{ session('error') }} -->
|
||||||
|
|
||||||
@if (config('services.analytics.tracking_id'))
|
@if (config('services.analytics.tracking_id'))
|
||||||
|
54
tests/cypress/integration/invoices.cy.js
vendored
Normal file
54
tests/cypress/integration/invoices.cy.js
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
describe('Test Invoices', () => {
|
||||||
|
|
||||||
|
it('Show Invoice List.', () => {
|
||||||
|
|
||||||
|
cy.visit('/client/login');
|
||||||
|
cy.contains('Client Portal');
|
||||||
|
|
||||||
|
cy.get('input[name=email]').type('cypress@example.com');
|
||||||
|
cy.get('input[name=password]').type('password{enter}');
|
||||||
|
cy.url().should('include', '/invoices');
|
||||||
|
|
||||||
|
cy.get('[dusk="pay-now"]').first().click();
|
||||||
|
cy.url().should('include', '/invoices/payment');
|
||||||
|
|
||||||
|
cy.get('[dusk="pay-now-dropdown"]').first().click();
|
||||||
|
cy.get('[dusk="pay-with-0"]').first().click();
|
||||||
|
|
||||||
|
cy.url().should('include', '/payments/process');
|
||||||
|
|
||||||
|
cy.get('input[name=client_address_line_1]').clear().type('5 Wallaby Way');
|
||||||
|
cy.get('input[name=client_city]').clear().type('Perth');
|
||||||
|
cy.get('input[name=client_state]').clear().type('WA');
|
||||||
|
cy.get('#client_country').select("840");
|
||||||
|
|
||||||
|
cy.get('input[name=client_shipping_address_line_1]').clear().type('5 Wallaby Way');
|
||||||
|
cy.get('input[name=client_shipping_city]').clear().type('Perth');
|
||||||
|
cy.get('input[name=client_shipping_state]').clear().type('WA');
|
||||||
|
cy.get('#client_country').select("840");
|
||||||
|
|
||||||
|
cy.contains('Continue').click();
|
||||||
|
|
||||||
|
cy.get('#cardholder-name').type('Cypress Test');
|
||||||
|
|
||||||
|
cy.get("iframe").then($iframe => {
|
||||||
|
const $body = $iframe.contents().find("body");
|
||||||
|
cy.wrap($body)
|
||||||
|
.find("input[placeholder='Card number']")
|
||||||
|
.type("4242424242424242");
|
||||||
|
cy.wrap($body)
|
||||||
|
.find("input[placeholder='MM / YY']")
|
||||||
|
.type("1225");
|
||||||
|
cy.wrap($body)
|
||||||
|
.find("input[placeholder='CVC']")
|
||||||
|
.type("100");
|
||||||
|
});
|
||||||
|
|
||||||
|
cy.get('#pay-now').click();
|
||||||
|
cy.url().should('include', '/payments');
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
4
tests/cypress/support/index.js
vendored
4
tests/cypress/support/index.js
vendored
@ -26,7 +26,9 @@ before(() => {
|
|||||||
cy.artisan("migrate:fresh", {
|
cy.artisan("migrate:fresh", {
|
||||||
'--seed': true,
|
'--seed': true,
|
||||||
});
|
});
|
||||||
cy.seed('RandomDataSeeder');
|
cy.artisan("db:seed", {
|
||||||
|
'--class': 'RandomDataSeeder',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
after(() => {
|
after(() => {
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user