Fixes de telefono y apellido de persona

This commit is contained in:
Juan Pablo Vial
2025-05-16 16:35:17 -04:00
parent 16cd29635d
commit 105179b4ed
6 changed files with 29 additions and 12 deletions

View File

@ -113,9 +113,11 @@ class Toku extends Ideal\Service
$invoice = array_find($customerInvoices, function($invoiceRow) use ($cuota) {
return $invoiceRow['invoice_external_id'] === $cuota->id;
});
$invoices []= $invoice;
$this->invoice->save($invoice);
continue;
if ($invoice !== null) {
$invoices []= $invoice;
$this->invoice->save($invoice);
continue;
}
}
try {
$invoices []= $this->invoice->getById($cuota->id);

View File

@ -72,6 +72,17 @@ class Customer extends AbstractEndPoint
if ($ref === null) {
continue;
}
if ($ref === 'telefono') {
$value = $data[$ref];
if ($value === '' or $value === null or $value === '0') {
continue;
}
if (!str_starts_with($value, '+')) {
$value = "+56{$value}";
}
$params[$key] = $value;
continue;
}
if (array_key_exists($ref, $data) and $data[$ref] !== '' and $data[$ref] !== null) {
$params[$key] = $data[$ref];
}