@extends('layouts.portal') @section('title', 'Edit Will Document - ' . $will->id) @section('page_title', 'Edit Will Document') @section('page_subtitle', 'Last Will and Testament - Version v{{ $will->version ?? 1 }}') @push('styles') @endpush @section('sidebar') @include('agent.partials.sidebar', ['active' => 'wills']) @endsection @section('content')

Edit Will Document

Client: {{ $client->full_name }} | Will ID: #{{ $will->id }}

Back
Saved
SAMPLE

LAST WILL AND TESTAMENT

Will Reference No: {{ $will->id }}

Date: {{ date('d F Y') }}

I, {{ strtoupper($client->full_name ?? '_________________________') }}, (NRIC/Passport No: {{ $client->ic_number ?? '_________________________' }}), of {{ $client->country ?? 'Malaysian' }} nationality, presently residing at {{ $client->address ?? '_________________________' }}, born on {{ $client->date_of_birth ? $client->date_of_birth->format('d F Y') : '_________________________' }}, being of sound mind, memory and understanding, do hereby make, publish and declare this to be my LAST WILL AND TESTAMENT, hereby expressly revoking all previous wills, codicils and testamentary dispositions made by me at any time heretofore.

FIRST: REVOCATION

I hereby revoke, annul and cancel all wills, codicils and other testamentary dispositions heretofore made by me, and declare this to be my Last Will and Testament.

@if($will->is_joint)

JOINT WILL DECLARATION: This is a Joint Will made jointly by:

1. {{ strtoupper($client->full_name ?? '_________________________') }} (NRIC/Passport No: {{ $client->ic_number ?? '_________________________' }})

@if($will->jointClient)

2. {{ strtoupper($will->jointClient->full_name ?? '_________________________') }} (NRIC/Passport No: {{ $will->jointClient->ic_number ?? '_________________________' }}) @if($will->jointClient->address) of {{ $will->jointClient->address }} @endif

@elseif(!empty($jointTestatorDetails['primary']))

2. {{ strtoupper($jointTestatorDetails['primary']['full_name'] ?? '_________________________') }} (NRIC/Passport No: {{ $jointTestatorDetails['primary']['ic'] ?? '_________________________' }}) @if(!empty($jointTestatorDetails['primary']['address'])) of {{ $jointTestatorDetails['primary']['address'] }} @endif

@endif

We hereby declare that this Joint Will represents our mutual testamentary intentions and that we have each made this Will freely and voluntarily.

@endif @if(isset($client) && $client->familyMembers && count($client->familyMembers) > 0)

SECOND: FAMILY DECLARATION

I declare that my family members are as follows:

@foreach($client->familyMembers as $member) @endforeach
No. Full Name Relationship NRIC/Passport Phone
{{ $loop->index + 1 }} {{ strtoupper($member->full_name ?? '_________________________') }} {{ ucfirst($member->relationship ?? '_________________________') }} {{ $member->ic_number ?? '_________________________' }} {{ $member->phone ?? '_________________________' }}
@endif

THIRD: APPOINTMENT OF EXECUTOR

@if(!empty($executor['full_name']))

I hereby nominate, constitute and appoint {{ strtoupper($executor['full_name']) }} (NRIC: {{ $executor['ic'] ?? '_________________________' }}) to be the Executor and Trustee of this my Will. I authorize my Executor to settle all my debts, funeral and testamentary expenses, and to distribute the residue of my estate according to the provisions herein contained.

@if(!empty($alternate_executor['full_name']))

In the event that the above-named Executor shall fail, refuse or be unable to act, I hereby nominate {{ strtoupper($alternate_executor['full_name']) }} (NRIC: {{ $alternate_executor['ic'] ?? '_________________________' }}) to act as the alternate Executor and Trustee of this my Will.

@endif @else

[No Executor appointed]

@endif

FOURTH: BENEFICIARIES AND DISTRIBUTION

I give, devise and bequeath my estate to my beneficiaries in the manner following:

@if(!empty($beneficiaries) && count($beneficiaries) > 0) @foreach($beneficiaries as $beneficiary) @php // Handle both array and object access $fullName = is_array($beneficiary) ? ($beneficiary['full_name'] ?? 'Not specified') : ($beneficiary->full_name ?? 'Not specified'); $relationship = is_array($beneficiary) ? ($beneficiary['relationship'] ?? 'Not specified') : ($beneficiary->relationship ?? 'Not specified'); @endphp @endforeach
No. Full Name Relationship
{{ $loop->index + 1 }} {{ strtoupper($fullName) }} {{ $relationship }}
@else

