mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for required client info
This commit is contained in:
parent
6351cc8c60
commit
b1887f8fa8
28
app/DataMapper/Transactions/InvoiceReversalTransaction.php
Normal file
28
app/DataMapper/Transactions/InvoiceReversalTransaction.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\DataMapper\Transactions;
|
||||||
|
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\Credit;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Models\Payment;
|
||||||
|
use App\Models\TransactionEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* InvoiceReversalTransaction.
|
||||||
|
*/
|
||||||
|
class InvoiceReversalTransaction extends BaseTransaction implements TransactionInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
public $event_id = TransactionEvent::INVOICE_REVERSED;
|
||||||
|
|
||||||
|
}
|
@ -82,6 +82,18 @@ class RequiredClientInfo extends Component
|
|||||||
'client.state' => '',
|
'client.state' => '',
|
||||||
'client.postal_code' => '',
|
'client.postal_code' => '',
|
||||||
'client.country_id' => '',
|
'client.country_id' => '',
|
||||||
|
'client.shipping_address1' => '',
|
||||||
|
'client.shipping_address2' => '',
|
||||||
|
'client.shipping_city' => '',
|
||||||
|
'client.shipping_state' => '',
|
||||||
|
'client.shipping_postal_code' => '',
|
||||||
|
'client.shipping_country_id' => '',
|
||||||
|
'contact.first_name' => '',
|
||||||
|
'contact.last_name' => '',
|
||||||
|
'contact.email' => '',
|
||||||
|
'client.name' => '',
|
||||||
|
'client.website' => '',
|
||||||
|
'client.phone' => '',
|
||||||
];
|
];
|
||||||
|
|
||||||
public $show_form = false;
|
public $show_form = false;
|
||||||
@ -93,6 +105,11 @@ class RequiredClientInfo extends Component
|
|||||||
MultiDB::setDb($this->company->db);
|
MultiDB::setDb($this->company->db);
|
||||||
|
|
||||||
$this->client = $this->contact->client;
|
$this->client = $this->contact->client;
|
||||||
|
|
||||||
|
count($this->fields) > 0
|
||||||
|
? $this->checkFields()
|
||||||
|
: $this->show_form = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleSubmit(array $data): bool
|
public function handleSubmit(array $data): bool
|
||||||
@ -213,10 +230,6 @@ class RequiredClientInfo extends Component
|
|||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
count($this->fields) > 0
|
|
||||||
? $this->checkFields()
|
|
||||||
: $this->show_form = false;
|
|
||||||
|
|
||||||
return render('components.livewire.required-client-info');
|
return render('components.livewire.required-client-info');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,14 +91,14 @@ class UpdateInvoicePayment
|
|||||||
$this->payment->applied += $paid_amount;
|
$this->payment->applied += $paid_amount;
|
||||||
|
|
||||||
$transaction = [
|
$transaction = [
|
||||||
'invoice' => $this->invoice->transaction_event(),
|
'invoice' => $invoice->transaction_event(),
|
||||||
'payment' => $this->payment->transaction_event(),
|
'payment' => $this->payment->transaction_event(),
|
||||||
'client' => $client->transaction_event(),
|
'client' => $client->transaction_event(),
|
||||||
'credit' => [],
|
'credit' => [],
|
||||||
'metadata' => [],
|
'metadata' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
TransactionLog::dispatch(TransactionEvent::GATEWAY_PAYMENT_MADE, $transaction, $this->invoice->company->db);
|
TransactionLog::dispatch(TransactionEvent::GATEWAY_PAYMENT_MADE, $transaction, $invoice->company->db);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
@if(!array_key_exists('filled', $field))
|
@if(!array_key_exists('filled', $field))
|
||||||
@component('portal.ninja2020.components.general.card-element', ['title' => $field['label']])
|
@component('portal.ninja2020.components.general.card-element', ['title' => $field['label']])
|
||||||
@if($field['name'] == 'client_country_id' || $field['name'] == 'client_shipping_country_id')
|
@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="{{ str_replace(["client_","_line_"], ["client.",""], $field['name']) }}">
|
<select id="client_country" class="input w-full form-select" name="{{ $field['name'] }}" wire:model="{{ str_replace(["client_","_line_","contact_"], ["client.","","contact."], $field['name']) }}">
|
||||||
<option value="none"></option>
|
<option value="none"></option>
|
||||||
|
|
||||||
@foreach($countries as $country)
|
@foreach($countries as $country)
|
||||||
@ -25,7 +25,7 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
@else
|
@else
|
||||||
<input class="input w-full" type="{{ $field['type'] ?? 'text' }}" name="{{ $field['name'] }}" wire:model="{{ str_replace(["client_","_line_"], ["client.",""], $field['name']) }}">
|
<input class="input w-full" type="{{ $field['type'] ?? 'text' }}" name="{{ $field['name'] }}" wire:model="{{ str_replace(["client_","_line_","contact_"], ["client.","","contact."], $field['name']) }}">
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if(session()->has('validation_errors') && array_key_exists($field['name'], session('validation_errors')))
|
@if(session()->has('validation_errors') && array_key_exists($field['name'], session('validation_errors')))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user