Skip to main content

Ultimate POS Watermark Feature - Complete Implementation Guide

This guide walks you through adding a watermark feature to your Ultimate POS invoice templates, allowing users to add custom logos as watermarks on their invoices.

Overview​

The watermark feature allows users to:

  • Upload a custom watermark logo
  • Control watermark visibility (show/hide)
  • Adjust watermark size (width/height)
  • Set transparency level (opacity)
  • Choose watermark position (center, corners)

Watermark Watermark in classic template

Prerequisites​

  • Ultimate POS system installed and running
  • Access to database and codebase
  • Basic knowledge of Laravel, PHP, and Blade templates

Step 1: Database Migration​

Create Migration File​

Create a new migration to add watermark fields to the invoice_layouts table:

php artisan make:migration add_watermark_fields_to_invoice_layouts --table=invoice_layouts

Migration Code​

Replace the generated migration content with:

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('invoice_layouts', function (Blueprint $table) {
$table->string('watermark_logo')->nullable()->after('logo');
$table->boolean('show_watermark')->default(0)->after('watermark_logo');
$table->integer('watermark_width')->default(300)->after('show_watermark');
$table->integer('watermark_height')->default(300)->after('watermark_width');
$table->decimal('watermark_opacity', 3, 2)->default(0.10)->after('watermark_height');
$table->string('watermark_position')->default('center')->after('watermark_opacity');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('invoice_layouts', function (Blueprint $table) {
$table->dropColumn([
'watermark_logo',
'show_watermark',
'watermark_width',
'watermark_height',
'watermark_opacity',
'watermark_position'
]);
});
}
};

Run Migration​

Execute the migration:

php artisan migrate

Or run specific migration:

php artisan migrate --path=database/migrations/2025_07_29_125312_add_watermark_fields_to_invoice_layouts.php

Alternative: Direct SQL Execution​

If you prefer to run SQL directly or need to add columns to an existing system, you can execute these SQL commands:

ALTER TABLE `invoice_layouts`
ADD COLUMN `watermark_logo` VARCHAR(255) NULL AFTER `logo`,
ADD COLUMN `show_watermark` TINYINT(1) NOT NULL DEFAULT 0 AFTER `watermark_logo`,
ADD COLUMN `watermark_width` INT NOT NULL DEFAULT 300 AFTER `show_watermark`,
ADD COLUMN `watermark_height` INT NOT NULL DEFAULT 300 AFTER `watermark_width`,
ADD COLUMN `watermark_opacity` DECIMAL(3,2) NOT NULL DEFAULT 0.10 AFTER `watermark_height`,
ADD COLUMN `watermark_position` VARCHAR(50) NOT NULL DEFAULT 'center' AFTER `watermark_opacity`;

Rollback SQL (if needed)​

To remove the watermark columns:

ALTER TABLE `invoice_layouts`
DROP COLUMN `watermark_logo`,
DROP COLUMN `show_watermark`,
DROP COLUMN `watermark_width`,
DROP COLUMN `watermark_height`,
DROP COLUMN `watermark_opacity`,
DROP COLUMN `watermark_position`;

Step 2: Update Model​

Update InvoiceLayout Model​

Add watermark field casting to app/InvoiceLayout.php:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class InvoiceLayout extends Model
{
/**
* The attributes that aren't mass assignable.
*
* @var array
*/
protected $guarded = ['id'];

/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'product_custom_fields' => 'array',
'contact_custom_fields' => 'array',
'location_custom_fields' => 'array',
'common_settings' => 'array',
'qr_code_fields' => 'array',
// Add watermark casts
'show_watermark' => 'boolean',
'watermark_width' => 'integer',
'watermark_height' => 'integer',
'watermark_opacity' => 'decimal:2',
];

/**
* Get the location associated with the invoice layout.
*/
public function locations()
{
return $this->hasMany(\App\BusinessLocation::class);
}

/**
* Return list of invoice layouts for a business
*
* @param int $business_id
* @return array
*/
public static function forDropdown($business_id)
{
$layouts = InvoiceLayout::where('business_id', $business_id)
->pluck('name', 'id');

return $layouts;
}
}

Step 3: Update Controller​

Update Store Method​