No beneficiaries have been added to this will.

@endif

TOTAL ESTATE VALUE: RM {{ number_format($totalEstateValue ?? (collect($beneficiaries)->sum('estimated_value') ?? 0), 2) }}

FIFTH: SPECIFIC BEQUESTS OF ASSETS

@if(!empty($assets) && count($assets) > 0)

I declare that I am the sole and absolute owner of the following assets, which I hereby give, devise and bequeath as follows:

@foreach($assets as $index => $asset)

{{ $index + 1 }}. I give and bequeath my {{ ucfirst(str_replace('_', ' ', $asset['main_category'] ?? 'Asset')) }} ({{ $asset['sub_category'] ?? 'N/A' }}) @if(!empty($asset['description'])) - {{ $asset['description'] }} @endif @if(!empty($asset['address'])) located at {{ $asset['address'] }} @endif @if(!empty($asset['acquisition_year'])) acquired in the year {{ $asset['acquisition_year'] }} @endif @if(!empty($asset['value'])) valued at RM {{ number_format($asset['value'], 2) }} @endif with a monthly income of RM {{ number_format($asset['monthly_income'] ?? 0, 2) }}.

@if(!empty($asset['ownership_type']) && strtolower($asset['ownership_type']) === 'joint')

This asset is jointly owned @if(!empty($asset['ownership_percentage'])) (my share: {{ $asset['ownership_percentage'] }}%) @endif @if(!empty($asset['co_owners'])) with {{ $asset['co_owners'] }} @endif.

@endif @if(isset($asset['beneficiaries']) && !empty($asset['beneficiaries']))

This asset shall be distributed to the following beneficiaries:

@foreach($asset['beneficiaries'] as $beneficiary)

{{ strtoupper($beneficiary['full_name'] ?? 'N/A') }} (NRIC: {{ $beneficiary['ic_number'] ?? 'N/A' }}), {{ ucfirst($beneficiary['relationship'] ?? 'N/A') }}, entitled to {{ $beneficiary['percentage'] ?? 0 }}% share thereof. Contact: {{ $beneficiary['email'] ?? 'N/A' }}, {{ $beneficiary['phone'] ?? 'N/A' }}. Address: {{ $beneficiary['address'] ?? 'N/A' }}.

@endforeach @endif
@endforeach

The total aggregate value of all assets bequeathed herein is estimated at RM {{ number_format(collect($assets)->sum('value') ?? collect($assets)->sum('current_value') ?? 0, 2) }}.

@if(!empty($liabilities) && count($liabilities) > 0)

The total liabilities against these assets amount to RM {{ number_format(collect($liabilities)->sum('amount') ?? 0, 2) }}, resulting in a net asset value of RM {{ number_format((collect($assets)->sum('value') ?? collect($assets)->sum('current_value') ?? 0) - (collect($liabilities)->sum('amount') ?? 0), 2) }}.

@endif
@else

[No assets specified]

@endif

SIXTH: LIABILITIES

@if(!empty($liabilities) && count($liabilities) > 0)

I declare that I have the following liabilities which shall be paid from my estate prior to distribution:

@foreach($liabilities as $index => $liability)

{{ $index + 1 }}. I hereby declare that I have a liability with {{ $liability['creditor'] ?? 'N/A' }} (Account Number: {{ $liability['account_number'] ?? 'N/A' }}). This is a {{ ucfirst(str_replace('_', ' ', $liability['type'] ?? $liability['liability_type'] ?? 'N/A')) }} @if(!empty($liability['description'])) described as {{ $liability['description'] }} @endif with an outstanding amount of RM {{ number_format($liability['amount'] ?? 0, 2) }}. @if(!empty($liability['monthly_payment']) && $liability['monthly_payment'] != 0) The monthly payment is RM {{ number_format($liability['monthly_payment'], 2) }} @endif @if(!empty($liability['interest_rate'])) at an interest rate of {{ $liability['interest_rate'] }}% @endif. @if(!empty($liability['start_date'])) This liability commenced on {{ $liability['start_date'] }} @endif @if(!empty($liability['maturity_date'])) and is due to mature on {{ $liability['maturity_date'] }} @endif. The current status of this liability is {{ ucfirst($liability['status'] ?? 'Active') }}.

@if(isset($liability['family_members']) && !empty($liability['family_members']))

The following family members are responsible for this liability:

