update marketing
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 5m14s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
Build, Push and Deploy / deploy-staging (push) Successful in 41s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-14 11:55:22 +07:00
parent f80fcc4c1b
commit 05fd3230b8
448 changed files with 17545 additions and 5128 deletions

View File

@@ -0,0 +1,59 @@
@extends('layouts.business.master')
@section('title')
{{ $party->type === 'Supplier' ? __('Advance Pay') : __('Advance Collect') }}
@endsection
@section('main_content')
<div class="erp-table-section">
<div class="container-fluid">
<div class="card border-0">
<div class="card-bodys ">
<div class="table-header p-16">
<h4>{{ $party->type === 'Supplier' ? __('Advance Pay') : __('Advance Collect') }}</h4>
</div>
<div class="order-form-section p-16">
<form action="{{ route('business.parties.advance-payments.store') }}" method="POST" class="ajaxform">
@csrf
<input type="hidden" name="party_id" value="{{ $party->id }}">
<div class="add-suplier-modal-wrapper d-block">
<div class="row">
<div class="col-lg-6 mb-2">
<label>{{ $party->type == 'Supplier' ? __('Supplier Name') : __('Customer Name') }}</label>
<input type="text" value="{{ $party->name }}" readonly class="form-control">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Date') }}</label>
<input type="date" name="date" required class="form-control" value="{{ date('Y-m-d') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Wallet Amount') }}</label>
<input type="number" value="{{ $party->wallet }}" readonly class="form-control">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Advance Amount') }}</label>
<input type="number" name="amount" id="advanceAmount" required class="form-control" placeholder="{{ __('Enter amount') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Notes') }}</label>
<input type="text" name="note" class="form-control" placeholder="{{ __('Enter notes') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Payment Type') }}</label>
@include('business::component.payment_type', ['context' => $party->type === 'Supplier' ? 'advance_pay' : 'advance_collect', 'payment_types' => $payment_types])
</div>
<div class="col-lg-12">
<div class="button-group text-center mt-5">
<button type="reset" class="theme-btn border-btn m-2">{{ __('Reset') }}</button>
<button class="theme-btn m-2 submit-btn">{{ __('Save') }}</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,142 @@
<div class="modal fade" id="parties-import-modal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{{__('Bulk Upload')}}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<!-- Modal Body -->
<div class="modal-body">
<div class="erp-table-section">
<div class="">
<div class="border-0">
<div class="card-bodys">
<form action="{{ route('business.parties.bulk-store', request('type')) }}" method="post" enctype="multipart/form-data" class="ajaxform">
@csrf
<div class="bulk-upload-container w-100">
<div class="d-flex justify-content-between align-items-center w-100">
<div class="bulk-input w-100">
<div class="row align-items-center">
<div class="col-lg-12">
<div class="custom-upload-wrapper">
<div class="custom-file-box">
<div class="custom-file-content">
<svg width="30" height="30" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 5V19M5 12H19" stroke="#4B5563" stroke-width="2.0" stroke-linecap="round"/>
</svg>
<span class="custom-upload-text">{{ __('Add File') }}</span>
</div>
<p class="preview-file d-none"></p>
<input type="file" name="file" class="preview-file-input" required>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="d-flex align-items-center justify-content-center gap-2 flex-wrap">
<button type="submit" class="add-order-btn process-csv-btn rounded-2 border-0 submit-btn mt-3">{{__('Submit')}}</button>
<a href="{{ asset('assets/party-bulk-upload.xlsx') }}" download="party-bulk-upload.xlsx" class="download-file-btn mt-3"><i class="fas fa-download"></i> {{__('Download Sample File')}}</a>
</div>
</div>
<div class="bulk-upload-container mt-3">
<div class="instruction-header">
<h5>{{__('Instructions')}}</h5>
<div class="mt-3">
<h6><strong>{{__('Note')}}: </strong> {{__('Please follow the instructions below to upload your file.')}}</h6>
<ul>
<li><b>{{__('1.')}}</b> {{__('Download the sample file first and add all your purchases data to it.')}}</li>
<li><b>{{__('2.')}}</b> <span class="text-danger">*</span> {{__('Indicates a required field. If you do not provide the required fields, the system will ignore except party information.')}}</li>
<li><b>{{__('3.')}}</b> {{__('After adding all your data, please save the file and then upload the updated version.')}}</li>
</ul>
</div>
</div>
</div>
{{-- Fields Documentation Table --}}
<div class="responsive-table mt-4 min-h-0">
<table class="table" id="datatable">
<thead>
<tr>
<th>{{ __('SL') }}.</th>
<th class="text-start">{{ __('Field Name') }}</th>
<th class="text-start">{{ __('Description') }}</th>
</tr>
</thead>
<tbody id="business-category-data">
<tr>
<td>{{__('1.')}}</td>
<td class="text-start">{{__('Customer/Supplier Name')}} <span class="text-danger fw-bold">*</span></td>
<td class="text-start">{{__('The name of the party you are adding')}} ({{__('e.g.,')}} <b>{{__('James')}}</b>).</td>
</tr>
<tr>
<td>{{__('1.')}}</td>
<td class="text-start">{{__('Phone Number')}}</td>
<td class="text-start">
{{__('Phone number of the party.')}} ({{__('e.g.,')}} <b>{{__('01*******')}}</b>).
</td>
</tr>
<tr>
<td>{{__('3.')}}</td>
<td class="text-start">{{__('Party Type')}} <span class="text-danger fw-bold">*</span></td>
<td class="text-start">
{{__('What is the party type. Retailer,Dealer,Wholesaler,Supplier. You have to store one of them.')}} ({{__('e.g.,')}} <b>{{__('Retailer')}}</b>).
</td>
</tr>
<tr>
<td>{{__('4.')}}</td>
<td class="text-start">{{__('Balance')}}</td>
<td class="text-start">
{{__('Party current balance.')}} ({{__('e.g.,')}} <b>{{__('500')}}</b>)
</td>
</tr>
<tr>
<td>{{__('5.')}}</td>
<td class="text-start">{{__('Balance Type')}}</td>
<td class="text-start">{{__('Balance type need to be added. due, advance')}} ({{__('e.g.,')}} <b>{{__('due')}}</b>).</td>
</tr>
<tr>
<td>{{__('6.')}}</td>
<td class="text-start">{{__('Email')}}</td>
<td class="text-start">
{{__('A unique email for the party')}} ({{__('e.g.,')}} <b>{{__('abc@gmail.com')}}</b>).
<br><small>{{__('Email must be unique — duplicate email will be ignored.')}}</small>
</td>
</tr>
<tr>
<td>{{__('7.')}}</td>
<td class="text-start">{{__('Party Credit Limit')}}</td>
<td class="text-start">{{__('This number field only applicable for Retailer,Dealer,Wholesaler.')}}</td>
</tr>
<tr>
<td>{{__('8.')}}</td>
<td class="text-start">{{__('Address')}}</td>
<td class="text-start">{{__('Party address')}}</td>
</tr>
<tr>
<td>{{__('9.')}}</</td>
<td class="text-start">{{__('Dealer Price')}}</td>
<td class="text-start">{{__('Special discounted price for bulk resellers or dealers.')}}</td>
</tr>
<tr>
<td>{{__('10.')}}</td>
<td class="text-start">{{__('Tax No')}}</td>
<td class="text-start">{{__('Enter tax no')}}</td>
</tr>
</tbody>
</table>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -5,13 +5,6 @@
@endsection
@php
$file = base_path('lang/countrylist.json');
if (file_exists($file)) {
$countries = json_decode(file_get_contents($file), true);
} else {
$countries = [];
}
$type = request('type') !== 'Supplier' ? 'Customer' : 'Supplier';
@endphp
@@ -27,12 +20,18 @@
<h4>{{ __('Add new :type', ['type' => __($type)]) }}</h4>
@usercan('parties.read')
<a href="{{ route('business.parties.index', ['type' => request('type')]) }}"
class="add-order-btn rounded-2 {{ Route::is('business.parties.create') ? 'active' : '' }}">
<i class="far fa-list" aria-hidden="true"></i>{{ __(':type List', ['type' => __($type)]) }}
</a>
@endusercan
<div class="d-flex align-items-center gap-3">
<a data-bs-toggle="modal" data-bs-target="#parties-import-modal" class="save-publish-btn" href="#">
{{__('Bulk Upload')}}
</a>
@usercan('parties.read')
<a href="{{ route('business.parties.index', ['type' => request('type')]) }}"
class="add-order-btn rounded-2 {{ Route::is('business.parties.create') ? 'active' : '' }}">
<i class="far fa-list" aria-hidden="true"></i>{{ __(':type List', ['type' => __($type)]) }}
</a>
@endusercan
</div>
</div>
<div class="order-form-section p-16">
@@ -43,11 +42,11 @@ class="add-order-btn rounded-2 {{ Route::is('business.parties.create') ? 'active
<div class="row col-lg-9">
<div class="col-lg-6 mb-2">
<label>{{ __($type . ' Name') }}</label>
<input type="text" name="name" required class="form-control" placeholder="{{ __('Enter '.$type.' Name') }}">
<input type="text" name="name" required class="form-control" placeholder="{{ __('Enter :type Name', ['type' => __($type)]) }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Phone Number') }}</label>
<input type="number" name="phone" class="form-control" placeholder="{{ __('Enter Phone Number') }}">
<input type="text" name="phone" class="form-control" placeholder="{{ __('Enter Phone Number') }}">
</div>
@if (request('type') !== 'Supplier')
<div class="col-lg-6 mb-2">
@@ -95,6 +94,12 @@ class="add-order-btn rounded-2 {{ Route::is('business.parties.create') ? 'active
<label>{{ __('Address') }}</label>
<input type="text" name="address" class="form-control" placeholder="{{ __('Enter Address') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Tax No') }}</label>
<input type="text" name="tax_no" class="form-control" placeholder="{{ __('Enter tax') }}">
</div>
<div class="accordion" id="customAccordion">
<div class="accordion-item border-0">
<h2 class="accordion-header">
@@ -106,31 +111,39 @@ class="add-order-btn rounded-2 {{ Route::is('business.parties.create') ? 'active
data-bs-parent="#customAccordion">
<div class="accordion-body fst-italic text-secondary p-0">
<div class="row">
<div class="col-lg-6 mb-2">
<label>{{ __('Address line 1') }}</label>
<input type="text" name="billing_address[address]" class="form-control" placeholder="{{ __('Enter address') }}">
<label>{{ __('Country') }}</label>
<select name="country_id" id="country_id" class="form-control">
<option value="">{{ __('Select a country') }}</option>
@foreach ($countries as $country)
<option value="{{ $country->id }}">{{ __($country->name) }}</option>
@endforeach
</select>
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('State') }}</label>
<select name="state_id" id="state_id" class="form-control">
<option value="">{{ __('Select state') }}</option>
</select>
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('City') }}</label>
<input type="text" name="billing_address[city]" class="form-control" placeholder="{{ __('Enter city') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('State') }}</label>
<input type="text" name="billing_address[state]" class="form-control" placeholder="{{ __('Enter state') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Zip Code') }}</label>
<input type="text" name="billing_address[zip_code]" class="form-control" placeholder="{{ __('Enter zip code') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Country') }}</label>
<select name="billing_address[country]" class="form-control">
<option value="">{{ __('Select a country') }}</option>
@foreach ($countries as $country)
<option value="{{ $country['name'] }}">{{ __($country['name']) }}</option>
@endforeach
</select>
<label>{{ __('Address line 1') }}</label>
<input type="text" name="billing_address[address]" class="form-control" placeholder="{{ __('Enter address') }}">
</div>
</div>
</div>
</div>
@@ -184,7 +197,7 @@ class="add-order-btn rounded-2 {{ Route::is('business.parties.create') ? 'active
<img src="{{ asset('assets/images/icons/img.png') }}" alt="icon" />
</div>
<p>{{__('Drag & drop your Image')}}</p>
<p>or <span class="browse-text">{{__('Browse')}}</span></p>
<p>{{__('or')}} <span class="browse-text">{{__('Browse')}}</span></p>
</div>
</div>
<input type="file" name="image" id="fileInput" accept="image/*">
@@ -205,4 +218,11 @@ class="add-order-btn rounded-2 {{ Route::is('business.parties.create') ? 'active
</div>
</div>
</div>
<input type="hidden" value="{{ route('business.get-states.index') }}" id="get-state">
@endsection
@push('modal')
@include('business::parties.bulk-upload.parties-import')
@endpush