Modify the store method in InvoiceLayoutController.php:

    /**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
if (! auth()->user()->can('invoice_settings.access')) {
abort(403, 'Unauthorized action.');
}

try {
$validator = Validator::make($request->all(), [
'logo' => 'mimes:jpeg,gif,png|max:1000',
'watermark_logo' => 'mimes:jpeg,gif,png|max:1000', // Add watermark validation
]);

$input = $request->only([
'name',
'header_text',
'invoice_no_prefix',
'invoice_heading',
'sub_total_label',
'discount_label',
'tax_label',
'total_label',
'highlight_color',
'footer_text',
'invoice_heading_not_paid',
'invoice_heading_paid',
'total_due_label',
'customer_label',
'paid_label',
'sub_heading_line1',
'sub_heading_line2',
'sub_heading_line3',
'sub_heading_line4',
'sub_heading_line5',
'table_product_label',
'table_qty_label',
'table_unit_price_label',
'table_subtotal_label',
'client_id_label',
'date_label',
'quotation_heading',
'quotation_no_prefix',
'design',
'client_tax_label',
'cat_code_label',
'cn_heading',
'cn_no_label',
'cn_amount_label',
'sales_person_label',
'prev_bal_label',
'date_time_format',
'common_settings',
'change_return_label',
'round_off_label',
'qr_code_fields',
'commission_agent_label',
// Add watermark fields
'watermark_width',
'watermark_height',
'watermark_opacity',
'watermark_position'
]);

$business_id = $request->session()->get('user.business_id');
$input['business_id'] = $business_id;

//Set value for checkboxes
$checkboxes = [
'show_business_name',
'show_location_name',
'show_landmark',
'show_city',
'show_state',
'show_country',
'show_zip_code',
'show_mobile_number',
'show_alternate_number',
'show_email',
'show_tax_1',
'show_tax_2',
'show_logo',
'show_barcode',
'show_payments',
'show_customer',
'show_client_id',
'show_brand',
'show_sku',
'show_cat_code',
'show_sale_description',
'show_sales_person',
'show_expiry',
'show_lot',
'show_previous_bal',
'show_image',
'show_reward_point',
'show_qr_code',
'show_commission_agent',
'show_letter_head',
'show_watermark' // Add watermark checkbox
];
foreach ($checkboxes as $name) {
$input[$name] = ! empty($request->input($name)) ? 1 : 0;
}

//Upload Logo
$logo_name = $this->commonUtil->uploadFile($request, 'logo', 'invoice_logos', 'image');
if (! empty($logo_name)) {
$input['logo'] = $logo_name;
}

$letter_head = $this->commonUtil->uploadFile($request, 'letter_head', 'invoice_logos', 'image');
if (! empty($letter_head)) {
$input['letter_head'] = $letter_head;
}

// Upload Watermark Logo
$watermark_logo_name = $this->commonUtil->uploadFile($request, 'watermark_logo', 'invoice_logos', 'image');
if (! empty($watermark_logo_name)) {
$input['watermark_logo'] = $watermark_logo_name;
}

// Set default values for watermark settings
$input['watermark_width'] = $request->input('watermark_width', 300);
$input['watermark_height'] = $request->input('watermark_height', 300);
$input['watermark_opacity'] = $request->input('watermark_opacity', '0.1');
$input['watermark_position'] = $request->input('watermark_position', 'center');

if (! empty($request->input('is_default'))) {
//get_default
$default = InvoiceLayout::where('business_id', $business_id)
->where('is_default', 1)
->update(['is_default' => 0]);
$input['is_default'] = 1;
}

//Module info
if ($request->has('module_info')) {
$input['module_info'] = json_encode($request->input('module_info'));
}

if (! empty($request->input('table_tax_headings'))) {
$input['table_tax_headings'] = json_encode($request->input('table_tax_headings'));
}
$input['product_custom_fields'] = ! empty($request->input('product_custom_fields')) ? $request->input('product_custom_fields') : null;
$input['contact_custom_fields'] = ! empty($request->input('contact_custom_fields')) ? $request->input('contact_custom_fields') : null;
$input['location_custom_fields'] = ! empty($request->input('location_custom_fields')) ? $request->input('location_custom_fields') : null;

InvoiceLayout::create($input);
$output = [
'success' => 1,
'msg' => __('invoice.layout_added_success'),
];
} catch (\Exception $e) {
\Log::emergency('File:' . $e->getFile() . 'Line:' . $e->getLine() . 'Message:' . $e->getMessage());

$output = [
'success' => 0,
'msg' => __('messages.something_went_wrong'),
];
}

return redirect('invoice-schemes')->with('status', $output);
}

Update Update Method​

Modify the update method in InvoiceLayoutController.php:

   /**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\InvoiceLayout $invoiceLayout
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
if (! auth()->user()->can('invoice_settings.access')) {
abort(403, 'Unauthorized action.');
}

try {
$validator = Validator::make($request->all(), [
'logo' => 'mimes:jpeg,gif,png|1000',
'watermark_logo' => 'mimes:jpeg,gif,png|1000', // Add watermark validation
]);

$input = $request->only([
'name',
'header_text',
'invoice_no_prefix',
'invoice_heading',
'sub_total_label',
'discount_label',
'tax_label',
'total_label',
'highlight_color',
'footer_text',
'invoice_heading_not_paid',
'invoice_heading_paid',
'total_due_label',
'customer_label',
'paid_label',
'sub_heading_line1',
'sub_heading_line2',
'sub_heading_line3',
'sub_heading_line4',
'sub_heading_line5',
'table_product_label',
'table_qty_label',
'table_unit_price_label',
'table_subtotal_label',
'client_id_label',
'date_label',
'quotation_heading',
'quotation_no_prefix',
'design',
'client_tax_label',
'cat_code_label',
'cn_heading',
'cn_no_label',
'cn_amount_label',
'sales_person_label',
'prev_bal_label',
'date_time_format',
'change_return_label',
'round_off_label',
'commission_agent_label',
// Add watermark fields
'watermark_width',
'watermark_height',
'watermark_opacity',
'watermark_position'
]);
$business_id = $request->session()->get('user.business_id');

$checkboxes = [
'show_business_name',
'show_location_name',
'show_landmark',
'show_city',
'show_state',
'show_country',
'show_zip_code',
'show_mobile_number',
'show_alternate_number',
'show_email',
'show_tax_1',
'show_tax_2',
'show_logo',
'show_barcode',
'show_payments',
'show_customer',
'show_client_id',
'show_brand',
'show_sku',
'show_cat_code',
'show_sale_description',
'show_sales_person',
'show_expiry',
'show_lot',
'show_previous_bal',
'show_image',
'show_reward_point',
'show_qr_code',
'show_commission_agent',
'show_letter_head',
'show_watermark', // Add watermark checkbox
];
foreach ($checkboxes as $name) {
$input[$name] = ! empty($request->input($name)) ? 1 : 0;
}

//Upload Logo
$logo_name = $this->commonUtil->uploadFile($request, 'logo', 'invoice_logos', 'image');
if (! empty($logo_name)) {
$input['logo'] = $logo_name;
}

//Upload letter head
$letter_head = $this->commonUtil->uploadFile($request, 'letter_head', 'invoice_logos', 'image');
if (! empty($letter_head)) {
$input['letter_head'] = $letter_head;
}

//Upload Watermark Logo
$watermark_logo_name = $this->commonUtil->uploadFile($request, 'watermark_logo', 'invoice_logos', 'image');
if (! empty($watermark_logo_name)) {
$input['watermark_logo'] = $watermark_logo_name;
}

// Set default values for watermark settings
$input['watermark_width'] = $request->input('watermark_width', 300);
$input['watermark_height'] = $request->input('watermark_height', 300);
$input['watermark_opacity'] = $request->input('watermark_opacity', '0.1');
$input['watermark_position'] = $request->input('watermark_position', 'center');

if (! empty($request->input('is_default'))) {
//get_default
$default = InvoiceLayout::where('business_id', $business_id)
->where('is_default', 1)
->update(['is_default' => 0]);
$input['is_default'] = 1;
}

//Module info
if ($request->has('module_info')) {
$input['module_info'] = json_encode($request->input('module_info'));
}

if (! empty($request->input('table_tax_headings'))) {
$input['table_tax_headings'] = json_encode($request->input('table_tax_headings'));
}

$input['product_custom_fields'] = ! empty($request->input('product_custom_fields')) ? json_encode($request->input('product_custom_fields')) : null;
$input['contact_custom_fields'] = ! empty($request->input('contact_custom_fields')) ? json_encode($request->input('contact_custom_fields')) : null;
$input['location_custom_fields'] = ! empty($request->input('location_custom_fields')) ? json_encode($request->input('location_custom_fields')) : null;
$input['common_settings'] = ! empty($request->input('common_settings')) ? json_encode($request->input('common_settings')) : null;
$input['qr_code_fields'] = ! empty($request->input('qr_code_fields')) ? json_encode($request->input('qr_code_fields')) : null;

InvoiceLayout::where('id', $id)
->where('business_id', $business_id)
->update($input);
$output = [
'success' => 1,
'msg' => __('invoice.layout_updated_success'),
];
} catch (\Exception $e) {
\Log::emergency('File:' . $e->getFile() . 'Line:' . $e->getLine() . 'Message:' . $e->getMessage());

$output = [
'success' => 0,
'msg' => __('messages.something_went_wrong'),
];
}

return redirect('invoice-schemes')->with('status', $output);
}

Step 4: Add Language Strings​

Update Language File​

Add watermark-related language strings to resources/lang/en/lang_v1.php:

    'watermark_settings' => 'Watermark Settings',
'watermark_logo' => 'Watermark Logo',
'watermark_logo_help' => 'Logo image for watermark. Max file size: :max_size',
'show_watermark' => 'Show Watermark',
'watermark_width' => 'Watermark Width',
'watermark_height' => 'Watermark Height',
'watermark_opacity' => 'Watermark Opacity',
'watermark_position' => 'Watermark Position',
'width_in_pixels' => 'Width in pixels (50-800)',
'height_in_pixels' => 'Height in pixels (50-800)',
'transparency_level' => 'Transparency level',
'center' => 'Center',
'top_left' => 'Top Left',
'top_right' => 'Top Right',
'bottom_left' => 'Bottom Left',
'bottom_right' => 'Bottom Right',
'current_watermark' => 'Current watermark logo',

Step 5: Update Forms​

Add Watermark Section to Create Form​

In your invoice layout create form (typically resources/views/invoice_layout/create.blade.php), add the watermark settings section:

@extends('layouts.app')
@section('title', __('invoice.add_invoice_layout'))

@section('content')
<style type="text/css">



</style>
@php
$custom_labels = json_decode(session('business.custom_labels'), true);
@endphp
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 class="tw-text-xl md:tw-text-3xl tw-font-bold tw-text-black">@lang('invoice.add_invoice_layout')</h1>
</section>

<!-- Main content -->
<section class="content">
{!! Form::open(['url' => action([\App\Http\Controllers\InvoiceLayoutController::class, 'store']), 'method' => 'post',
'id' => 'add_invoice_layout_form', 'files' => true]) !!}
<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{!! Form::label('name', __('invoice.layout_name') . ':*') !!}
{!! Form::text('name', null, ['class' => 'form-control', 'required',
'placeholder' => __('invoice.layout_name')]); !!}
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
{!! Form::label('design', __('lang_v1.design') . ':*') !!}
{!! Form::select('design', $designs, 'classic', ['class' => 'form-control']); !!}
<span class="help-block">
@lang('lang_v1.used_for_browser_based_printing')
</span>
</div>

<div class="form-group hide" id="columnize-taxes">
<div class="col-md-3">
<input type="text" class="form-control" name="table_tax_headings[]" required="required"
placeholder="tax 1 name" disabled>
@show_tooltip(__('lang_v1.tooltip_columnize_taxes_heading'))
</div>
<div class="col-md-3">
<input type="text" class="form-control" name="table_tax_headings[]" placeholder="tax 2 name" disabled>
</div>
<div class="col-md-3">
<input type="text" class="form-control" name="table_tax_headings[]" placeholder="tax 3 name" disabled>
</div>
<div class="col-md-3">
<input type="text" class="form-control" name="table_tax_headings[]" placeholder="tax 4 name" disabled>
</div>
</div>

</div>
<div class="clearfix"></div>
<div class="col-sm-6">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_letter_head', 1, false,
['class' => 'input-icheck', 'id' => 'show_letter_head']); !!} @lang('lang_v1.show_letter_head')</label>
</div>
</div>
</div>
<div class="col-sm-6 letter_head_input hide">
<div class="form-group">
{!! Form::label('letter_head', __('lang_v1.letter_head') . ':') !!}
{!! Form::file('letter_head', ['accept' => 'image/*']); !!}
<span class="help-block">@lang('lang_v1.letter_head_help') <br> @lang('lang_v1.invoice_logo_help',
['max_size' => '1 MB'])</span>
</div>
</div>
<div class="clearfix"></div>

<!-- Logo -->
<div class="col-sm-6 hide-for-letterhead">
<div class="form-group">
{!! Form::label('logo', __('invoice.invoice_logo') . ':') !!}
{!! Form::file('logo', ['accept' => 'image/*']); !!}
<span class="help-block">@lang('lang_v1.invoice_logo_help', ['max_size' => '1 MB'])</span>
</div>
</div>
<div class="col-sm-6 hide-for-letterhead">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_logo', 1, false, ['class' => 'input-icheck']); !!}
@lang('invoice.show_logo')</label>
</div>
</div>
</div>






<div class="col-sm-12 hide-for-letterhead">
<div class="form-group">
{!! Form::label('header_text', __('invoice.header_text') . ':' ) !!}
{!! Form::textarea('header_text','', ['class' => 'form-control',
'placeholder' => __('invoice.header_text'), 'rows' => 3]); !!}
</div>
</div>
</div>
<div class="row hide-for-letterhead">
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line1', __('lang_v1.sub_heading_line', ['_number_' => 1]) . ':' ) !!}
{!! Form::text('sub_heading_line1', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 1]) ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line2', __('lang_v1.sub_heading_line', ['_number_' => 2]) . ':' ) !!}
{!! Form::text('sub_heading_line2', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 2]) ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line3', __('lang_v1.sub_heading_line', ['_number_' => 3]) . ':' ) !!}
{!! Form::text('sub_heading_line3', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 3]) ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line4', __('lang_v1.sub_heading_line', ['_number_' => 4]) . ':' ) !!}
{!! Form::text('sub_heading_line4', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 4]) ]); !!}
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line5', __('lang_v1.sub_heading_line', ['_number_' => 5]) . ':' ) !!}
{!! Form::text('sub_heading_line5', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 5]) ]); !!}
</div>
</div>
</div>
</div>
</div>




<div class="box box-solid">
<div class="box-body">
<div class="row">

<!-- Watermark Settings Section -->
<div class="col-sm-12">
<h4>@lang('lang_v1.watermark_settings'):</h4>
</div>

<div class="col-sm-6">
<div class="form-group">
{!! Form::label('watermark_logo', __('lang_v1.watermark_logo') . ':') !!}
{!! Form::file('watermark_logo', ['accept' => 'image/*']); !!}
<span class="help-block">@lang('lang_v1.watermark_logo_help', ['max_size' => '1 MB'])</span>
</div>
</div>

<div class="col-sm-6">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_watermark', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_watermark')</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('watermark_width', __('lang_v1.watermark_width') . ':') !!}
{!! Form::number('watermark_width', 300, ['class' => 'form-control', 'min' => '50', 'max' => '800',
'placeholder' => '300']); !!}
<span class="help-block">@lang('lang_v1.width_in_pixels')</span>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('watermark_height', __('lang_v1.watermark_height') . ':') !!}
{!! Form::number('watermark_height', 300, ['class' => 'form-control', 'min' => '50', 'max' => '800',
'placeholder' => '300']); !!}
<span class="help-block">@lang('lang_v1.height_in_pixels')</span>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('watermark_opacity', __('lang_v1.watermark_opacity') . ':') !!}
{!! Form::select('watermark_opacity', [
'0.05' => '5%',
'0.1' => '10%',
'0.15' => '15%',
'0.2' => '20%',
'0.25' => '25%',
'0.3' => '30%'
], '0.1', ['class' => 'form-control']); !!}
<span class="help-block">@lang('lang_v1.transparency_level')</span>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('watermark_position', __('lang_v1.watermark_position') . ':') !!}
{!! Form::select('watermark_position', [
'center' => __('lang_v1.center'),
'top-left' => __('lang_v1.top_left'),
'top-right' => __('lang_v1.top_right'),
'bottom-left' => __('lang_v1.bottom_left'),
'bottom-right' => __('lang_v1.bottom_right')
], 'center', ['class' => 'form-control']); !!}
</div>
</div>
</div>
</div>
</div>
<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('invoice_heading', __('invoice.invoice_heading') . ':' ) !!}
{!! Form::text('invoice_heading', 'Invoice', ['class' => 'form-control',
'placeholder' => __('invoice.invoice_heading') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('invoice_heading_not_paid', __('invoice.invoice_heading_not_paid') . ':' ) !!}
{!! Form::text('invoice_heading_not_paid', null, ['class' => 'form-control',
'placeholder' => __('invoice.invoice_heading_not_paid') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('invoice_heading_paid', __('invoice.invoice_heading_paid') . ':' ) !!}
{!! Form::text('invoice_heading_paid', null, ['class' => 'form-control',
'placeholder' => __('invoice.invoice_heading_paid') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('proforma_heading', __('lang_v1.proforma_heading') . ':' ) !!}
@show_tooltip(__('lang_v1.tooltip_proforma_heading'))
{!! Form::text('common_settings[proforma_heading]', __('lang_v1.proforma_invoice'), ['class' =>
'form-control',
'placeholder' => __('lang_v1.proforma_heading'), 'id' => 'proforma_heading' ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('quotation_heading', __('lang_v1.quotation_heading') . ':' ) !!}
@show_tooltip(__('lang_v1.tooltip_quotation_heading'))
{!! Form::text('quotation_heading', __('lang_v1.quotation'), ['class' => 'form-control',
'placeholder' => __('lang_v1.quotation_heading') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sales_order_heading', __('lang_v1.sales_order_heading') . ':' ) !!}
{!! Form::text('common_settings[sales_order_heading]', __('lang_v1.sales_order'), ['class' =>
'form-control',
'placeholder' => __('lang_v1.sales_order_heading'), 'id' => 'sales_order_heading' ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('invoice_no_prefix', __('invoice.invoice_no_prefix') . ':' ) !!}
{!! Form::text('invoice_no_prefix', __('sale.invoice_no'), ['class' => 'form-control',
'placeholder' => __('invoice.invoice_no_prefix') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('quotation_no_prefix', __('lang_v1.quotation_no_prefix') . ':' ) !!}
{!! Form::text('quotation_no_prefix', __('lang_v1.quotation_no'), ['class' => 'form-control',
'placeholder' => __('lang_v1.quotation_no_prefix') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('date_label', __('lang_v1.date_label') . ':' ) !!}
{!! Form::text('date_label', __('lang_v1.date'), ['class' => 'form-control',
'placeholder' => __('lang_v1.date_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('due_date_label', __('lang_v1.due_date_label') . ':' ) !!}
{!! Form::text('common_settings[due_date_label]', __('lang_v1.due_date'), ['class' => 'form-control',
'placeholder' => __('lang_v1.due_date_label'), 'id' => 'due_date_label' ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_due_date]', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_due_date')</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('date_time_format', __('lang_v1.date_time_format') . ':' ) !!}
{!! Form::text('date_time_format', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.date_time_format') ]); !!}
<p class="help-block">{!! __('lang_v1.date_time_format_help') !!}</p>
</div>
</div>
@php
$sell_custom_field_1_label = !empty($custom_labels['sell']['custom_field_1']) ?
$custom_labels['sell']['custom_field_1'] : '';

$sell_custom_field_2_label = !empty($custom_labels['sell']['custom_field_2']) ?
$custom_labels['sell']['custom_field_2'] : '';

$sell_custom_field_3_label = !empty($custom_labels['sell']['custom_field_3']) ?
$custom_labels['sell']['custom_field_3'] : '';

$sell_custom_field_4_label = !empty($custom_labels['sell']['custom_field_4']) ?
$custom_labels['sell']['custom_field_4'] : '';
@endphp
@if (!empty($sell_custom_field_1_label))
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[sell_custom_fields1]', 1, false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['sell']['custom_field_1'] ?? __('lang_v1.product_custom_field1') }}</label>
</div>
</div>
</div>
@endif
@if (!empty($sell_custom_field_2_label))
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[sell_custom_fields2]', 1, false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['sell']['custom_field_2'] ?? __('lang_v1.product_custom_field2') }}</label>
</div>
</div>
</div>
@endif
@if (!empty($sell_custom_field_3_label))
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[sell_custom_fields3]', 1, false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['sell']['custom_field_3'] ?? __('lang_v1.product_custom_field3') }}</label>
</div>
</div>
</div>
@endif
@if (!empty($sell_custom_field_4_label))
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[sell_custom_fields4]', 1, false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['sell']['custom_field_4'] ?? __('lang_v1.product_custom_field4') }}</label>
</div>
</div>
</div>
@endif

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sales_person_label', __('lang_v1.sales_person_label') . ':' ) !!}
{!! Form::text('sales_person_label', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.sales_person_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('commission_agent_label', __('lang_v1.commission_agent_label') . ':' ) !!}
{!! Form::text('commission_agent_label', __('lang_v1.commission_agent'), ['class' => 'form-control',
'placeholder' => __('lang_v1.commission_agent_label') ]); !!}
</div>
</div>

<div class="clearfix"></div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_business_name', 1, false, ['class' => 'input-icheck']); !!}
@lang('invoice.show_business_name')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_location_name', 1, true, ['class' => 'input-icheck']); !!}
@lang('invoice.show_location_name')</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_sales_person', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_sales_person')</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_commission_agent', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_commission_agent')</label>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-12">
<h4>@lang('lang_v1.fields_for_customer_details'):</h4>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_customer', 1, true, ['class' => 'input-icheck']); !!}
@lang('invoice.show_customer')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('customer_label', __('invoice.customer_label') . ':' ) !!}
{!! Form::text('customer_label', __('contact.customer'), ['class' => 'form-control',
'placeholder' => __('invoice.customer_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_client_id', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_client_id')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('client_id_label', __('lang_v1.client_id_label') . ':' ) !!}
{!! Form::text('client_id_label', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.client_id_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('client_tax_label', __('lang_v1.client_tax_label') . ':' ) !!}
{!! Form::text('client_tax_label', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.client_tax_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_reward_point', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_reward_point')</label>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('contact_custom_fields[]', 'custom_field1', false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['contact']['custom_field_1'] ?? __('lang_v1.contact_custom_field1') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('contact_custom_fields[]', 'custom_field2', false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['contact']['custom_field_2'] ?? __('lang_v1.contact_custom_field2') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('contact_custom_fields[]', 'custom_field3', false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['contact']['custom_field_3'] ?? __('lang_v1.contact_custom_field3') }}</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('contact_custom_fields[]', 'custom_field4', false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['contact']['custom_field_4'] ?? __('lang_v1.contact_custom_field4') }}</label>
</div>
</div>
</div>
</div>
<div class="row hide-for-letterhead">
<div class="col-sm-12">
<h4>@lang('invoice.fields_to_be_shown_in_address'):</h4>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_landmark', 1, true, ['class' => 'input-icheck']); !!}
@lang('business.landmark')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_city', 1, true, ['class' => 'input-icheck']); !!}
@lang('business.city')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_state', 1, true, ['class' => 'input-icheck']); !!}
@lang('business.state')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_country', 1, true, ['class' => 'input-icheck']); !!}
@lang('business.country')</label>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_zip_code', 1, true, ['class' => 'input-icheck']); !!}
@lang('business.zip_code')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('location_custom_fields[]', 'custom_field1', false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['location']['custom_field_1'] ?? __('lang_v1.location_custom_field1') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('location_custom_fields[]', 'custom_field2', false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['location']['custom_field_2'] ?? __('lang_v1.location_custom_field2') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('location_custom_fields[]', 'custom_field3', false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['location']['custom_field_3'] ?? __('lang_v1.location_custom_field3') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('location_custom_fields[]', 'custom_field4', false, ['class' => 'input-icheck']); !!}
{{ $custom_labels['location']['custom_field_4'] ?? __('lang_v1.location_custom_field4') }}</label>
</div>
</div>
</div>

<div class="clearfix"></div>
<!-- Shop Communication details -->
<div class="col-sm-12">
<h4>@lang('invoice.fields_to_shown_for_communication'):</h4>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_mobile_number', 1, true, ['class' => 'input-icheck']); !!}
@lang('invoice.show_mobile_number')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_alternate_number', 1, false, ['class' => 'input-icheck']); !!}
@lang('invoice.show_alternate_number')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_email', 1, false, ['class' => 'input-icheck']); !!}
@lang('invoice.show_email')</label>
</div>
</div>
</div>
<div class="col-sm-12">
<h4>@lang('invoice.fields_to_shown_for_tax'):</h4>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_tax_1', 1, true, ['class' => 'input-icheck']); !!}
@lang('invoice.show_tax_1')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_tax_2', 1, false, ['class' => 'input-icheck']); !!}
@lang('invoice.show_tax_2')</label>
</div>
</div>
</div>

</div>
</div>
</div>
<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('table_product_label', __('lang_v1.product_label') . ':' ) !!}
{!! Form::text('table_product_label', __('sale.product'), ['class' => 'form-control',
'placeholder' => __('lang_v1.product_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('table_qty_label', __('lang_v1.qty_label') . ':' ) !!}
{!! Form::text('table_qty_label', __('lang_v1.quantity'), ['class' => 'form-control',
'placeholder' => __('lang_v1.qty_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('table_unit_price_label', __('lang_v1.unit_price_label') . ':' ) !!}
{!! Form::text('table_unit_price_label', __('sale.unit_price'), ['class' => 'form-control',
'placeholder' => __('lang_v1.unit_price_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('table_subtotal_label', __('lang_v1.subtotal_label') . ':' ) !!}
{!! Form::text('table_subtotal_label', __('sale.subtotal'), ['class' => 'form-control',
'placeholder' => __('lang_v1.subtotal_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('cat_code_label', __('lang_v1.cat_code_label') . ':' ) !!}
{!! Form::text('cat_code_label', 'HSN', ['class' => 'form-control',
'placeholder' => 'HSN or Category Code' ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('total_quantity_label', __('lang_v1.total_quantity_label') . ':' ) !!}
{!! Form::text('common_settings[total_quantity_label]', 'Total Quantity', ['class' => 'form-control',
'placeholder' => __('lang_v1.total_quantity_label'), 'id' => 'total_quantity_label' ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('item_discount_label', __('lang_v1.item_discount_label') . ':' ) !!}
{!! Form::text('common_settings[item_discount_label]', 'Discount', ['class' => 'form-control',
'placeholder' => __('lang_v1.item_discount_label'), 'id' => 'item_discount_label' ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('discounted_unit_price_label', __('lang_v1.discounted_unit_price_label') . ':' ) !!}
{!! Form::text('common_settings[discounted_unit_price_label]', 'Price after discount', ['class' =>
'form-control',
'placeholder' => __('lang_v1.discounted_unit_price_label'), 'id' => 'discounted_unit_price_label' ]); !!}
</div>
</div>

<div class="col-sm-12">
<h4>@lang('lang_v1.product_details_to_be_shown'):</h4>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_brand', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_brand')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_sku', 1, true, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_sku')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_cat_code', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_cat_code')</label>
</div>
</div>
</div>



<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_sale_description', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_sale_description')</label>
</div>
<p class="help-block">@lang('lang_v1.product_imei_or_sn')</p>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_product_description]', 1, false, ['class' => 'input-icheck']);
!!} @lang('lang_v1.show_product_description')</label>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('product_custom_fields[]', 'product_custom_field1', false, ['class' =>
'input-icheck']); !!} {{ $custom_labels['product']['custom_field_1'] ??
__('lang_v1.product_custom_field1') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('product_custom_fields[]', 'product_custom_field2', false, ['class' =>
'input-icheck']); !!} {{ $custom_labels['product']['custom_field_2'] ??
__('lang_v1.product_custom_field2') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('product_custom_fields[]', 'product_custom_field3', false, ['class' =>
'input-icheck']); !!} {{ $custom_labels['product']['custom_field_3'] ??
__('lang_v1.product_custom_field3') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('product_custom_fields[]', 'product_custom_field4', false, ['class' =>
'input-icheck']); !!} {{ $custom_labels['product']['custom_field_4'] ??
__('lang_v1.product_custom_field4') }}</label>
</div>
</div>
</div>
<div class="clearfix"></div>
@if(request()->session()->get('business.enable_product_expiry') == 1)
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_expiry', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_product_expiry')</label>
</div>
</div>
</div>
@endif
@if(request()->session()->get('business.enable_lot_number') == 1)
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_lot', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_lot_number')</label>
</div>
</div>
</div>
@endif

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_image', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_product_image')</label>
</div>
</div>
</div>

<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_warranty_name]', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_warranty_name')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_warranty_exp_date]', 1, false, ['class' => 'input-icheck']);
!!} @lang('lang_v1.show_warranty_exp_date')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_warranty_description]', 1, false, ['class' => 'input-icheck']);
!!} @lang('lang_v1.show_warranty_description')</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_base_unit_details]', 1, false, ['class' => 'input-icheck']);
!!} @lang('lang_v1.show_base_unit_details')</label>
</div>
</div>
</div>

</div>
</div>
</div>
<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_total_label', __('invoice.sub_total_label') . ':' ) !!}
{!! Form::text('sub_total_label', __('sale.subtotal'), ['class' => 'form-control',
'placeholder' => __('invoice.sub_total_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('discount_label', __('invoice.discount_label') . ':' ) !!}
{!! Form::text('discount_label', __('sale.discount'), ['class' => 'form-control',
'placeholder' => __('invoice.discount_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('tax_label', __('invoice.tax_label') . ':' ) !!}
{!! Form::text('tax_label', __('sale.tax'), ['class' => 'form-control',
'placeholder' => __('invoice.tax_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('total_label', __('invoice.total_label') . ':' ) !!}
{!! Form::text('total_label', __('sale.total'), ['class' => 'form-control',
'placeholder' => __('invoice.total_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('total_items_label', __('lang_v1.total_items_label') . ':' ) !!}
{!! Form::text('common_settings[total_items_label]', null, ['class' => 'form-control',
'placeholder' => __('lang_v1.total_items_label'), 'id' => 'total_items_label' ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('round_off_label', __('lang_v1.round_off_label') . ':' ) !!}
{!! Form::text('round_off_label', __('lang_v1.round_off'), ['class' => 'form-control',
'placeholder' => __('lang_v1.round_off_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('total_due_label', __('invoice.total_due_label') . ' (' . __('lang_v1.current_sale') . '):'
) !!}
{!! Form::text('total_due_label', __('report.total_due'), ['class' => 'form-control',
'placeholder' => __('invoice.total_due_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('paid_label', __('invoice.paid_label') . ':' ) !!}
{!! Form::text('paid_label', __('sale.total_paid'), ['class' => 'form-control',
'placeholder' => __('invoice.paid_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_payments', 1, true, ['class' => 'input-icheck']); !!}
@lang('invoice.show_payments')</label>
</div>
</div>
</div>
<!-- Barcode -->
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_barcode', 1, false, ['class' => 'input-icheck']); !!}
@lang('invoice.show_barcode')</label>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('prev_bal_label', __('invoice.total_due_label') . ' (' . __('lang_v1.all_sales') . '):' )
!!}
{!! Form::text('prev_bal_label', '', ['class' => 'form-control',
'placeholder' => __('invoice.total_due_label') ]); !!}
</div>
</div>
<div class="col-sm-5">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_previous_bal', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_previous_bal_due')</label>
@show_tooltip(__('lang_v1.previous_bal_due_help'))
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('change_return_label', __('lang_v1.change_return_label') . ':' ) !!}
@show_tooltip(__('lang_v1.change_return_help'))
{!! Form::text('change_return_label', __('lang_v1.change_return'), ['class' => 'form-control',
'placeholder' => __('lang_v1.change_return_label') ]); !!}
</div>
</div>

<div class="col-sm-3 hide" id="hide_price_div">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[hide_price]', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.hide_all_prices')</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<label>
{!! Form::checkbox('common_settings[show_total_in_words]', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_total_in_words')</label> @show_tooltip(__('lang_v1.show_in_word_help'))
@if(!extension_loaded('intl'))
<p class="help-block">@lang('lang_v1.enable_php_intl_extension')</p>
@endif
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('word_format', __('lang_v1.word_format') . ':') !!}
@show_tooltip(__('lang_v1.word_format_help'))
{!! Form::select('common_settings[num_to_word_format]', ['international' => __('lang_v1.international'),
'indian' => __('lang_v1.indian')], 'international', ['class' => 'form-control', 'id' => 'word_format']); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('tax_summary_label', __('lang_v1.tax_summary_label') . ':' ) !!}
{!! Form::text('common_settings[tax_summary_label]', '', ['class' => 'form-control', 'placeholder' =>
__('lang_v1.tax_summary_label'), 'id' => 'tax_summary_label' ]); !!}
</div>
</div>




</div>
</div>
</div>
<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-6 hide">
<div class="form-group">
{!! Form::label('highlight_color', __('invoice.highlight_color') . ':' ) !!}
{!! Form::text('highlight_color', '#000000', ['class' => 'form-control',
'placeholder' => __('invoice.highlight_color') ]); !!}
</div>
</div>

<div class="clearfix"></div>
<div class="col-md-12 hide">
<hr />
</div>

<div class="col-sm-12">
<div class="form-group">
{!! Form::label('footer_text', __('invoice.footer_text') . ':' ) !!}
{!! Form::textarea('footer_text', null, ['class' => 'form-control',
'placeholder' => __('invoice.footer_text'), 'rows' => 3]); !!}
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<br>
<div class="checkbox">
<label>
{!! Form::checkbox('is_default', 1, false, ['class' => 'input-icheck']); !!}
@lang('barcode.set_as_default')</label>
</div>
</div>
</div>
</div>
</div>
</div>
@component('components.widget', ['class' => 'box-solid', 'title' => __('lang_v1.qr_code')])
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_qr_code', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_qr_code')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_qr_code_label]', 1, false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_labels')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[zatca_qr]', 1, false, ['class' => 'input-icheck', 'id' => 'zatca_qr']);
!!} @lang('lang_v1.zatca_qr')</label>
@show_tooltip(__('lang_v1.zatca_qr_help'))
</div>
</div>
</div>
<div class="col-sm-4" id="zatca_phase_container" style="display: none;">
<div class="form-group">
{!! Form::label('zatca_phase', __('lang_v1.zatca_phase') . ':*') !!}
{!! Form::select('common_settings[zatca_phase]', [
'phase_1' => __('lang_v1.zatca_phase1'),
'phase_2' => __('lang_v1.zatca_phase2'),
],$invoice_layout->common_settings['zatca_phase'] ?? null , ['class' => 'form-control', 'id' => 'zatca_phase']);
!!}
<small id="phase2_message" style="display: none; color: green; font-size: 12px;">
{{ __('lang_v1.phase2_message') }}
</small>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<h4>@lang('lang_v1.fields_to_be_shown'):</h4>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'business_name', false, ['class' => 'input-icheck']); !!}
@lang('business.business_name')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'address', false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.business_location_address')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'tax_1', false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.business_tax_1')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'tax_2', false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.business_tax_2')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'invoice_no', false, ['class' => 'input-icheck']); !!}
@lang('sale.invoice_no')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'invoice_datetime', false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.invoice_datetime')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'subtotal', false, ['class' => 'input-icheck']); !!}
@lang('sale.subtotal')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'total_amount', false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.total_amount_with_tax')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'total_tax', false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.total_tax')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'customer_name', false, ['class' => 'input-icheck']); !!}
@lang('sale.customer_name')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'invoice_url', false, ['class' => 'input-icheck']); !!}
@lang('lang_v1.view_invoice_url')</label>
</div>
</div>
</div>
</div>
@endcomponent

@if(!empty($enabled_modules) && in_array('types_of_service', $enabled_modules) )
@include('types_of_service.invoice_layout_settings')
@endif

<!-- Call restaurant module if defined -->
@include('restaurant.partials.invoice_layout')

@if(Module::has('Repair'))
@include('repair::layouts.partials.invoice_layout_settings')
@endif
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">@lang('lang_v1.layout_credit_note')</h3>
</div>

<div class="box-body">
<div class="row">

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('cn_heading', __('lang_v1.cn_heading') . ':' ) !!}
{!! Form::text('cn_heading', 'Credit Note', ['class' => 'form-control',
'placeholder' => __('lang_v1.cn_heading') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('cn_no_label', __('lang_v1.cn_no_label') . ':' ) !!}
{!! Form::text('cn_no_label', __('purchase.ref_no'), ['class' => 'form-control',
'placeholder' => __('lang_v1.cn_no_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('cn_amount_label', __('lang_v1.cn_amount_label') . ':' ) !!}
{!! Form::text('cn_amount_label', 'Credit Amount', ['class' => 'form-control', 'placeholder' =>
__('lang_v1.cn_amount_label') ]); !!}
</div>
</div>

</div>
</div>
</div>

<div class="row">
<div class="col-sm-12 text-center">
<button type="submit"
class="tw-dw-btn tw-dw-btn-primary tw-text-white tw-dw-btn-lg">@lang('messages.save')</button>
</div>
</div>

{!! Form::close() !!}
</section>
<!-- /.content -->
@stop
@section('javascript')
<script type="text/javascript">
__page_leave_confirmation('#add_invoice_layout_form');
$(document).on('ifChanged', '#show_letter_head', function() {
letter_head_changed();
});

function letter_head_changed() {
if($('#show_letter_head').is(":checked")) {
$('.hide-for-letterhead').addClass('hide');
$('.letter_head_input').removeClass('hide');
} else {
$('.hide-for-letterhead').removeClass('hide');
$('.letter_head_input').addClass('hide');
}
}
</script>
<script>
$(document).ready(function () {
function toggleZatcaPhase() {
if ($('#zatca_qr').is(':checked')) {
$('#zatca_phase_container').fadeIn();
} else {
$('#zatca_phase_container').fadeOut();
}
}

function checkPhaseSelection(){
if ($('#zatca_phase').val() === 'phase_2') {
$('#phase2_message').fadeIn();
} else {
$('#phase2_message').fadeOut();
}
}
// $(document).on('change', '#zatca_qr', function () {
// toggleZatcaPhase();
// });

$('#zatca_qr').on('ifChanged', function(event){
//Check if checkbox is checked or not
toggleZatcaPhase()
});


$('#zatca_phase').on('change', function () {
checkPhaseSelection();
});
});
</script>
@endsection

Add Watermark Section to Edit Form​

In your invoice layout edit form (typically resources/views/invoice_layout/edit.blade.php), add the watermark settings section:

@extends('layouts.app')
@section('title', __('invoice.edit_invoice_layout'))

@section('content')
<style type="text/css">



</style>
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 class="tw-text-xl md:tw-text-3xl tw-font-bold tw-text-black">@lang('invoice.edit_invoice_layout')</h1>
</section>

<!-- Main content -->
<section class="content">
{!! Form::open(['url' => action([\App\Http\Controllers\InvoiceLayoutController::class, 'update'],
[$invoice_layout->id]), 'method' => 'put',
'id' => 'add_invoice_layout_form', 'files' => true]) !!}

@php
$product_custom_fields = !empty($invoice_layout->product_custom_fields) ? $invoice_layout->product_custom_fields : [];
$contact_custom_fields = !empty($invoice_layout->contact_custom_fields) ? $invoice_layout->contact_custom_fields : [];
$location_custom_fields = !empty($invoice_layout->location_custom_fields) ? $invoice_layout->location_custom_fields :
[];
$custom_labels = json_decode(session('business.custom_labels'), true);
@endphp
<div class="box box-solid">
<div class="box-body">
<div class="row">

<div class="col-sm-6">
<div class="form-group">
{!! Form::label('name', __('invoice.layout_name') . ':*') !!}
{!! Form::text('name', $invoice_layout->name, ['class' => 'form-control', 'required',
'placeholder' => __('invoice.layout_name')]); !!}
</div>
</div>

<div class="col-sm-6">
<div class="form-group">
{!! Form::label('design', __('lang_v1.design') . ':*') !!}
{!! Form::select('design', $designs, $invoice_layout->design, ['class' => 'form-control']); !!}
<span class="help-block">
@lang('lang_v1.used_for_browser_based_printing')
</span>
</div>

<div class="form-group @if($invoice_layout->design != 'columnize-taxes') hide @endif" id="columnize-taxes">
<div class="col-md-3">
<input type="text" class="form-control" name="table_tax_headings[]" required="required"
placeholder="tax 1 name" value="{{$invoice_layout->table_tax_headings[0]}}" @if($invoice_layout->design
!= 'columnize-taxes') disabled @endif>
@show_tooltip(__('lang_v1.tooltip_columnize_taxes_heading'))
</div>
<div class="col-md-3">
<input type="text" class="form-control" name="table_tax_headings[]" placeholder="tax 2 name"
value="{{$invoice_layout->table_tax_headings[1]}}" @if($invoice_layout->design != 'columnize-taxes')
disabled @endif>
</div>
<div class="col-md-3">
<input type="text" class="form-control" name="table_tax_headings[]" placeholder="tax 3 name"
value="{{$invoice_layout->table_tax_headings[2]}}" @if($invoice_layout->design != 'columnize-taxes')
disabled @endif>
</div>
<div class="col-md-3">
<input type="text" class="form-control" name="table_tax_headings[]" placeholder="tax 4 name"
value="{{$invoice_layout->table_tax_headings[3]}}" @if($invoice_layout->design != 'columnize-taxes')
disabled @endif>
</div>

</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-6">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_letter_head', 1, $invoice_layout->show_letter_head,
['class' => 'input-icheck', 'id' => 'show_letter_head']); !!}
@lang('lang_v1.show_letter_head')</label>
</div>
</div>
</div>
<div class="col-sm-6 letter_head_input">
<div class="form-group">
{!! Form::label('letter_head', __('lang_v1.letter_head') . ':') !!}
{!! Form::file('letter_head', ['accept' => 'image/*']); !!}
<span class="help-block">@lang('lang_v1.letter_head_help') <br> @lang('lang_v1.invoice_logo_help',
['max_size' => '1 MB']) <br> @lang('lang_v1.letter_head_help2')</span>
</div>
</div>
</div>
<div class="row hide-for-letterhead">
<!-- Logo -->
<div class="col-sm-6">
<div class="form-group">
{!! Form::label('logo', __('invoice.invoice_logo') . ':') !!}
{!! Form::file('logo', ['accept' => 'image/*']); !!}
<span class="help-block">@lang('lang_v1.invoice_logo_help', ['max_size' => '1 MB'])<br>
@lang('lang_v1.invoice_logo_help2')</span>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_logo', 1, $invoice_layout->show_logo, ['class' => 'input-icheck']); !!}
@lang('invoice.show_logo')</label>
</div>
</div>
</div>





<div class="col-sm-12">
<div class="form-group">
{!! Form::label('header_text', __('invoice.header_text') . ':' ) !!}
{!! Form::textarea('header_text', $invoice_layout->header_text, ['class' => 'form-control',
'placeholder' => __('invoice.header_text'), 'rows' => 3]); !!}
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line1', __('lang_v1.sub_heading_line', ['_number_' => 1]) . ':' ) !!}
{!! Form::text('sub_heading_line1', $invoice_layout->sub_heading_line1, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 1]) ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line2', __('lang_v1.sub_heading_line', ['_number_' => 2]) . ':' ) !!}
{!! Form::text('sub_heading_line2', $invoice_layout->sub_heading_line2, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 2]) ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line3', __('lang_v1.sub_heading_line', ['_number_' => 3]) . ':' ) !!}
{!! Form::text('sub_heading_line3', $invoice_layout->sub_heading_line3, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 3]) ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line4', __('lang_v1.sub_heading_line', ['_number_' => 4]) . ':' ) !!}
{!! Form::text('sub_heading_line4', $invoice_layout->sub_heading_line4, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 4]) ]); !!}
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_heading_line5', __('lang_v1.sub_heading_line', ['_number_' => 5]) . ':' ) !!}
{!! Form::text('sub_heading_line5', $invoice_layout->sub_heading_line5, ['class' => 'form-control',
'placeholder' => __('lang_v1.sub_heading_line', ['_number_' => 5]) ]); !!}
</div>
</div>
</div>
</div>
</div>




<div class="box box-solid">
<div class="box-body">
<div class="row">

<!-- Watermark Settings Section -->
<div class="col-sm-12">
<h4>@lang('lang_v1.watermark_settings'):</h4>
</div>

<div class="col-sm-6">
<div class="form-group">
{!! Form::label('watermark_logo', __('lang_v1.watermark_logo') . ':') !!}
{!! Form::file('watermark_logo', ['accept' => 'image/*']); !!}
<span class="help-block">@lang('lang_v1.watermark_logo_help', ['max_size' => '1 MB'])</span>
@if(!empty($invoice_layout->watermark_logo))
<div class="current_logo">
<img src="{{asset('uploads/invoice_logos/' . $invoice_layout->watermark_logo)}}" alt="Current Watermark"
style="max-height: 80px; width: auto;">
<br><small>@lang('lang_v1.current_watermark')</small>
</div>
@endif
</div>
</div>

<div class="col-sm-6">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_watermark', 1, $invoice_layout->show_watermark, ['class' =>
'input-icheck']);
!!} @lang('lang_v1.show_watermark')</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('watermark_width', __('lang_v1.watermark_width') . ':') !!}
{!! Form::number('watermark_width', $invoice_layout->watermark_width ?? 300, ['class' =>
'form-control',
'min' => '50', 'max' => '800', 'placeholder' => '300']); !!}
<span class="help-block">@lang('lang_v1.width_in_pixels')</span>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('watermark_height', __('lang_v1.watermark_height') . ':') !!}
{!! Form::number('watermark_height', $invoice_layout->watermark_height ?? 300, ['class' =>
'form-control',
'min' => '50', 'max' => '800', 'placeholder' => '300']); !!}
<span class="help-block">@lang('lang_v1.height_in_pixels')</span>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('watermark_opacity', __('lang_v1.watermark_opacity') . ':') !!}
{!! Form::select('watermark_opacity', [
'0.05' => '5%',
'0.1' => '10%',
'0.15' => '15%',
'0.2' => '20%',
'0.25' => '25%',
'0.3' => '30%'
], $invoice_layout->watermark_opacity ?? '0.1', ['class' => 'form-control']); !!}
<span class="help-block">@lang('lang_v1.transparency_level')</span>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('watermark_position', __('lang_v1.watermark_position') . ':') !!}
{!! Form::select('watermark_position', [
'center' => __('lang_v1.center'),
'top-left' => __('lang_v1.top_left'),
'top-right' => __('lang_v1.top_right'),
'bottom-left' => __('lang_v1.bottom_left'),
'bottom-right' => __('lang_v1.bottom_right')
], $invoice_layout->watermark_position ?? 'center', ['class' => 'form-control']); !!}
</div>
</div>
</div>
</div>
</div>


<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('invoice_heading', __('invoice.invoice_heading') . ':' ) !!}
{!! Form::text('invoice_heading', $invoice_layout->invoice_heading, ['class' => 'form-control',
'placeholder' => __('invoice.invoice_heading') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('invoice_heading_not_paid', __('invoice.invoice_heading_not_paid') . ':' ) !!}
{!! Form::text('invoice_heading_not_paid', $invoice_layout->invoice_heading_not_paid, ['class' =>
'form-control',
'placeholder' => __('invoice.invoice_heading_not_paid') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('invoice_heading_paid', __('invoice.invoice_heading_paid') . ':' ) !!}
{!! Form::text('invoice_heading_paid', $invoice_layout->invoice_heading_paid, ['class' =>
'form-control',
'placeholder' => __('invoice.invoice_heading_paid') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('proforma_heading', __('lang_v1.proforma_heading') . ':' ) !!}
@show_tooltip(__('lang_v1.tooltip_proforma_heading'))
{!! Form::text('common_settings[proforma_heading]',
!empty($invoice_layout->common_settings['proforma_heading']) ?
$invoice_layout->common_settings['proforma_heading'] : null, ['class' => 'form-control',
'placeholder' => __('lang_v1.proforma_heading'), 'id' => 'proforma_heading' ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('quotation_heading', __('lang_v1.quotation_heading') . ':' )
!!}@show_tooltip(__('lang_v1.tooltip_quotation_heading'))
{!! Form::text('quotation_heading', $invoice_layout->quotation_heading, ['class' => 'form-control',
'placeholder' => __('lang_v1.quotation_heading') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sales_order_heading', __('lang_v1.sales_order_heading') . ':' ) !!}
{!! Form::text('common_settings[sales_order_heading]',
!empty($invoice_layout->common_settings['sales_order_heading']) ?
$invoice_layout->common_settings['sales_order_heading'] : null, ['class' => 'form-control',
'placeholder' => __('lang_v1.sales_order_heading'), 'id' => 'sales_order_heading' ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('invoice_no_prefix', __('invoice.invoice_no_prefix') . ':' ) !!}
{!! Form::text('invoice_no_prefix', $invoice_layout->invoice_no_prefix, ['class' => 'form-control',
'placeholder' => __('invoice.invoice_no_prefix') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('quotation_no_prefix', __('lang_v1.quotation_no_prefix') . ':' ) !!}
{!! Form::text('quotation_no_prefix', $invoice_layout->quotation_no_prefix, ['class' =>
'form-control',
'placeholder' => __('lang_v1.quotation_no_prefix') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('date_label', __('lang_v1.date_label') . ':' ) !!}
{!! Form::text('date_label', $invoice_layout->date_label, ['class' => 'form-control',
'placeholder' => __('lang_v1.date_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('due_date_label', __('lang_v1.due_date_label') . ':' ) !!}
{!! Form::text('common_settings[due_date_label]',
!empty($invoice_layout->common_settings['due_date_label'])
? $invoice_layout->common_settings['due_date_label'] : null, ['class' => 'form-control',
'placeholder' => __('lang_v1.due_date_label'), 'id' => 'due_date_label' ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_due_date]', 1,
!empty($invoice_layout->common_settings['show_due_date']), ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_due_date')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('date_time_format', __('lang_v1.date_time_format') . ':' ) !!}
{!! Form::text('date_time_format', $invoice_layout->date_time_format, ['class' => 'form-control',
'placeholder' => __('lang_v1.date_time_format') ]); !!}
<p class="help-block">{!! __('lang_v1.date_time_format_help') !!}</p>
</div>
</div>
@php
$sell_custom_field_1_label = !empty($custom_labels['sell']['custom_field_1']) ?
$custom_labels['sell']['custom_field_1'] : '';

$sell_custom_field_2_label = !empty($custom_labels['sell']['custom_field_2']) ?
$custom_labels['sell']['custom_field_2'] : '';

$sell_custom_field_3_label = !empty($custom_labels['sell']['custom_field_3']) ?
$custom_labels['sell']['custom_field_3'] : '';

$sell_custom_field_4_label = !empty($custom_labels['sell']['custom_field_4']) ?
$custom_labels['sell']['custom_field_4'] : '';
@endphp
@if (!empty($sell_custom_field_1_label))
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[sell_custom_fields1]', 1,
!empty($invoice_layout->common_settings['sell_custom_fields1']), ['class' => 'input-icheck']); !!}
{{
$custom_labels['sell']['custom_field_1'] ?? __('lang_v1.product_custom_field1') }}</label>
</div>
</div>
</div>
@endif
@if (!empty($sell_custom_field_2_label))
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[sell_custom_fields2]', 1,
!empty($invoice_layout->common_settings['sell_custom_fields2']), ['class' => 'input-icheck']); !!}
{{
$custom_labels['sell']['custom_field_2'] ?? __('lang_v1.product_custom_field2') }}</label>
</div>
</div>
</div>
@endif
@if (!empty($sell_custom_field_3_label))
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[sell_custom_fields3]', 1,
!empty($invoice_layout->common_settings['sell_custom_fields3']), ['class' => 'input-icheck']); !!}
{{
$custom_labels['sell']['custom_field_3'] ?? __('lang_v1.product_custom_field3') }}</label>
</div>
</div>
</div>
@endif
@if (!empty($sell_custom_field_4_label))
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[sell_custom_fields4]', 1,
!empty($invoice_layout->common_settings['sell_custom_fields4']), ['class' => 'input-icheck']); !!}
{{
$custom_labels['sell']['custom_field_4'] ?? __('lang_v1.product_custom_field4') }}</label>
</div>
</div>
</div>
@endif
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sales_person_label', __('lang_v1.sales_person_label') . ':' ) !!}
{!! Form::text('sales_person_label', $invoice_layout->sales_person_label, ['class' => 'form-control',
'placeholder' => __('lang_v1.sales_person_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('commission_agent_label', __('lang_v1.commission_agent_label') . ':' ) !!}
{!! Form::text('commission_agent_label', $invoice_layout->commission_agent_label, ['class' =>
'form-control',
'placeholder' => __('lang_v1.commission_agent_label') ]); !!}
</div>
</div>
<div class="clearfix"></div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_business_name', 1, $invoice_layout->show_business_name, ['class' =>
'input-icheck']); !!} @lang('invoice.show_business_name')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_location_name', 1, $invoice_layout->show_location_name, ['class' =>
'input-icheck']); !!} @lang('invoice.show_location_name')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_sales_person', 1, $invoice_layout->show_sales_person, ['class' =>
'input-icheck']); !!} @lang('lang_v1.show_sales_person')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_commission_agent', 1, $invoice_layout->show_commission_agent, ['class' =>
'input-icheck']); !!} @lang('lang_v1.show_commission_agent')</label>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-12">
<h4>@lang('lang_v1.fields_for_customer_details'):</h4>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_customer', 1, $invoice_layout->show_customer, ['class' =>
'input-icheck']); !!}
@lang('invoice.show_customer')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('customer_label', __('invoice.customer_label') . ':' ) !!}
{!! Form::text('customer_label', $invoice_layout->customer_label, ['class' => 'form-control',
'placeholder' => __('invoice.customer_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_client_id', 1, $invoice_layout->show_client_id, ['class' =>
'input-icheck']);
!!} @lang('lang_v1.show_client_id')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('client_id_label', __('lang_v1.client_id_label') . ':' ) !!}
{!! Form::text('client_id_label', $invoice_layout->client_id_label, ['class' => 'form-control',
'placeholder' => __('lang_v1.client_id_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('client_tax_label', __('lang_v1.client_tax_label') . ':' ) !!}
{!! Form::text('client_tax_label', $invoice_layout->client_tax_label, ['class' => 'form-control',
'placeholder' => __('lang_v1.client_tax_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_reward_point', 1, $invoice_layout->show_reward_point, ['class' =>
'input-icheck']); !!} @lang('lang_v1.show_reward_point')</label>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('contact_custom_fields[]', 'custom_field1', in_array('custom_field1',
$contact_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['contact']['custom_field_1'] ?? __('lang_v1.contact_custom_field1') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('contact_custom_fields[]', 'custom_field2', in_array('custom_field2',
$contact_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['contact']['custom_field_2'] ?? __('lang_v1.contact_custom_field2') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('contact_custom_fields[]', 'custom_field3', in_array('custom_field3',
$contact_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['contact']['custom_field_3'] ?? __('lang_v1.contact_custom_field3') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('contact_custom_fields[]', 'custom_field4', in_array('custom_field4',
$contact_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['contact']['custom_field_4'] ?? __('lang_v1.contact_custom_field4') }}</label>
</div>
</div>
</div>

</div>
<div class="row hide-for-letterhead">
<div class="col-sm-12">
<h4>@lang('invoice.fields_to_be_shown_in_address'):</h4>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_landmark', 1, $invoice_layout->show_landmark, ['class' =>
'input-icheck']); !!}
@lang('business.landmark')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_city', 1, $invoice_layout->show_city, ['class' => 'input-icheck']); !!}
@lang('business.city')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_state', 1, $invoice_layout->show_state, ['class' => 'input-icheck']); !!}
@lang('business.state')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_country', 1, $invoice_layout->show_country, ['class' => 'input-icheck']);
!!}
@lang('business.country')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_zip_code', 1, $invoice_layout->show_zip_code, ['class' =>
'input-icheck']); !!}
@lang('business.zip_code')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('location_custom_fields[]', 'custom_field1', in_array('custom_field1',
$location_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['location']['custom_field_1'] ?? __('lang_v1.location_custom_field1') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('location_custom_fields[]', 'custom_field2', in_array('custom_field2',
$location_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['location']['custom_field_2'] ?? __('lang_v1.location_custom_field2') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('location_custom_fields[]', 'custom_field3', in_array('custom_field3',
$location_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['location']['custom_field_3'] ?? __('lang_v1.location_custom_field3') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('location_custom_fields[]', 'custom_field4', in_array('custom_field4',
$location_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['location']['custom_field_4'] ?? __('lang_v1.location_custom_field4') }}</label>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label>@lang('invoice.fields_to_shown_for_communication'):</label>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_mobile_number', 1, $invoice_layout->show_mobile_number, ['class' =>
'input-icheck']); !!} @lang('invoice.show_mobile_number')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_alternate_number', 1, $invoice_layout->show_alternate_number, ['class' =>
'input-icheck']); !!} @lang('invoice.show_alternate_number')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_email', 1, $invoice_layout->show_email, ['class' => 'input-icheck']); !!}
@lang('invoice.show_email')</label>
</div>
</div>
</div>

<div class="col-sm-12">
<div class="form-group">
<label>@lang('invoice.fields_to_shown_for_tax'):</label>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_tax_1', 1, $invoice_layout->show_tax_1, ['class' => 'input-icheck']); !!}
@lang('invoice.show_tax_1')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_tax_2', 1, $invoice_layout->show_tax_2, ['class' => 'input-icheck']); !!}
@lang('invoice.show_tax_2')</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('table_product_label', __('lang_v1.product_label') . ':' ) !!}
{!! Form::text('table_product_label', $invoice_layout->table_product_label, ['class' =>
'form-control',
'placeholder' => __('lang_v1.product_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('table_qty_label', __('lang_v1.qty_label') . ':' ) !!}
{!! Form::text('table_qty_label', $invoice_layout->table_qty_label, ['class' => 'form-control',
'placeholder' => __('lang_v1.qty_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('table_unit_price_label', __('lang_v1.unit_price_label') . ':' ) !!}
{!! Form::text('table_unit_price_label', $invoice_layout->table_unit_price_label, ['class' =>
'form-control',
'placeholder' => __('lang_v1.unit_price_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('table_subtotal_label', __('lang_v1.subtotal_label') . ':' ) !!}
{!! Form::text('table_subtotal_label', $invoice_layout->table_subtotal_label, ['class' =>
'form-control',
'placeholder' => __('lang_v1.subtotal_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('cat_code_label', __('lang_v1.cat_code_label') . ':' ) !!}
{!! Form::text('cat_code_label', $invoice_layout->cat_code_label, ['class' => 'form-control',
'placeholder'
=> 'HSN or Category Code' ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('total_quantity_label', __('lang_v1.total_quantity_label') . ':' ) !!}
{!! Form::text('common_settings[total_quantity_label]',
!empty($invoice_layout->common_settings['total_quantity_label']) ?
$invoice_layout->common_settings['total_quantity_label'] : null, ['class' => 'form-control',
'placeholder' => __('lang_v1.total_quantity_label'), 'id' => 'total_quantity_label' ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('item_discount_label', __('lang_v1.item_discount_label') . ':' ) !!}
{!! Form::text('common_settings[item_discount_label]',
!empty($invoice_layout->common_settings['item_discount_label']) ?
$invoice_layout->common_settings['item_discount_label'] : null, ['class' => 'form-control',
'placeholder' => __('lang_v1.item_discount_label'), 'id' => 'item_discount_label' ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('discounted_unit_price_label', __('lang_v1.discounted_unit_price_label') . ':' ) !!}
{!! Form::text('common_settings[discounted_unit_price_label]',
!empty($invoice_layout->common_settings['discounted_unit_price_label']) ?
$invoice_layout->common_settings['discounted_unit_price_label'] : null, ['class' => 'form-control',
'placeholder' => __('lang_v1.discounted_unit_price_label'), 'id' => 'discounted_unit_price_label' ]);
!!}
</div>
</div>

<div class="col-sm-12">
<h4>@lang('lang_v1.product_details_to_be_shown'):</h4>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_brand', 1, $invoice_layout->show_brand, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_brand')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_sku', 1, $invoice_layout->show_sku, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_sku')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_cat_code', 1, $invoice_layout->show_cat_code, ['class' =>
'input-icheck']); !!}
@lang('lang_v1.show_cat_code')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_sale_description', 1, $invoice_layout->show_sale_description, ['class' =>
'input-icheck']); !!} @lang('lang_v1.show_sale_description')</label>
</div>
<p class="help-block">@lang('lang_v1.product_imei_or_sn')</p>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_product_description]', 1,
!empty($invoice_layout->common_settings['show_product_description']), ['class' =>
'input-icheck']); !!}
@lang('lang_v1.show_product_description')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('product_custom_fields[]', 'product_custom_field1',
in_array('product_custom_field1',
$product_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['product']['custom_field_1'] ?? __('lang_v1.product_custom_field1') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('product_custom_fields[]', 'product_custom_field2',
in_array('product_custom_field2',
$product_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['product']['custom_field_2'] ?? __('lang_v1.product_custom_field2') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('product_custom_fields[]', 'product_custom_field3',
in_array('product_custom_field3',
$product_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['product']['custom_field_3'] ?? __('lang_v1.product_custom_field3') }}</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('product_custom_fields[]', 'product_custom_field4',
in_array('product_custom_field4',
$product_custom_fields), ['class' => 'input-icheck']); !!} {{
$custom_labels['product']['custom_field_4'] ?? __('lang_v1.product_custom_field4') }}</label>
</div>
</div>
</div>
<div class="clearfix"></div>
@if(request()->session()->get('business.enable_product_expiry') == 1)
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_expiry', 1, $invoice_layout->show_expiry, ['class' => 'input-icheck']);
!!}
@lang('lang_v1.show_product_expiry')</label>
</div>
</div>
</div>
@endif
@if(request()->session()->get('business.enable_lot_number') == 1)
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_lot', 1, $invoice_layout->show_lot, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_lot_number')</label>
</div>
</div>
</div>
@endif

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_image', 1, !empty($invoice_layout->show_image), ['class' =>
'input-icheck']);
!!} @lang('lang_v1.show_product_image')</label>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_warranty_name]', 1,
!empty($invoice_layout->common_settings['show_warranty_name']), ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_warranty_name')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_warranty_exp_date]', 1,
!empty($invoice_layout->common_settings['show_warranty_exp_date']), ['class' => 'input-icheck']);
!!}
@lang('lang_v1.show_warranty_exp_date')</label>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_warranty_description]', 1,
!empty($invoice_layout->common_settings['show_warranty_description']), ['class' =>
'input-icheck']); !!}
@lang('lang_v1.show_warranty_description')</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_base_unit_details]', 1,
!empty($invoice_layout->common_settings['show_base_unit_details']), ['class' => 'input-icheck']);
!!}
@lang('lang_v1.show_base_unit_details')</label>
</div>
</div>
</div>

</div>

</div>
</div>
<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('sub_total_label', __('invoice.sub_total_label') . ':' ) !!}
{!! Form::text('sub_total_label', $invoice_layout->sub_total_label, ['class' => 'form-control',
'placeholder' => __('invoice.sub_total_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('discount_label', __('invoice.discount_label') . ':' ) !!}
{!! Form::text('discount_label', $invoice_layout->discount_label, ['class' => 'form-control',
'placeholder' => __('invoice.discount_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('tax_label', __('invoice.tax_label') . ':' ) !!}
{!! Form::text('tax_label', $invoice_layout->tax_label, ['class' => 'form-control',
'placeholder' => __('invoice.tax_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('total_label', __('invoice.total_label') . ':' ) !!}
{!! Form::text('total_label', $invoice_layout->total_label, ['class' => 'form-control',
'placeholder' => __('invoice.total_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('total_items_label', __('lang_v1.total_items_label') . ':' ) !!}
{!! Form::text('common_settings[total_items_label]',
!empty($invoice_layout->common_settings['total_items_label']) ?
$invoice_layout->common_settings['total_items_label'] : null, ['class' => 'form-control',
'placeholder' => __('lang_v1.total_items_label'), 'id' => 'total_items_label' ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('round_off_label', __('lang_v1.round_off_label') . ':' ) !!}
{!! Form::text('round_off_label', $invoice_layout->round_off_label, ['class' => 'form-control',
'placeholder' => __('lang_v1.round_off_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('total_due_label', __('invoice.total_due_label') . ' (' . __('lang_v1.current_sale') .
'):'
) !!}
{!! Form::text('total_due_label', $invoice_layout->total_due_label, ['class' => 'form-control',
'placeholder' => __('invoice.total_due_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('paid_label', __('invoice.paid_label') . ':' ) !!}
{!! Form::text('paid_label', $invoice_layout->paid_label, ['class' => 'form-control',
'placeholder' => __('invoice.paid_label') ]); !!}
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_payments', 1, $invoice_layout->show_payments, ['class' =>
'input-icheck']); !!}
@lang('invoice.show_payments')</label>
</div>
</div>
</div>

<!-- Barcode -->
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_barcode', 1, $invoice_layout->show_barcode, ['class' => 'input-icheck']);
!!}
@lang('invoice.show_barcode')</label>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('prev_bal_label', __('invoice.total_due_label') . ' (' . __('lang_v1.all_sales') .
'):' )
!!}
{!! Form::text('prev_bal_label', $invoice_layout->prev_bal_label, ['class' => 'form-control',
'placeholder' => __('invoice.total_due_label') ]); !!}
</div>
</div>
<div class="col-sm-5">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_previous_bal', 1, $invoice_layout->show_previous_bal, ['class' =>
'input-icheck']); !!} @lang('lang_v1.show_previous_bal_due')</label>
@show_tooltip(__('lang_v1.previous_bal_due_help'))
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
{!! Form::label('change_return_label', __('lang_v1.change_return_label') . ':' ) !!}
@show_tooltip(__('lang_v1.change_return_help'))
{!! Form::text('change_return_label', $invoice_layout->change_return_label, ['class' =>
'form-control',
'placeholder' => __('lang_v1.change_return_label') ]); !!}
</div>
</div>
<div class="col-sm-3 @if($invoice_layout->design != 'slim') hide @endif" id="hide_price_div">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[hide_price]', 1,
!empty($invoice_layout->common_settings['hide_price']), ['class' => 'input-icheck']); !!}
@lang('lang_v1.hide_all_prices')</label>
</div>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<label>
{!! Form::checkbox('common_settings[show_total_in_words]', 1,
!empty($invoice_layout->common_settings['show_total_in_words']), ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_total_in_words')</label> @show_tooltip(__('lang_v1.show_in_word_help'))
@if(!extension_loaded('intl'))
<p class="help-block">@lang('lang_v1.enable_php_intl_extension')</p>
@endif
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::label('word_format', __('lang_v1.word_format') . ':') !!}
@show_tooltip(__('lang_v1.word_format_help'))
{!! Form::select('common_settings[num_to_word_format]', ['international' =>
__('lang_v1.international'),
'indian' => __('lang_v1.indian')], $invoice_layout->common_settings['num_to_word_format'] ??
'international', ['class' => 'form-control', 'id' => 'word_format']); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('tax_summary_label', __('lang_v1.tax_summary_label') . ':' ) !!}
{!! Form::text('common_settings[tax_summary_label]',
!empty($invoice_layout->common_settings['tax_summary_label']) ?
$invoice_layout->common_settings['tax_summary_label'] : null, ['class' => 'form-control',
'placeholder' =>
__('lang_v1.tax_summary_label'), 'id' => 'tax_summary_label' ]); !!}
</div>
</div>

</div>
</div>
</div>
<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-12">

<div class="col-sm-6 hide">
<div class="form-group">
{!! Form::label('highlight_color', __('invoice.highlight_color') . ':' ) !!}
{!! Form::text('highlight_color', $invoice_layout->highlight_color, ['class' => 'form-control',
'placeholder' => __('invoice.highlight_color') ]); !!}
</div>
</div>

<div class="clearfix"></div>
<div class="col-md-12 hide">
<hr />
</div>

<div class="col-sm-12">
<div class="form-group">
{!! Form::label('footer_text', __('invoice.footer_text') . ':' ) !!}
{!! Form::textarea('footer_text', $invoice_layout->footer_text, ['class' => 'form-control',
'placeholder' => __('invoice.footer_text'), 'rows' => 3]); !!}
</div>
</div>
@if(empty($invoice_layout->is_default))
<div class="col-sm-6">
<div class="form-group">
<br>
<div class="checkbox">
<label>
{!! Form::checkbox('is_default', 1, $invoice_layout->is_default, ['class' => 'input-icheck']);
!!}
@lang('barcode.set_as_default')</label>
</div>
</div>
</div>
@endif

</div>
</div>
</div>
</div>


@component('components.widget', ['class' => 'box-solid', 'title' => __('lang_v1.qr_code')])
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('show_qr_code', 1, $invoice_layout->show_qr_code, ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_qr_code')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[show_qr_code_label]', 1,
!empty($invoice_layout->common_settings['show_qr_code_label']), ['class' => 'input-icheck']); !!}
@lang('lang_v1.show_labels')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('common_settings[zatca_qr]', 1,
!empty($invoice_layout->common_settings['zatca_qr']),
['class' => 'input-icheck', 'id' => 'zatca_qr']); !!} @lang('lang_v1.zatca_qr')</label>
@show_tooltip(__('lang_v1.zatca_qr_help'))
</div>
</div>
</div>
<div class="col-sm-4" id="zatca_phase_container" style="display: none;">
<div class="form-group">
{!! Form::label('zatca_phase', __('lang_v1.zatca_phase') . ':*') !!}
{!! Form::select('common_settings[zatca_phase]', [
'phase_1' => __('lang_v1.zatca_phase1'),
'phase_2' => __('lang_v1.zatca_phase2'),
],$invoice_layout->common_settings['zatca_phase'] ?? null , ['class' => 'form-control', 'id' =>
'zatca_phase']);
!!}
<small id="phase2_message" style="display: none; color: green; font-size: 12px;">
{{ __('lang_v1.phase2_message') }}
</small>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<h4>@lang('lang_v1.fields_to_be_shown'):</h4>
</div>
@php
$qr_code_fields = empty($invoice_layout->qr_code_fields) ? [] : $invoice_layout->qr_code_fields;
@endphp
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'business_name', in_array('business_name', $qr_code_fields),
['class'
=> 'input-icheck']); !!} @lang('business.business_name')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'address', in_array('address', $qr_code_fields), ['class' =>
'input-icheck']); !!} @lang('lang_v1.business_location_address')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'tax_1', in_array('tax_1', $qr_code_fields), ['class' =>
'input-icheck']); !!} @lang('lang_v1.business_tax_1')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'tax_2', in_array('tax_2', $qr_code_fields), ['class' =>
'input-icheck']); !!} @lang('lang_v1.business_tax_2')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'invoice_no', in_array('invoice_no', $qr_code_fields), ['class'
=>
'input-icheck']); !!} @lang('sale.invoice_no')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'invoice_datetime', in_array('invoice_datetime',
$qr_code_fields),
['class' => 'input-icheck']); !!} @lang('lang_v1.invoice_datetime')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'subtotal', in_array('subtotal', $qr_code_fields), ['class' =>
'input-icheck']); !!} @lang('sale.subtotal')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'total_amount', in_array('total_amount', $qr_code_fields),
['class'
=> 'input-icheck']); !!} @lang('lang_v1.total_amount_with_tax')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'total_tax', in_array('total_tax', $qr_code_fields), ['class'
=>
'input-icheck']); !!} @lang('lang_v1.total_tax')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'customer_name', in_array('customer_name', $qr_code_fields),
['class'
=> 'input-icheck']); !!} @lang('sale.customer_name')</label>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="checkbox">
<label>
{!! Form::checkbox('qr_code_fields[]', 'invoice_url', in_array('invoice_url', $qr_code_fields),
['class' =>
'input-icheck']); !!} @lang('lang_v1.view_invoice_url')</label>
</div>
</div>
</div>

</div>
@endcomponent
@if(!empty($enabled_modules) && in_array('types_of_service', $enabled_modules) )
@include('types_of_service.invoice_layout_settings', ['module_info' => $invoice_layout->module_info])
@endif
<!-- Call restaurant module if defined -->
@include('restaurant.partials.invoice_layout', ['module_info' => $invoice_layout->module_info, 'edit_il' =>
true])

@if(Module::has('Repair'))
@include('repair::layouts.partials.invoice_layout_settings', ['module_info' => $invoice_layout->module_info,
'edit_il'
=> true])
@endif


<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">@lang('lang_v1.layout_credit_note')</h3>
</div>

<div class="box-body">
<div class="row">

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('cn_heading', __('lang_v1.cn_heading') . ':' ) !!}
{!! Form::text('cn_heading', $invoice_layout->cn_heading, ['class' => 'form-control', 'placeholder' =>
__('lang_v1.cn_heading') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('cn_no_label', __('lang_v1.cn_no_label') . ':' ) !!}
{!! Form::text('cn_no_label', $invoice_layout->cn_no_label, ['class' => 'form-control', 'placeholder'
=>
__('lang_v1.cn_no_label') ]); !!}
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
{!! Form::label('cn_amount_label', __('lang_v1.cn_amount_label') . ':' ) !!}
{!! Form::text('cn_amount_label', $invoice_layout->cn_amount_label, ['class' => 'form-control',
'placeholder' => __('lang_v1.cn_amount_label') ]); !!}
</div>
</div>

</div>
</div>
</div>

<div class="row">
<div class="col-sm-12 text-center">
<button type="submit"
class="tw-dw-btn tw-dw-btn-primary tw-text-white tw-dw-btn-lg">@lang('messages.update')</button>
</div>
</div>

{!! Form::close() !!}
</section>
<!-- /.content -->
@stop
@section('javascript')
<script type="text/javascript">
__page_leave_confirmation('#add_invoice_layout_form');
$(document).on('ifChanged', '#show_letter_head', function() {
letter_head_changed();
});

function letter_head_changed() {
if($('#show_letter_head').is(":checked")) {
$('.hide-for-letterhead').addClass('hide');
$('.letter_head_input').removeClass('hide');
} else {
$('.hide-for-letterhead').removeClass('hide');
$('.letter_head_input').addClass('hide');
}
}

$(document).ready(function(){
letter_head_changed();
})
</script>
<script>
$(document).ready(function () {
function toggleZatcaPhase() {
if ($('#zatca_qr').is(':checked')) {
$('#zatca_phase_container').fadeIn();
} else {
$('#zatca_phase_container').fadeOut();
}
}

function checkPhaseSelection(){
if ($('#zatca_phase').val() === 'phase_2') {
$('#phase2_message').fadeIn();
} else {
$('#phase2_message').fadeOut();
}
}
// Initial check on page load
toggleZatcaPhase();
checkPhaseSelection();

$('#zatca_qr').on('ifChanged', function(event){
//Check if checkbox is checked or not
toggleZatcaPhase()
});

$('#zatca_phase').on('change', function () {
checkPhaseSelection();
});
});
</script>
@endsection

Step 6: Update Receipt Details Method​

Modify getReceiptDetails Method​

Update the app/Utils/TransactionUtil.php: getReceiptDetails method to include watermark data:

    public function getReceiptDetails($transaction_id, $location_id, $invoice_layout, $business_details, $location_details, $receipt_printer_type)
{
$il = $invoice_layout;

$transaction = Transaction::find($transaction_id);
$transaction_type = $transaction->type;

$output = [
'header_text' => isset($il->header_text) ? $il->header_text : '',
'business_name' => ($il->show_business_name == 1) ? $business_details->name : '',
'location_name' => ($il->show_location_name == 1) ? $location_details->name : '',
'sub_heading_line1' => trim($il->sub_heading_line1),
'sub_heading_line2' => trim($il->sub_heading_line2),
'sub_heading_line3' => trim($il->sub_heading_line3),
'sub_heading_line4' => trim($il->sub_heading_line4),
'sub_heading_line5' => trim($il->sub_heading_line5),
'table_product_label' => $il->table_product_label,
'table_qty_label' => $il->table_qty_label,
'table_unit_price_label' => $il->table_unit_price_label,
'table_subtotal_label' => $il->table_subtotal_label,
];

//Display name
$output['display_name'] = $output['business_name'];
if (! empty($output['location_name'])) {
if (! empty($output['display_name'])) {
$output['display_name'] .= ', ';
}
$output['display_name'] .= $output['location_name'];
}

//Codes
if (! empty($business_details->code_label_1) && ! empty($business_details->code_1)) {
$output['code_label_1'] = $business_details->code_label_1;
$output['code_1'] = $business_details->code_1;
}

if (! empty($business_details->code_label_1) && ! empty($business_details->code_1)) {
$output['code_label_2'] = $business_details->code_label_2;
$output['code_2'] = $business_details->code_2;
}

if ($il->show_letter_head == 1) {
$output['letter_head'] = ! empty($il->letter_head) &&
file_exists(public_path('uploads/invoice_logos/' . $il->letter_head)) ?
asset('uploads/invoice_logos/' . $il->letter_head) : null;
}

//Logo
$output['logo'] = $il->show_logo != 0 && ! empty($il->logo) && file_exists(public_path('uploads/invoice_logos/' . $il->logo)) ? asset('uploads/invoice_logos/' . $il->logo) : false;
//Watermark
$output['watermark_logo'] = null;
$output['show_watermark'] = false;
$output['watermark_width'] = 300;
$output['watermark_height'] = 300;
$output['watermark_opacity'] = '0.1';
$output['watermark_position'] = 'center';

if ($il->show_watermark == 1 && !empty($il->watermark_logo) && file_exists(public_path('uploads/invoice_logos/' . $il->watermark_logo))) {
$output['watermark_logo'] = $il->watermark_logo;
$output['show_watermark'] = true;
$output['watermark_width'] = $il->watermark_width ?? 300;
$output['watermark_height'] = $il->watermark_height ?? 300;
$output['watermark_opacity'] = $il->watermark_opacity ?? '0.1';
$output['watermark_position'] = $il->watermark_position ?? 'center';
}
//Address
$output['address'] = '';
$temp = [];
if ($il->show_landmark == 1) {
$temp[] = $location_details->landmark;
}
if ($il->show_city == 1 && ! empty($location_details->city)) {
$temp[] = $location_details->city;
}
if ($il->show_state == 1 && ! empty($location_details->state)) {
$temp[] = $location_details->state;
}
if ($il->show_zip_code == 1 && ! empty($location_details->zip_code)) {
$temp[] = $location_details->zip_code;
}
if ($il->show_country == 1 && ! empty($location_details->country)) {
$temp[] = $location_details->country;
}
if (! empty($temp)) {
$output['address'] .= implode(', ', $temp);
}

$output['website'] = $location_details->website;
$output['location_custom_fields'] = '';
$temp = [];
$location_custom_field_settings = ! empty($il->location_custom_fields) ? $il->location_custom_fields : [];
if (! empty($location_details->custom_field1) && in_array('custom_field1', $location_custom_field_settings)) {
$temp[] = $location_details->custom_field1;
}
if (! empty($location_details->custom_field2) && in_array('custom_field2', $location_custom_field_settings)) {
$temp[] = $location_details->custom_field2;
}
if (! empty($location_details->custom_field3) && in_array('custom_field3', $location_custom_field_settings)) {
$temp[] = $location_details->custom_field3;
}
if (! empty($location_details->custom_field4) && in_array('custom_field4', $location_custom_field_settings)) {
$temp[] = $location_details->custom_field4;
}
if (! empty($temp)) {
$output['location_custom_fields'] .= implode(', ', $temp);
}

//Tax Info
if ($il->show_tax_1 == 1 && ! empty($business_details->tax_number_1)) {
$output['tax_label1'] = ! empty($business_details->tax_label_1) ? $business_details->tax_label_1 . ': ' : '';

$output['tax_info1'] = $business_details->tax_number_1;
}
if ($il->show_tax_2 == 1 && ! empty($business_details->tax_number_2)) {
if (! empty($output['tax_info1'])) {
$output['tax_info1'] .= ', ';
}

$output['tax_label2'] = ! empty($business_details->tax_label_2) ? $business_details->tax_label_2 . ': ' : '';

$output['tax_info2'] = $business_details->tax_number_2;
}

//Shop Contact Info
$output['contact'] = '';
if ($il->show_mobile_number == 1 && ! empty($location_details->mobile)) {
$output['contact'] .= '<b>' . __('contact.mobile') . ':</b> ' . $location_details->mobile;
}
if ($il->show_alternate_number == 1 && ! empty($location_details->alternate_number)) {
if (empty($output['contact'])) {
$output['contact'] .= __('contact.mobile') . ': ' . $location_details->alternate_number;
} else {
$output['contact'] .= ', ' . $location_details->alternate_number;
}
}
if ($il->show_email == 1 && ! empty($location_details->email)) {
if (! empty($output['contact'])) {
$output['contact'] .= "\n";
}
$output['contact'] .= '<br>' . __('business.email') . ': ' . $location_details->email;
}

//Customer show_customer
$customer = Contact::find($transaction->contact_id);

$output['customer_info'] = '';
$output['customer_tax_number'] = '';
$output['customer_tax_label'] = '';
$output['customer_custom_fields'] = '';
if ($il->show_customer == 1) {
$output['customer_label'] = ! empty($il->customer_label) ? $il->customer_label : '';
$output['customer_name'] = ! empty($customer->name) ? $customer->name : $customer->supplier_business_name;
$output['customer_mobile'] = $customer->mobile;

if ($receipt_printer_type != 'printer') {
$output['customer_info'] .= $customer->contact_address;
if (! empty($customer->contact_address)) {
$output['customer_info'] .= '<br>';
}
$output['customer_info'] .= '<b>' . __('contact.mobile') . '</b>: ' . $customer->mobile;
if (! empty($customer->landline)) {
$output['customer_info'] .= ', ' . $customer->landline;
}
}

$output['customer_tax_number'] = $customer->tax_number;
$output['customer_tax_label'] = ! empty($il->client_tax_label) ? $il->client_tax_label : '';

$temp = [];
$customer_custom_fields_settings = ! empty($il->contact_custom_fields) ? $il->contact_custom_fields : [];
$contact_custom_labels = $this->getCustomLabels($business_details, 'contact');
if (! empty($customer->custom_field1) && in_array('custom_field1', $customer_custom_fields_settings)) {
if (! empty($contact_custom_labels['custom_field_1'])) {
$temp[] = $contact_custom_labels['custom_field_1'] . ': ' . $customer->custom_field1;
} else {
$temp[] = $customer->custom_field1;
}
}
if (! empty($customer->custom_field2) && in_array('custom_field2', $customer_custom_fields_settings)) {
if (! empty($contact_custom_labels['custom_field_2'])) {
$temp[] = $contact_custom_labels['custom_field_2'] . ': ' . $customer->custom_field2;
} else {
$temp[] = $customer->custom_field2;
}
}
if (! empty($customer->custom_field3) && in_array('custom_field3', $customer_custom_fields_settings)) {
if (! empty($contact_custom_labels['custom_field_3'])) {
$temp[] = $contact_custom_labels['custom_field_3'] . ': ' . $customer->custom_field3;
} else {
$temp[] = $customer->custom_field3;
}
}
if (! empty($customer->custom_field4) && in_array('custom_field4', $customer_custom_fields_settings)) {
if (! empty($contact_custom_labels['custom_field_4'])) {
$temp[] = $contact_custom_labels['custom_field_4'] . ': ' . $customer->custom_field4;
} else {
$temp[] = $customer->custom_field1;
}
}
if (! empty($temp)) {
$output['customer_custom_fields'] .= implode('<br>', $temp);
}

//To be used in pdfs
$customer_address = [];
if (! empty($customer->supplier_business_name)) {
$customer_address[] = $customer->supplier_business_name;
}
if (! empty($customer->address_line_1)) {
$customer_address[] = '<br>' . $customer->address_line_1;
}
if (! empty($customer->address_line_2)) {
$customer_address[] = '<br>' . $customer->address_line_2;
}
if (! empty($customer->city)) {
$customer_address[] = '<br>' . $customer->city;
}
if (! empty($customer->state)) {
$customer_address[] = $customer->state;
}
if (! empty($customer->country)) {
$customer_address[] = $customer->country;
}
if (! empty($customer->zip_code)) {
$customer_address[] = '<br>' . $customer->zip_code;
}
if (! empty(trim($customer->name))) {
$customer_address[] = '<br>' . $customer->name;
}
if (! empty($customer->mobile)) {
$customer_address[] = '<br>' . $customer->mobile;
}
if (! empty($customer->landline)) {
$customer_address[] = $customer->landline;
}

$output['customer_info_address'] = '';
if (! empty($customer_address)) {
$output['customer_info_address'] = implode(', ', $customer_address);
}
}

if ($il->show_reward_point == 1) {
$output['customer_rp_label'] = $business_details->rp_name;
$output['customer_total_rp'] = $customer->total_rp;
}

$output['client_id'] = '';
$output['client_id_label'] = '';
if ($il->show_client_id == 1) {
$output['client_id_label'] = ! empty($il->client_id_label) ? $il->client_id_label : '';
$output['client_id'] = ! empty($customer->contact_id) ? $customer->contact_id : '';
}

//Sales person info
$output['sales_person'] = '';
$output['sales_person_label'] = '';
if ($il->show_sales_person == 1) {
$output['sales_person_label'] = ! empty($il->sales_person_label) ? $il->sales_person_label : '';
$output['sales_person'] = ! empty($transaction->sales_person->user_full_name) ? $transaction->sales_person->user_full_name : '';
}

//commission agent info
$output['commission_agent'] = '';
$output['commission_agent_label'] = '';
if ($il->show_commission_agent == 1) {
$output['commission_agent_label'] = ! empty($il->commission_agent_label) ? $il->commission_agent_label : '';
$output['commission_agent'] = ! empty($transaction->sale_commission_agent->user_full_name) ? $transaction->sale_commission_agent->user_full_name : '';
}

//Invoice info
$output['invoice_no'] = $transaction->invoice_no;
$output['invoice_no_prefix'] = $il->invoice_no_prefix;
$output['shipping_address'] = ! empty($transaction->shipping_address()) ? $transaction->shipping_address() : $transaction->shipping_address;

//Heading & invoice label, when quotation use the quotation heading.
if ($transaction_type == 'sell_return') {
$output['invoice_heading'] = $il->cn_heading;
$output['invoice_no_prefix'] = $il->cn_no_label;

//Parent sell details(return_parent_id)
$output['parent_invoice_no'] = Transaction::find($transaction->return_parent_id)->invoice_no;
$output['parent_invoice_no_prefix'] = $il->invoice_no_prefix;
} elseif ($transaction->status == 'draft' && $transaction->sub_status == 'proforma' && ! empty($il->common_settings['proforma_heading'])) {
$output['invoice_heading'] = $il->common_settings['proforma_heading'];
} elseif ($transaction->status == 'draft' && $transaction->is_quotation == 1) {
$output['invoice_heading'] = $il->quotation_heading;
$output['invoice_no_prefix'] = $il->quotation_no_prefix;
} elseif ($transaction_type == 'sales_order') {
$output['invoice_heading'] = ! empty($il->common_settings['sales_order_heading']) ? $il->common_settings['sales_order_heading'] : __('lang_v1.sales_order');
$output['invoice_no_prefix'] = $il->quotation_no_prefix;
} else {
$output['invoice_heading'] = $il->invoice_heading;
if ($transaction->payment_status == 'paid' && ! empty($il->invoice_heading_paid)) {
$output['invoice_heading'] .= ' ' . $il->invoice_heading_paid;
} elseif (in_array($transaction->payment_status, ['due', 'partial']) && ! empty($il->invoice_heading_not_paid)) {
$output['invoice_heading'] .= ' ' . $il->invoice_heading_not_paid;
}
}

$output['date_label'] = $il->date_label;
if (blank($il->date_time_format)) {
$output['invoice_date'] = $this->format_date($transaction->transaction_date, true, $business_details);
} else {
$output['invoice_date'] = \Carbon::createFromFormat('Y-m-d H:i:s', $transaction->transaction_date)->format($il->date_time_format);
}

$output['transaction_date'] = $transaction->transaction_date;
$output['date_time_format'] = $business_details->date_format;
$output['currency_symbol'] = $business_details->currency_symbol;

$output['hide_price'] = ! empty($il->common_settings['hide_price']) ? true : false;

if (! empty($il->common_settings['show_due_date']) && $transaction->payment_status != 'paid') {
$output['due_date_label'] = ! empty($il->common_settings['due_date_label']) ? $il->common_settings['due_date_label'] : '';
$due_date = $transaction->due_date;
if (! empty($due_date)) {
if (blank($il->date_time_format)) {
$output['due_date'] = $this->format_date($due_date->toDateTimeString(), true, $business_details);
} else {
$output['due_date'] = \Carbon::createFromFormat('Y-m-d H:i:s', $due_date->toDateTimeString())->format($il->date_time_format);
}
}
}

$show_currency = true;
if ($receipt_printer_type == 'printer' && trim($business_details->currency_symbol) != '$') {
$show_currency = false;
}

//Invoice product lines
$is_lot_number_enabled = $business_details->enable_lot_number;
$is_product_expiry_enabled = $business_details->enable_product_expiry;

$output['lines'] = [];
$total_exempt = 0;
if (in_array($transaction_type, ['sell', 'sales_order'])) {
$sell_line_relations = ['modifiers', 'sub_unit', 'warranties'];

if ($is_lot_number_enabled == 1) {
$sell_line_relations[] = 'lot_details';
}

$lines = $transaction->sell_lines()->whereNull('parent_sell_line_id')->with($sell_line_relations)->get();

foreach ($lines as $key => $value) {
if (! empty($value->sub_unit_id)) {
$formated_sell_line = $this->recalculateSellLineTotals($business_details->id, $value);

$lines[$key] = $formated_sell_line;
}
}

$output['item_discount_label'] = $il->common_settings['item_discount_label'] ?? '';

$output['discounted_unit_price_label'] = $il->common_settings['discounted_unit_price_label'] ?? '';

$output['show_base_unit_details'] = ! empty($il->common_settings['show_base_unit_details']);

$output['tax_summary_label'] = $il->common_settings['tax_summary_label'] ?? '';
$details = $this->_receiptDetailsSellLines($lines, $il, $business_details);

$output['lines'] = $details['lines'];
$output['taxes'] = [];
$total_quantity = 0;
$total_line_discount = 0;
$total_line_taxes = 0;
$subtotal_exc_tax = 0;
$unique_items = [];
foreach ($details['lines'] as $line) {
if (! empty($line['group_tax_details'])) {
foreach ($line['group_tax_details'] as $tax_group_detail) {
if (! isset($output['taxes'][$tax_group_detail['name']])) {
$output['taxes'][$tax_group_detail['name']] = 0;
}
$output['taxes'][$tax_group_detail['name']] += $tax_group_detail['calculated_tax'];
}
} elseif (! empty($line['tax_id'])) {
if (! isset($output['taxes'][$line['tax_name']])) {
$output['taxes'][$line['tax_name']] = 0;
}

$output['taxes'][$line['tax_name']] += ($line['tax_unformatted'] * $line['quantity_uf']);
}

if (! empty($line['tax_id']) && $line['tax_percent'] == 0) {
$total_exempt += $line['line_total_uf'];
}
$subtotal_exc_tax += $line['line_total_exc_tax_uf'];
$total_quantity += $line['quantity_uf'];
$total_line_discount += ($line['line_discount_uf'] * $line['quantity_uf']);
$total_line_taxes += ($line['tax_unformatted'] * $line['quantity_uf']);
if (! empty($line['variation_id']) && ! in_array($line['variation_id'], $unique_items)) {
$unique_items[] = $line['variation_id'];
}
}

if (! empty($il->common_settings['total_quantity_label'])) {
$output['total_quantity_label'] = $il->common_settings['total_quantity_label'];
$output['total_quantity'] = $this->num_f($total_quantity, false, $business_details, true);
}

if (! empty($il->common_settings['total_items_label'])) {
$output['total_items_label'] = $il->common_settings['total_items_label'];
$output['total_items'] = count($unique_items);
}

$output['subtotal_exc_tax'] = $this->num_f($subtotal_exc_tax, true, $business_details);
$output['total_line_discount'] = ! empty($total_line_discount) ? $this->num_f($total_line_discount, true, $business_details) : 0;
} elseif ($transaction_type == 'sell_return') {
$parent_sell = Transaction::find($transaction->return_parent_id);
$lines = $parent_sell->sell_lines;
$total_line_taxes = 0;
foreach ($lines as $key => $value) {
if (! empty($value->sub_unit_id)) {
$formated_sell_line = $this->recalculateSellLineTotals($business_details->id, $value);

$lines[$key] = $formated_sell_line;
}
}

$details = $this->_receiptDetailsSellReturnLines($lines, $il, $business_details);
$output['lines'] = $details['lines'];

$output['taxes'] = [];
foreach ($details['lines'] as $line) {
if (! empty($line['group_tax_details'])) {
foreach ($line['group_tax_details'] as $tax_group_detail) {
if (! isset($output['taxes'][$tax_group_detail['name']])) {
$output['taxes'][$tax_group_detail['name']] = 0;
}
$output['taxes'][$tax_group_detail['name']] += $tax_group_detail['calculated_tax'];
}
}

$total_line_taxes += ($line['tax_unformatted'] * $line['quantity']);
}
}

//show cat code
$output['show_cat_code'] = $il->show_cat_code;
$output['cat_code_label'] = $il->cat_code_label;

//Subtotal
$output['subtotal_label'] = $il->sub_total_label . ':';
$output['subtotal'] = ($transaction->total_before_tax != 0) ? $this->num_f($transaction->total_before_tax, $show_currency, $business_details) : 0;
$output['subtotal_unformatted'] = ($transaction->total_before_tax != 0) ? $transaction->total_before_tax : 0;

//round off
$output['round_off_label'] = ! empty($il->round_off_label) ? $il->round_off_label . ':' : __('lang_v1.round_off') . ':';
$output['round_off'] = $this->num_f($transaction->round_off_amount, $show_currency, $business_details);
$output['round_off_amount'] = $transaction->round_off_amount;
$output['total_exempt'] = $this->num_f($total_exempt, $show_currency, $business_details);
$output['total_exempt_uf'] = $total_exempt;

$taxed_subtotal = $output['subtotal_unformatted'] - $total_exempt;
$output['taxed_subtotal'] = $this->num_f($taxed_subtotal, $show_currency, $business_details);

//Discount
$discount_amount = $this->num_f($transaction->discount_amount, $show_currency, $business_details);
$output['line_discount_label'] = $invoice_layout->discount_label;
$output['discount_label'] = $invoice_layout->discount_label;
$output['discount_label'] .= ($transaction->discount_type == 'percentage') ? ' <small>(' . $this->num_f($transaction->discount_amount, false, $business_details) . '%)</small> :' : '';

if ($transaction->discount_type == 'percentage') {
$discount = ($transaction->discount_amount / 100) * $transaction->total_before_tax;
} else {
$discount = $transaction->discount_amount;
}
$output['discount'] = ($discount != 0) ? $this->num_f($discount, $show_currency, $business_details) : 0;

//reward points
if ($business_details->enable_rp == 1 && ! empty($transaction->rp_redeemed)) {
$output['reward_point_label'] = $business_details->rp_name;
$output['reward_point_amount'] = $this->num_f($transaction->rp_redeemed_amount, $show_currency, $business_details);
}

//Format tax
if (! empty($output['taxes'])) {
$total_tax = 0;
foreach ($output['taxes'] as $key => $value) {
$total_tax += $value;

$output['taxes'][$key] = $this->num_f($value, $show_currency, $business_details);
}

$output['taxes'][trans('lang_v1.total_tax')] = $this->num_f($total_tax, $show_currency, $business_details);
}

//Order Tax
$tax = $transaction->tax;
$output['tax_label'] = $invoice_layout->tax_label;
$output['line_tax_label'] = $invoice_layout->tax_label;
if (! empty($tax) && ! empty($tax->name)) {
$output['tax_label'] .= ' (' . $tax->name . ')';
}
$output['tax_label'] .= ':';
$output['tax'] = ($transaction->tax_amount != 0) ? $this->num_f($transaction->tax_amount, $show_currency, $business_details) : 0;

if ($transaction->tax_amount != 0 && $tax->is_tax_group) {
$transaction_group_tax_details = $this->groupTaxDetails($tax, $transaction->tax_amount);

$output['group_tax_details'] = [];
foreach ($transaction_group_tax_details as $value) {
$output['group_tax_details'][$value['name']] = $this->num_f($value['calculated_tax'], $show_currency, $business_details);
}
}

//Shipping charges
$output['shipping_charges'] = ($transaction->shipping_charges != 0) ? $this->num_f($transaction->shipping_charges, $show_currency, $business_details) : 0;
$output['shipping_charges_label'] = trans('sale.shipping_charges');
//Shipping details
$output['shipping_details'] = $transaction->shipping_details;
$output['delivered_to'] = $transaction->delivered_to;
$output['shipping_details_label'] = trans('sale.shipping_details');
$output['packing_charge_label'] = trans('lang_v1.packing_charge');
$output['packing_charge'] = ($transaction->packing_charge != 0) ? $this->num_f($transaction->packing_charge, $show_currency, $business_details) : 0;

//Total
if ($transaction_type == 'sell_return') {
$output['total_label'] = $invoice_layout->cn_amount_label . ':';
$output['total'] = $this->num_f($transaction->final_total, $show_currency, $business_details);
} else {
$output['total_label'] = $invoice_layout->total_label . ':';
$output['total'] = $this->num_f($transaction->final_total, $show_currency, $business_details);
}
if (! empty($il->common_settings['show_total_in_words'])) {
$word_format = isset($il->common_settings['num_to_word_format']) ? $il->common_settings['num_to_word_format'] : 'international';
$output['total_in_words'] = $this->numToWord($transaction->final_total, null, $word_format);
}

$output['total_unformatted'] = $transaction->final_total;

//Paid & Amount due, only if final
if ($transaction_type == 'sell' && $transaction->status == 'final') {
$paid_amount = $this->getTotalPaid($transaction->id);
$due = $transaction->final_total - $paid_amount;

$output['total_paid'] = ($paid_amount == 0) ? 0 : $this->num_f($paid_amount, $show_currency, $business_details);
$output['total_paid_label'] = $il->paid_label;
$output['total_due'] = ($due == 0) ? 0 : $this->num_f($due, $show_currency, $business_details);
$output['total_due_label'] = $il->total_due_label;

if ($il->show_previous_bal == 1) {
$all_due = $this->getContactDue($transaction->contact_id);
if (! empty($all_due)) {
$output['all_bal_label'] = $il->prev_bal_label;
$output['all_due'] = $this->num_f($all_due, $show_currency, $business_details);
}
}

//Get payment details
$output['payments'] = [];
if ($il->show_payments == 1) {
$payments = $transaction->payment_lines->toArray();
$payment_types = $this->payment_types($transaction->location_id, true);
if (! empty($payments)) {
foreach ($payments as $value) {
$method = ! empty($payment_types[$value['method']]) ? $payment_types[$value['method']] : '';
if ($value['method'] == 'cash') {
$output['payments'][] =
[
'method' => $method . ($value['is_return'] == 1 ? ' (' . $il->change_return_label . ')(-)' : ''),
'amount' => $this->num_f($value['amount'], $show_currency, $business_details),
'date' => $this->format_date($value['paid_on'], false, $business_details),
];
if ($value['is_return'] == 1) {
}
} elseif ($value['method'] == 'card') {
$output['payments'][] =
[
'method' => $method . (! empty($value['card_transaction_number']) ? (', Transaction Number:' . $value['card_transaction_number']) : ''),
'amount' => $this->num_f($value['amount'], $show_currency, $business_details),
'date' => $this->format_date($value['paid_on'], false, $business_details),
];
} elseif ($value['method'] == 'cheque') {
$output['payments'][] =
[
'method' => $method . (! empty($value['cheque_number']) ? (', Cheque Number:' . $value['cheque_number']) : ''),
'amount' => $this->num_f($value['amount'], $show_currency, $business_details),
'date' => $this->format_date($value['paid_on'], false, $business_details),
];
} elseif ($value['method'] == 'bank_transfer') {
$output['payments'][] =
[
'method' => $method . (! empty($value['bank_account_number']) ? (', Account Number:' . $value['bank_account_number']) : ''),
'amount' => $this->num_f($value['amount'], $show_currency, $business_details),
'date' => $this->format_date($value['paid_on'], false, $business_details),
];
} elseif ($value['method'] == 'advance') {
$output['payments'][] =
[
'method' => $method,
'amount' => $this->num_f($value['amount'], $show_currency, $business_details),
'date' => $this->format_date($value['paid_on'], false, $business_details),
];
} elseif ($value['method'] == 'other') {
$output['payments'][] =
[
'method' => $method,
'amount' => $this->num_f($value['amount'], $show_currency, $business_details),
'date' => $this->format_date($value['paid_on'], false, $business_details),
];
}

for ($i = 1; $i < 8; $i++) {
if ($value['method'] == "custom_pay_{$i}") {
$output['payments'][] =
[
'method' => $method . (! empty($value['transaction_no']) ? (', ' . trans('lang_v1.transaction_no') . ':' . $value['transaction_no']) : ''),
'amount' => $this->num_f($value['amount'], $show_currency, $business_details),
'date' => $this->format_date($value['paid_on'], false, $business_details),
];
}
}
}
}
}
}

$output['additional_expenses'] = [];

if (! empty($transaction->additional_expense_value_1) && ! empty($transaction->additional_expense_key_1)) {
$output['additional_expenses'][$transaction->additional_expense_key_1] = $this->num_f($transaction->additional_expense_value_1, $show_currency, $business_details);
}
if (! empty($transaction->additional_expense_value_2) && ! empty($transaction->additional_expense_key_2)) {
$output['additional_expenses'][$transaction->additional_expense_key_2] = $this->num_f($transaction->additional_expense_value_2, $show_currency, $business_details);
}
if (! empty($transaction->additional_expense_value_3) && ! empty($transaction->additional_expense_key_3)) {
$output['additional_expenses'][$transaction->additional_expense_key_3] = $this->num_f($transaction->additional_expense_value_3, $show_currency, $business_details);
}
if (! empty($transaction->additional_expense_value_4) && ! empty($transaction->additional_expense_key_4)) {
$output['additional_expenses'][$transaction->additional_expense_key_4] = $this->num_f($transaction->additional_expense_value_4, $show_currency, $business_details);
}

//Check for barcode
$output['barcode'] = ($il->show_barcode == 1) ? $transaction->invoice_no : false;

//Additional notes
$output['additional_notes'] = $transaction->additional_notes;
$output['footer_text'] = $invoice_layout->footer_text;

//Barcode related information.
$output['show_barcode'] = ! empty($il->show_barcode) ? true : false;

if (in_array($transaction_type, ['sell', 'sales_order'])) {
//Qr code related information.
$output['show_qr_code'] = ! empty($il->show_qr_code) ? true : false;

$zatca_qr = ! empty($il->common_settings['zatca_qr']) ? true : false;

if ($zatca_qr) {
$total_order_tax = $transaction->tax_amount + $total_line_taxes;

$zatca_phase = ! empty($il->common_settings['zatca_phase']) ? $il->common_settings['zatca_phase'] : '';
$qr_code_text = $this->_zatca_qr_text($business_details->name, $business_details->tax_number_1, $transaction, $total_order_tax, $zatca_phase);
// $qr_code_text = $this->_zatca_qr_text( $transaction);
} else {
$is_label_enabled = ! empty($il->common_settings['show_qr_code_label']) ? true : false;
$qr_code_details = [];
$qr_code_fields = ! empty($il->qr_code_fields) ? $il->qr_code_fields : [];

if (in_array('business_name', $qr_code_fields)) {
$qr_code_details[] = $is_label_enabled ? __('business.business') . ': ' . $business_details->name : $business_details->name;
}
if (in_array('address', $qr_code_fields)) {
$qr_code_details[] = $is_label_enabled ? __('business.address') . ': ' . $location_details->name . ', ' . $output['address'] : $location_details->name . ' ' . str_replace(',', '', $output['address']);
}
if (in_array('tax_1', $qr_code_fields)) {
$qr_code_details[] = $is_label_enabled ? $business_details->tax_label_1 . ': ' . $business_details->tax_number_1 : $business_details->tax_number_1;
}
if (in_array('tax_2', $qr_code_fields)) {
$qr_code_details[] = $is_label_enabled ? $business_details->tax_label_2 . ' ' . $business_details->tax_number_2 : $business_details->tax_number_2;
}
if (in_array('invoice_no', $qr_code_fields)) {
$qr_code_details[] = $is_label_enabled ? $il->invoice_no_prefix . ': ' . $transaction->invoice_no : $transaction->invoice_no;
}
if (in_array('invoice_datetime', $qr_code_fields)) {
$qr_code_details[] = $is_label_enabled ? $output['date_label'] . ': ' . $output['invoice_date'] : $output['invoice_date'];
}
if (in_array('subtotal', $qr_code_fields)) {
$qr_code_details[] = $is_label_enabled ? $output['subtotal_label'] . ' ' . $output['subtotal'] : $output['subtotal'];
}
if (in_array('total_amount', $qr_code_fields)) {
$qr_code_details[] = $is_label_enabled ? $output['total_label'] . ' ' . $output['total'] : $output['total'];
}
if (in_array('total_tax', $qr_code_fields)) {
$total_order_tax = $transaction->tax_amount + $total_line_taxes;
$total_order_tax_formatted = $this->num_f($total_order_tax, $show_currency, $business_details);
$qr_code_details[] = $is_label_enabled ? __('sale.tax') . ': ' . $total_order_tax_formatted : $total_order_tax_formatted;
}
if (in_array('customer_name', $qr_code_fields)) {
$cust_label = $il->customer_label ?? __('contact.customer');
$qr_code_details[] = $is_label_enabled ? $cust_label . ': ' . $customer->full_name : $customer->full_name;
}
if (in_array('invoice_url', $qr_code_fields)) {
$qr_code_details[] = $this->getInvoiceUrl($transaction->id, $business_details->id);
}

$output['qr_code_details'] = $qr_code_details;

$qr_code_text = $is_label_enabled ? implode(', ', $qr_code_details) : implode(' ', $qr_code_details);
}

if ($transaction->status == 'final') {
$output['qr_code_text'] = $qr_code_text;
}
// add this seprate for sell retuen qr text of zatca
} else if (in_array($transaction_type, ['sell_return'])) {

$output['show_qr_code'] = ! empty($il->show_qr_code) ? true : false;
$zatca_qr = ! empty($il->common_settings['zatca_qr']) ? true : false;
if ($zatca_qr) {
$total_order_tax = $transaction->tax_amount + $total_line_taxes;
$zatca_phase = ! empty($il->common_settings['zatca_phase']) ? $il->common_settings['zatca_phase'] : '';
$qr_code_text = $this->_zatca_qr_text($business_details->name, $business_details->tax_number_1, $transaction, $total_order_tax, $zatca_phase);
}

if ($transaction->status == 'final') {
$output['qr_code_text'] = $qr_code_text;
}
}
//Module related information.
$il->module_info = ! empty($il->module_info) ? json_decode($il->module_info, true) : [];
if (! empty($il->module_info['tables']) && $this->isModuleEnabled('tables')) {
//Table label & info
$output['table_label'] = null;
$output['table'] = null;
if (isset($il->module_info['tables']['show_table'])) {
$output['table_label'] = ! empty($il->module_info['tables']['table_label']) ? $il->module_info['tables']['table_label'] : '';
if (! empty($transaction->res_table_id)) {
$table = ResTable::find($transaction->res_table_id);
}

//res_table_id
$output['table'] = ! empty($table->name) ? $table->name : '';
}
}

if (! empty($il->module_info['types_of_service']) && $this->isModuleEnabled('types_of_service') && ! empty($transaction->types_of_service_id)) {
//Table label & info
$output['types_of_service_label'] = null;
$output['types_of_service'] = null;
if (isset($il->module_info['types_of_service']['show_types_of_service'])) {
$output['types_of_service_label'] = ! empty($il->module_info['types_of_service']['types_of_service_label']) ? $il->module_info['types_of_service']['types_of_service_label'] : '';
$output['types_of_service'] = $transaction->types_of_service->name;
}

if (isset($il->module_info['types_of_service']['show_tos_custom_fields'])) {
$types_of_service_custom_labels = $this->getCustomLabels($business_details, 'types_of_service');
$output['types_of_service_custom_fields'] = [];
if (! empty($transaction->service_custom_field_1)) {
$tos_custom_label_1 = $types_of_service_custom_labels['custom_field_1'] ?? __('lang_v1.service_custom_field_1');
$output['types_of_service_custom_fields'][$tos_custom_label_1] = $transaction->service_custom_field_1;
}
if (! empty($transaction->service_custom_field_2)) {
$tos_custom_label_2 = $types_of_service_custom_labels['custom_field_2'] ?? __('lang_v1.service_custom_field_2');
$output['types_of_service_custom_fields'][$tos_custom_label_2] = $transaction->service_custom_field_2;
}
if (! empty($transaction->service_custom_field_3)) {
$tos_custom_label_3 = $types_of_service_custom_labels['custom_field_3'] ?? __('lang_v1.service_custom_field_3');
$output['types_of_service_custom_fields'][$tos_custom_label_3] = $transaction->service_custom_field_3;
}
if (! empty($transaction->service_custom_field_4)) {
$tos_custom_label_4 = $types_of_service_custom_labels['custom_field_4'] ?? __('lang_v1.service_custom_field_4');
$output['types_of_service_custom_fields'][$tos_custom_label_4] = $transaction->service_custom_field_4;
}

if (! empty($transaction->service_custom_field_5)) {
$tos_custom_label_5 = $types_of_service_custom_labels['custom_field_5'] ?? __('lang_v1.service_custom_field_5');
$output['types_of_service_custom_fields'][$tos_custom_label_5] = $transaction->service_custom_field_5;
}

if (! empty($transaction->service_custom_field_6)) {
$tos_custom_label_6 = $types_of_service_custom_labels['custom_field_6'] ?? __('lang_v1.service_custom_field_6');
$output['types_of_service_custom_fields'][$tos_custom_label_6] = $transaction->service_custom_field_6;
}
}
}

if (! empty($il->module_info['service_staff']) && $this->isModuleEnabled('service_staff')) {
//Waiter label & info
$output['service_staff_label'] = null;
$output['service_staff'] = null;
if (isset($il->module_info['service_staff']['show_service_staff'])) {
$output['service_staff_label'] = ! empty($il->module_info['service_staff']['service_staff_label']) ? $il->module_info['service_staff']['service_staff_label'] : '';
if (! empty($transaction->res_waiter_id)) {
$waiter = \App\User::find($transaction->res_waiter_id);
}

//res_table_id
$output['service_staff'] = ! empty($waiter->id) ? implode(' ', [$waiter->first_name, $waiter->last_name]) : '';
}
}

//Repair module details
if (! empty($il->module_info['repair']) && $transaction->sub_type == 'repair') {
if (! empty($il->module_info['repair']['show_repair_status'])) {
$output['repair_status_label'] = $il->module_info['repair']['repair_status_label'];
$output['repair_status'] = '';
if (! empty($transaction->repair_status_id)) {
$repair_status = \Modules\Repair\Entities\RepairStatus::find($transaction->repair_status_id);
$output['repair_status'] = $repair_status->name;
}
}

if (! empty($il->module_info['repair']['show_repair_warranty'])) {
$output['repair_warranty_label'] = $il->module_info['repair']['repair_warranty_label'];
$output['repair_warranty'] = '';
if (! empty($transaction->repair_warranty_id)) {
$repair_warranty = \App\Warranty::find($transaction->repair_warranty_id);
$output['repair_warranty'] = $repair_warranty->name;
}
}

if (! empty($il->module_info['repair']['show_serial_no'])) {
$output['serial_no_label'] = $il->module_info['repair']['serial_no_label'];
$output['repair_serial_no'] = $transaction->repair_serial_no;
}

if (! empty($il->module_info['repair']['show_defects'])) {
$output['defects_label'] = $il->module_info['repair']['defects_label'];
$output['repair_defects'] = $transaction->repair_defects;
}

if (! empty($il->module_info['repair']['show_model'])) {
$output['model_no_label'] = $il->module_info['repair']['model_no_label'];

$output['repair_model_no'] = '';

if (! empty($transaction->repair_model_id)) {
$device_model = \Modules\Repair\Entities\DeviceModel::find($transaction->repair_model_id);

if (! empty($device_model)) {
$output['repair_model_no'] = $device_model->name;
}
}
}

if (! empty($il->module_info['repair']['show_repair_checklist'])) {
$output['repair_checklist_label'] = $il->module_info['repair']['repair_checklist_label'];
$output['checked_repair_checklist'] = $transaction->repair_checklist;

$checklists = [];
if (! empty($transaction->repair_model_id)) {
$model = \Modules\Repair\Entities\DeviceModel::find($transaction->repair_model_id);

if (! empty($model) && ! empty($model->repair_checklist)) {
$checklists = explode('|', $model->repair_checklist);
}
}

$output['repair_checklist'] = $checklists;
}

if (! empty($il->module_info['repair']['show_device'])) {
$output['device_label'] = $il->module_info['repair']['device_label'];
$device = \App\Category::find($transaction->repair_device_id);

$output['repair_device'] = '';
if (! empty($device)) {
$output['repair_device'] = $device->name;
}
}

if (! empty($il->module_info['repair']['show_brand'])) {
$output['brand_label'] = $il->module_info['repair']['brand_label'];
$brand = \App\Brands::find($transaction->repair_brand_id);
$output['repair_brand'] = '';
if (! empty($brand)) {
$output['repair_brand'] = $brand->name;
}
}
}

//Custom fields
$custom_labels = json_decode($business_details['custom_labels']);

//shipping custom fields
if (! empty($custom_labels->shipping->custom_field_1)) {
$output['shipping_custom_field_1_label'] = $custom_labels->shipping->custom_field_1;
$output['shipping_custom_field_1_value'] = $transaction['shipping_custom_field_1'];
}

if (! empty($custom_labels->shipping->custom_field_2)) {
$output['shipping_custom_field_2_label'] = $custom_labels->shipping->custom_field_2;
$output['shipping_custom_field_2_value'] = $transaction['shipping_custom_field_2'];
}

if (! empty($custom_labels->shipping->custom_field_3)) {
$output['shipping_custom_field_3_label'] = $custom_labels->shipping->custom_field_3;
$output['shipping_custom_field_3_value'] = $transaction['shipping_custom_field_3'];
}

if (! empty($custom_labels->shipping->custom_field_4)) {
$output['shipping_custom_field_4_label'] = $custom_labels->shipping->custom_field_4;
$output['shipping_custom_field_4_value'] = $transaction['shipping_custom_field_4'];
}

//Sell custom fields
if (! empty($custom_labels->shipping->custom_field_5)) {
$output['shipping_custom_field_5_label'] = $custom_labels->shipping->custom_field_5;
$output['shipping_custom_field_5_value'] = $transaction['shipping_custom_field_5'];
}


$is_show_sell_custom_fields1 = ! empty($il->common_settings['sell_custom_fields1']) ? true : false;
if (! empty($custom_labels->sell->custom_field_1) && $is_show_sell_custom_fields1) {
$output['sell_custom_field_1_label'] = $custom_labels->sell->custom_field_1;
$output['sell_custom_field_1_value'] = $transaction['custom_field_1'];
}

$is_show_sell_custom_fields2 = ! empty($il->common_settings['sell_custom_fields2']) ? true : false;
if (! empty($custom_labels->sell->custom_field_2) && $is_show_sell_custom_fields2) {
$output['sell_custom_field_2_label'] = $custom_labels->sell->custom_field_2;
$output['sell_custom_field_2_value'] = $transaction['custom_field_2'];
}

$is_show_sell_custom_fields3 = ! empty($il->common_settings['sell_custom_fields3']) ? true : false;
if (! empty($custom_labels->sell->custom_field_3) && $is_show_sell_custom_fields3) {
$output['sell_custom_field_3_label'] = $custom_labels->sell->custom_field_3;
$output['sell_custom_field_3_value'] = $transaction['custom_field_3'];
}

$is_show_sell_custom_fields4 = ! empty($il->common_settings['sell_custom_fields4']) ? true : false;
if (! empty($custom_labels->sell->custom_field_4) && $is_show_sell_custom_fields4) {
$output['sell_custom_field_4_label'] = $custom_labels->sell->custom_field_4;
$output['sell_custom_field_4_value'] = $transaction['custom_field_4'];
}



// location custom fields
if (in_array('custom_field1', $location_custom_field_settings) && ! empty($location_details->custom_field1) && ! empty($custom_labels->location->custom_field_1)) {
$output['location_custom_field_1_label'] = $custom_labels->location->custom_field_1;
$output['location_custom_field_1_value'] = $location_details->custom_field1;
}

if (in_array('custom_field2', $location_custom_field_settings) && ! empty($location_details->custom_field2) && ! empty($custom_labels->location->custom_field_2)) {
$output['location_custom_field_2_label'] = $custom_labels->location->custom_field_2;
$output['location_custom_field_2_value'] = $location_details->custom_field2;
}

if (in_array('custom_field3', $location_custom_field_settings) && ! empty($location_details->custom_field3) && ! empty($custom_labels->location->custom_field_3)) {
$output['location_custom_field_3_label'] = $custom_labels->location->custom_field_3;
$output['location_custom_field_3_value'] = $location_details->custom_field3;
}

if (in_array('custom_field4', $location_custom_field_settings) && ! empty($location_details->custom_field4) && ! empty($custom_labels->location->custom_field_4)) {
$output['location_custom_field_4_label'] = $custom_labels->location->custom_field_4;
$output['location_custom_field_4_value'] = $location_details->custom_field4;
}

//Used in pdfs
if (! empty($transaction->sales_order_ids)) {
$sale_orders = Transaction::where('type', 'sales_order')
->find($transaction->sales_order_ids);

$output['sale_orders_invoice_no'] = implode(', ', $sale_orders->pluck('invoice_no')->toArray());
$sale_orders_invoice_date = [];
foreach ($sale_orders as $sale_order) {
if (blank($il->date_time_format)) {
$sale_orders_invoice_date[] = $this->format_date($sale_order->transaction_date, true);
} else {
$sale_orders_invoice_date[] = \Carbon::createFromFormat('Y-m-d H:i:s', $sale_order->transaction_date)->format($il->date_time_format);
}
}
$output['sale_orders_invoice_date'] = implode(', ', $sale_orders_invoice_date);
}

if (! empty($transaction->prefer_payment_method)) {
$payment_types = $this->payment_types(null, true, $transaction->business_id);
$output['preferred_payment_method'] = $payment_types[$transaction->prefer_payment_method];
}

if (! empty($transaction->prefer_payment_account)) {
$output['preferred_account_details'] = $transaction->preferredAccount->account_details;
}

//export custom fields
$output['is_export'] = $transaction->is_export;
$export_custom_fields_info = $transaction->export_custom_fields_info;
if (! empty($transaction->is_export)) {
$output['export_custom_fields_info']['export_custom_field_1'] = $export_custom_fields_info['export_custom_field_1'] ?? '';
$output['export_custom_fields_info']['export_custom_field_2'] = $export_custom_fields_info['export_custom_field_2'] ?? '';
$output['export_custom_fields_info']['export_custom_field_3'] = $export_custom_fields_info['export_custom_field_3'] ?? '';
$output['export_custom_fields_info']['export_custom_field_4'] = $export_custom_fields_info['export_custom_field_4'] ?? '';
$output['export_custom_fields_info']['export_custom_field_5'] = $export_custom_fields_info['export_custom_field_5'] ?? '';
$output['export_custom_fields_info']['export_custom_field_6'] = $export_custom_fields_info['export_custom_field_6'] ?? '';
}

$output['design'] = $il->design;
$output['table_tax_headings'] = ! empty($il->table_tax_headings) ? array_filter(json_decode($il->table_tax_headings), 'strlen') : null;

return (object) $output;
}

Step 7: Add Watermark Templates​

Ultimate POS typically has multiple receipt templates (classic, modern, slim, etc.). You need to add the watermark code to each template you want to support watermarks.

Template Locations​

Common template locations in Ultimate POS:

  • resources/views/sale_pos/receipts/classic.blade.php
  • resources/views/sale_pos/receipts/detailed.blade.php
  • resources/views/sale_pos/receipts/columnize-taxes.blade.php
  • resources/views/sale_pos/receipts/elegant.blade.php
  • Any custom templates you've created

Universal Watermark Code​

Add this watermark code to each template. The placement depends on the template structure:

For table-based templates (like elegant):
Add this code at the very beginning of your template

<!-- Watermark Implementation -->
@if(!empty($receipt_details->watermark_logo) && !empty($receipt_details->show_watermark))
<style>
.watermark {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

opacity: {
{
$receipt_details->watermark_opacity ?? '0.15'
}
}

;
/* Slightly more visible */
z-index: -1;
pointer-events: none;
}

