Skip to content

Commit ca0b0c3

Browse files
authored
Merge pull request #85 from chechojgb/buttonsLovers
delete: cambios microservicio y modelo
2 parents 1528de3 + 2272ac8 commit ca0b0c3

File tree

820 files changed

+23
-115061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

820 files changed

+23
-115061
lines changed

app/Http/Controllers/BlCuentaCobroController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Models\BlCuentaCobro;
66
use App\Models\BlCuentaCobroItem;
77
use App\Models\BlMarcacion;
8+
use App\Models\BlMarcaciones;
89
use Illuminate\Http\Request;
910
use Inertia\Inertia;
1011
use Illuminate\Support\Facades\Auth;
@@ -16,7 +17,7 @@ public function index()
1617
{
1718
// .producto
1819
$user = Auth::user();
19-
$cuentas = BlCuentaCobro::with(['items.marcacion.pedido.items.empaque', 'usuario'])->get();
20+
$cuentas = BlCuentaCobro::with(['itemsMarcacion.marcacion.pedido.items.empaque', 'usuario'])->get();
2021
return Inertia::render('BLCuentaCobro', [
2122
'user' => $user,
2223
'cuentasCobro' => $cuentas,
@@ -42,7 +43,7 @@ public function pasarPagados(Request $request)
4243
'cuenta_cobro_id' => $cuenta->id,
4344
'marcacion_id' => $item['marcacion_id'],
4445
]);
45-
BlMarcacion::where('id', $item['marcacion_id'])->update(['pagado' => 1]);
46+
BlMarcaciones::where('id', $item['marcacion_id'])->update(['pagado' => 1]);
4647
}
4748
});
4849
return back()->with('success', 'Cuenta de cobro creada y items marcados como pagados.');

app/Models/BLMarcacion.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

app/Models/BLPedidoItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function empaque(): \Illuminate\Database\Eloquent\Relations\BelongsTo
3232

3333
public function marcaciones()
3434
{
35-
return $this->hasMany(BlMarcacion::class, 'pedido_item_id');
35+
return $this->hasMany(BlMarcaciones::class, 'pedido_item_id');
3636
}
3737

3838
public function movimientos(): MorphMany

app/Models/BlCuentaCobro.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function usuario()
1414
return $this->belongsTo(User::class, 'user_id');
1515
}
1616

17-
public function items()
17+
public function itemsMarcacion()
1818
{
1919
return $this->hasMany(BlCuentaCobroItem::class, 'cuenta_cobro_id');
2020
}

app/Models/BlCuentaCobroItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ public function cuenta()
1515

1616
public function marcacion()
1717
{
18-
return $this->belongsTo(BlMarcacion::class, 'marcacion_id');
18+
return $this->belongsTo(BlMarcaciones::class, 'marcacion_id');
1919
}
2020
}

app/Models/BlMarcaciones.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App\Models;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class BlMarcaciones extends Model
8+
{
9+
protected $table = 'bl_marcacion';
10+
protected $fillable = [ 'pedido_id', 'pedido_item_id', 'user_id', 'cantidad', 'fecha', 'precio_unitario', 'costo_total' ];
11+
protected $casts = [ 'items_marcados' => 'array', // para que se convierta automáticamente a array
12+
'fecha' => 'date', ]; // Relaciones opcionales
13+
public function cliente() { return $this->belongsTo(BLCliente::class, 'cliente_id'); }
14+
public function pedido() { return $this->belongsTo(BLPedido::class, 'pedido_id'); }
15+
public function trabajador() { return $this->belongsTo(User::class, 'user_id'); }
16+
public function itemsCuenta() { return $this->hasMany(BlCuentaCobroItem::class, 'marcacion_id'); }
17+
}

microservicio-ssh/index.js

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)