nueva estructura nomina
FossilOrigin-Name: 54638bc6d28c9d12b1a079bfaf7321e9da788c76827acbf88d41187ce9636502
This commit is contained in:
		
							
								
								
									
										73
									
								
								facho/fe/nomina/trabajador/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								facho/fe/nomina/trabajador/__init__.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,73 @@ | ||||
| from dataclasses import dataclass | ||||
|  | ||||
| from ..amount import Amount | ||||
|  | ||||
| from .tipo_contrato import * | ||||
| from .tipo_documento import * | ||||
| from .lugar_trabajo import * | ||||
| from .tipo_trabajador import * | ||||
| from .sub_tipo_trabajador import * | ||||
|  | ||||
|  | ||||
|  | ||||
| @dataclass | ||||
| class Trabajador: | ||||
|     tipo_contrato: TipoContrato | ||||
|     tipo_documento: TipoDocumento | ||||
|     numero_documento: str | ||||
|  | ||||
|     primer_apellido: str | ||||
|     segundo_apellido: str | ||||
|     primer_nombre: str | ||||
|  | ||||
|     lugar_trabajo: LugarTrabajo | ||||
|     alto_riesgo: bool | ||||
|     salario_integral: bool | ||||
|     sueldo: Amount | ||||
|  | ||||
|     tipo: TipoTrabajador | ||||
|  | ||||
|     codigo_trabajador: str = None | ||||
|     otros_nombres: str = None | ||||
|     sub_tipo: SubTipoTrabajador = SubTipoTrabajador(code='00') | ||||
|  | ||||
|     def apply(self, fragment): | ||||
|         fragment.set_attributes('./Trabajador', | ||||
|                                 # NIE041 | ||||
|                                 TipoTrabajador = self.tipo.code, | ||||
|                                 # NIE042 | ||||
|                                 SubTipoTrabajador = self.sub_tipo.code, | ||||
|                                 # NIE043 | ||||
|                                 AltoRiesgoPension = str(self.alto_riesgo).lower(), | ||||
|                                 # NIE044 | ||||
|                                 TipoDocumento = self.tipo_documento.code, | ||||
|                                 # NIE045 | ||||
|                                 NumeroDocumento = self.numero_documento, | ||||
|                                 # NIE046 | ||||
|                                 PrimerApellido = self.primer_apellido, | ||||
|                                 # NIE047 | ||||
|                                 SegundoApellido = self.segundo_apellido, | ||||
|                                 # NIE048 | ||||
|                                 PrimerNombre = self.primer_nombre, | ||||
|                                 # NIE049 | ||||
|                                 OtrosNombres = self.otros_nombres, | ||||
|                                 # NIE050 | ||||
|                                 LugarTrabajoPais = self.lugar_trabajo.pais.code, | ||||
|  | ||||
|                                 # NIE051 | ||||
|                                 LugarTrabajoDepartamentoEstadoEstado = self.lugar_trabajo.departamento.code, | ||||
|  | ||||
|                                 # NIE052 | ||||
|                                 LugarTrabajoMunicipioCiudad = self.lugar_trabajo.municipio.code, | ||||
|  | ||||
|                                 # NIE053 | ||||
|                                 LugarTrabajoDireccion = self.lugar_trabajo.direccion, | ||||
|                                 # NIE056 | ||||
|                                 SalarioIntegral = str(self.salario_integral).lower(), | ||||
|                                 # NIE061 | ||||
|                                 TipoContrato = self.tipo_contrato.code, | ||||
|                                 # NIE062 | ||||
|                                 Sueldo = str(self.sueldo), | ||||
|                                 # NIE063 | ||||
|                                 CodigoTrabajador = self.codigo_trabajador | ||||
|                                 ) | ||||
							
								
								
									
										13
									
								
								facho/fe/nomina/trabajador/lugar_trabajo.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								facho/fe/nomina/trabajador/lugar_trabajo.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| from dataclasses import dataclass | ||||
|  | ||||
| from . import * | ||||
| from ..pais import Pais | ||||
| from ..departamento import Departamento | ||||
| from ..municipio import Municipio | ||||
|  | ||||
| @dataclass | ||||
| class LugarTrabajo: | ||||
|     pais: Pais | ||||
|     departamento: Departamento | ||||
|     municipio: Municipio | ||||
|     direccion: str | ||||
							
								
								
									
										13
									
								
								facho/fe/nomina/trabajador/sub_tipo_trabajador.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								facho/fe/nomina/trabajador/sub_tipo_trabajador.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| from dataclasses import dataclass | ||||
|  | ||||
| from facho.fe.data.dian import codelist | ||||
|  | ||||
| @dataclass | ||||
| class SubTipoTrabajador: | ||||
|     code: str | ||||
|     name: str = '' | ||||
|  | ||||
|     def __post_init__(self): | ||||
|         if self.code not in codelist.SubTipoTrabajador: | ||||
|             raise ValueError("code [%s] not found" % (self.code)) | ||||
|         self.name = codelist.SubTipoTrabajador[self.code]['name'] | ||||
							
								
								
									
										15
									
								
								facho/fe/nomina/trabajador/tipo_contrato.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								facho/fe/nomina/trabajador/tipo_contrato.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| from dataclasses import dataclass | ||||
|  | ||||
| from facho.fe.data.dian import codelist | ||||
|  | ||||
| @dataclass | ||||
| class TipoContrato: | ||||
|     code: str | ||||
|     name: str = '' | ||||
|  | ||||
|     def __post_init__(self): | ||||
|         if self.code not in codelist.TipoContrato: | ||||
|             raise ValueError("code [%s] not found" % (self.code)) | ||||
|         self.name = codelist.TipoContrato[self.code]['name'] | ||||
|  | ||||
|  | ||||
							
								
								
									
										13
									
								
								facho/fe/nomina/trabajador/tipo_documento.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								facho/fe/nomina/trabajador/tipo_documento.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| from dataclasses import dataclass | ||||
|  | ||||
| from facho.fe.data.dian import codelist | ||||
|  | ||||
| @dataclass | ||||
| class TipoDocumento: | ||||
|     code: str | ||||
|     name: str = '' | ||||
|  | ||||
|     def __post_init__(self): | ||||
|         if self.code not in codelist.TipoIdFiscal: | ||||
|             raise ValueError("code [%s] not found" % (self.code)) | ||||
|         self.name = codelist.TipoIdFiscal[self.code]['name'] | ||||
							
								
								
									
										13
									
								
								facho/fe/nomina/trabajador/tipo_trabajador.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								facho/fe/nomina/trabajador/tipo_trabajador.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| from dataclasses import dataclass | ||||
|  | ||||
| from facho.fe.data.dian import codelist | ||||
|  | ||||
| @dataclass | ||||
| class TipoTrabajador: | ||||
|     code: str | ||||
|     name: str = '' | ||||
|  | ||||
|     def __post_init__(self): | ||||
|         if self.code not in codelist.TipoTrabajador: | ||||
|             raise ValueError("code [%s] not found" % (self.code)) | ||||
|         self.name = codelist.TipoTrabajador[self.code]['name'] | ||||
		Reference in New Issue
	
	Block a user