.transparent-content {
position: relative;
background-color: rgba(255, 255, 255, 0.1) !important;
/* Semi-transparent white */
}

.transparent-content td,
.transparent-content th {
background-color: transparent !important;
}
</style>
<div style="position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: {{ $receipt_details->watermark_opacity ?? '0.1' }};
z-index: -1;
pointer-events: none;">
<img src="{{ asset('uploads/invoice_logos/' . $receipt_details->watermark_logo) }}" style="width: {{ $receipt_details->watermark_width ?? '300' }}px;
height: {{ $receipt_details->watermark_height ?? '300' }}px;
object-fit: contain;">
</div>
@endif


then update <table> tag

<table class="transparent-content" style="width:100%; color: #000000 !important;">

For div-based templates (like classic):

<!-- Add this wrapper div at the very beginning of the template -->
<div style="position: relative;">

<!-- Watermark Logo -->
@if(!empty($receipt_details->watermark_logo) && !empty($receipt_details->show_watermark))
@php
$position_styles = match($receipt_details->watermark_position ?? 'center') {
'center' => 'top: 300px; left: 50%; transform: translateX(-50%);',
'top-left' => 'top: 50px; left: 50px;',
'top-right' => 'top: 50px; right: 50px;',
'bottom-left' => 'bottom: 50px; left: 50px;',
'bottom-right' => 'bottom: 50px; right: 50px;',
default => 'top: 300px; left: 50%; transform: translateX(-50%);'
};
@endphp
<div style="
position: absolute;
{{ $position_styles }}
opacity: {{ $receipt_details->watermark_opacity ?? '0.1' }};
z-index: 1;
pointer-events: none;
">
<img src="{{asset('uploads/invoice_logos/' . $receipt_details->watermark_logo)}}" alt="Watermark" style="
width: {{$receipt_details->watermark_width ?? '300'}}px;
height: {{$receipt_details->watermark_height ?? '300'}}px;
object-fit: contain;
">
</div>
@endif

