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,11 +242,16 @@ class FacturaEInvoice extends AbstractService
private function setBillingPeriod(): self
{
try {
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'));
}
}
catch(\Exception $e) {
nlog($e->getMessage());
}
return $this;
}