View File

@@ -65,9 +65,21 @@ class="table-product-img">
@endusercan
</li>
<li>
<a
href="{{ route('business.parties.edit', [$party->id, 'type' => request('type')]) }}"><i
class="fal fa-edit"></i>{{ __('Edit') }}</a>
<a href="{{ route('business.parties.advance-payments', [$party->id, 'type' => request('type')]) }}">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" class="pt-1 me-0" xmlns="http://www.w3.org/2000/svg">
<path d="M1.66602 3.75H7.29715C7.96019 3.75 8.5961 4.01339 9.06493 4.48223L11.666 7.08333" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.16602 11.25H1.66602" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7.08268 6.25L8.74935 7.91667C9.2096 8.37692 9.2096 9.12308 8.74935 9.58333C8.28912 10.0436 7.54292 10.0436 7.08268 9.58333L5.83268 8.33333C5.11544 9.05058 3.97994 9.13125 3.16847 8.52267L2.91602 8.33333" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.16602 9.16536V12.9154C4.16602 14.4867 4.16602 15.2724 4.65417 15.7605C5.14232 16.2487 5.928 16.2487 7.49935 16.2487H14.9993C16.5707 16.2487 17.3563 16.2487 17.8445 15.7605C18.3327 15.2724 18.3327 14.4867 18.3327 12.9154V10.4154C18.3327 8.84403 18.3327 8.05834 17.8445 7.57019C17.3563 7.08203 16.5707 7.08203 14.9993 7.08203H7.91602" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12.7077 11.6654C12.7077 12.4708 12.0548 13.1237 11.2493 13.1237C10.4439 13.1237 9.79102 12.4708 9.79102 11.6654C9.79102 10.8599 10.4439 10.207 11.2493 10.207C12.0548 10.207 12.7077 10.8599 12.7077 11.6654Z" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
{{ $party->type == 'Supplier' ? __('Advance Pay') : __('Advance Collect') }}
</a>
</li>
<li>
<a href="{{ route('business.parties.edit', [$party->id, 'type' => request('type')]) }}">
<i class="fal fa-edit"></i>{{ __('Edit') }}
</a>
</li>
<li>
@usercan('parties.delete')

