Fixes for e-invoicing

This commit is contained in:
David Bomba 2023-07-26 20:24:03 +10:00
parent a821f7e751
commit f16eb06d52

View File

@ -242,10 +242,15 @@ class FacturaEInvoice extends AbstractService
private function setBillingPeriod(): self private function setBillingPeriod(): self
{ {
if (\Carbon\Carbon::createFromFormat('Y-m-d', $this->invoice->custom_value3)->format('Y-m-d') === $this->invoice->custom_value3 && try {
\Carbon\Carbon::createFromFormat('Y-m-d', $this->invoice->custom_value4)->format('Y-m-d') === $this->invoice->custom_value4 if (\Carbon\Carbon::createFromFormat('Y-m-d', $this->invoice->custom_value3)->format('Y-m-d') === $this->invoice->custom_value3 &&
){ \Carbon\Carbon::createFromFormat('Y-m-d', $this->invoice->custom_value4)->format('Y-m-d') === $this->invoice->custom_value4
$this->fac->setBillingPeriod(\Carbon\Carbon::parse($this->invoice->custom_value3)->format('Y-m-d'), \Carbon\Carbon::parse($this->invoice->custom_value4)->format('Y-m-d')); ) {
$this->fac->setBillingPeriod(\Carbon\Carbon::parse($this->invoice->custom_value3)->format('Y-m-d'), \Carbon\Carbon::parse($this->invoice->custom_value4)->format('Y-m-d'));
}
}
catch(\Exception $e) {
nlog($e->getMessage());
} }
return $this; return $this;