diff --git a/app/DataMapper/Transactions/InvoiceReversalTransaction.php b/app/DataMapper/Transactions/InvoiceReversalTransaction.php new file mode 100644 index 000000000000..2fc88418797d --- /dev/null +++ b/app/DataMapper/Transactions/InvoiceReversalTransaction.php @@ -0,0 +1,28 @@ + '', 'client.postal_code' => '', '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; @@ -93,6 +105,11 @@ class RequiredClientInfo extends Component MultiDB::setDb($this->company->db); $this->client = $this->contact->client; + + count($this->fields) > 0 + ? $this->checkFields() + : $this->show_form = false; + } public function handleSubmit(array $data): bool @@ -213,10 +230,6 @@ class RequiredClientInfo extends Component public function render() { - count($this->fields) > 0 - ? $this->checkFields() - : $this->show_form = false; - return render('components.livewire.required-client-info'); } } diff --git a/app/Services/Payment/UpdateInvoicePayment.php b/app/Services/Payment/UpdateInvoicePayment.php index a41d146a7f9a..1cbd644ad9c9 100644 --- a/app/Services/Payment/UpdateInvoicePayment.php +++ b/app/Services/Payment/UpdateInvoicePayment.php @@ -91,14 +91,14 @@ class UpdateInvoicePayment $this->payment->applied += $paid_amount; $transaction = [ - 'invoice' => $this->invoice->transaction_event(), + 'invoice' => $invoice->transaction_event(), 'payment' => $this->payment->transaction_event(), 'client' => $client->transaction_event(), 'credit' => [], 'metadata' => [], ]; - TransactionLog::dispatch(TransactionEvent::GATEWAY_PAYMENT_MADE, $transaction, $this->invoice->company->db); + TransactionLog::dispatch(TransactionEvent::GATEWAY_PAYMENT_MADE, $transaction, $invoice->company->db); }); diff --git a/resources/views/portal/ninja2020/components/livewire/required-client-info.blade.php b/resources/views/portal/ninja2020/components/livewire/required-client-info.blade.php index cd3da118c664..3a5b764ec540 100644 --- a/resources/views/portal/ninja2020/components/livewire/required-client-info.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/required-client-info.blade.php @@ -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') - @foreach($countries as $country) @@ -25,7 +25,7 @@ @endforeach @else - + @endif @if(session()->has('validation_errors') && array_key_exists($field['name'], session('validation_errors')))