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:
co-authored by
Claude Sonnet 5
parent
daf0b2c2a1
commit
6e281dfbda
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user