diff --git a/app/Helpers/Invoice/ProRata.php b/app/Helpers/Invoice/ProRata.php index c96166c64df4..cae0b696d083 100644 --- a/app/Helpers/Invoice/ProRata.php +++ b/app/Helpers/Invoice/ProRata.php @@ -23,12 +23,12 @@ class ProRata * the time interval and the frequency duration * * @param float $amount - * @param Carbon $from_date - * @param Carbon $to_date + * @param \Illuminate\Support\Carbon | \Carbon\Carbon $from_date + * @param \Illuminate\Support\Carbon | \Carbon\Carbon $to_date * @param int $frequency * @return float */ - public function refund(float $amount, Carbon $from_date, Carbon $to_date, int $frequency): float + public function refund(float $amount, $from_date, $to_date, int $frequency): float { $days = intval(abs($from_date->copy()->diffInDays($to_date))); $days_in_frequency = $this->getDaysInFrequency($frequency); @@ -41,12 +41,12 @@ class ProRata * the time interval and the frequency duration * * @param float $amount - * @param Carbon $from_date - * @param Carbon $to_date + * @param \Illuminate\Support\Carbon | \Carbon\Carbon $from_date + * @param \Illuminate\Support\Carbon | \Carbon\Carbon $to_date * @param int $frequency * @return float */ - public function charge(float $amount, Carbon $from_date, Carbon $to_date, int $frequency): float + public function charge(float $amount, $from_date, $to_date, int $frequency): float { $days = intval(abs($from_date->copy()->diffInDays($to_date))); $days_in_frequency = $this->getDaysInFrequency($frequency); diff --git a/app/Livewire/Flow2/InvoicePay.php b/app/Livewire/Flow2/InvoicePay.php index f67278d32b9c..2c2aecc86e28 100644 --- a/app/Livewire/Flow2/InvoicePay.php +++ b/app/Livewire/Flow2/InvoicePay.php @@ -165,6 +165,7 @@ class InvoicePay extends Component return $this->required_fields = true; } + /** @var \App\Models\ClientContact $contact */ $contact = $this->getContext()['contact']; foreach ($fields as $index => $field) { @@ -173,7 +174,7 @@ class InvoicePay extends Component if (\Illuminate\Support\Str::startsWith($field['name'], 'client_')) { if ( empty($contact->client->{$_field}) - || is_null($contact->client->{$_field}) + || is_null($contact->client->{$_field}) //@phpstan-ignore-line ) { return $this->required_fields = true; @@ -182,7 +183,7 @@ class InvoicePay extends Component } if (\Illuminate\Support\Str::startsWith($field['name'], 'contact_')) { - if (empty($contact->{$_field}) || is_null($contact->{$_field}) || str_contains($contact->{$_field}, '@example.com')) { + if (empty($contact->{$_field}) || is_null($contact->{$_field}) || str_contains($contact->{$_field}, '@example.com')) { //@phpstan-ignore-line return $this->required_fields = true; } } diff --git a/app/Repositories/BaseRepository.php b/app/Repositories/BaseRepository.php index 3e4ff6b4e557..5d6d9a15d56c 100644 --- a/app/Repositories/BaseRepository.php +++ b/app/Repositories/BaseRepository.php @@ -147,8 +147,7 @@ class BaseRepository * @throws \ReflectionException */ protected function alternativeSave($data, $model) - { //$start = microtime(true); - //forces the client_id if it doesn't exist + { if (array_key_exists('client_id', $data)) { $model->client_id = $data['client_id']; } @@ -167,7 +166,7 @@ class BaseRepository $company_defaults = $client->setCompanyDefaults($data, lcfirst($resource)); $data['exchange_rate'] = $company_defaults['exchange_rate']; $model->uses_inclusive_taxes = $client->getSetting('inclusive_taxes'); - // $data = array_merge($company_defaults, $data); + $data = array_merge($data, $company_defaults); } diff --git a/app/Services/Client/RFFService.php b/app/Services/Client/RFFService.php index a3983d7c9593..08b4b3b467a0 100644 --- a/app/Services/Client/RFFService.php +++ b/app/Services/Client/RFFService.php @@ -69,7 +69,7 @@ class RFFService if (Str::startsWith($field['name'], 'client_')) { if ( empty($_contact->client->{$_field}) - || is_null($_contact->client->{$_field}) + || is_null($_contact->client->{$_field}) //@phpstan-ignore-line ) { // $this->show_form = true; $this->unfilled_fields++; @@ -79,7 +79,7 @@ class RFFService } if (Str::startsWith($field['name'], 'contact_')) { - if (empty($_contact->{$_field}) || is_null($_contact->{$_field}) || str_contains($_contact->{$_field}, '@example.com')) { + if (empty($_contact->{$_field}) || is_null($_contact->{$_field}) || str_contains($_contact->{$_field}, '@example.com')) { //@phpstan-ignore-line $this->unfilled_fields++; } else { $this->fields[$index]['filled'] = true; diff --git a/app/Services/EDocument/Standards/OrderXDocument.php b/app/Services/EDocument/Standards/OrderXDocument.php index de3af56868d5..32200b9a3dc8 100644 --- a/app/Services/EDocument/Standards/OrderXDocument.php +++ b/app/Services/EDocument/Standards/OrderXDocument.php @@ -100,7 +100,7 @@ class OrderXDocument extends AbstractService $this->orderxdocument->setDocumentShipToAddress($settings_entity->shipping_address1, $settings_entity->shipping_address2, "", $settings_entity->shipping_postal_code, $settings_entity->shipping_city, $settings_entity->shipping_country->iso_3166_2, $settings_entity->shipping_state); } - $this->orderxdocument->addDocumentPaymentMean(68, ctrans("texts.xinvoice_online_payment")); + $this->orderxdocument->addDocumentPaymentMean('68', ctrans("texts.xinvoice_online_payment")); if (str_contains($company->getSetting('vat_number'), "/")) { $this->orderxdocument->addDocumentSellerTaxRegistration("FC", $company->getSetting('vat_number')); diff --git a/app/Services/EDocument/Standards/ZugferdEDokument.php b/app/Services/EDocument/Standards/ZugferdEDokument.php index 4e261fd1b7a9..74555942c393 100644 --- a/app/Services/EDocument/Standards/ZugferdEDokument.php +++ b/app/Services/EDocument/Standards/ZugferdEDokument.php @@ -124,9 +124,9 @@ class ZugferdEDokument extends AbstractService //Payment Means - Switcher if($company->settings->custom_value1 == '42') { - $this->xdocument->addDocumentPaymentMean(typecode: 42, payeeIban: $company->settings->custom_value2, payeeAccountName: $company->settings->custom_value4, payeeBic: $company->settings->custom_value3); + $this->xdocument->addDocumentPaymentMean(typecode: '42', payeeIban: $company->settings->custom_value2, payeeAccountName: $company->settings->custom_value4, payeeBic: $company->settings->custom_value3); } else { - $this->xdocument->addDocumentPaymentMean(68, ctrans("texts.xinvoice_online_payment")); + $this->xdocument->addDocumentPaymentMean('68', ctrans("texts.xinvoice_online_payment")); } if (str_contains($company->getSetting('vat_number'), "/")) { diff --git a/app/Services/Quickbooks/Jobs/QuickbooksSync.php b/app/Services/Quickbooks/Jobs/QuickbooksSync.php index 86057a06bd22..0b82e5a3578a 100644 --- a/app/Services/Quickbooks/Jobs/QuickbooksSync.php +++ b/app/Services/Quickbooks/Jobs/QuickbooksSync.php @@ -102,9 +102,9 @@ class QuickbooksSync implements ShouldQueue private function processEntitySync(string $entity, $records) { match($entity){ - // 'client' => $this->syncQbToNinjaClients($records), + 'client' => $this->syncQbToNinjaClients($records), 'product' => $this->syncQbToNinjaProducts($records), - // 'invoice' => $this->syncQbToNinjaInvoices($records), + 'invoice' => $this->syncQbToNinjaInvoices($records), // 'vendor' => $this->syncQbToNinjaClients($records), // 'quote' => $this->syncInvoices($records), // 'purchase_order' => $this->syncInvoices($records),