Annotate missing mappings
This commit is contained in:
parent
407dde3bae
commit
382d241bd4
4
aeat.py
4
aeat.py
|
@ -584,7 +584,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
|||
'Periodo': str(
|
||||
self.period.start_date.month).zfill(2),
|
||||
}
|
||||
# TODO: IDFactura, Contraparte,
|
||||
# TODO: IDFactura,
|
||||
# FechaPresentacion, FacturaModificada,
|
||||
# EstadoCuadre, ClavePaginacion
|
||||
}
|
||||
|
@ -628,7 +628,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
|||
})
|
||||
|
||||
|
||||
class IssuedTrytonInvoiceMapper(mapping.OutInvoiceMapper):
|
||||
class IssuedTrytonInvoiceMapper(mapping.IssuedInvoiceMapper):
|
||||
year = attrgetter('move.period.fiscalyear.name')
|
||||
period = attrgetter('move.period.start_date.month')
|
||||
nif = attrgetter('company.party.vat_number')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
__all__ = [
|
||||
'get_headers',
|
||||
'OutInvoiceMapper',
|
||||
'IssuedInvoiceMapper',
|
||||
'RecievedInvoiceMapper',
|
||||
]
|
||||
|
||||
|
@ -14,12 +14,13 @@ def get_headers(name=None, vat=None, comm_kind=None, version='0.7'):
|
|||
'Titular': {
|
||||
'NombreRazon': name,
|
||||
'NIF': vat,
|
||||
# TODO: NIFRepresentante
|
||||
},
|
||||
'TipoComunicacion': comm_kind,
|
||||
}
|
||||
|
||||
|
||||
class OutInvoiceMapper(object):
|
||||
class IssuedInvoiceMapper(object):
|
||||
|
||||
@classmethod
|
||||
def build_delete_request(cls, invoice):
|
||||
|
@ -48,6 +49,7 @@ class OutInvoiceMapper(object):
|
|||
'NIF': cls.nif(invoice),
|
||||
},
|
||||
'NumSerieFacturaEmisor': cls.serial_number(invoice),
|
||||
# TODO: NumSerieFacturaEmisorResumenFinal
|
||||
'FechaExpedicionFacturaEmisor':
|
||||
cls.issue_date(invoice).strftime(_DATE_FMT),
|
||||
}
|
||||
|
@ -56,9 +58,24 @@ class OutInvoiceMapper(object):
|
|||
def build_issued_invoice(cls, invoice):
|
||||
ret = {
|
||||
'TipoFactura': cls.invoice_kind(invoice),
|
||||
# TODO: TipoRectificativa
|
||||
# TODO: FacturasAgrupadas
|
||||
# TODO: FacturasRectificadas
|
||||
# TODO: ImporteRectificacion
|
||||
# TODO: FechaOperacion
|
||||
'ClaveRegimenEspecialOTrascendencia':
|
||||
cls.specialkey_or_trascendence(invoice),
|
||||
# TODO: ClaveRegimenEspecialOTrascendenciaAdicional1
|
||||
# TODO: ClaveRegimenEspecialOTrascendenciaAdicional2
|
||||
# TODO: NumRegistroAcuerdoFacturacion
|
||||
# TODO: ImporteTotal
|
||||
# TODO: BaseImponibleACoste
|
||||
'DescripcionOperacion': cls.description(invoice),
|
||||
# TODO: DatosInmueble
|
||||
# TODO: ImporteTransmisionSujetoAIVA
|
||||
# TODO: EmitidaPorTerceros
|
||||
# TODO: VariosDestinatarios
|
||||
# TODO: Cupon
|
||||
'TipoDesglose': {
|
||||
'DesgloseFactura': {
|
||||
'Sujeta': {
|
||||
|
@ -142,6 +159,7 @@ class RecievedInvoiceMapper(object):
|
|||
return {
|
||||
'IDEmisorFactura': {
|
||||
'NIF': cls.counterpart_nif(invoice),
|
||||
# TODO: IDOtro: {CodigoPais, IDType, ID}
|
||||
},
|
||||
'NumSerieFacturaEmisor': cls.serial_number(invoice),
|
||||
# TODO: NumSerieFacturaEmisorResumenFin
|
||||
|
@ -165,8 +183,19 @@ class RecievedInvoiceMapper(object):
|
|||
def build_invoice(cls, invoice):
|
||||
ret = {
|
||||
'TipoFactura': cls.invoice_kind(invoice),
|
||||
# TODO: TipoRectificativa
|
||||
# TODO: FacturasAgrupadas: {IDFacturaAgrupada: [{Num, Fecha}]}
|
||||
# TODO: FacturasRectificadas:{IDFacturaRectificada:[{Num, Fecha}]}
|
||||
# TODO: ImporteRectificacion: {
|
||||
# BaseRectificada, CuotaRectificada, CuotaRecargoRectificado }
|
||||
# TODO: FechaOperacion
|
||||
'ClaveRegimenEspecialOTrascendencia':
|
||||
cls.specialkey_or_trascendence(invoice),
|
||||
# TODO: ClaveRegimenEspecialOTrascendenciaAdicional1
|
||||
# TODO: ClaveRegimenEspecialOTrascendenciaAdicional2
|
||||
# TODO: NumRegistroAcuerdoFacturacion
|
||||
# TODO: ImporteTotal
|
||||
# TODO: BaseImponibleACoste
|
||||
'DescripcionOperacion': cls.description(invoice),
|
||||
'DesgloseFactura': {
|
||||
# 'InversionSujetoPasivo': {
|
||||
|
@ -178,11 +207,10 @@ class RecievedInvoiceMapper(object):
|
|||
map(cls.build_taxes, cls.taxes(invoice)),
|
||||
}
|
||||
},
|
||||
'Contraparte': cls.build_counterpart(invoice),
|
||||
'FechaRegContable': cls.move_date(invoice).strftime(_DATE_FMT),
|
||||
'CuotaDeducible': cls.deductible_amount(invoice),
|
||||
}
|
||||
if ret['TipoFactura'] not in {'F2', 'F4', 'R5'}:
|
||||
ret['Contraparte'] = cls.build_counterpart(invoice)
|
||||
return ret
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Reference in New Issue