Private
Public Access
feat: añadida entidad de descuentos
This commit is contained in:
1 parent
3f3175b615
commit
a1169c7234
4 files changed
+45
-3
No files matched your search
@@ -0,0 +1,22 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
import "gorm.io/gorm"
|
||||||
|
|
||||||
|
type Descuento struct {
|
||||||
|
gorm.Model
|
||||||
|
|
||||||
|
Nombre string `gorm:"type:varchar(100);not null"`
|
||||||
|
Descripcion string `gorm:"type:text"`
|
||||||
|
|
||||||
|
Tipo TipoDescuento `gorm:"type:varchar(20);not null"`
|
||||||
|
Valor float64 `gorm:"type:decimal(12,2);not null"`
|
||||||
|
|
||||||
|
Activo bool `gorm:"not null;default:true"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type TipoDescuento string
|
||||||
|
|
||||||
|
const (
|
||||||
|
Porcentaje TipoDescuento = "PORCENTAJE"
|
||||||
|
Fijo TipoDescuento = "FIJO"
|
||||||
|
)
|
||||||
@@ -3,6 +3,8 @@ package models
|
|||||||
type FacturaDetalle struct {
|
type FacturaDetalle struct {
|
||||||
RepuestoID uint64 `json:"repuestoId"`
|
RepuestoID uint64 `json:"repuestoId"`
|
||||||
Cantidad uint `json:"cantidad"`
|
Cantidad uint `json:"cantidad"`
|
||||||
|
DescuentoID uint `json:"descuentoId"`
|
||||||
|
Descuento float64 `json:"descuento"`
|
||||||
PrecioUnitario float64 `json:"precioUnitario"`
|
PrecioUnitario float64 `json:"precioUnitario"`
|
||||||
Subtotal float64 `json:"subtotal"`
|
Subtotal float64 `json:"subtotal"`
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,7 @@ note top of "gorm.Model"
|
|||||||
Las siguientes entidades heredan de gorm.Model
|
Las siguientes entidades heredan de gorm.Model
|
||||||
|
|
||||||
- Cliente
|
- Cliente
|
||||||
|
- Descuento
|
||||||
- FormaPago
|
- FormaPago
|
||||||
- Comprobante
|
- Comprobante
|
||||||
- Factura
|
- Factura
|
||||||
@@ -55,6 +56,20 @@ Responsable: Usuario
|
|||||||
' end note
|
' end note
|
||||||
'/
|
'/
|
||||||
|
|
||||||
|
class "Descuento" as DS {
|
||||||
|
Nombre: string
|
||||||
|
Descripcion: string
|
||||||
|
Tipo: TipoDescuento
|
||||||
|
Valor: float64
|
||||||
|
Activo: bool
|
||||||
|
}
|
||||||
|
|
||||||
|
Descuento "0..*" --> "1" TipoDescuento
|
||||||
|
|
||||||
|
enum TipoDescuento {
|
||||||
|
PORCENTAJE
|
||||||
|
FIJO
|
||||||
|
}
|
||||||
|
|
||||||
class "Almacen" as A {
|
class "Almacen" as A {
|
||||||
ID: string
|
ID: string
|
||||||
@@ -91,11 +106,14 @@ Factura "1" --> "1..*" FacturaDetalle
|
|||||||
class "FacturaDetalle" as FD {
|
class "FacturaDetalle" as FD {
|
||||||
RepuestoID: uint64
|
RepuestoID: uint64
|
||||||
Cantidad: uint
|
Cantidad: uint
|
||||||
|
DescuentoID: uint
|
||||||
|
Descuento: float64
|
||||||
PrecioUnitario: float64
|
PrecioUnitario: float64
|
||||||
Subtotal: float64
|
Subtotal: float64
|
||||||
}
|
}
|
||||||
|
|
||||||
FacturaDetalle "1" --> "1" Repuesto
|
FacturaDetalle "1" --> "1" Repuesto
|
||||||
|
FacturaDetalle "1" --> "1" Descuento
|
||||||
|
|
||||||
|
|
||||||
class "FormaPago" as FPF {
|
class "FormaPago" as FPF {
|
||||||
@@ -226,7 +244,7 @@ AsientoContable "1" --> "1..*" MovimientoContable
|
|||||||
|
|
||||||
|
|
||||||
' Relación polimórfica con los comprobantes
|
' Relación polimórfica con los comprobantes
|
||||||
AsientoContable "1..*" --> "1" Comprobante : Tipo + ID
|
AsientoContable "1..*" --> "1" Comprobante
|
||||||
/'
|
/'
|
||||||
' AsientoContable ..> Factura : Tipo + ID
|
' AsientoContable ..> Factura : Tipo + ID
|
||||||
' AsientoContable ..> Recibo : Tipo + ID
|
' AsientoContable ..> Recibo : Tipo + ID
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user