<!-- All existing content with higher z-index -->
<div style="position: relative; z-index: 2;">

<!-- business information here -->
<div class="row" style="color: #000000 !important; background: rgba(255,255,255,0.9);">
<!-- Logo -->
@if(empty($receipt_details->letter_head))
@if(!empty($receipt_details->logo))
<img style="max-height: 120px; width: auto;" src="{{$receipt_details->logo}}"
class="img img-responsive center-block">
@endif

<!-- Header text -->
@if(!empty($receipt_details->header_text))
<div class="col-xs-12">
{!! $receipt_details->header_text !!}
</div>
@endif

<!-- business information here -->
<div class="col-xs-12 text-center">
<h2 class="text-center">
<!-- Shop & Location Name -->
@if(!empty($receipt_details->display_name))
{{$receipt_details->display_name}}
@endif
</h2>

<!-- Address -->
<p>
@if(!empty($receipt_details->address))
<small class="text-center">
{!! $receipt_details->address !!}
</small>
@endif
@if(!empty($receipt_details->contact))
<br />{!! $receipt_details->contact !!}
@endif
@if(!empty($receipt_details->contact) && !empty($receipt_details->website))
,
@endif
@if(!empty($receipt_details->website))
{{ $receipt_details->website }}
@endif
@if(!empty($receipt_details->location_custom_fields))
<br>{{ $receipt_details->location_custom_fields }}
@endif
</p>
<p>
@if(!empty($receipt_details->sub_heading_line1))
{{ $receipt_details->sub_heading_line1 }}
@endif
@if(!empty($receipt_details->sub_heading_line2))
<br>{{ $receipt_details->sub_heading_line2 }}
@endif
@if(!empty($receipt_details->sub_heading_line3))
<br>{{ $receipt_details->sub_heading_line3 }}
@endif
@if(!empty($receipt_details->sub_heading_line4))
<br>{{ $receipt_details->sub_heading_line4 }}
@endif
@if(!empty($receipt_details->sub_heading_line5))
<br>{{ $receipt_details->sub_heading_line5 }}
@endif
</p>
<p>
@if(!empty($receipt_details->tax_info1))
<b>{{ $receipt_details->tax_label1 }}</b> {{ $receipt_details->tax_info1 }}
@endif