@php $fmArray = $liability['family_members']; if (!is_array($fmArray)) { $fmArray = json_decode($fmArray, true) ?? []; } @endphp @foreach($fmArray as $memberId => $memberData) @php // Handle both indexed array format and associative array format if (is_array($memberData) && isset($memberData['id'])) { $memberId = $memberData['id']; $percentage = $memberData['percentage'] ?? null; } else { $memberId = is_numeric($memberId) ? $memberId : null; $percentage = null; } $member = $memberId ? $client->familyMembers->firstWhere('id', $memberId) : null; @endphp @if($member)

{{ strtoupper($member->full_name) }} (NRIC: {{ $member->ic_number ?? 'N/A' }}), {{ ucfirst($member->relationship ?? 'N/A') }}. @if($percentage !== null && $percentage !== '' && $percentage != 0) Responsible for {{ $percentage }}% thereof. @endif

@endif @endforeach @endif
@endforeach

TOTAL LIABILITIES: RM {{ number_format(collect($liabilities)->sum('amount') ?? 0, 2) }}

@else

[No liabilities specified]

@endif
@php $existingWillData = $instructions['existing_will'] ?? null; // Handle both old and new field naming conventions if (!empty($existingWillData)) { $willDate = $existingWillData['will_date'] ?? $existingWillData['existing_will_date'] ?? null; $willNumber = $existingWillData['will_number'] ?? $existingWillData['existing_will_number'] ?? null; $contactPerson = $existingWillData['contact_person'] ?? $existingWillData['existing_will_executor'] ?? null; $contactTel = $existingWillData['contact_tel'] ?? $existingWillData['existing_will_contact_tel'] ?? null; $companyName = $existingWillData['company_name'] ?? $existingWillData['existing_will_company'] ?? null; $address = $existingWillData['address'] ?? $existingWillData['existing_will_location'] ?? null; $hasData = ($willDate || $willNumber || $contactPerson || $contactTel || $companyName || $address); } else { $hasData = false; } @endphp @if($hasData && !empty($existingWillData))

SEVENTH: EXISTING WILL INFORMATION

I hereby declare the following information regarding my existing will:

@if($willDate) @endif @if($willNumber) @endif @if($contactPerson) @endif @if($contactTel) @endif @if($companyName) @endif @if($address) @endif @if(isset($existingWillData['existing_will_notes']) && $existingWillData['existing_will_notes']) @endif
Will Date: {{ $willDate }}
Will Number: {{ $willNumber }}
Contact Person/Executor: {{ $contactPerson }}
Contact Telephone: {{ $contactTel }}
Company Name: {{ $companyName }}
Will Location/Address: {{ $address }}
Notes: {{ $existingWillData['existing_will_notes'] }}
@endif

EIGHTH: MONTHLY ALLOWANCES

@if(!empty($allowances) && count($allowances) > 0)

I hereby direct my Executor to provide the following monthly allowances from my estate:

@foreach($allowances as $index => $allowance) @endforeach
No. Beneficiary Amount (RM) Duration Conditions
{{ $loop->index + 1 }} {{ $allowance['beneficiary_name'] ?? 'Not specified' }} {{ number_format($allowance['amount'] ?? 0, 2) }} {{ $allowance['duration'] ?? 'Not specified' }} {{ $allowance['conditions'] ?? 'N/A' }}
@else

[No monthly allowances specified]

@endif

NINTH: SPECIFIC GIFTS

@if(!empty($gifts) && count($gifts) > 0)

I hereby give and bequeath the following specific gifts:

@foreach($gifts as $index => $gift) @endforeach
No. Description Recipient Value (RM)
{{ $loop->index + 1 }} {{ $gift['description'] ?? 'Gift' }} {{ $gift['recipient_name'] ?? 'Not specified' }} {{ number_format($gift['value'] ?? 0, 2) }}
@else

[No specific gifts specified]

@endif

TENTH: CHARITABLE DONATIONS

@if(!empty($donations) && count($donations) > 0)

I hereby give and bequeath the following charitable donations:

@foreach($donations as $index => $donation) @endforeach
No. Organization Percentage Purpose
{{ $loop->index + 1 }} {{ $donation['organization'] ?? 'Organization' }} {{ $donation['percentage'] ?? '0' }}% {{ $donation['purpose'] ?? 'General' }}
@else

[No charitable donations specified]

@endif

ELEVENTH: APPOINTMENT OF TRUSTEES

@if(!empty($trustees) && count($trustees) > 0)

I hereby appoint the following person(s) as Trustee(s) of this my Will to manage and administer my estate in accordance with the provisions herein contained:

