mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2026-03-03 02:47:02 +00:00
@@ -1 +1 @@
|
||||
5.12.59
|
||||
5.12.60
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
namespace App\Http\Requests\ClientPortal\Documents;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
@@ -27,7 +28,7 @@ class ShowDocumentRequest extends FormRequest
|
||||
public function authorize()
|
||||
{
|
||||
return auth()->guard('contact')->user()->client_id == $this->document->documentable_id
|
||||
|| $this->document->company_id == auth()->guard('contact')->user()->company_id;
|
||||
|| ($this->document->is_public && $this->document->documentable_type == Company::class && $this->document->company_id == auth()->guard('contact')->user()->company_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -283,7 +283,7 @@ class Expense extends BaseModel
|
||||
|
||||
public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Project::class);
|
||||
return $this->belongsTo(Project::class)->withTrashed();
|
||||
}
|
||||
|
||||
public function transaction(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
|
||||
@@ -27,12 +27,12 @@ class Helper
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Find a TaxRate in QuickBooks by name or rate.
|
||||
* Find a Tax Rate in QuickBooks by name or rate.
|
||||
* TaxRates are read-only in QuickBooks and cannot be created via API.
|
||||
*
|
||||
* @param float $tax_rate The tax rate percentage
|
||||
* @param string $tax_name The tax name
|
||||
* @return string|null The QuickBooks TaxRate ID, or null if not found
|
||||
* @return string|null The QuickBooks Tax Rate ID, or null if not found
|
||||
*/
|
||||
public function findTaxRate(float $tax_rate, string $tax_name): ?string
|
||||
{
|
||||
@@ -163,8 +163,8 @@ class Helper
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate total tax from QuickBooks data and create TaxRate if needed.
|
||||
* This is business logic that creates/updates TaxRate models.
|
||||
* Calculate total tax from QuickBooks data and create Tax Rate if needed.
|
||||
* This is business logic that creates/updates Tax Rate models.
|
||||
*
|
||||
* @param mixed $qb_data QuickBooks invoice data
|
||||
* @return array [tax_rate, tax_name]
|
||||
|
||||
@@ -12,39 +12,42 @@
|
||||
|
||||
namespace App\Services\Template;
|
||||
|
||||
use App\Models\Task;
|
||||
use App\Models\User;
|
||||
use App\Models\Quote;
|
||||
use App\Utils\Number;
|
||||
use Twig\Error\Error;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Credit;
|
||||
use App\Models\Design;
|
||||
use App\Models\Vendor;
|
||||
use App\Models\Company;
|
||||
use App\Models\Expense;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Project;
|
||||
use App\Utils\HtmlEngine;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\VendorHtmlEngine;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use App\Models\Quote;
|
||||
use App\Models\RecurringInvoice;
|
||||
use App\Models\Task;
|
||||
use App\Models\User;
|
||||
use App\Models\Vendor;
|
||||
use App\Services\Pdf\Purify;
|
||||
use App\Services\Template\TemplateMock;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\HtmlEngine;
|
||||
use App\Utils\Number;
|
||||
use App\Utils\PaymentHtmlEngine;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\Pdf\PdfMaker;
|
||||
use App\Utils\VendorHtmlEngine;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Twig\Extra\Intl\IntlExtension;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
use Twig\Extra\Markdown\MarkdownExtension;
|
||||
use Twig\Error\Error;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Extra\Intl\IntlExtension;
|
||||
use Twig\Extra\Markdown\DefaultMarkdown;
|
||||
use Twig\Extra\Markdown\MarkdownExtension;
|
||||
use Twig\Extra\Markdown\MarkdownRuntime;
|
||||
use Twig\RuntimeLoader\RuntimeLoaderInterface;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
|
||||
class TemplateService
|
||||
{
|
||||
@@ -1138,7 +1141,7 @@ class TemplateService
|
||||
'client' => $this->getClient($expense),
|
||||
'vendor' => $this->getVendor($expense),
|
||||
'project' => ($expense->project && !$nested) ? $this->transformProject($expense->project, true) : [],
|
||||
'invoice' => $expense->invoice ? $this->processInvoice([$expense->invoice]) : [],
|
||||
'invoice' => $expense->invoice ? $this->processInvoices([$expense->invoice]) : [],
|
||||
];
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
72
composer.lock
generated
72
composer.lock
generated
@@ -497,16 +497,16 @@
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.369.31",
|
||||
"version": "3.369.33",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "c7bf53dfb09bea3ebfd19b89213625aa134dcc71"
|
||||
"reference": "27a14b3822c253cb98465c2e43f4e68b153a63f4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c7bf53dfb09bea3ebfd19b89213625aa134dcc71",
|
||||
"reference": "c7bf53dfb09bea3ebfd19b89213625aa134dcc71",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/27a14b3822c253cb98465c2e43f4e68b153a63f4",
|
||||
"reference": "27a14b3822c253cb98465c2e43f4e68b153a63f4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -588,9 +588,9 @@
|
||||
"support": {
|
||||
"forum": "https://github.com/aws/aws-sdk-php/discussions",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.369.31"
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.369.33"
|
||||
},
|
||||
"time": "2026-02-10T19:13:30+00:00"
|
||||
"time": "2026-02-12T19:07:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "babenkoivan/elastic-adapter",
|
||||
@@ -8077,16 +8077,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nette/utils",
|
||||
"version": "v4.1.2",
|
||||
"version": "v4.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nette/utils.git",
|
||||
"reference": "f76b5dc3d6c6d3043c8d937df2698515b99cbaf5"
|
||||
"reference": "bb3ea637e3d131d72acc033cfc2746ee893349fe"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nette/utils/zipball/f76b5dc3d6c6d3043c8d937df2698515b99cbaf5",
|
||||
"reference": "f76b5dc3d6c6d3043c8d937df2698515b99cbaf5",
|
||||
"url": "https://api.github.com/repos/nette/utils/zipball/bb3ea637e3d131d72acc033cfc2746ee893349fe",
|
||||
"reference": "bb3ea637e3d131d72acc033cfc2746ee893349fe",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -8098,8 +8098,10 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"jetbrains/phpstorm-attributes": "^1.2",
|
||||
"nette/phpstan-rules": "^1.0",
|
||||
"nette/tester": "^2.5",
|
||||
"phpstan/phpstan": "^2.0@stable",
|
||||
"phpstan/extension-installer": "^1.4@stable",
|
||||
"phpstan/phpstan": "^2.1@stable",
|
||||
"tracy/tracy": "^2.9"
|
||||
},
|
||||
"suggest": {
|
||||
@@ -8160,9 +8162,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/nette/utils/issues",
|
||||
"source": "https://github.com/nette/utils/tree/v4.1.2"
|
||||
"source": "https://github.com/nette/utils/tree/v4.1.3"
|
||||
},
|
||||
"time": "2026-02-03T17:21:09+00:00"
|
||||
"time": "2026-02-13T03:05:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nikic/php-parser",
|
||||
@@ -10454,16 +10456,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psy/psysh",
|
||||
"version": "v0.12.19",
|
||||
"version": "v0.12.20",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bobthecow/psysh.git",
|
||||
"reference": "a4f766e5c5b6773d8399711019bb7d90875a50ee"
|
||||
"reference": "19678eb6b952a03b8a1d96ecee9edba518bb0373"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/a4f766e5c5b6773d8399711019bb7d90875a50ee",
|
||||
"reference": "a4f766e5c5b6773d8399711019bb7d90875a50ee",
|
||||
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/19678eb6b952a03b8a1d96ecee9edba518bb0373",
|
||||
"reference": "19678eb6b952a03b8a1d96ecee9edba518bb0373",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -10527,9 +10529,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/bobthecow/psysh/issues",
|
||||
"source": "https://github.com/bobthecow/psysh/tree/v0.12.19"
|
||||
"source": "https://github.com/bobthecow/psysh/tree/v0.12.20"
|
||||
},
|
||||
"time": "2026-01-30T17:33:13+00:00"
|
||||
"time": "2026-02-11T15:05:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pusher/pusher-php-server",
|
||||
@@ -18411,16 +18413,16 @@
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.93.1",
|
||||
"version": "v3.94.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "b3546ab487c0762c39f308dc1ec0ea2c461fc21a"
|
||||
"reference": "883b20fb38c7866de9844ab6d0a205c423bde2d4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b3546ab487c0762c39f308dc1ec0ea2c461fc21a",
|
||||
"reference": "b3546ab487c0762c39f308dc1ec0ea2c461fc21a",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/883b20fb38c7866de9844ab6d0a205c423bde2d4",
|
||||
"reference": "883b20fb38c7866de9844ab6d0a205c423bde2d4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -18437,7 +18439,7 @@
|
||||
"react/event-loop": "^1.5",
|
||||
"react/socket": "^1.16",
|
||||
"react/stream": "^1.4",
|
||||
"sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0",
|
||||
"sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0 || ^8.0",
|
||||
"symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
"symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
"symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
@@ -18451,18 +18453,18 @@
|
||||
"symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"facile-it/paraunit": "^1.3.1 || ^2.7",
|
||||
"infection/infection": "^0.32",
|
||||
"justinrainbow/json-schema": "^6.6",
|
||||
"facile-it/paraunit": "^1.3.1 || ^2.7.1",
|
||||
"infection/infection": "^0.32.3",
|
||||
"justinrainbow/json-schema": "^6.6.4",
|
||||
"keradus/cli-executor": "^2.3",
|
||||
"mikey179/vfsstream": "^1.6.12",
|
||||
"php-coveralls/php-coveralls": "^2.9",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6",
|
||||
"phpunit/phpunit": "^9.6.31 || ^10.5.60 || ^11.5.48",
|
||||
"php-coveralls/php-coveralls": "^2.9.1",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.7",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.7",
|
||||
"phpunit/phpunit": "^9.6.34 || ^10.5.63 || ^11.5.51",
|
||||
"symfony/polyfill-php85": "^1.33",
|
||||
"symfony/var-dumper": "^5.4.48 || ^6.4.26 || ^7.4.0 || ^8.0",
|
||||
"symfony/yaml": "^5.4.45 || ^6.4.30 || ^7.4.1 || ^8.0"
|
||||
"symfony/var-dumper": "^5.4.48 || ^6.4.32 || ^7.4.4 || ^8.0.4",
|
||||
"symfony/yaml": "^5.4.45 || ^6.4.30 || ^7.4.1 || ^8.0.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-dom": "For handling output formats in XML",
|
||||
@@ -18503,7 +18505,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.93.1"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.94.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -18511,7 +18513,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-28T23:50:50+00:00"
|
||||
"time": "2026-02-11T16:44:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "hamcrest/hamcrest-php",
|
||||
|
||||
@@ -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.12.59'),
|
||||
'app_tag' => env('APP_TAG', '5.12.59'),
|
||||
'app_version' => env('APP_VERSION', '5.12.60'),
|
||||
'app_tag' => env('APP_TAG', '5.12.60'),
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', false),
|
||||
|
||||
535
package-lock.json
generated
535
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@apidevtools/swagger-parser": "^10.1.1",
|
||||
"@docuninja/builder2.0": "^0.0.49",
|
||||
"@docuninja/builder2.0": "^0.0.73",
|
||||
"axios": "^0.25",
|
||||
"card-js": "^1.0.13",
|
||||
"card-validator": "^8.1.1",
|
||||
|
||||
File diff suppressed because one or more lines are too long
294
public/build/dist/builder.iife.js
vendored
Normal file
294
public/build/dist/builder.iife.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/build/dist/builder2.0.standalone.css
vendored
Normal file
2
public/build/dist/builder2.0.standalone.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"file": "assets/wait-8f4ae121.js"
|
||||
},
|
||||
"resources/js/app.js": {
|
||||
"file": "assets/app-83112d30.js",
|
||||
"file": "assets/app-ed86bab1.js",
|
||||
"imports": [
|
||||
"_index-08e160a7.js",
|
||||
"__commonjsHelpers-725317a4.js"
|
||||
|
||||
2
resources/js/app.js
vendored
2
resources/js/app.js
vendored
@@ -30,7 +30,7 @@ document.querySelectorAll('.disposable-alert').forEach((element) => {
|
||||
*/
|
||||
(async () => {
|
||||
try {
|
||||
const modulePath = '../../node_modules/@docuninja/builder2.0/dist/builder.iife';
|
||||
const modulePath = '/build/dist/builder.iife.js';
|
||||
await import(/* @vite-ignore */ modulePath);
|
||||
console.log('DocuNinja loaded');
|
||||
} catch (e) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@section('meta_title', ctrans('texts.sign_now') . ' - ' . ctrans("texts.{$entity_type}") . ' - ' . $entity_number)
|
||||
|
||||
@push('head')
|
||||
<link rel="stylesheet" href="{{ asset('build/dist/builder2.0.standalone.css/builder2.0.standalone.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('build/dist/builder2.0.standalone.css') }}">
|
||||
@endpush
|
||||
|
||||
@section('body')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<link rel="stylesheet" href="{{ asset('build/dist/builder2.0.standalone.css/builder2.0.standalone.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('build/dist/builder2.0.standalone.css') }}">
|
||||
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden px-4 py-5 bg-white sm:gap-4 sm:px-6">
|
||||
<div class="p-2">
|
||||
@@ -22,18 +22,26 @@
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script type="module">
|
||||
<script src="{{ asset('build/dist/builder.iife.js') }}"></script>
|
||||
@endassets
|
||||
|
||||
@script
|
||||
<script>
|
||||
const doc = '{{ $document }}';
|
||||
const invitation = '{{ $invitation }}';
|
||||
const sig = '{{ $sig }}';
|
||||
const company = '{{ $company_key }}';
|
||||
|
||||
|
||||
const mount = document.getElementById("sign");
|
||||
|
||||
|
||||
new DocuNinjaSign({ document: doc, invitation, sig, endpoint: '{{ config('ninja.docuninja_api_url') }}', company }).mount(mount);
|
||||
|
||||
console.log('DocuNinjaSign mounted');
|
||||
console.log('Document:', doc);
|
||||
console.log('{{ config('ninja.docuninja_api_url') }}');
|
||||
|
||||
window.addEventListener('builder:sign.submit.success', function () {
|
||||
Livewire.dispatch('docuninja-signature-captured');
|
||||
});
|
||||
</script>
|
||||
@endassets
|
||||
@endscript
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
@if($docuninja_active)
|
||||
<div id="docuninja-container" class="hidden">
|
||||
@livewire('sign', ['invitation_id' => $invitation->id ?? false, 'entity_type' => 'quote', 'entity_number' => $quote->number, 'db' => $quote->company->db])
|
||||
@livewire('sign', ['_key' => $_key, 'invitation_id' => $invitation->id ?? false, 'entity_type' => 'quote', 'entity_number' => $quote->number, 'db' => $quote->company->db])
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@@ -1,24 +1,6 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import { existsSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
|
||||
// Check if DocuNinja builder is available
|
||||
const docuNinjaPath = resolve(__dirname, 'node_modules/@docuninja/builder2.0/dist/builder.iife.js');
|
||||
const hasDocuNinja = existsSync(docuNinjaPath);
|
||||
|
||||
// Conditionally add DocuNinja static copy targets
|
||||
const staticCopyTargets = hasDocuNinja ? [
|
||||
{
|
||||
src: 'node_modules/@docuninja/builder2.0/dist/builder2.0.standalone.css',
|
||||
dest: 'dist/builder2.0.standalone.css',
|
||||
},
|
||||
{
|
||||
src: 'node_modules/@docuninja/builder2.0/dist/builder.iife.js',
|
||||
dest: 'dist/builder.iife.js',
|
||||
},
|
||||
] : [];
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
@@ -78,10 +60,17 @@ export default defineConfig({
|
||||
'resources/js/clients/payments/powerboard-credit-card.js',
|
||||
'resources/js/clients/payments/blockonomics.js',
|
||||
]),
|
||||
...(staticCopyTargets.length > 0 ? [
|
||||
viteStaticCopy({
|
||||
targets: staticCopyTargets,
|
||||
})
|
||||
] : []),
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
{
|
||||
src: 'node_modules/@docuninja/builder2.0/dist/builder2.0.standalone.css',
|
||||
dest: 'dist',
|
||||
},
|
||||
{
|
||||
src: 'node_modules/@docuninja/builder2.0/dist/builder.iife.js',
|
||||
dest: 'dist',
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user