@if(!empty($receipt_details->tax_info2))
<b>{{ $receipt_details->tax_label2 }}</b> {{ $receipt_details->tax_info2 }}
@endif
</p>
@endif


<!-- Title of receipt -->
@if(!empty($receipt_details->invoice_heading))
<h3 class="text-center">
{!! $receipt_details->invoice_heading !!}
</h3>
@endif
</div>
@if(!empty($receipt_details->letter_head))
<div class="col-xs-12 text-center">
<img style="width: 100%;margin-bottom: 10px;" src="{{$receipt_details->letter_head}}">
</div>
@endif
<div class="col-xs-12 text-center">
<!-- Invoice number, Date -->
<p style="width: 100% !important" class="word-wrap">
<span class="pull-left text-left word-wrap">
@if(!empty($receipt_details->invoice_no_prefix))
<b>{!! $receipt_details->invoice_no_prefix !!}</b>
@endif
{{$receipt_details->invoice_no}}

@if(!empty($receipt_details->types_of_service))
<br />
<span class="pull-left text-left">
<strong>{!! $receipt_details->types_of_service_label !!}:</strong>
{{$receipt_details->types_of_service}}
<!-- Waiter info -->
@if(!empty($receipt_details->types_of_service_custom_fields))
@foreach($receipt_details->types_of_service_custom_fields as $key => $value)
<br><strong>{{$key}}: </strong> {{$value}}
@endforeach
@endif
</span>
@endif

