X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/ac4e74bc3235c3ced324ee54e9f788307a1e5eed..a9f9aecb4dc1ae44e94c45b461dc18b6da2a9c9a:/emufs_gui/facturas.c?ds=sidebyside diff --git a/emufs_gui/facturas.c b/emufs_gui/facturas.c index 8cd9267..a585be9 100644 --- a/emufs_gui/facturas.c +++ b/emufs_gui/facturas.c @@ -868,3 +868,45 @@ void fact_reformatear(int tipo, int tam_bloque, int tam_reg, int nota_tipo, int PERR("==== TERMINE ====\n"); } +int fact_exportar_xml(const char *filename) +{ + int j; + t_Reg_Factura *nodo; + t_Factura *fact; + EMUFS_REG_ID id, id1; + FILE *fp; + + if (lst_facturas->primero == NULL) return 0; + + nodo = lst_facturas->primero; + + if (!(fp = fopen(filename, "wt"))) return 0; + + fprintf(fp, "\n"); + fprintf(fp, "\n"); + while (nodo) { + fact = fact_buscar(lst_facturas, nodo->numero, &id, &id1); + fprintf(fp, "\tnumero); + fprintf(fp, "FechaEmisión=\"%s\" ", fact->emision); + fprintf(fp, "FechaVto=\"%s\" ", fact->vencimiento); + fprintf(fp, "NroRemito=\"%08d\" ", fact->numero_remito); + fprintf(fp, "FP=\"%s\" ", fact->fp); + fprintf(fp, "Estado=\"%s\" ", fact->estado); + fprintf(fp, "NroCheque=\"%s\" ", fact->cheque); + fprintf(fp, "PorcDoI=\"%.2f\" ", fact->procdoi); + fprintf(fp, "NroCtaCte=\"%s\" ", fact->ctacte); + fprintf(fp, ">\n"); + fprintf(fp, "\t\t%s\n", fact->nota); + for(j=0; jcant_items; j++) { + if (fact->items[j].numero != 0) + fprintf(fp, "\t\t\n", fact->items[j].numero, fact->items[j].cv, fact->items[j].pvu); + } + fprintf(fp, "\t\n"); + nodo = nodo->sig; + } + fprintf(fp, "\t\n"); + + fclose(fp); + return 1; +} +