nueva estructura de directorios para nomina
FossilOrigin-Name: f3a95167abace679098bac9daffda6f17a8c819b92a5d096558f20dfce3acbbe
This commit is contained in:
parent
791d534653
commit
4b11f6b06d
@ -5,82 +5,17 @@
|
||||
# La idea en general es validar comportamiento desde el XML,
|
||||
# creando las estructuras minimas necesaras.
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from .. import fe
|
||||
from .. import form
|
||||
|
||||
from dataclasses import dataclass
|
||||
from .devengado import *
|
||||
from .deduccion import *
|
||||
|
||||
class Amount(form.Amount):
|
||||
pass
|
||||
from .amount import Amount
|
||||
|
||||
|
||||
class Devengado:
|
||||
pass
|
||||
|
||||
@dataclass
|
||||
class DevengadoBasico(Devengado):
|
||||
dias_trabajados: int
|
||||
sueldo_trabajado: Amount
|
||||
|
||||
def apply(self, fragment):
|
||||
fragment.find_or_create_element('./Basico')
|
||||
|
||||
fragment.set_attributes('/Basico',
|
||||
# NIE069
|
||||
DiasTrabajados = str(self.dias_trabajados),
|
||||
# NIE070
|
||||
SueldoTrabajado = str(self.sueldo_trabajado)
|
||||
)
|
||||
|
||||
@dataclass
|
||||
class DevengadoTransporte(Devengado):
|
||||
auxilio_transporte: Amount = None
|
||||
viatico_manutencion: Amount = None
|
||||
viatico_manutencion_no_salarial: Amount = None
|
||||
|
||||
def apply(self, fragment):
|
||||
fragment.set_element('./Transporte', None,
|
||||
append_ = True,
|
||||
# NIE071
|
||||
AuxilioTransporte = self.auxilio_transporte,
|
||||
# NIE072
|
||||
ViaticoManuAlojS = self.viatico_manutencion,
|
||||
# NIE073
|
||||
ViaticoManuAlojNS = self.viatico_manutencion_no_salarial
|
||||
)
|
||||
|
||||
class Deduccion:
|
||||
pass
|
||||
|
||||
@dataclass
|
||||
class DeduccionSalud(Deduccion):
|
||||
porcentaje: Amount
|
||||
deduccion: Amount
|
||||
|
||||
def apply(self, fragment):
|
||||
fragment.set_element('./Salud', None,
|
||||
append_ = True,
|
||||
# NIE161
|
||||
Porcentaje = self.porcentaje,
|
||||
# NIE163
|
||||
Deduccion = self.deduccion
|
||||
)
|
||||
|
||||
@dataclass
|
||||
class DeduccionFondoPension(Deduccion):
|
||||
porcentaje: Amount
|
||||
deduccion: Amount
|
||||
|
||||
def apply(self, fragment):
|
||||
fragment.set_element('./FondoPension', None,
|
||||
append_ = True,
|
||||
# NIE164
|
||||
Porcentaje = self.porcentaje,
|
||||
# NIE166
|
||||
Deduccion = self.deduccion
|
||||
)
|
||||
|
||||
class DIANNominaIndividualError(Exception):
|
||||
pass
|
||||
|
||||
|
4
facho/fe/nomina/amount.py
Normal file
4
facho/fe/nomina/amount.py
Normal file
@ -0,0 +1,4 @@
|
||||
from .. import form
|
||||
|
||||
class Amount(form.Amount):
|
||||
pass
|
3
facho/fe/nomina/deduccion/README.md
Normal file
3
facho/fe/nomina/deduccion/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# contributing
|
||||
|
||||
crear nuevo objeto de valor y exportar en **__init__.py** atributo **__all__**.
|
13
facho/fe/nomina/deduccion/__init__.py
Normal file
13
facho/fe/nomina/deduccion/__init__.py
Normal file
@ -0,0 +1,13 @@
|
||||
#
|
||||
# al crear objetos de valor
|
||||
# se debe exportar en __all__
|
||||
|
||||
from .deduccion import *
|
||||
from .salud import *
|
||||
from .fondo_pension import *
|
||||
|
||||
__all__ = [
|
||||
'Deduccion',
|
||||
'DeduccionSalud',
|
||||
'DeduccionFondoPension'
|
||||
]
|
2
facho/fe/nomina/deduccion/deduccion.py
Normal file
2
facho/fe/nomina/deduccion/deduccion.py
Normal file
@ -0,0 +1,2 @@
|
||||
class Deduccion:
|
||||
pass
|
18
facho/fe/nomina/deduccion/fondo_pension.py
Normal file
18
facho/fe/nomina/deduccion/fondo_pension.py
Normal file
@ -0,0 +1,18 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from ..amount import Amount
|
||||
from .deduccion import Deduccion
|
||||
|
||||
@dataclass
|
||||
class DeduccionFondoPension(Deduccion):
|
||||
porcentaje: Amount
|
||||
deduccion: Amount
|
||||
|
||||
def apply(self, fragment):
|
||||
fragment.set_element('./FondoPension', None,
|
||||
append_ = True,
|
||||
# NIE164
|
||||
Porcentaje = self.porcentaje,
|
||||
# NIE166
|
||||
Deduccion = self.deduccion
|
||||
)
|
19
facho/fe/nomina/deduccion/salud.py
Normal file
19
facho/fe/nomina/deduccion/salud.py
Normal file
@ -0,0 +1,19 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from ..amount import Amount
|
||||
from .deduccion import Deduccion
|
||||
|
||||
@dataclass
|
||||
class DeduccionSalud(Deduccion):
|
||||
porcentaje: Amount
|
||||
deduccion: Amount
|
||||
|
||||
def apply(self, fragment):
|
||||
fragment.set_element('./Salud', None,
|
||||
append_ = True,
|
||||
# NIE161
|
||||
Porcentaje = self.porcentaje,
|
||||
# NIE163
|
||||
Deduccion = self.deduccion
|
||||
)
|
||||
|
3
facho/fe/nomina/devengado/README.md
Normal file
3
facho/fe/nomina/devengado/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# contributing
|
||||
|
||||
crear nuevo objeto de valor y exportar en **__init__.py** atributo **__all__**.
|
10
facho/fe/nomina/devengado/__init__.py
Normal file
10
facho/fe/nomina/devengado/__init__.py
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
from .basico import *
|
||||
from .transporte import *
|
||||
from .devengado import *
|
||||
|
||||
__all__ = [
|
||||
'Devengado',
|
||||
'DevengadoBasico',
|
||||
'DevengadoTransporte'
|
||||
]
|
20
facho/fe/nomina/devengado/basico.py
Normal file
20
facho/fe/nomina/devengado/basico.py
Normal file
@ -0,0 +1,20 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from ..amount import Amount
|
||||
from .devengado import Devengado
|
||||
|
||||
|
||||
@dataclass
|
||||
class DevengadoBasico(Devengado):
|
||||
dias_trabajados: int
|
||||
sueldo_trabajado: Amount
|
||||
|
||||
def apply(self, fragment):
|
||||
fragment.find_or_create_element('./Basico')
|
||||
|
||||
fragment.set_attributes('/Basico',
|
||||
# NIE069
|
||||
DiasTrabajados = str(self.dias_trabajados),
|
||||
# NIE070
|
||||
SueldoTrabajado = str(self.sueldo_trabajado)
|
||||
)
|
2
facho/fe/nomina/devengado/devengado.py
Normal file
2
facho/fe/nomina/devengado/devengado.py
Normal file
@ -0,0 +1,2 @@
|
||||
class Devengado:
|
||||
pass
|
21
facho/fe/nomina/devengado/transporte.py
Normal file
21
facho/fe/nomina/devengado/transporte.py
Normal file
@ -0,0 +1,21 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from ..amount import Amount
|
||||
from .devengado import Devengado
|
||||
|
||||
@dataclass
|
||||
class DevengadoTransporte(Devengado):
|
||||
auxilio_transporte: Amount = None
|
||||
viatico_manutencion: Amount = None
|
||||
viatico_manutencion_no_salarial: Amount = None
|
||||
|
||||
def apply(self, fragment):
|
||||
fragment.set_element('./Transporte', None,
|
||||
append_ = True,
|
||||
# NIE071
|
||||
AuxilioTransporte = self.auxilio_transporte,
|
||||
# NIE072
|
||||
ViaticoManuAlojS = self.viatico_manutencion,
|
||||
# NIE073
|
||||
ViaticoManuAlojNS = self.viatico_manutencion_no_salarial
|
||||
)
|
Loading…
Reference in New Issue
Block a user