<!-- Table information-->
@if(!empty($receipt_details->table_label) || !empty($receipt_details->table))
<br />
<span class="pull-left text-left">
@if(!empty($receipt_details->table_label))
<b>{!! $receipt_details->table_label !!}</b>
@endif
{{$receipt_details->table}}

<!-- Waiter info -->
</span>
@endif

<!-- customer info -->
@if(!empty($receipt_details->customer_info))
<br />
<b>{{ $receipt_details->customer_label }}</b> <br> {!! $receipt_details->customer_info !!} <br>
@endif
@if(!empty($receipt_details->client_id_label))
<br />
<b>{{ $receipt_details->client_id_label }}</b> {{ $receipt_details->client_id }}
@endif
@if(!empty($receipt_details->customer_tax_label))
<br />
<b>{{ $receipt_details->customer_tax_label }}</b> {{ $receipt_details->customer_tax_number }}
@endif
@if(!empty($receipt_details->customer_custom_fields))
<br />{!! $receipt_details->customer_custom_fields !!}
@endif
@if(!empty($receipt_details->sales_person_label))
<br />
<b>{{ $receipt_details->sales_person_label }}</b> {{ $receipt_details->sales_person }}
@endif
@if(!empty($receipt_details->commission_agent_label))
<br />
<strong>{{ $receipt_details->commission_agent_label }}</strong> {{
$receipt_details->commission_agent }}
@endif
@if(!empty($receipt_details->customer_rp_label))
<br />
<strong>{{ $receipt_details->customer_rp_label }}</strong> {{
$receipt_details->customer_total_rp }}
@endif
</span>

