feat: cuentas por cobrar usa listado de clientes en vez de entidades contables

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Lizandro GD
2026-07-13 02:44:19 +00:00
co-authored by Claude Sonnet 5
parent daf0b2c2a1
commit 6e281dfbda
4 changed files with 35 additions and 36 deletions
+4 -4
View File
@@ -408,7 +408,7 @@ func GetCuentasCobro(c *fiber.Ctx) error {
func CreateCuentaCobro(c *fiber.Ctx) error {
type Req struct {
EntidadID uint `json:"entidad_id"`
ClienteID uint `json:"cliente_id"`
Fecha string `json:"fecha"`
Descripcion string `json:"descripcion"`
Valor float64 `json:"valor"`
@@ -419,11 +419,11 @@ func CreateCuentaCobro(c *fiber.Ctx) error {
if err := c.BodyParser(&req); err != nil {
return c.Status(400).JSON(fiber.Map{"error": err.Error()})
}
if req.EntidadID == 0 {
return c.Status(400).JSON(fiber.Map{"error": "entidad_id es requerido"})
if req.ClienteID == 0 {
return c.Status(400).JSON(fiber.Map{"error": "cliente_id es requerido"})
}
cc := &models.CuentaCobro{
EntidadID: req.EntidadID,
ClienteID: req.ClienteID,
Descripcion: req.Descripcion,
Valor: req.Valor,
Estado: "pendiente",