View File

@@ -5,13 +5,6 @@
@endsection
@php
$file = base_path('lang/countrylist.json');
if (file_exists($file)) {
$countries = json_decode(file_get_contents($file), true);
} else {
$countries = [];
}
$type = request('type') !== 'Supplier' ? 'Customer' : 'Supplier';
@endphp
@@ -49,7 +42,7 @@ class="ajaxform_instant_reload">
<div class="col-lg-6 mb-2">
<label>{{ __('Phone') }}</label>
<input type="number" value="{{ $party->phone }}" name="phone"
<input type="text" value="{{ $party->phone }}" name="phone"
class="form-control" placeholder="{{ __('Enter phone number') }}">
</div>
@@ -77,7 +70,8 @@ class="form-control" placeholder="{{ __('Enter phone number') }}">
@endif
@php
$branch_logic = $party->branch_id != (auth()->user()->active_branch?->id);
$branch_id = auth()->user()->branch_id ?? auth()->user()->active_branch_id ?? null;
$branch_logic = $party->branch_id != $branch_id;
@endphp
<div class="col-lg-6 mb-2">
@@ -116,6 +110,11 @@ class="form-control" placeholder="{{ __('Enter Email') }}">
class="form-control" placeholder="{{ __('Enter Address') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Tax No') }}</label>
<input type="text" value="{{ $party->tax_no }}" name="tax_no" class="form-control" placeholder="{{ __('Enter tax') }}">
</div>
<div class="accordion" id="customAccordion">
<div class="accordion-item border-0">
<h2 class="accordion-header">
@@ -131,12 +130,22 @@ class="accordion-button address-accordion collapsed fw-medium text-primary bg-t
data-bs-parent="#customAccordion">
<div class="accordion-body fst-italic text-secondary p-0">
<div class="row">
<div class="col-lg-6 mb-2">
<label>{{ __('Address') }}</label>
<input type="text" name="billing_address[address]"
value="{{ $party->billing_address['address'] ?? '' }}"
class="form-control"
placeholder="{{ __('Enter address') }}">
<label>{{ __('Country') }}</label>
<select name="country_id" id="country_id" class="form-control">
<option value="">{{ __('Select a country') }}</option>
@foreach ($countries as $country)
<option value="{{ $country->id }}" @selected(($party->country_id ?? '') == $country->id)>{{ __($country->name) }}</option>
@endforeach
</select>
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('State') }}</label>
<select name="state_id" id="state_id" class="form-control" data-selected="{{ $party->state_id ?? '' }}">
<option value="">{{ __('Select state') }}</option>
</select>
</div>
<div class="col-lg-6 mb-2">
@@ -147,14 +156,6 @@ class="form-control"
placeholder="{{ __('Enter city') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('State') }}</label>
<input type="text" name="billing_address[state]"
value="{{ $party->billing_address['state'] ?? '' }}"
class="form-control"
placeholder="{{ __('Enter state') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Zip Code') }}</label>
<input type="text" name="billing_address[zip_code]"
@@ -163,24 +164,18 @@ class="form-control"
placeholder="{{ __('Enter zip code') }}">
</div>
<div class="col-lg-6 mb-2">
<label>{{ __('Address') }}</label>
<input type="text" name="billing_address[address]"
value="{{ $party->billing_address['address'] ?? '' }}"
class="form-control"
placeholder="{{ __('Enter address') }}">
</div>
@php
$billing = is_array($party->billing_address) ? $party->billing_address : json_decode($party->billing_address, true) ?? [];
@endphp
<div class="col-lg-6 mb-2">
<label>{{ __('Country') }}</label>
<select name="billing_address[country]"
class="form-control">
<option value="">{{ __('Select a country') }}
</option>
@foreach ($countries as $country)
<option value="{{ $country['name'] }}"
@selected(($billing['country'] ?? '') == $country['name'])>
{{ __($country['name']) }}</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
@@ -204,7 +199,7 @@ class="accordion-button address-accordion fw-medium text-dark bg-transparent sha
<div class="col-lg-6 mb-2">
<label>{{ __('Address') }}</label>
<input type="text" name="shipping_address[address]"
value="{{ $party->billing_address['address'] ?? '' }}"
value="{{ $party->shipping_address['address'] ?? '' }}"
class="form-control"
placeholder="{{ __('Enter address') }}">
</div>
@@ -212,7 +207,7 @@ class="form-control"
<div class="col-lg-6 mb-2">
<label>{{ __('City') }}</label>
<input type="text" name="shipping_address[city]"
value="{{ $party->billing_address['city'] ?? '' }}"
value="{{ $party->shipping_address['city'] ?? '' }}"
class="form-control"
placeholder="{{ __('Enter city') }}">
</div>
@@ -220,7 +215,7 @@ class="form-control"
<div class="col-lg-6 mb-2">
<label>{{ __('State') }}</label>
<input type="text" name="shipping_address[state]"
value="{{ $party->billing_address['state'] ?? '' }}"
value="{{ $party->shipping_address['state'] ?? '' }}"
class="form-control"
placeholder="{{ __('Enter state') }}">
</div>
@@ -228,7 +223,7 @@ class="form-control"
<div class="col-lg-6 mb-2">
<label>{{ __('Zip Code') }}</label>
<input type="text" name="shipping_address[zip_code]"
value="{{ $party->billing_address['zip_code'] ?? '' }}"
value="{{ $party->shipping_address['zip_code'] ?? '' }}"
class="form-control"
placeholder="{{ __('Enter zip code') }}">
</div>
@@ -265,7 +260,7 @@ class="form-control">
<img src="{{ asset( $party->image ?? 'assets/images/icons/img.png') }}" alt="icon" />
</div>
<p>{{__('Drag & drop your Image')}}</p>
<p>or <span class="browse-text">{{__('Browse')}}</span></p>
<p>{{__('or')}} <span class="browse-text">{{__('Browse')}}</span></p>
</div>
</div>
@@ -290,5 +285,6 @@ class="theme-btn border-btn m-2">{{ __('Cancel') }}</a>
</div>
</div>
</div>
</div>
<input type="hidden" value="{{ route('business.get-states.index') }}" id="get-state">
@endsection