<span class="pull-right text-left">
<b>{{$receipt_details->date_label}}</b> {{$receipt_details->invoice_date}}

@if(!empty($receipt_details->due_date_label))
<br><b>{{$receipt_details->due_date_label}}</b> {{$receipt_details->due_date ?? ''}}
@endif

@if(!empty($receipt_details->brand_label) || !empty($receipt_details->repair_brand))
<br>
@if(!empty($receipt_details->brand_label))
<b>{!! $receipt_details->brand_label !!}</b>
@endif
{{$receipt_details->repair_brand}}
@endif


@if(!empty($receipt_details->device_label) || !empty($receipt_details->repair_device))
<br>
@if(!empty($receipt_details->device_label))
<b>{!! $receipt_details->device_label !!}</b>
@endif
{{$receipt_details->repair_device}}
@endif

@if(!empty($receipt_details->model_no_label) || !empty($receipt_details->repair_model_no))
<br>
@if(!empty($receipt_details->model_no_label))
<b>{!! $receipt_details->model_no_label !!}</b>
@endif
{{$receipt_details->repair_model_no}}
@endif

@if(!empty($receipt_details->serial_no_label) || !empty($receipt_details->repair_serial_no))
<br>
@if(!empty($receipt_details->serial_no_label))
<b>{!! $receipt_details->serial_no_label !!}</b>
@endif
{{$receipt_details->repair_serial_no}}<br>
@endif
@if(!empty($receipt_details->repair_status_label) || !empty($receipt_details->repair_status))
@if(!empty($receipt_details->repair_status_label))
<b>{!! $receipt_details->repair_status_label !!}</b>
@endif
{{$receipt_details->repair_status}}<br>
@endif

