Merge branch 'develop' into feature/cierres

This commit is contained in:
Juan Pablo Vial
2025-09-15 18:49:56 -03:00
2 changed files with 6 additions and 11 deletions

View File

@ -125,6 +125,7 @@ return [
'headers' => $request->getHeaders(), 'headers' => $request->getHeaders(),
'body' => $request->getBody()->getContents(), 'body' => $request->getBody()->getContents(),
]); ]);
return $request;
})); }));
return new GuzzleHttp\Client([ return new GuzzleHttp\Client([
'handler' => $stack, 'handler' => $stack,

View File

@ -251,7 +251,7 @@ class Invoice extends AbstractEndPoint
{ {
$paramsMap = [ $paramsMap = [
'customer' => 'customer', 'customer' => 'customer',
'product_id' => 'cuota_id', 'product_id' => 'venta_id',
'due_date' => 'fecha', 'due_date' => 'fecha',
'subscription' => 'subscription', 'subscription' => 'subscription',
'amount' => 'valor', 'amount' => 'valor',
@ -266,8 +266,6 @@ class Invoice extends AbstractEndPoint
'invoice_external_id' => 'cuota_id' 'invoice_external_id' => 'cuota_id'
]; ];
$today = new DateTimeImmutable('now', new DateTimeZone('America/Santiago'));
$params = []; $params = [];
foreach ($paramsMap as $key => $ref) { foreach ($paramsMap as $key => $ref) {
if ($ref === null) { if ($ref === null) {
@ -278,14 +276,6 @@ class Invoice extends AbstractEndPoint
continue; continue;
} }
if ($ref === 'valor') { if ($ref === 'valor') {
/*$valor = 0;
if ($data['cuota']->pago->fecha <= $today) {
$valor = $data['cuota']->pago->valor();
}
if ($valor === 0) {
$valor = $data['cuota']->pago->valor / $data['venta']->uf;
}
$params[$key] = $valor;*/
$params[$key] = $data['cuota']->pago->valor; $params[$key] = $data['cuota']->pago->valor;
continue; continue;
} }
@ -303,6 +293,10 @@ class Invoice extends AbstractEndPoint
$params[$key] = $data['cuota']->id; $params[$key] = $data['cuota']->id;
continue; continue;
} }
if ($ref === 'product_id') {
$params[$key] = $data['venta']->id;
continue;
}
if (array_key_exists($ref, $data) and $data[$ref] !== '' and $data[$ref] !== null) { if (array_key_exists($ref, $data) and $data[$ref] !== '' and $data[$ref] !== null) {
$params[$key] = $data[$ref]; $params[$key] = $data[$ref];
} }