This commit is contained in:
Cüneyt Şentürk 2022-10-05 10:09:10 +03:00
parent 4e6988373c
commit 38c6ccd9c7
10 changed files with 46 additions and 46 deletions

View File

@ -171,7 +171,7 @@ abstract class Report
$sum += is_array($total) ? array_sum($total) : $total; $sum += is_array($total) ? array_sum($total) : $total;
} }
$total = $this->has_money ? money($sum, setting('default.currency'), true)->format() : $sum; $total = $this->has_money ? money($sum, default_currency(), true)->format() : $sum;
} else { } else {
$total = trans('general.na'); $total = trans('general.na');
} }

View File

@ -67,7 +67,7 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
$currency_code = !empty($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; $currency_code = !empty($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code;
$this->request['company_id'] = $this->model->company_id; $this->request['company_id'] = $this->model->company_id;
$this->request['currency_code'] = isset($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; $this->request['currency_code'] = $currency_code;
$this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->toDateTimeString(); $this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->toDateTimeString();
$this->request['currency_rate'] = config('money.' . $currency_code . '.rate'); $this->request['currency_rate'] = config('money.' . $currency_code . '.rate');
$this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account'); $this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account');

View File

@ -66,7 +66,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$currency_code = ! empty($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; $currency_code = ! empty($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code;
$this->request['company_id'] = $this->model->company_id; $this->request['company_id'] = $this->model->company_id;
$this->request['currency_code'] = isset($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; $this->request['currency_code'] = $currency_code;
$this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->toDateTimeString(); $this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->toDateTimeString();
$this->request['currency_rate'] = config('money.' . $currency_code . '.rate'); $this->request['currency_rate'] = config('money.' . $currency_code . '.rate');
$this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account'); $this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account');

View File

@ -28,7 +28,7 @@ class CreateDocumentItem extends Job implements HasOwner, HasSource, ShouldCreat
public function handle(): DocumentItem public function handle(): DocumentItem
{ {
$item_id = !empty($this->request['item_id']) ? $this->request['item_id'] : 0; $item_id = ! empty($this->request['item_id']) ? $this->request['item_id'] : 0;
$precision = config('money.' . $this->document->currency_code . '.precision'); $precision = config('money.' . $this->document->currency_code . '.precision');
$item_amount = (double) $this->request['price'] * (double) $this->request['quantity']; $item_amount = (double) $this->request['price'] * (double) $this->request['quantity'];
@ -36,7 +36,7 @@ class CreateDocumentItem extends Job implements HasOwner, HasSource, ShouldCreat
$item_discounted_amount = $item_amount; $item_discounted_amount = $item_amount;
// Apply line discount to amount // Apply line discount to amount
if (!empty($this->request['discount'])) { if (! empty($this->request['discount'])) {
if ($this->request['discount_type'] === 'percentage') { if ($this->request['discount_type'] === 'percentage') {
$item_discounted_amount -= ($item_amount * ($this->request['discount'] / 100)); $item_discounted_amount -= ($item_amount * ($this->request['discount'] / 100));
} else { } else {

View File

@ -63,7 +63,7 @@
{{ trans('modules.free') }} {{ trans('modules.free') }}
</span> </span>
@else @else
@if (!empty($module->is_discount)) @if (! empty($module->is_discount))
{!! trans('modules.monthly_price', ['price' => '<del class="text-danger">' . $module->yearly_per_monthly_price . '</del> ' . $module->yearly_per_monthly_special_price]) !!} {!! trans('modules.monthly_price', ['price' => '<del class="text-danger">' . $module->yearly_per_monthly_price . '</del> ' . $module->yearly_per_monthly_special_price]) !!}
@else @else
{!! trans('modules.monthly_price', ['price' => $module->yearly_per_monthly_price]) !!} {!! trans('modules.monthly_price', ['price' => $module->yearly_per_monthly_price]) !!}

View File

@ -2,64 +2,64 @@
<x-tabs active="general" class="grid grid-cols-3" override="class"> <x-tabs active="general" class="grid grid-cols-3" override="class">
<x-slot name="navs"> <x-slot name="navs">
<x-tabs.nav id="general"> <x-tabs.nav id="general">
{{ trans('general.general') }} {{ trans('general.general') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name')||form.errors.has('email')||form.errors.has('phone')||form.errors.has('tax_number')||form.errors.has('currency_code')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name') || form.errors.has('email') || form.errors.has('phone') || form.errors.has('tax_number') || form.errors.has('currency_code')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
<x-tabs.nav id="address"> <x-tabs.nav id="address">
{{ trans('general.address') }} {{ trans('general.address') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address')||form.errors.has('city')||form.errors.has('zip_code')||form.errors.has('state')||form.errors.has('country')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address') || form.errors.has('city') || form.errors.has('zip_code') || form.errors.has('state') || form.errors.has('country')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
<x-tabs.nav id="other"> <x-tabs.nav id="other">
{{ trans_choice('general.others', 1) }} {{ trans_choice('general.others', 1) }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website')||form.errors.has('reference')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website') || form.errors.has('reference')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
</x-slot> </x-slot>
<x-slot name="content"> <x-slot name="content">
<x-tabs.tab id="general"> <x-tabs.tab id="general">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" /> <x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" />
<x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required />
<x-form.group.currency without-add-new form-group-class="col-span-6" :add-new-text="trans_choice('general.currencies', 1)" /> <x-form.group.currency without-add-new form-group-class="col-span-6" :add-new-text="trans_choice('general.currencies', 1)" />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
<x-tabs.tab id="address"> <x-tabs.tab id="address">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" rows=2 not-required /> <x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" rows=2 not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required /> <x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
<x-tabs.tab id="other"> <x-tabs.tab id="other">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.text name="website" label="{{ trans('general.website') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="website" label="{{ trans('general.website') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="reference" label="{{ trans('general.reference') }}" form-group-class="col-span-6" not-required />
<x-form.input.hidden name="type" value="customer" /> <x-form.input.hidden name="type" value="customer" />

View File

@ -4,7 +4,7 @@
<x-tabs.nav id="general"> <x-tabs.nav id="general">
{{ trans('general.general') }} {{ trans('general.general') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name')||form.errors.has('email')||form.errors.has('phone')||form.errors.has('tax_number')||form.errors.has('currency_code')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name') || form.errors.has('email') || form.errors.has('phone') || form.errors.has('tax_number') || form.errors.has('currency_code')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -12,7 +12,7 @@
<x-tabs.nav id="address"> <x-tabs.nav id="address">
{{ trans('general.address') }} {{ trans('general.address') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address')||form.errors.has('city')||form.errors.has('zip_code')||form.errors.has('state')||form.errors.has('country')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address') || form.errors.has('city') || form.errors.has('zip_code') || form.errors.has('state') || form.errors.has('country')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -20,7 +20,7 @@
<x-tabs.nav id="other"> <x-tabs.nav id="other">
{{ trans_choice('general.others', 1) }} {{ trans_choice('general.others', 1) }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website')||form.errors.has('reference')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website') || form.errors.has('reference')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -32,19 +32,19 @@
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" /> <x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" />
<x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required />
<x-form.group.currency without-add-new form-group-class="col-span-6" /> <x-form.group.currency without-add-new form-group-class="col-span-6" />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
<x-tabs.tab id="address"> <x-tabs.tab id="address">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required /> <x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required />

View File

@ -4,7 +4,7 @@
<x-tabs.nav id="general"> <x-tabs.nav id="general">
{{ trans('general.general') }} {{ trans('general.general') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name')||form.errors.has('email')||form.errors.has('phone')||form.errors.has('tax_number')||form.errors.has('currency_code')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name') || form.errors.has('email') || form.errors.has('phone') || form.errors.has('tax_number') || form.errors.has('currency_code')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -12,7 +12,7 @@
<x-tabs.nav id="address"> <x-tabs.nav id="address">
{{ trans('general.address') }} {{ trans('general.address') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address')||form.errors.has('city')||form.errors.has('zip_code')||form.errors.has('state')||form.errors.has('country')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address') || form.errors.has('city') || form.errors.has('zip_code') || form.errors.has('state') || form.errors.has('country')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -20,7 +20,7 @@
<x-tabs.nav id="other"> <x-tabs.nav id="other">
{{ trans_choice('general.others', 1) }} {{ trans_choice('general.others', 1) }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website')||form.errors.has('reference')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website') || form.errors.has('reference')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -32,11 +32,11 @@
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" /> <x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" />
<x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required />
<x-form.group.currency without-add-new form-group-class="col-span-6" /> <x-form.group.currency without-add-new form-group-class="col-span-6" />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
@ -44,7 +44,7 @@
<x-tabs.tab id="address"> <x-tabs.tab id="address">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required /> <x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required />

View File

@ -4,7 +4,7 @@
<x-tabs.nav id="general"> <x-tabs.nav id="general">
{{ trans('general.general') }} {{ trans('general.general') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name')||form.errors.has('email')||form.errors.has('phone')||form.errors.has('tax_number')||form.errors.has('currency_code')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name') || form.errors.has('email') || form.errors.has('phone') || form.errors.has('tax_number') || form.errors.has('currency_code')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -12,7 +12,7 @@
<x-tabs.nav id="address"> <x-tabs.nav id="address">
{{ trans('general.address') }} {{ trans('general.address') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address')||form.errors.has('city')||form.errors.has('zip_code')||form.errors.has('state')||form.errors.has('country')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address') || form.errors.has('city') || form.errors.has('zip_code') || form.errors.has('state') || form.errors.has('country')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -20,7 +20,7 @@
<x-tabs.nav id="other"> <x-tabs.nav id="other">
{{ trans_choice('general.others', 1) }} {{ trans_choice('general.others', 1) }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website')||form.errors.has('reference')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website') || form.errors.has('reference')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -32,19 +32,19 @@
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" /> <x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" />
<x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required />
<x-form.group.currency without-add-new form-group-class="col-span-6" /> <x-form.group.currency without-add-new form-group-class="col-span-6" />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
<x-tabs.tab id="address"> <x-tabs.tab id="address">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required /> <x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required />

View File

@ -66,7 +66,7 @@
<x-index.disable text="{{ trans_choice('general.currencies', 1) }}" /> <x-index.disable text="{{ trans_choice('general.currencies', 1) }}" />
@endif @endif
@if ($item->code == setting("default.currency")) @if ($item->code == default_currency())
<x-index.default text="{{ trans('currencies.default') }}" /> <x-index.default text="{{ trans('currencies.default') }}" />
@endif @endif
</x-slot> </x-slot>