Fixes for select box background color

This commit is contained in:
David Bomba 2022-09-06 20:51:42 +10:00
parent c5de797e04
commit d79b374eda
14 changed files with 35 additions and 39 deletions

View File

@ -21,6 +21,7 @@ class ContactRegister
{
$domain_name = $request->getHost();
/* Hosted */
if (strpos($domain_name, 'invoicing.co') !== false) {
$subdomain = explode('.', $domain_name)[0];
@ -42,6 +43,7 @@ class ContactRegister
}
}
/* Hosted */
if (Ninja::isHosted()) {
$query = [
'portal_domain' => $request->getSchemeAndHttpHost(),

View File

@ -45,8 +45,7 @@ class MarkInvoiceDeleted extends AbstractService
->setAdjustmentAmount()
->deletePaymentables()
->adjustPayments()
->adjustPaidToDate()
->adjustBalance()
->adjustPaidToDateAndBalance()
->adjustLedger();
$transaction = [
@ -70,21 +69,29 @@ class MarkInvoiceDeleted extends AbstractService
return $this;
}
private function adjustPaidToDate()
private function adjustPaidToDateAndBalance()
{
$client = $this->invoice->client->fresh();
$client->paid_to_date += $this->adjustment_amount * -1;
$client->save();
// $this->invoice->client->service()->updatePaidToDate($this->adjustment_amount * -1)->save(); //reduces the paid to date by the payment totals
// $client = $this->invoice->client->fresh();
// $client->paid_to_date += $this->adjustment_amount * -1;
// $client->balance += $this->balance_adjustment * -1;
// $client->save();
// 06-09-2022
$this->invoice
->client
->service()
->updateBalanceAndPaidToDate($this->balance_adjustment * -1, $this->adjustment_amount * -1)
->save(); //reduces the paid to date by the payment totals
return $this;
}
// @deprecated
private function adjustBalance()
{
$client = $this->invoice->client->fresh();
$client->balance += $this->balance_adjustment * -1;
$client->save();
// $client = $this->invoice->client->fresh();
// $client->balance += $this->balance_adjustment * -1;
// $client->save();
// $this->invoice->client->service()->updateBalance($this->balance_adjustment * -1)->save(); //reduces the client balance by the invoice amount.

View File

@ -117,16 +117,12 @@ class MarkPaid extends AbstractService
$payment->ledger()
->updatePaymentBalance($this->payable_balance * -1);
// \DB::connection(config('database.default'))->transaction(function () use ($payment) {
// /* Get the last record for the client and set the current balance*/
// $client = Client::withTrashed()->where('id', $this->invoice->client_id)->lockForUpdate()->first();
// $client->paid_to_date += $payment->amount;
// $client->balance -= $payment->amount;
// $client->save();
// }, 1);
$this->invoice->client->service()->updateBalanceAndPaidToDate($payment->amount*-1, $payment->amount)->save();
//06-09-2022
$this->invoice
->client
->service()
->updateBalanceAndPaidToDate($payment->amount*-1, $payment->amount)
->save();
$this->invoice = $this->invoice
->service()

View File

@ -62,16 +62,6 @@ class MarkSent extends AbstractService
->save();
/*Adjust client balance*/
// \DB::connection(config('database.default'))->transaction(function () use ($adjustment) {
// /* Get the last record for the client and set the current balance*/
// $client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first();
// $client->balance += $adjustment;
// $client->save();
// }, 1);
$this->invoice->client->service()->updateBalance($adjustment)->save();
$this->invoice->markInvitationsSent();

View File

@ -28,6 +28,7 @@ trait Refundable
/**
* Entry point for processing of refunds.
* @param array $data
* @deprecated ???? 06-09-2022
* @return Refundable
* @throws PaymentRefundFailed
*/

View File

@ -52,7 +52,7 @@
@elseif($field['key'] === 'country_id')
<select
id="shipping_country"
class="input w-full form-select"
class="input w-full form-select bg-white"
name="country_id">
<option value="none"></option>
@foreach(App\Utils\TranslationHelper::getCountries() as $country)

View File

@ -15,7 +15,7 @@
@if(!array_key_exists('filled', $field))
@component('portal.ninja2020.components.general.card-element', ['title' => $field['label']])
@if($field['name'] == 'client_country_id' || $field['name'] == 'client_shipping_country_id')
<select id="client_country" class="input w-full form-select" name="{{ $field['name'] }}" wire:model.lazy="{{ str_replace(["client_","_line_","contact_"], ["client.","","contact."], $field['name']) }}">
<select id="client_country" class="input w-full form-select bg-white" name="{{ $field['name'] }}" wire:model.lazy="{{ str_replace(["client_","_line_","contact_"], ["client.","","contact."], $field['name']) }}">
<option value="none"></option>
@foreach($countries as $country)

View File

@ -55,7 +55,7 @@
@endcomponent
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.country')])
<select name="countries" id="country" name="country" class="form-select input w-full" required>
<select name="countries" id="country" name="country" class="form-select input w-full bg-white" required>
@foreach($countries as $country)
<option value="{{ $country->iso_3166_2 }}" {{$country->iso_3166_2 == 'US' ? "selected" : ""}}>{{ $country->iso_3166_2 }} ({{ $country->name }})</option>
@endforeach

View File

@ -47,7 +47,7 @@
@endcomponent
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.country')])
<select name="countries" id="country" class="form-select input w-full">
<select name="countries" id="country" class="form-select input w-full bg-white">
<option disabled selected></option>
@foreach($countries as $country)
@if($country->iso_3166_2 == 'US')

View File

@ -45,7 +45,7 @@
@endcomponent
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.country')])
<select name="countries" id="country" class="form-select input w-full" required>
<select name="countries" id="country" class="form-select input w-full bg-white" required>
@foreach($countries as $country)
<option value="{{ $country->iso_3166_2 }}">{{ $country->iso_3166_2 }} ({{ $country->name }})</option>
@endforeach

View File

@ -45,7 +45,7 @@
@endcomponent
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.country')])
<select name="countries" id="country" class="form-select input w-full" required>
<select name="countries" id="country" class="form-select input w-full bg-white" required>
@foreach($countries as $country)
<option value="{{ $country->iso_3166_2 }}">{{ $country->iso_3166_2 }} ({{ $country->name }})</option>
@endforeach

View File

@ -45,7 +45,7 @@
@endcomponent
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.country')])
<select name="countries" id="country" class="form-select input w-full" required>
<select name="countries" id="country" class="form-select input w-full bg-white" required>
@foreach($countries as $country)
<option value="{{ $country->iso_3166_2 }}">{{ $country->iso_3166_2 }} ({{ $country->name }})</option>
@endforeach

View File

@ -57,7 +57,7 @@
</div>
<div class="col-span-6 sm:col-span-2">
<label for="country" class="input-label">@lang('texts.country')</label>
<select id="country" class="input w-full form-select {{ in_array('billing_country', (array) session('missing_required_fields')) ? 'border border-red-400' : '' }}" wire:model.defer="country_id">
<select id="country" class="input w-full form-select bg-white {{ in_array('billing_country', (array) session('missing_required_fields')) ? 'border border-red-400' : '' }}" wire:model.defer="country_id">
<option value="none"></option>
@foreach($countries as $country)
<option value="{{ $country->id }}">

View File

@ -58,7 +58,7 @@
</div>
<div class="col-span-4 sm:col-span-2">
<label for="shipping_country" class="input-label">@lang('texts.shipping_country')</label>
<select id="shipping_country" class="input w-full form-select" wire:model.defer="shipping_country_id">
<select id="shipping_country" class="input w-full form-select bg-white" wire:model.defer="shipping_country_id">
<option value="none"></option>
@foreach($countries as $country)
<option value="{{ $country->id }}">