mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Merge branch 'v2' into v2-1706-improve-authroize-cards
This commit is contained in:
commit
0b7b90fc44
@ -63,7 +63,7 @@ class Bold extends AbstractDesign
|
||||
</div>
|
||||
<div class="col-span-5">
|
||||
<div class="bg-teal-600 px-5 py-3 text-white">
|
||||
<div class="w-80 flex flex-col text-white">
|
||||
<div class="w-80 flex flex-col text-white flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
@ -76,7 +76,7 @@ class Bold extends AbstractDesign
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -84,7 +84,7 @@ class Bold extends AbstractDesign
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -52,10 +52,10 @@ $custom_css
|
||||
<div class="col-span-2 p-3">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col">
|
||||
<div class="col-span-2 p-3 flex flex-col flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col">
|
||||
<div class="col-span-2 p-3 flex flex-col flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>';
|
||||
@ -64,11 +64,11 @@ $custom_css
|
||||
public function body()
|
||||
{
|
||||
return '<div class="grid grid-cols-12 gap-1 mt-8">
|
||||
<div class="col-span-7 p-3 flex flex-col">
|
||||
<div class="col-span-7 p-3 flex flex-col flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="col-span-5 p-3 flex flex-col bg-orange-600 px-4 py-4 h-auto rounded-lg">
|
||||
<div class="flex flex-col text-white">
|
||||
<div class="flex flex-col text-white flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
@ -78,7 +78,7 @@ $custom_css
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="bg-gray-200">
|
||||
<tbody class="bg-gray-200 whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -86,7 +86,7 @@ $custom_css
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="bg-gray-200">
|
||||
<tbody class="bg-gray-200 whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -48,10 +48,10 @@ class Clean extends AbstractDesign
|
||||
<div class="h-14 w-14">$company_logo</div>
|
||||
</div>
|
||||
<div class="w-auto flex">
|
||||
<div class="mr-10 text-gray-600 flex flex-col">
|
||||
<div class="mr-10 text-gray-600 flex flex-col flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="ml-5 text-gray-600 flex flex-col">
|
||||
<div class="ml-5 text-gray-600 flex flex-col flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
@ -68,13 +68,13 @@ class Clean extends AbstractDesign
|
||||
|
||||
<div class="ml-4 py-4">
|
||||
<div class="flex">
|
||||
<div class="w-40 flex flex-col">
|
||||
<div class="w-40 flex flex-col flex-wrap">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="w-48 flex flex-col">
|
||||
<div class="w-48 flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
<div class="w-56 flex flex-col">
|
||||
<div class="w-56 flex flex-col flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
</div>
|
||||
@ -84,7 +84,7 @@ class Clean extends AbstractDesign
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -92,7 +92,7 @@ class Clean extends AbstractDesign
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -60,14 +60,14 @@ $custom_css
|
||||
<div class="col-span-7">
|
||||
<p class="text-4xl text-pink-700">#$entity_number</p>
|
||||
</div>
|
||||
<div class="col-span-5 flex flex-col">$entity_details</div>
|
||||
<div class="col-span-5 flex flex-col flex-wrap">$entity_details</div>
|
||||
</div>
|
||||
|
||||
<table class="w-full table-auto border-t-4 border-pink-700 bg-white mt-8">
|
||||
<thead class="text-left rounded-lg">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -75,7 +75,7 @@ $custom_css
|
||||
<thead class="text-left rounded-lg">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -47,7 +47,7 @@ class Elegant extends AbstractDesign
|
||||
<div class="col-span-8">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-4 flex flex-col">
|
||||
<div class="col-span-4 flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
@ -57,13 +57,13 @@ class Elegant extends AbstractDesign
|
||||
public function body()
|
||||
{
|
||||
return '<div class="grid grid-cols-12 gap-4 mt-8">
|
||||
<div class="col-span-4 mr-6 flex flex-col pr-2 border-r border-dashed border-black">
|
||||
<div class="col-span-4 mr-6 flex flex-col pr-2 border-r border-dashed border-black flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="col-span-4 flex flex-col mr-6">
|
||||
<div class="col-span-4 flex flex-col mr-6 flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-4 flex flex-col">
|
||||
<div class="col-span-4 flex flex-col flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
@ -71,7 +71,7 @@ class Elegant extends AbstractDesign
|
||||
<thead class="text-left border-dashed border-b border-black">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -79,7 +79,7 @@ class Elegant extends AbstractDesign
|
||||
<thead class="text-left border-dashed border-b border-black">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -48,15 +48,15 @@ $custom_css
|
||||
<div class="w-1/2 border-l pl-4 border-black mr-4">
|
||||
<p class="font-semibold uppercase text-yellow-600">From:</p>
|
||||
<div class="flex">
|
||||
<div class="flex flex-col mr-5">
|
||||
<div class="flex flex-col mr-5 flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<div class="flex flex-col flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/3 border-l pl-4 border-black flex flex-col">
|
||||
<div class="w-1/3 border-l pl-4 border-black flex flex-col flex-wrap">
|
||||
<p class="font-semibold uppercase text-yellow-600">To:</p>
|
||||
$client_details
|
||||
</div>
|
||||
@ -90,7 +90,7 @@ $custom_css
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -98,7 +98,7 @@ $custom_css
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -45,10 +45,10 @@ $custom_css
|
||||
<div class="col-span-2 p-3">
|
||||
<h1 class="text-white font-bold text-3xl">$company.name</h1>
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col text-white">
|
||||
<div class="col-span-2 p-3 flex flex-col text-white flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col text-white">
|
||||
<div class="col-span-2 p-3 flex flex-col text-white flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
@ -64,7 +64,7 @@ $custom_css
|
||||
<div class="col-span-2 p-3">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-3 p-3 flex flex-col">
|
||||
<div class="col-span-3 p-3 flex flex-col flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
</div>
|
||||
@ -74,7 +74,7 @@ $custom_css
|
||||
<thead class="text-left text-white bg-gray-900 display: table-header-group;">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -82,7 +82,7 @@ $custom_css
|
||||
<thead class="text-left text-white bg-gray-900 display: table-header-group;">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -141,10 +141,10 @@ $custom_css
|
||||
return '
|
||||
<div class="footer bg-orange-600 flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
<div class="grid grid-cols-12 gap-4">
|
||||
<div class="col-start-4 col-span-4 p-3 flex flex-col text-white text-right">
|
||||
<div class="col-start-4 col-span-4 p-3 flex flex-col text-white text-right flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-4 p-3 flex flex-col text-white text-right">
|
||||
<div class="col-span-4 p-3 flex flex-col text-white text-right flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
|
@ -53,7 +53,7 @@ $custom_css
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-5">
|
||||
<div class="flex flex-col">
|
||||
<div class="flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
@ -67,13 +67,13 @@ $custom_css
|
||||
<div class="flex flex-col">
|
||||
<div class="flex">
|
||||
<p class="uppercase text-orange-800">$to_label:</p>
|
||||
<div class="flex flex-col ml-2">
|
||||
<div class="flex flex-col ml-2 flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-5">
|
||||
<p class="uppercase text-orange-800">$from_label:</p>
|
||||
<div class="flex flex-col ml-2">
|
||||
<div class="flex flex-col ml-2 flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
</div>
|
||||
@ -84,7 +84,7 @@ $custom_css
|
||||
<thead class="text-left border-b-4 border-black">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -92,7 +92,7 @@ $custom_css
|
||||
<thead class="text-left border-b-4 border-black">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -45,10 +45,10 @@ $custom_css
|
||||
<div class="col-span-2 p-3">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col">
|
||||
<div class="col-span-2 p-3 flex flex-col flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col">
|
||||
<div class="col-span-2 p-3 flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>';
|
||||
@ -56,7 +56,7 @@ $custom_css
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<div class="flex flex-col mt-8">
|
||||
return '<div class="flex flex-col mt-8 flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
<table class="w-full table-auto mt-8">
|
||||
|
@ -48,7 +48,7 @@ $custom_css
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-5 bg-teal-600 p-5 text-white">
|
||||
<div class="flex flex-col">
|
||||
<div class="flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
@ -62,7 +62,7 @@ $custom_css
|
||||
<div class="flex flex-col">
|
||||
<p class="font-semibold text-teal-600 pl-4">$to_label:</p>
|
||||
<div class="flex border-dashed border-t-4 border-b-4 border-teal-600 py-4 mt-4 pl-4">
|
||||
<section class="flex flex-col">
|
||||
<section class="flex flex-col flex-wrap">
|
||||
$client_details
|
||||
</section>
|
||||
</div>
|
||||
@ -72,7 +72,7 @@ $custom_css
|
||||
<div class="flex flex-col">
|
||||
<p class="font-semibold text-teal-600 pl-4">$from_label:</p>
|
||||
<div class="flex border-dashed border-t-4 border-b-4 border-teal-600 py-4 mt-4 pl-4">
|
||||
<section class="flex flex-col">
|
||||
<section class="flex flex-col flex-wrap">
|
||||
$company_details
|
||||
</section>
|
||||
</div>
|
||||
@ -83,7 +83,7 @@ $custom_css
|
||||
<thead class="text-left bg-teal-600 rounded-lg">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
@ -91,7 +91,7 @@ $custom_css
|
||||
<thead class="text-left bg-teal-600 rounded-lg">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -314,11 +314,10 @@ class BaseController extends Controller
|
||||
|
||||
public function flutterRoute()
|
||||
{
|
||||
|
||||
// // Ensure all request are over HTTPS in production
|
||||
// if (! request()->secure()) {
|
||||
// return redirect()->secure(request()->path());
|
||||
// }
|
||||
|
||||
if (config('ninja.require_https') && !request()->isSecure()) {
|
||||
return redirect()->secure(request()->getRequestUri());
|
||||
}
|
||||
|
||||
if ((bool)$this->checkAppSetup() !== false && Schema::hasTable('accounts') && $account = Account::all()->first()) {
|
||||
$data = [];
|
||||
|
@ -52,6 +52,10 @@ class InvoiceController extends Controller
|
||||
'invoice' => $invoice,
|
||||
];
|
||||
|
||||
if ($request->query('mode') === 'fullscreen') {
|
||||
return $this->render('invoices.show.fullscreen', $data);
|
||||
}
|
||||
|
||||
return $this->render('invoices.show', $data);
|
||||
}
|
||||
|
||||
|
@ -37,9 +37,15 @@ class QuoteController extends Controller
|
||||
*/
|
||||
public function show(ShowQuoteRequest $request, Quote $quote)
|
||||
{
|
||||
return $this->render('quotes.show', [
|
||||
$data = [
|
||||
'quote' => $quote,
|
||||
]);
|
||||
];
|
||||
|
||||
if ($request->query('mode') === 'fullscreen') {
|
||||
return $this->render('quotes.show.fullscreen', $data);
|
||||
}
|
||||
|
||||
return $this->render('quotes.show', $data);
|
||||
}
|
||||
|
||||
public function bulk(ProcessQuotesInBulkRequest $request)
|
||||
|
@ -29,6 +29,8 @@ class Kernel extends HttpKernel
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\App\Http\Middleware\Cors::class,
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
@ -53,7 +55,7 @@ class Kernel extends HttpKernel
|
||||
'bindings',
|
||||
'query_logging',
|
||||
\App\Http\Middleware\StartupCheck::class,
|
||||
\App\Http\Middleware\Cors::class,
|
||||
# \App\Http\Middleware\Cors::class,
|
||||
],
|
||||
'contact' => [
|
||||
'throttle:60,1',
|
||||
|
@ -35,9 +35,9 @@ class UpdatePaymentRequest extends Request
|
||||
|
||||
|
||||
public function rules()
|
||||
{
|
||||
{//min:1 removed
|
||||
return [
|
||||
'invoices' => ['required','array','min:1',new PaymentAppliedValidAmount,new ValidCreditsPresentRule],
|
||||
'invoices' => ['required','array',new PaymentAppliedValidAmount,new ValidCreditsPresentRule],
|
||||
'invoices.*.invoice_id' => 'distinct',
|
||||
'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
|
||||
];
|
||||
|
@ -50,14 +50,14 @@ class CreateCompanyPaymentTerms
|
||||
{
|
||||
|
||||
$paymentTerms = [
|
||||
['num_days' => 0, 'name' => 'Net 0', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
|
||||
['num_days' => 7, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
|
||||
['num_days' => 10, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
|
||||
['num_days' => 14, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
|
||||
['num_days' => 15, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
|
||||
['num_days' => 30, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
|
||||
['num_days' => 60, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
|
||||
['num_days' => 90, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
|
||||
['num_days' => 0, 'name' => 'Net 0', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['num_days' => 7, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['num_days' => 10, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['num_days' => 14, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['num_days' => 15, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['num_days' => 30, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['num_days' => 60, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['num_days' => 90, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
];
|
||||
|
||||
PaymentTerm::insert($paymentTerms);
|
||||
|
@ -38,7 +38,7 @@ class CompanyPresenter extends EntityPresenter
|
||||
$settings = $this->entity->settings;
|
||||
}
|
||||
|
||||
return iconv_strlen($settings->company_logo > 0) ? $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png';
|
||||
return (strlen($settings->company_logo) > 0) ? $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png';
|
||||
}
|
||||
|
||||
public function address($settings = null)
|
||||
|
@ -151,14 +151,16 @@ class PaymentRepository extends BaseRepository
|
||||
$invoice_totals -= $credit_totals;
|
||||
|
||||
//$payment->amount = $invoice_totals; //creates problems when setting amount like this.
|
||||
|
||||
if ($invoice_totals == $payment->amount) {
|
||||
if($credit_totals == $payment->amount){
|
||||
$payment->applied += $credit_totals;
|
||||
} elseif ($invoice_totals == $payment->amount) {
|
||||
$payment->applied += $payment->amount;
|
||||
} elseif ($invoice_totals < $payment->amount) {
|
||||
$payment->applied += $invoice_totals;
|
||||
}
|
||||
|
||||
$payment->save();
|
||||
|
||||
return $payment->fresh();
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ class ApplyPayment extends AbstractService
|
||||
->ledger()
|
||||
->updatePaymentBalance($this->payment_amount*-1);
|
||||
|
||||
info("apply paymenet method - current client balance = {$this->payment->client->balance}");
|
||||
info("apply payment method - current client balance = {$this->payment->client->balance}");
|
||||
|
||||
info("reducing client balance by payment amount {$this->payment_amount}");
|
||||
|
||||
@ -56,7 +56,7 @@ class ApplyPayment extends AbstractService
|
||||
|
||||
$this->invoice->fresh('client');
|
||||
|
||||
info("1 end of apply payment method the client balnace = {$this->invoice->client->balance}");
|
||||
info("1 end of apply payment method the client balance = {$this->invoice->client->balance}");
|
||||
|
||||
if ($this->invoice->hasPartial()) {
|
||||
//is partial and amount is exactly the partial amount
|
||||
|
@ -71,7 +71,8 @@ class HandleReversal extends AbstractService
|
||||
if ($total_paid > 0) {
|
||||
$credit = CreditFactory::create($this->invoice->company_id, $this->invoice->user_id);
|
||||
$credit->client_id = $this->invoice->client_id;
|
||||
|
||||
$credit->invoice_id = $this->invoice->id;
|
||||
|
||||
$item = InvoiceItemFactory::create();
|
||||
$item->quantity = 1;
|
||||
$item->cost = (float)$total_paid;
|
||||
|
@ -76,7 +76,7 @@ class PaymentTransformer extends EntityTransformer
|
||||
'updated_at' => (int)$payment->updated_at,
|
||||
'archived_at' => (int)$payment->deleted_at,
|
||||
'is_deleted' => (bool) $payment->is_deleted,
|
||||
'type_id' => (string) $payment->payment_type_id ?: '',
|
||||
'type_id' => (string) $payment->type_id ?: '',
|
||||
'invitation_id' => (string) $payment->invitation_id ?: '',
|
||||
'private_notes' => (string) $payment->private_notes ?: '',
|
||||
'number' => (string) $payment->number ?: '',
|
||||
|
@ -24,6 +24,8 @@ trait Uploadable
|
||||
if ($file) {
|
||||
$path = UploadAvatar::dispatchNow($file, $company->company_key);
|
||||
|
||||
info("the path {$path}");
|
||||
|
||||
if ($path) {
|
||||
$settings = $entity->settings;
|
||||
$settings->company_logo = $path;
|
||||
|
130
composer.lock
generated
130
composer.lock
generated
@ -107,16 +107,16 @@
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.142.1",
|
||||
"version": "3.142.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "ab92ec111132712417cc97be06275553b10a76ab"
|
||||
"reference": "1d55df0b6490f6a9d6ebfd3a73d297d299ff8802"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/ab92ec111132712417cc97be06275553b10a76ab",
|
||||
"reference": "ab92ec111132712417cc97be06275553b10a76ab",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/1d55df0b6490f6a9d6ebfd3a73d297d299ff8802",
|
||||
"reference": "1d55df0b6490f6a9d6ebfd3a73d297d299ff8802",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -188,7 +188,7 @@
|
||||
"s3",
|
||||
"sdk"
|
||||
],
|
||||
"time": "2020-06-12T18:16:31+00:00"
|
||||
"time": "2020-06-17T18:18:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "checkout/checkout-sdk-php",
|
||||
@ -1387,16 +1387,16 @@
|
||||
},
|
||||
{
|
||||
"name": "egulias/email-validator",
|
||||
"version": "2.1.17",
|
||||
"version": "2.1.18",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/egulias/EmailValidator.git",
|
||||
"reference": "ade6887fd9bd74177769645ab5c474824f8a418a"
|
||||
"reference": "cfa3d44471c7f5bfb684ac2b0da7114283d78441"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ade6887fd9bd74177769645ab5c474824f8a418a",
|
||||
"reference": "ade6887fd9bd74177769645ab5c474824f8a418a",
|
||||
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/cfa3d44471c7f5bfb684ac2b0da7114283d78441",
|
||||
"reference": "cfa3d44471c7f5bfb684ac2b0da7114283d78441",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1420,7 +1420,7 @@
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Egulias\\EmailValidator\\": "EmailValidator"
|
||||
"Egulias\\EmailValidator\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
@ -1441,7 +1441,7 @@
|
||||
"validation",
|
||||
"validator"
|
||||
],
|
||||
"time": "2020-02-13T22:36:52+00:00"
|
||||
"time": "2020-06-16T20:11:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fedeisas/laravel-mail-css-inliner",
|
||||
@ -1804,16 +1804,16 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "6.5.4",
|
||||
"version": "6.5.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "a4a1b6930528a8f7ee03518e6442ec7a44155d9d"
|
||||
"reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/a4a1b6930528a8f7ee03518e6442ec7a44155d9d",
|
||||
"reference": "a4a1b6930528a8f7ee03518e6442ec7a44155d9d",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
|
||||
"reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1821,7 +1821,7 @@
|
||||
"guzzlehttp/promises": "^1.0",
|
||||
"guzzlehttp/psr7": "^1.6.1",
|
||||
"php": ">=5.5",
|
||||
"symfony/polyfill-intl-idn": "1.17.0"
|
||||
"symfony/polyfill-intl-idn": "^1.17.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-curl": "*",
|
||||
@ -1867,7 +1867,7 @@
|
||||
"rest",
|
||||
"web service"
|
||||
],
|
||||
"time": "2020-05-25T19:35:05+00:00"
|
||||
"time": "2020-06-16T21:01:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
@ -2432,16 +2432,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v6.18.19",
|
||||
"version": "v6.18.20",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "69321afec31f4a908112e5dc8995fc91024fd971"
|
||||
"reference": "2862a9857533853bb2851bac39d65e3bfb8ba6cd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/69321afec31f4a908112e5dc8995fc91024fd971",
|
||||
"reference": "69321afec31f4a908112e5dc8995fc91024fd971",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/2862a9857533853bb2851bac39d65e3bfb8ba6cd",
|
||||
"reference": "2862a9857533853bb2851bac39d65e3bfb8ba6cd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2523,6 +2523,7 @@
|
||||
"suggest": {
|
||||
"aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.0).",
|
||||
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).",
|
||||
"ext-ftp": "Required to use the Flysystem FTP driver.",
|
||||
"ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().",
|
||||
"ext-memcached": "Required to use the memcache cache driver.",
|
||||
"ext-pcntl": "Required to use all features of the queue worker.",
|
||||
@ -2575,7 +2576,7 @@
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"time": "2020-06-09T13:59:34+00:00"
|
||||
"time": "2020-06-16T13:21:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/slack-notification-channel",
|
||||
@ -4095,16 +4096,16 @@
|
||||
},
|
||||
{
|
||||
"name": "opis/closure",
|
||||
"version": "3.5.4",
|
||||
"version": "3.5.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/opis/closure.git",
|
||||
"reference": "1d0deef692f66dae5d70663caee2867d0971306b"
|
||||
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/1d0deef692f66dae5d70663caee2867d0971306b",
|
||||
"reference": "1d0deef692f66dae5d70663caee2867d0971306b",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
|
||||
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -4152,7 +4153,7 @@
|
||||
"serialization",
|
||||
"serialize"
|
||||
],
|
||||
"time": "2020-06-07T11:41:29+00:00"
|
||||
"time": "2020-06-17T14:59:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
@ -6272,7 +6273,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v5.1.1",
|
||||
"version": "v5.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
@ -6683,7 +6684,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
"version": "v5.1.1",
|
||||
"version": "v5.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/filesystem.git",
|
||||
@ -6984,7 +6985,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/mime",
|
||||
"version": "v5.1.1",
|
||||
"version": "v5.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/mime.git",
|
||||
@ -7061,7 +7062,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/options-resolver",
|
||||
"version": "v5.1.1",
|
||||
"version": "v5.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/options-resolver.git",
|
||||
@ -8436,16 +8437,16 @@
|
||||
},
|
||||
{
|
||||
"name": "yajra/laravel-datatables-oracle",
|
||||
"version": "v9.10.1",
|
||||
"version": "v9.10.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/yajra/laravel-datatables.git",
|
||||
"reference": "01b4a4fdbd13e4d77fa2d27916cdafac789d2d1a"
|
||||
"reference": "7ccbc890aa03d645bd509c03299234dc631240ee"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/01b4a4fdbd13e4d77fa2d27916cdafac789d2d1a",
|
||||
"reference": "01b4a4fdbd13e4d77fa2d27916cdafac789d2d1a",
|
||||
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/7ccbc890aa03d645bd509c03299234dc631240ee",
|
||||
"reference": "7ccbc890aa03d645bd509c03299234dc631240ee",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -8513,7 +8514,7 @@
|
||||
"type": "patreon"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-30T04:43:39+00:00"
|
||||
"time": "2020-06-17T03:08:37+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
@ -8706,52 +8707,6 @@
|
||||
],
|
||||
"time": "2020-05-05T10:53:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "beganovich/omnipay-checkout",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/beganovich/omnipay-checkout.git",
|
||||
"reference": "a4e78bc3ce6ea39ea2c2b7da3019b3966fc86a21"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/beganovich/omnipay-checkout/zipball/a4e78bc3ce6ea39ea2c2b7da3019b3966fc86a21",
|
||||
"reference": "a4e78bc3ce6ea39ea2c2b7da3019b3966fc86a21",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"omnipay/common": "^3",
|
||||
"php": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"omnipay/tests": "^3"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Omnipay\\Checkout\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Benjamin Beganović",
|
||||
"email": "ben@invoiceninja.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Checkout driver for the Omnipay PHP payment processing library",
|
||||
"homepage": "https://github.com/beganovich/omnipay-checkout",
|
||||
"keywords": [
|
||||
"beganovich",
|
||||
"omnipay-checkout"
|
||||
],
|
||||
"time": "2020-05-11T22:18:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "beyondcode/laravel-dump-server",
|
||||
"version": "1.3.0",
|
||||
@ -10957,16 +10912,16 @@
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
"version": "1.8.0",
|
||||
"version": "1.9.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webmozart/assert.git",
|
||||
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
|
||||
"reference": "9dc4f203e36f2b486149058bade43c851dd97451"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
|
||||
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
|
||||
"url": "https://api.github.com/repos/webmozart/assert/zipball/9dc4f203e36f2b486149058bade43c851dd97451",
|
||||
"reference": "9dc4f203e36f2b486149058bade43c851dd97451",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -10974,6 +10929,7 @@
|
||||
"symfony/polyfill-ctype": "^1.8"
|
||||
},
|
||||
"conflict": {
|
||||
"phpstan/phpstan": "<0.12.20",
|
||||
"vimeo/psalm": "<3.9.1"
|
||||
},
|
||||
"require-dev": {
|
||||
@ -11001,7 +10957,7 @@
|
||||
"check",
|
||||
"validate"
|
||||
],
|
||||
"time": "2020-04-18T12:12:48+00:00"
|
||||
"time": "2020-06-16T10:16:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "wildbit/postmark-php",
|
||||
|
@ -6,7 +6,7 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Client::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->name(),
|
||||
'name' => $faker->company(),
|
||||
'website' => $faker->url,
|
||||
'private_notes' => $faker->text(200),
|
||||
'balance' => 0,
|
||||
|
28
public/flutter_service_worker.js
vendored
28
public/flutter_service_worker.js
vendored
@ -3,22 +3,22 @@ const MANIFEST = 'flutter-app-manifest';
|
||||
const TEMP = 'flutter-temp-cache';
|
||||
const CACHE_NAME = 'flutter-app-cache';
|
||||
const RESOURCES = {
|
||||
"assets/fonts/MaterialIcons-Regular.ttf": "56d3ffdef7a25659eab6a68a3fbfaf16",
|
||||
"assets/fonts/Roboto-Regular.ttf": "3e1af3ef546b9e6ecef9f3ba197bf7d2",
|
||||
"assets/assets/images/logo.png": "090f69e23311a4b6d851b3880ae52541",
|
||||
"assets/assets/images/google-icon.png": "0f118259ce403274f407f5e982e681c3",
|
||||
"assets/NOTICES": "8e6e4a20b409c4109de20a91757d52a7",
|
||||
"assets/FontManifest.json": "280b2f61f6810d59bd1bcd4cf01d3bf4",
|
||||
"assets/packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf": "5a37ae808cf9f652198acde612b5328d",
|
||||
"assets/packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf": "2aa350bd2aeab88b601a593f793734c0",
|
||||
"assets/packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf": "2bca5ec802e40d3f4b60343e346cedde",
|
||||
"assets/web/assets/fonts/Roboto-Regular.ttf": "3e1af3ef546b9e6ecef9f3ba197bf7d2",
|
||||
"assets/AssetManifest.json": "43bc57fb55ca8ea2fc1975108be086c9",
|
||||
"main.dart.js": "c1c684bb13b250c36e9c45683de705de",
|
||||
"main.dart.js": "70b9695fb0b0b645839d829005dffd13",
|
||||
"favicon.ico": "51636d3a390451561744c42188ccd628",
|
||||
"manifest.json": "77215c1737c7639764e64a192be2f7b8",
|
||||
"assets/fonts/Roboto-Regular.ttf": "3e1af3ef546b9e6ecef9f3ba197bf7d2",
|
||||
"assets/fonts/MaterialIcons-Regular.ttf": "56d3ffdef7a25659eab6a68a3fbfaf16",
|
||||
"assets/web/assets/fonts/Roboto-Regular.ttf": "3e1af3ef546b9e6ecef9f3ba197bf7d2",
|
||||
"assets/FontManifest.json": "280b2f61f6810d59bd1bcd4cf01d3bf4",
|
||||
"assets/NOTICES": "8e6e4a20b409c4109de20a91757d52a7",
|
||||
"assets/packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf": "2bca5ec802e40d3f4b60343e346cedde",
|
||||
"assets/packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf": "2aa350bd2aeab88b601a593f793734c0",
|
||||
"assets/packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf": "5a37ae808cf9f652198acde612b5328d",
|
||||
"assets/assets/images/google-icon.png": "0f118259ce403274f407f5e982e681c3",
|
||||
"assets/assets/images/logo.png": "090f69e23311a4b6d851b3880ae52541",
|
||||
"assets/AssetManifest.json": "43bc57fb55ca8ea2fc1975108be086c9",
|
||||
"index.html": "57fdc91b6cf6f7a7eddf1419c5763c19",
|
||||
"/": "57fdc91b6cf6f7a7eddf1419c5763c19",
|
||||
"favicon.ico": "51636d3a390451561744c42188ccd628"
|
||||
"/": "57fdc91b6cf6f7a7eddf1419c5763c19"
|
||||
};
|
||||
|
||||
// The application shell files that are downloaded before a service worker can
|
||||
|
25
public/index.html
Normal file
25
public/index.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Invoice Ninja</title>
|
||||
<link rel="manifest" href="manifest.json">
|
||||
</head>
|
||||
<body style="background-color:#888888;">
|
||||
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function () {
|
||||
navigator.serviceWorker.register('/flutter_service_worker.js');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="main.dart.js" type="application/javascript"></script>
|
||||
|
||||
<center style="font-family:Tahoma,Geneva,sans-serif;font-size:28px;color:white;padding-top:100px">
|
||||
Loading...
|
||||
</center>
|
||||
|
||||
</body>
|
||||
</html>
|
150154
public/main.dart.js
vendored
150154
public/main.dart.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
56
resources/js/clients/shared/pdf.js
vendored
56
resources/js/clients/shared/pdf.js
vendored
@ -12,9 +12,11 @@ class PDF {
|
||||
constructor(url, canvas) {
|
||||
this.url = url;
|
||||
this.canvas = canvas;
|
||||
this.context = canvas.getContext("2d");
|
||||
this.context = canvas.getContext('2d');
|
||||
this.currentPage = 1;
|
||||
this.maxPages = 1;
|
||||
this.currentScale = 1.75;
|
||||
this.currentScaleText = document.getElementById('zoom-level');
|
||||
}
|
||||
|
||||
handlePreviousPage() {
|
||||
@ -37,40 +39,62 @@ class PDF {
|
||||
this.handle();
|
||||
}
|
||||
|
||||
handleZoomChange(zoom = null) {
|
||||
if (this.currentScale == 0.25 && !zoom) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (zoom) {
|
||||
this.currentScale += 0.25;
|
||||
this.currentScaleText.textContent = this.currentScale * 100 + '%';
|
||||
|
||||
return this.handle();
|
||||
}
|
||||
|
||||
this.currentScale -= 0.25;
|
||||
this.currentScaleText.textContent = this.currentScale * 100 + '%';
|
||||
|
||||
return this.handle();
|
||||
}
|
||||
|
||||
prepare() {
|
||||
let previousPageButton = document.getElementById(
|
||||
"previous-page-button"
|
||||
);
|
||||
let previousPageButton = document
|
||||
.getElementById('previous-page-button')
|
||||
.addEventListener('click', () => this.handlePreviousPage());
|
||||
|
||||
let nextPageButton = document.getElementById("next-page-button");
|
||||
let nextPageButton = document
|
||||
.getElementById('next-page-button')
|
||||
.addEventListener('click', () => this.handleNextPage());
|
||||
|
||||
previousPageButton.addEventListener("click", () =>
|
||||
this.handlePreviousPage()
|
||||
);
|
||||
let zoomInButton = document
|
||||
.getElementById('zoom-in')
|
||||
.addEventListener('click', () => this.handleZoomChange(true));
|
||||
|
||||
nextPageButton.addEventListener("click", () => this.handleNextPage());
|
||||
let zoomOutButton = document
|
||||
.getElementById('zoom-out')
|
||||
.addEventListener('click', () => this.handleZoomChange());
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
setPagesInViewport() {
|
||||
let currentPageContainer = document.getElementById(
|
||||
"current-page-container"
|
||||
'current-page-container'
|
||||
);
|
||||
|
||||
let totalPageContainer = document.getElementById(
|
||||
"total-page-container"
|
||||
'total-page-container'
|
||||
);
|
||||
|
||||
let paginationButtonContainer = document.getElementById(
|
||||
"pagination-button-container"
|
||||
'pagination-button-container'
|
||||
);
|
||||
|
||||
currentPageContainer.innerText = this.currentPage;
|
||||
totalPageContainer.innerText = this.maxPages;
|
||||
|
||||
if (this.maxPages > 1) {
|
||||
paginationButtonContainer.style.display = "flex";
|
||||
paginationButtonContainer.style.display = 'flex';
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,14 +105,14 @@ class PDF {
|
||||
|
||||
this.maxPages = pdf.numPages;
|
||||
|
||||
let viewport = await page.getViewport({ scale: 1 });
|
||||
let viewport = await page.getViewport({ scale: this.currentScale });
|
||||
|
||||
this.canvas.height = viewport.height;
|
||||
this.canvas.width = viewport.width;
|
||||
|
||||
page.render({
|
||||
canvasContext: this.context,
|
||||
viewport
|
||||
viewport,
|
||||
});
|
||||
|
||||
this.setPagesInViewport();
|
||||
@ -96,6 +120,6 @@ class PDF {
|
||||
}
|
||||
|
||||
const url = document.querySelector("meta[name='pdf-url'").content;
|
||||
const canvas = document.getElementById("pdf-placeholder");
|
||||
const canvas = document.getElementById('pdf-placeholder');
|
||||
|
||||
new PDF(url, canvas).prepare().handle();
|
||||
|
@ -76,22 +76,33 @@
|
||||
<span id="total-page-container"></span>
|
||||
</span>
|
||||
</section>
|
||||
<div x-data="{ open: false }" @keydown.escape="open = false" @click.away="open = false" class="relative inline-block text-left">
|
||||
<div>
|
||||
<button @click="open = !open" class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600">
|
||||
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
|
||||
</svg>
|
||||
</button>
|
||||
<section class="flex items-center space-x-1">
|
||||
<div class="flex items-center mr-4 space-x-1">
|
||||
<span class="text-gray-600 mr-2" id="zoom-level">175%</span>
|
||||
<a href="#" id="zoom-in">
|
||||
<svg class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 cursor-pointer" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="11" y1="8" x2="11" y2="14"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>
|
||||
</a>
|
||||
<a href="#" id="zoom-out">
|
||||
<svg class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 cursor-pointer" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>
|
||||
</a>
|
||||
</div>
|
||||
<div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg">
|
||||
<div class="rounded-md bg-white shadow-xs">
|
||||
<div class="py-1">
|
||||
<a target="_blank" href="{{ $invoice->pdf_file_path() }}" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ ctrans('texts.open_in_new_tab') }}</a>
|
||||
<div x-data="{ open: false }" @keydown.escape="open = false" @click.away="open = false" class="relative inline-block text-left">
|
||||
<div>
|
||||
<button @click="open = !open" class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600">
|
||||
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg">
|
||||
<div class="rounded-md bg-white shadow-xs">
|
||||
<div class="py-1">
|
||||
<a target="_blank" href="?mode=fullscreen" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ ctrans('texts.open_in_new_tab') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-center">
|
||||
|
@ -0,0 +1,36 @@
|
||||
@extends('portal.ninja2020.layout.clean')
|
||||
@section('meta_title', ctrans('texts.view_invoice'))
|
||||
|
||||
@section('body')
|
||||
@if($invoice->isPayable())
|
||||
<form action="{{ route('client.invoices.bulk') }}" method="post">
|
||||
@csrf
|
||||
<div class="bg-white">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<div class="sm:flex sm:items-start sm:justify-between">
|
||||
<div>
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||
{{ ctrans('texts.unpaid') }}
|
||||
</h3>
|
||||
<div class="mt-2 max-w-xl text-sm leading-5 text-gray-500">
|
||||
<p translate>
|
||||
{{ ctrans('texts.invoice_still_unpaid') }}
|
||||
<!-- This invoice is still not paid. Click the button to complete the payment. -->
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-0 sm:ml-6 sm:flex-shrink-0 sm:flex sm:items-center">
|
||||
<div class="inline-flex rounded-md shadow-sm">
|
||||
<input type="hidden" name="invoices[]" value="{{ $invoice->hashed_id }}">
|
||||
<input type="hidden" name="action" value="payment">
|
||||
<button class="button button-primary">@lang('texts.pay_now')</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
<iframe src="{{ $invoice->pdf_file_path() }}" class="h-screen w-full border-0"></iframe>
|
||||
@endsection
|
@ -67,22 +67,33 @@
|
||||
<span id="total-page-container"></span>
|
||||
</span>
|
||||
</section>
|
||||
<div x-data="{ open: false }" @keydown.escape="open = false" @click.away="open = false" class="relative inline-block text-left">
|
||||
<div>
|
||||
<button @click="open = !open" class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600">
|
||||
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
|
||||
</svg>
|
||||
</button>
|
||||
<section class="flex items-center space-x-1">
|
||||
<div class="flex items-center mr-4 space-x-1">
|
||||
<span class="text-gray-600 mr-2" id="zoom-level">175%</span>
|
||||
<a href="#" id="zoom-in">
|
||||
<svg class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 cursor-pointer" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="11" y1="8" x2="11" y2="14"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>
|
||||
</a>
|
||||
<a href="#" id="zoom-out">
|
||||
<svg class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 cursor-pointer" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>
|
||||
</a>
|
||||
</div>
|
||||
<div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg">
|
||||
<div class="rounded-md bg-white shadow-xs">
|
||||
<div class="py-1">
|
||||
<a target="_blank" href="{{ $quote->pdf_file_path() }}" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ ctrans('texts.open_in_new_tab') }}</a>
|
||||
<div x-data="{ open: false }" @keydown.escape="open = false" @click.away="open = false" class="relative inline-block text-left">
|
||||
<div>
|
||||
<button @click="open = !open" class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600">
|
||||
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg">
|
||||
<div class="rounded-md bg-white shadow-xs">
|
||||
<div class="py-1">
|
||||
<a target="_blank" href="?mode=fullscreen" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ ctrans('texts.open_in_new_tab') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-center">
|
||||
|
@ -0,0 +1,36 @@
|
||||
@extends('portal.ninja2020.layout.clean')
|
||||
@section('meta_title', ctrans('texts.view_quote'))
|
||||
|
||||
@section('body')
|
||||
@if(!$quote->isApproved())
|
||||
<form action="{{ route('client.quotes.bulk') }}" method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="action" value="approve">
|
||||
<input type="hidden" name="quotes[]" value="{{ $quote->hashed_id }}">
|
||||
<div class="bg-white" translate>
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<div class="sm:flex sm:items-start sm:justify-between">
|
||||
<div>
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" translate>
|
||||
{{ ctrans('texts.waiting_for_approval') }}
|
||||
</h3>
|
||||
<div class="mt-2 max-w-xl text-sm leading-5 text-gray-500">
|
||||
<p translate>
|
||||
{{ ctrans('texts.quote_still_not_approved') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-0 sm:ml-6 sm:flex-shrink-0 sm:flex sm:items-center">
|
||||
<div class="inline-flex rounded-md shadow-sm">
|
||||
<input type="hidden" name="action" value="payment">
|
||||
<button class="button button-primary">@lang('texts.approve')</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
<iframe src="{{ $quote->pdf_file_path() }}" class="h-screen w-full border-0"></iframe>
|
||||
@endsection
|
Loading…
x
Reference in New Issue
Block a user