Пример #1
0
 def testData6(self):
     with open(DPATH + '/IT01234567890_FPR03.xml', 'rt') as f:
         tree = ElementTree.parse(f)
         fe = serializer.deserialize(element=tree)
         strxml = serializer.serializer(fe, 'xml')
         self.assertIsInstance(strxml, str)
         self.assertIsInstance(fe, fepa.FatturaElettronica)
Пример #2
0
    'datafattura':
    datetime.datetime.strptime('2014-11-28T00:00:00', '%Y-%m-%dT%H:%M:%S'),
    'importototale':
    14480.00,
    'importoiva':
    3185.60,
    'nr_rg':
    '000001/2012',
    'sede':
    '08500402104',
    'numeromodello37':
    None,
    'datainizioprestazione':
    datetime.datetime.strptime('2014-07-31T00:00:00', '%Y-%m-%dT%H:%M:%S'),
    'datafineprestazione':
    datetime.datetime.strptime('2014-10-20T00:00:00', '%Y-%m-%dT%H:%M:%S'),
    'nomemagistrato':
    'Stefanò'.decode('utf-8'),
    'cognomemagistrato':
    'Luciani',
    'tipointercettazione':
    'C'
}

with open(DPATH + '/PyFePA/test/IT01234567890_11001.xml', 'rt') as f:
    tree = ElementTree.parse(f)
    fe = serializer.deserialize(element=tree)
    print((serializer.serializer(fe, 'xml')))

testdata_list = [testdata, testdata, testdata]
print((siamm.serialize(testdata_list)))
Пример #3
0
    def datipagamento(self):

        dp = DatiPagamento()
        dp.CondizioniPagamento = 'TP02'
        dp.DettaglioPagamento = DettaglioPagamento()
        dp.DettaglioPagamento.ModalitaPagamento = 'MP05'
        dp.DettaglioPagamento.ImportoPagamento = 1220000
        dp.DettaglioPagamento.IBAN = '12A 4567 890234 51234567 890236'
        dp.DettaglioPagamento.BIC = '12345678'

        return dp

    def allegati(self):

        allegati = []

        all = Allegati()
        all.NomeAttachment = 'Test'
        all.FormatoAttachment = 'XML'
        all.DescrizioneAttachment = 'Allegato di Test'
        all.Attachment = 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KCjxkYXRhcm9vdCB4bWxuczpvZD0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTpvZmZpY2VkYXRhIiAKCQkgIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIAoJCSAgeHNpOm5vTmFtZXNwYWNlU2NoZW1hTG9jYXRpb249IkludGVyY2V0dGF6aW9uaS54c2QiIGdlbmVyYXRlZD0iMjAxMC0wMy0zMFQxMDo0MjoyMSI'
        allegati.append(all)

        return allegati


if __name__ == "__main__":
    fatturapa = FatturaPA()
    fpa = fatturapa.get_fatturapa()
    print((serializer(fpa, 'xml')))