mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
edicion de facturas terminada a falta de tirada flexible
This commit is contained in:
@ -538,6 +538,18 @@ class Facturas extends \App\Controllers\BaseResourceController
|
||||
$dataName = $postData['name'] ?? '';
|
||||
$dataValue = $postData['value'] ?? '';
|
||||
|
||||
if($dataName == 'factura_rectificativa_id'){
|
||||
// se actualiza la factura donde el campo 'numero' sea igual al valor de $dataValue. El campo a actualizar es 'factura_rectificada_id'
|
||||
$factura_rectificada = $this->model->where('numero', $dataValue)->first();
|
||||
if($factura_rectificada){
|
||||
$data2 = [
|
||||
'factura_rectificada_id' => $factura->numero,
|
||||
'user_updated_id' => auth()->user()->id,
|
||||
];
|
||||
$this->model->update($factura_rectificada->id, $data2);
|
||||
}
|
||||
}
|
||||
|
||||
$data = [
|
||||
$dataName => $dataValue,
|
||||
'user_updated_id' => auth()->user()->id,
|
||||
|
||||
@ -25,12 +25,7 @@ class Test extends BaseController
|
||||
$data = $model->obtenerLineasPedidoSinFacturar(999);
|
||||
*/
|
||||
|
||||
$model = model("\App\Models\Facturas\FacturaPagoModel");
|
||||
$data = $model->getResource(9)->get()->getResultObject();
|
||||
|
||||
echo('<pre>');
|
||||
var_dump($data);
|
||||
echo('</pre>');
|
||||
xdebug_info();
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user