@foreach($trustees as $index => $trustee) @endforeach
No. Full Name NRIC/Passport Phone
{{ $loop->index + 1 }} {{ strtoupper($trustee['full_name'] ?? 'Not specified') }} {{ $trustee['ic'] ?? '_________________________' }} {{ $trustee['phone'] ?? 'N/A' }}
@else

[No trustees appointed]

@endif

TWELFTH: RESIDUAL ESTATE

All the rest, residue and remainder of my estate, both real and personal, of whatsoever nature and wheresoever situated, which I may own or be entitled to at the time of my death, and which is not otherwise effectively disposed of by this my Will, I give, devise and bequeath unto my beneficiaries as specified herein, in the proportions hereinbefore indicated.

THIRTEENTH: FUNERAL ARRANGEMENTS

I direct that my funeral and burial arrangements be made in a manner befitting my station in life, and that all reasonable expenses thereof be paid from my estate as a first charge thereon.

FOURTEENTH: DISPUTE RESOLUTION

In the event of any dispute arising from the interpretation or administration of this my Will, I direct that the laws of Malaysia shall govern, and the Courts of Malaysia shall have exclusive jurisdiction to determine any such dispute.

FIFTEENTH: EXECUTION

IN WITNESS WHEREOF

I have hereunto set my hand this {{ date('d') }} day of {{ date('F') }}, {{ date('Y') }}.



{{ strtoupper($client->full_name ?? $testator['full_name'] ?? '_________________________') }}

Signature of Testator

NRIC/Passport: {{ $client->ic_number ?? $testator['ic'] ?? '_________________________' }}

Name: {{ strtoupper($client->full_name ?? $testator['full_name'] ?? '_________________________') }}

Signed by the Testator:

{{ strtoupper($client->full_name ?? '_________________________') }}

Signature of Testator

NRIC/Passport: {{ $client->ic_number ?? '_________________________' }}

Name: {{ strtoupper($client->full_name ?? '_________________________') }}

WITNESSES:

@if(!empty($witnesses) && count($witnesses) > 0)

SIGNED, PUBLISHED and DECLARED by the above-named Testator as and for their Last Will and Testament in the presence of us, who at the Testator's request and in the presence of the Testator and in the presence of each other, have hereunto subscribed our names as witnesses on the date and time stated below:

@foreach($witnesses as $index => $witness) @php $witnessData = is_array($witness) ? $witness : (is_object($witness) ? (array)$witness : []); $witnessSignature = $witnessData['digital_signature'] ?? $witnessData['signature'] ?? null; $witnessName = $witnessData['full_name'] ?? '_________________________'; $witnessIC = $witnessData['ic_number'] ?? $witnessData['ic'] ?? '_________________________'; $witnessAddress = $witnessData['address'] ?? '_________________________'; @endphp @endforeach
No. Full Name Signature NRIC/Passport Address Date & Time
{{ $loop->index + 1 }}

{{ strtoupper($witnessName) }}

@if(!empty($witnessSignature)) @else
@endif
{{ $witnessIC }} {{ $witnessAddress }} {{ date('d-m-Y') }}
{{ date('h:i A') }}

WE, the above-named witnesses, do hereby declare that the Testator signed and executed this Will in our presence, and we, in the presence of the Testator and in the presence of each other, have hereunto subscribed our names as witnesses.

@else

[No witnesses specified]

@endif

Lawyer Attestation & Digital Signature

I, the undersigned Advocate & Solicitor of the High Court of Malaya, do hereby certify that:

  1. I have verified the identity of the Testator through their original NRIC/Passport;
  2. The Testator appeared to be of sound mind and understood the nature and effect of this Will;
  3. This Will was executed in accordance with the Wills Act 1959 (Revised 1988) of Malaysia;
  4. I have witnessed the execution of this Will by the Testator.

Digital Signature:
_________________________

Date & Time of Attestation:
{{ date('d F Y, h:i A') }}

Name of Lawyer: _________________________
Bar Council Number: _________________________
Firm: _________________________
Office Address: _________________________

This digital signature is affixed in accordance with the Electronic Commerce Act 2006
and the Digital Signature Act 1997 of Malaysia.

THIS IS A PREVIEW OF THE LAST WILL AND TESTAMENT

Please review all details carefully before executing the final document.

Will Reference: {{ $will->id }} | Generated: {{ date('d F Y, h:i A') }}

Current Version: v{{ $will->version ?? 1 }} | Last Updated: {{ $will->updated_at->format('M d, Y H:i') }}
Saving will create a new version (v{{ ($will->version ?? 1) + 1 }})
@endsection