@if(!empty($receipt_details->repair_warranty_label) ||
!empty($receipt_details->repair_warranty))
@if(!empty($receipt_details->repair_warranty_label))
<b>{!! $receipt_details->repair_warranty_label !!}</b>
@endif
{{$receipt_details->repair_warranty}}
<br>
@endif

<!-- Waiter info -->
@if(!empty($receipt_details->service_staff_label) || !empty($receipt_details->service_staff))
<br />
@if(!empty($receipt_details->service_staff_label))
<b>{!! $receipt_details->service_staff_label !!}</b>
@endif
{{$receipt_details->service_staff}}
@endif
@if(!empty($receipt_details->shipping_custom_field_1_label))
<br><strong>{!!$receipt_details->shipping_custom_field_1_label!!} :</strong>
{!!$receipt_details->shipping_custom_field_1_value ?? ''!!}
@endif

@if(!empty($receipt_details->shipping_custom_field_2_label))
<br><strong>{!!$receipt_details->shipping_custom_field_2_label!!}:</strong>
{!!$receipt_details->shipping_custom_field_2_value ?? ''!!}
@endif

@if(!empty($receipt_details->shipping_custom_field_3_label))
<br><strong>{!!$receipt_details->shipping_custom_field_3_label!!}:</strong>
{!!$receipt_details->shipping_custom_field_3_value ?? ''!!}
@endif

@if(!empty($receipt_details->shipping_custom_field_4_label))
<br><strong>{!!$receipt_details->shipping_custom_field_4_label!!}:</strong>
{!!$receipt_details->shipping_custom_field_4_value ?? ''!!}
@endif

@if(!empty($receipt_details->shipping_custom_field_5_label))
<br><strong>{!!$receipt_details->shipping_custom_field_2_label!!}:</strong>
{!!$receipt_details->shipping_custom_field_5_value ?? ''!!}
@endif
{{-- sale order --}}
@if(!empty($receipt_details->sale_orders_invoice_no))
<br>
<strong>@lang('restaurant.order_no'):</strong> {!!$receipt_details->sale_orders_invoice_no ??
''!!}
@endif

@if(!empty($receipt_details->sale_orders_invoice_date))
<br>
<strong>@lang('lang_v1.order_dates'):</strong> {!!$receipt_details->sale_orders_invoice_date ??
''!!}
@endif

@if(!empty($receipt_details->sell_custom_field_1_value))
<br>
<strong>{{ $receipt_details->sell_custom_field_1_label }}:</strong>
{!!$receipt_details->sell_custom_field_1_value ?? ''!!}
@endif

@if(!empty($receipt_details->sell_custom_field_2_value))
<br>
<strong>{{ $receipt_details->sell_custom_field_2_label }}:</strong>
{!!$receipt_details->sell_custom_field_2_value ?? ''!!}
@endif

@if(!empty($receipt_details->sell_custom_field_3_value))
<br>
<strong>{{ $receipt_details->sell_custom_field_3_label }}:</strong>
{!!$receipt_details->sell_custom_field_3_value ?? ''!!}
@endif

@if(!empty($receipt_details->sell_custom_field_4_value))
<br>
<strong>{{ $receipt_details->sell_custom_field_4_label }}:</strong>
{!!$receipt_details->sell_custom_field_4_value ?? ''!!}
@endif

</span>
</p>
</div>
</div>

<div class="row" style="color: #000000 !important; background: rgba(255,255,255,0.9);">
@includeIf('sale_pos.receipts.partial.common_repair_invoice')
</div>

<div class="row" style="color: #000000 !important; background: rgba(255,255,255,0.9);">
<div class="col-xs-12">
<br />
@php
$p_width = 45;
@endphp
@if(!empty($receipt_details->item_discount_label))
@php
$p_width -= 10;
@endphp
@endif
@if(!empty($receipt_details->discounted_unit_price_label))
@php
$p_width -= 10;
@endphp
@endif
<table class="table table-responsive table-slim" style="background: transparent;">
<thead>
<tr>
<th width="{{$p_width}}%">{{$receipt_details->table_product_label}}</th>
<th class="text-right" width="15%">{{$receipt_details->table_qty_label}}</th>
<th class="text-right" width="15%">{{$receipt_details->table_unit_price_label}}</th>
@if(!empty($receipt_details->discounted_unit_price_label))
<th class="text-right" width="10%">{{$receipt_details->discounted_unit_price_label}}</th>
@endif
@if(!empty($receipt_details->item_discount_label))
<th class="text-right" width="10%">{{$receipt_details->item_discount_label}}</th>
@endif
<th class="text-right" width="15%">{{$receipt_details->table_subtotal_label}}</th>
</tr>
</thead>
<tbody>
@forelse($receipt_details->lines as $line)
<tr style="background: rgba(255,255,255,0.8);">
<td>
@if(!empty($line['image']))
<img src="{{$line['image']}}" alt="Image" width="50"
style="float: left; margin-right: 8px;">
@endif
{{$line['name']}} {{$line['product_variation']}} {{$line['variation']}}
@if(!empty($line['sub_sku'])), {{$line['sub_sku']}} @endif @if(!empty($line['brand'])),
{{$line['brand']}} @endif @if(!empty($line['cat_code'])), {{$line['cat_code']}}@endif
@if(!empty($line['product_custom_fields'])), {{$line['product_custom_fields']}} @endif
@if(!empty($line['product_description']))
<small>
{!!$line['product_description']!!}
</small>
@endif
@if(!empty($line['sell_line_note']))
<br>
<small>
{!!$line['sell_line_note']!!}
</small>
@endif
@if(!empty($line['lot_number']))<br> {{$line['lot_number_label']}}:
{{$line['lot_number']}} @endif
@if(!empty($line['product_expiry'])), {{$line['product_expiry_label']}}:
{{$line['product_expiry']}} @endif

@if(!empty($line['warranty_name'])) <br><small>{{$line['warranty_name']}} </small>@endif
@if(!empty($line['warranty_exp_date'])) <small>-
{{@format_date($line['warranty_exp_date'])}} </small>@endif
@if(!empty($line['warranty_description'])) <small> {{$line['warranty_description'] ??
''}}</small>@endif

@if($receipt_details->show_base_unit_details && $line['quantity'] &&
$line['base_unit_multiplier'] !== 1)
<br><small>
1 {{$line['units']}} = {{$line['base_unit_multiplier']}} {{$line['base_unit_name']}}
<br>
{{$line['base_unit_price']}} x {{$line['orig_quantity']}} = {{$line['line_total']}}
</small>
@endif
</td>
<td class="text-right">
{{$line['quantity']}} {{$line['units']}}

@if($receipt_details->show_base_unit_details && $line['quantity'] &&
$line['base_unit_multiplier'] !== 1)
<br><small>
{{$line['quantity']}} x {{$line['base_unit_multiplier']}} =
{{$line['orig_quantity']}} {{$line['base_unit_name']}}
</small>
@endif
</td>
<td class="text-right">{{$line['unit_price_before_discount']}}</td>
@if(!empty($receipt_details->discounted_unit_price_label))
<td class="text-right">
{{$line['unit_price_inc_tax']}}
</td>
@endif
@if(!empty($receipt_details->item_discount_label))
<td class="text-right">
{{$line['total_line_discount'] ?? '0.00'}}

@if(!empty($line['line_discount_percent']))
({{$line['line_discount_percent']}}%)
@endif
</td>
@endif
<td class="text-right">{{$line['line_total']}}</td>
</tr>
@if(!empty($line['modifiers']))
@foreach($line['modifiers'] as $modifier)
<tr style="background: rgba(255,255,255,0.8);">
<td>
{{$modifier['name']}} {{$modifier['variation']}}
@if(!empty($modifier['sub_sku'])), {{$modifier['sub_sku']}} @endif
@if(!empty($modifier['cat_code'])), {{$modifier['cat_code']}}@endif
@if(!empty($modifier['sell_line_note']))({!!$modifier['sell_line_note']!!}) @endif
</td>
<td class="text-right">{{$modifier['quantity']}} {{$modifier['units']}} </td>
<td class="text-right">{{$modifier['unit_price_inc_tax']}}</td>
@if(!empty($receipt_details->discounted_unit_price_label))
<td class="text-right">{{$modifier['unit_price_exc_tax']}}</td>
@endif
@if(!empty($receipt_details->item_discount_label))
<td class="text-right">0.00</td>
@endif
<td class="text-right">{{$modifier['line_total']}}</td>
</tr>
@endforeach
@endif
@empty
<tr style="background: rgba(255,255,255,0.8);">
<td colspan="4">&nbsp;</td>
@if(!empty($receipt_details->discounted_unit_price_label))
<td></td>
@endif
@if(!empty($receipt_details->item_discount_label))
<td></td>
@endif
</tr>
@endforelse
</tbody>
</table>
</div>
</div>

<div class="row" style="color: #000000 !important; background: rgba(255,255,255,0.9);">
<div class="col-md-12">
<hr />
</div>
<div class="col-xs-6">

<table class="table table-slim" style="background: transparent;">

@if(!empty($receipt_details->payments))
@foreach($receipt_details->payments as $payment)
<tr>
<td>{{$payment['method']}}</td>
<td class="text-right">{{$payment['amount']}}</td>
<td class="text-right">{{$payment['date']}}</td>
</tr>
@endforeach
@endif

<!-- Total Paid-->
@if(!empty($receipt_details->total_paid))
<tr>
<th>
{!! $receipt_details->total_paid_label !!}
</th>
<td class="text-right">
{{$receipt_details->total_paid}}
</td>
</tr>
@endif

<!-- Total Due-->
@if(!empty($receipt_details->total_due) && !empty($receipt_details->total_due_label))
<tr>
<th>
{!! $receipt_details->total_due_label !!}
</th>
<td class="text-right">
{{$receipt_details->total_due}}
</td>
</tr>
@endif

@if(!empty($receipt_details->all_due))
<tr>
<th>
{!! $receipt_details->all_bal_label !!}
</th>
<td class="text-right">
{{$receipt_details->all_due}}
</td>
</tr>
@endif
</table>
</div>

<div class="col-xs-6">
<div class="table-responsive">
<table class="table table-slim" style="background: transparent;">
<tbody>
@if(!empty($receipt_details->total_quantity_label))
<tr>
<th style="width:70%">
{!! $receipt_details->total_quantity_label !!}
</th>
<td class="text-right">
{{$receipt_details->total_quantity}}
</td>
</tr>
@endif

@if(!empty($receipt_details->total_items_label))
<tr>
<th style="width:70%">
{!! $receipt_details->total_items_label !!}
</th>
<td class="text-right">
{{$receipt_details->total_items}}
</td>
</tr>
@endif
<tr>
<th style="width:70%">
{!! $receipt_details->subtotal_label !!}
</th>
<td class="text-right">
{{$receipt_details->subtotal}}
</td>
</tr>
@if(!empty($receipt_details->total_exempt_uf))
<tr>
<th style="width:70%">
@lang('lang_v1.exempt')
</th>
<td class="text-right">
{{$receipt_details->total_exempt}}
</td>
</tr>
@endif
<!-- Shipping Charges -->
@if(!empty($receipt_details->shipping_charges))
<tr>
<th style="width:70%">
{!! $receipt_details->shipping_charges_label !!}
</th>
<td class="text-right">
{{$receipt_details->shipping_charges}}
</td>
</tr>
@endif

@if(!empty($receipt_details->packing_charge))
<tr>
<th style="width:70%">
{!! $receipt_details->packing_charge_label !!}
</th>
<td class="text-right">
{{$receipt_details->packing_charge}}
</td>
</tr>
@endif

<!-- Discount -->
@if( !empty($receipt_details->discount) )
<tr>
<th>
{!! $receipt_details->discount_label !!}
</th>

<td class="text-right">
(-) {{$receipt_details->discount}}
</td>
</tr>
@endif

@if( !empty($receipt_details->total_line_discount) )
<tr>
<th>
{!! $receipt_details->line_discount_label !!}
</th>

<td class="text-right">
(-) {{$receipt_details->total_line_discount}}
</td>
</tr>
@endif

@if( !empty($receipt_details->additional_expenses) )
@foreach($receipt_details->additional_expenses as $key => $val)
<tr>
<td>
{{$key}}:
</td>

<td class="text-right">
(+) {{$val}}
</td>
</tr>
@endforeach
@endif

@if( !empty($receipt_details->reward_point_label) )
<tr>
<th>
{!! $receipt_details->reward_point_label !!}
</th>

<td class="text-right">
(-) {{$receipt_details->reward_point_amount}}
</td>
</tr>
@endif

<!-- Tax -->
@if( !empty($receipt_details->tax) )
<tr>
<th>
{!! $receipt_details->tax_label !!}
</th>
<td class="text-right">
(+) {{$receipt_details->tax}}
</td>
</tr>
@endif

@if( $receipt_details->round_off_amount > 0)
<tr>
<th>
{!! $receipt_details->round_off_label !!}
</th>
<td class="text-right">
{{$receipt_details->round_off}}
</td>
</tr>
@endif

<!-- Total -->
<tr>
<th>
{!! $receipt_details->total_label !!}
</th>
<td class="text-right">
{{$receipt_details->total}}
@if(!empty($receipt_details->total_in_words))
<br>
<small>({{$receipt_details->total_in_words}})</small>
@endif
</td>
</tr>
</tbody>
</table>
</div>
</div>

<div class="border-bottom col-md-12">
@if(empty($receipt_details->hide_price) && !empty($receipt_details->tax_summary_label) )
<!-- tax -->
@if(!empty($receipt_details->taxes))
<table class="table table-slim table-bordered" style="background: rgba(255,255,255,0.9);">
<tr>
<th colspan="2" class="text-center">{{$receipt_details->tax_summary_label}}</th>
</tr>
@foreach($receipt_details->taxes as $key => $val)
<tr>
<td class="text-center"><b>{{$key}}</b></td>
<td class="text-center">{{$val}}</td>
</tr>
@endforeach
</table>
@endif
@endif
</div>

@if(!empty($receipt_details->additional_notes))
<div class="col-xs-12">
<p>{!! nl2br($receipt_details->additional_notes) !!}</p>
</div>
@endif

</div>
<div class="row" style="color: #000000 !important; background: rgba(255,255,255,0.9);">
@if(!empty($receipt_details->footer_text))
<div
class="@if($receipt_details->show_barcode || $receipt_details->show_qr_code) col-xs-8 @else col-xs-12 @endif">
{!! $receipt_details->footer_text !!}
</div>
@endif
@if($receipt_details->show_barcode || $receipt_details->show_qr_code)
<div class="@if(!empty($receipt_details->footer_text)) col-xs-4 @else col-xs-12 @endif text-center">
@if($receipt_details->show_barcode)
{{-- Barcode --}}
<img class="center-block"
src="data:image/png;base64,{{DNS1D::getBarcodePNG($receipt_details->invoice_no, 'C128', 2,30,array(39, 48, 54), true)}}">
@endif

@if($receipt_details->show_qr_code && !empty($receipt_details->qr_code_text))
<img class="center-block mt-5"
src="data:image/png;base64,{{DNS2D::getBarcodePNG($receipt_details->qr_code_text, 'QRCODE', 3, 3, [39, 48, 54])}}">
@endif
</div>
@endif
</div>

</div> <!-- End of content wrapper -->

</div> <!-- End of watermark container -->

Step 8: Testing​

Test the Implementation​

  1. Access Invoice Settings

    • Go to your invoice layout settings
    • You should see the new watermark section
  2. Upload Watermark

    • Upload a watermark image
    • Set desired size, opacity, and position
    • Enable "Show Watermark" checkbox
    • Save the layout
  3. Generate Invoice

    • Create a test invoice
    • Verify watermark appears with correct settings
    • Check that text remains readable
  4. Test Different Settings

    • Try different opacity levels (5% - 30%)
    • Test different positions (center, corners)
    • Adjust size settings
    • Verify changes reflect on invoices

Step 9: Troubleshooting​

Common Issues and Solutions​

Watermark Not Showing​

  • Check if show_watermark is enabled
  • Verify watermark file exists in uploads/invoice_logos/
  • Ensure correct file permissions

404 Error for Watermark Image​

  • Verify image path in template: uploads/invoice_logos/filename
  • Check file upload was successful
  • Confirm file exists on server

Watermark Hidden Behind Table​

  • Ensure proper z-index values are set
  • Add transparency to table rows
  • Check CSS positioning

Form Not Saving Settings​

  • Verify all fields are in controller's $request->only() array
  • Check validation rules include watermark fields
  • Ensure database columns exist

File Permissions​

Ensure proper permissions for upload directory:

chmod 755 public/uploads/invoice_logos/
chown www-data:www-data public/uploads/invoice_logos/

Step 10: Customization Options​

Advanced Customizations​

Add More Position Options​

You can extend the position dropdown with additional options like:

  • Top center
  • Bottom center
  • Custom coordinates

Dynamic Opacity​

Implement slider control for opacity instead of dropdown.

Multiple Watermarks​

Extend to support multiple watermarks per invoice.

Conditional Watermarks​

Add logic to show different watermarks based on customer type, invoice amount, etc.

File Structure​

After implementation, your key files should include:

├── app/
│ ├── InvoiceLayout.php (updated)
│ └── Http/Controllers/InvoiceLayoutController.php (updated)
├── database/migrations/
│ └── add_watermark_fields_to_invoice_layouts.php (new)
├── resources/
│ ├── lang/en/lang_v1.php (updated)
│ └── views/
│ ├── invoice_layouts/create.blade.php (updated)
│ ├── invoice_layouts/edit.blade.php (updated)
│ └── receipts/invoice_template.blade.php (updated)
└── public/uploads/invoice_logos/ (watermark storage)

Security Considerations​

  • Validate uploaded images (file type, size)
  • Implement proper file naming to prevent conflicts
  • Set appropriate file permissions
  • Consider file size limits for performance

Performance Notes​

  • Watermark images should be optimized for web
  • Consider caching for frequently accessed watermarks
  • Monitor storage usage for uploaded watermarks
  • Implement cleanup for unused watermark files

Conclusion​

The watermark feature is now fully implemented in your Ultimate POS system. Users can upload custom watermarks, adjust their appearance, and position them on invoices while maintaining text readability.

For additional customizations or troubleshooting, refer to the Laravel documentation and Ultimate POS codebase structure.

💬 Discussion & Questions

Please sign in to join the discussion.

Loading comments...

💛 Support this project

Binance ID:

478036326
Premium Login