Correzione errori

git-svn-id: svn://10.65.10.50/trunk@1657 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1995-07-31 09:49:11 +00:00
parent 5be42f00f4
commit 5ec94653a6
8 changed files with 5914 additions and 5906 deletions

View File

@ -667,8 +667,11 @@ void CG1100_application::set_senza_IV()
}
if (sottoc != 0l)
{
char tipospric = rec.get_char(PCN_TIPOSPRIC);
if (tipospric == '\0') tipospric = '0';
set_row (i, "@104g@1n", FLD(LF_PCON, PCN_RICSER) );
set_row (i, "@109g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
//set_row (i, "@109g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
set_row (i, "@109g%c", tipospric);
set_row (i, "@115g@1s", FLD(LF_PCON, PCN_SEZSALDI) );
set_row (i, "@129g@f", FLD(LF_PCON, PCN_STSOTTAB) );
}
@ -712,7 +715,6 @@ void CG1100_application::set_con_ana()
void CG1100_application::set_senza_ana()
{
reset_row (1);
set_row (1, "$[r]@pn$[n] $[r]@pn$[n] $[r]@pn$[n]",
@ -731,14 +733,14 @@ void CG1100_application::set_senza_ana()
set_row (1, "@92g@1s", FLD(LF_PCON, PCN_TMCF) );
set_row (1, "@99g@f", FLD(LF_PCON, PCN_STSOTTBIL) );
set_row (1, "@107g@f", FLD(LF_PCON, PCN_COMPENS) );
set_row (1, "@114g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
//set_row (1, "@114g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
set_row (1, "@120g@1s", FLD(LF_PCON, PCN_SEZSALDI) );
}
void CG1100_application::set_completa()
{
TRectype & rec = current_cursor()->curr();
TRectype& rec = current_cursor()->curr();
char sezione;
int i;
@ -790,8 +792,11 @@ void CG1100_application::set_completa()
}
if (sottoc != 0l)
{
char tipospric = rec.get_char(PCN_TIPOSPRIC);
if (tipospric == '\0') tipospric = '0';
set_row (i, "@104g@1n", FLD(LF_PCON, PCN_RICSER) );
set_row (i, "@109g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
//set_row (i, "@109g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
set_row (i, "@109g%c", tipospric);
set_row (i, "@115g@1s", FLD(LF_PCON, PCN_SEZSALDI) );
set_row (i, "@129g@f", FLD(LF_PCON, PCN_STSOTTAB) );
}
@ -818,6 +823,9 @@ bool CG1100_application::elabora_riga()
// se e' un sottoconto stampo sotttab in 127
if (sottoc != 0)
{
char tipospric = curr_rec.get_char(PCN_TIPOSPRIC);
if (tipospric == '\0') tipospric = '0';
set_row (1, "@114g%c", tipospric);
set_row (1, "@127g@f", FLD(LF_PCON, PCN_STSOTTAB));
set_row (1, "@117g ");
}
@ -908,7 +916,7 @@ bool CG1100_application::preprocess_page(int file,int counter)
{
if (file == LF_PCON)
{
TRectype & rec = current_cursor()->curr();
TRectype& rec = current_cursor()->curr();
int gruppo = rec.get_int (PCN_GRUPPO);
int conto = rec.get_int (PCN_CONTO);
long sottoc = rec.get_long(PCN_SOTTOCONTO);
@ -963,8 +971,8 @@ bool CG1100_application::preprocess_page(int file,int counter)
}
if (_tipo_stampa == senza_ana_bil)
{
TRectype & rec = current_cursor()->curr();
TRectype& rec = current_cursor()->curr();
force_setpage();
if (rec.get_int(PCN_CONTO) == 0) return FALSE;
if (rec.get_long(PCN_SOTTOCONTO) == 0L)
a1 = rec.get(PCN_CODCBL);
@ -1165,7 +1173,7 @@ bool CG1100_application::user_create()
add_file(LF_PCON);
set_print_zero();
//set_print_zero();
_tipo_stampa = completa;
_salto_pag = FALSE;

View File

@ -1,163 +1,163 @@
//****************************
//* Aggiornamento Tipo Conto *
//****************************
#include <mov.h>
#include <rmoviva.h>
#include <nditte.h>
#include "conto.h"
#include "cg1302.h"
const int TAgg_tconto::look_reg (const char* cod, int anno)
{
TTable tab_reg("REG");
TString codtab;
codtab.format("%4d%-3s", anno, cod);
int tipo_reg;
tab_reg.zero();
tab_reg.put("CODTAB", codtab);
if (tab_reg.read() == NOERR)
tipo_reg = tab_reg.get_int("I0");
else
tipo_reg = 0;
return tipo_reg;
}
bool TAgg_tconto::user_create()
{
_rel = new TRelation(LF_MOV);
_rel->add(LF_RMOVIVA, "NUMREG=NUMREG",1);
_cur = new TCursor(_rel,"",1);
add_cursor(_cur);
add_file (LF_MOV);
add_file (LF_RMOVIVA);
_pcon = new TLocalisamfile(LF_PCON);
_nditte = new TLocalisamfile(LF_NDITTE);
_tabreg = new TTable("REG");
return TRUE;
}
bool TAgg_tconto::user_destroy()
{
delete _rel;
delete _cur;
delete _pcon;
delete _nditte;
delete _tabreg;
return TRUE;
}
bool TAgg_tconto::set_print(int)
{
TMask msk("cg1300a");
while (msk.run() == K_ENTER)
{
setta_intestazione();
printer().footerlen(5);
return TRUE;
}
return FALSE;
}
void TAgg_tconto::postclose_print()
{
message_box("Aggiornamento tipo conto completato");
}
bool TAgg_tconto::preprocess_page(int file,int counter)
{
if (counter) return TRUE;
TCursor* cur = current_cursor();
if (file == LF_MOV)
{
TString16 reg = cur->curr().get(MOV_REG);
if (reg.empty()) return FALSE;
}
else if (file == LF_RMOVIVA)
{
TRectype pcon(LF_PCON);
int gruppo = cur->curr(LF_RMOVIVA).get_int(RMI_GRUPPO);
int conto = cur->curr(LF_RMOVIVA).get_int(RMI_CONTO);
long sottoconto = cur->curr(LF_RMOVIVA).get_long(RMI_SOTTOCONTO);
long numreg = cur->curr(LF_RMOVIVA).get_long(RMI_NUMREG);
int nrigimp = cur->curr(LF_RMOVIVA).get_int("RIGAIMP");
TBill tc (gruppo,conto,0L);
tc.read(pcon);
if (!pcon.empty())
if (pcon.get_char("TMCF") != '\0')
return FALSE;
tc.set(gruppo,conto,sottoconto);
tc.read(pcon);
if (!pcon.empty())
{
if (tc.sospeso())
{
set_row(1, "@4g%7ld@23g%3d@31g%3d@37g%3d@45g%6ld ** Conto sospeso **",
numreg, nrigimp, gruppo, conto, sottoconto);
return TRUE;
}
int t = tc.tipo_cr();
TString16 reg = cur->curr().get(MOV_REG);
int annoiva = cur->curr().get_int(MOV_ANNOIVA);
const int tipo = look_reg(reg, annoiva); //cerca il tipo del registro
//aggiorno sul movimento iva il tipo costo/ricavo
//con quello letto dal piano conti
_rel->lfile(LF_RMOVIVA).put(RMI_TIPOCR, t);
if (tipo == 1 && (t == 2 || t == 3))
_rel->lfile(LF_RMOVIVA).put(RMI_TIPOCR, 4);
_rel->lfile(LF_RMOVIVA).rewrite();
}
else
{
set_row(1, "@4g%7ld@23g%3d@31g%3d@37g%3d@45g%6ld ** Conto inesistente **",
numreg, nrigimp, gruppo, conto, sottoconto);
return TRUE;
}
return FALSE;
}
return TRUE;
}
void TAgg_tconto::setta_intestazione()
{
int soh = 1;
TString sep(132);
TString ragsoc(50);
TLocalisamfile nditte(LF_NDITTE);
nditte.zero();
nditte.put(NDT_CODDITTA, get_firm());
if (nditte.read() == NOERR)
ragsoc = nditte.get(NDT_RAGSOC);
reset_header();
sep << "Ditta " << get_firm();
sep << " " << ragsoc;
sep.left_just(132);
set_header (soh++, (const char*) sep);
sep = "";
sep << "Data @< Pag. @#";
sep.right_just(127);
sep.overwrite ("AGGIORNAMENTO TIPO CONTO SU MOVIMENTI IVA - Lista errori");
set_header (soh++, (const char*)sep);
sep.fill('-');
set_header (soh++, (const char *) sep);
set_header (soh++, "Numero Registrazione Riga Gruppo Conto Sottoconto");
set_header (soh++, (const char *) sep);
set_header (soh, "");
}
//****************************
//* Aggiornamento Tipo Conto *
//****************************
#include <mov.h>
#include <rmoviva.h>
#include <nditte.h>
#include "conto.h"
#include "cg1302.h"
const int TAgg_tconto::look_reg (const char* cod, int anno)
{
TTable tab_reg("REG");
TString codtab;
codtab.format("%4d%-3s", anno, cod);
int tipo_reg;
tab_reg.zero();
tab_reg.put("CODTAB", codtab);
if (tab_reg.read() == NOERR)
tipo_reg = tab_reg.get_int("I0");
else
tipo_reg = 0;
return tipo_reg;
}
bool TAgg_tconto::user_create()
{
_rel = new TRelation(LF_MOV);
_rel->add(LF_RMOVIVA, "NUMREG=NUMREG",1);
_cur = new TCursor(_rel,"",1);
add_cursor(_cur);
add_file (LF_MOV);
add_file (LF_RMOVIVA);
_pcon = new TLocalisamfile(LF_PCON);
_nditte = new TLocalisamfile(LF_NDITTE);
_tabreg = new TTable("REG");
return TRUE;
}
bool TAgg_tconto::user_destroy()
{
delete _rel;
delete _cur;
delete _pcon;
delete _nditte;
delete _tabreg;
return TRUE;
}
bool TAgg_tconto::set_print(int)
{
TMask msk("cg1300a");
while (msk.run() == K_ENTER)
{
setta_intestazione();
printer().footerlen(5);
return TRUE;
}
return FALSE;
}
void TAgg_tconto::postclose_print()
{
message_box("Aggiornamento tipo conto completato");
}
bool TAgg_tconto::preprocess_page(int file,int counter)
{
if (counter) return TRUE;
TCursor* cur = current_cursor();
if (file == LF_MOV)
{
TString16 reg = cur->curr().get(MOV_REG);
if (reg.empty()) return FALSE;
}
else if (file == LF_RMOVIVA)
{
TRectype pcon(LF_PCON);
int gruppo = cur->curr(LF_RMOVIVA).get_int(RMI_GRUPPO);
int conto = cur->curr(LF_RMOVIVA).get_int(RMI_CONTO);
long sottoconto = cur->curr(LF_RMOVIVA).get_long(RMI_SOTTOCONTO);
long numreg = cur->curr(LF_RMOVIVA).get_long(RMI_NUMREG);
int nrigimp = cur->curr(LF_RMOVIVA).get_int("RIGAIMP");
TBill tc (gruppo,conto,0L);
tc.read(pcon);
if (!pcon.empty())
if (pcon.get_char("TMCF") != '\0')
return FALSE;
tc.set(gruppo,conto,sottoconto);
tc.read(pcon);
if (!pcon.empty())
{
if (tc.sospeso())
{
set_row(1, "@4g%7ld@23g%3d@31g%3d@37g%3d@45g%6ld ** Conto sospeso **",
numreg, nrigimp, gruppo, conto, sottoconto);
return TRUE;
}
int t = tc.tipo_cr();
TString16 reg = cur->curr().get(MOV_REG);
int annoiva = cur->curr().get_int(MOV_ANNOIVA);
const int tipo = look_reg(reg, annoiva); //cerca il tipo del registro
//aggiorno sul movimento iva il tipo costo/ricavo
//con quello letto dal piano conti
_rel->lfile(LF_RMOVIVA).put(RMI_TIPOCR, t);
if (tipo == 1 && (t == 2 || t == 3))
_rel->lfile(LF_RMOVIVA).put(RMI_TIPOCR, 4);
_rel->lfile(LF_RMOVIVA).rewrite();
}
else
{
set_row(1, "@4g%7ld@23g%3d@31g%3d@37g%3d@45g%6ld ** Conto inesistente **",
numreg, nrigimp, gruppo, conto, sottoconto);
return TRUE;
}
return FALSE;
}
return TRUE;
}
void TAgg_tconto::setta_intestazione()
{
int soh = 1;
TString sep(132);
TString ragsoc(50);
TLocalisamfile nditte(LF_NDITTE);
nditte.zero();
nditte.put(NDT_CODDITTA, get_firm());
if (nditte.read() == NOERR)
ragsoc = nditte.get(NDT_RAGSOC);
reset_header();
sep << "Ditta " << get_firm();
sep << " " << ragsoc;
sep.left_just(132);
set_header (soh++, (const char*) sep);
sep = "";
sep << "Data @< Pag. @#";
sep.right_just(127);
sep.overwrite ("AGGIORNAMENTO TIPO CONTO SU MOVIMENTI IVA - Lista errori");
set_header (soh++, (const char*)sep);
sep.fill('-');
set_header (soh++, (const char *) sep);
set_header (soh++, "Numero Registrazione Riga Gruppo Conto Sottoconto");
set_header (soh++, (const char *) sep);
set_header (soh, "");
}

View File

@ -1,28 +1,28 @@
#include <printapp.h>
#include <mask.h>
#include <tabutil.h>
#include <utility.h>
#include <progind.h>
#include <urldefid.h>
#include <prefix.h>
class TAgg_tconto : public TPrintapp
{
TLocalisamfile* _pcon,* _nditte;
TTable* _tabreg;
TRelation* _rel;
TCursor* _cur;
public:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int i);
virtual bool preprocess_page(int, int);
virtual void postclose_print();
void setta_intestazione();
const int look_reg(const char*, int);
TAgg_tconto() {};
virtual ~TAgg_tconto() {};
};
#include <printapp.h>
#include <mask.h>
#include <tabutil.h>
#include <utility.h>
#include <progind.h>
#include <urldefid.h>
#include <prefix.h>
class TAgg_tconto : public TPrintapp
{
TLocalisamfile* _pcon,* _nditte;
TTable* _tabreg;
TRelation* _rel;
TCursor* _cur;
public:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int i);
virtual bool preprocess_page(int, int);
virtual void postclose_print();
void setta_intestazione();
const int look_reg(const char*, int);
TAgg_tconto() {};
virtual ~TAgg_tconto() {};
};

View File

@ -1,168 +1,168 @@
//*****************************************************
//* Aggiornamento codice attivita' su progressivi IVA *
//*****************************************************
#include <mov.h>
#include "cg1300.h"
#include "cg1304.h"
#include "cg2103.h"
HIDDEN TAgg_codatt& app() { return (TAgg_codatt&) main_app(); }
bool TAgg_codatt::create()
{
TApplication::create();
_tab = new TLocalisamfile(LF_TAB);
dispatch_e_menu (BAR_ITEM(1));
return TRUE;
}
bool TAgg_codatt::destroy()
{
delete _tab;
return TApplication::destroy();
}
bool TAgg_codatt::menu(MENU_TAG m)
{
TProgind* pri;
TMask msk("cg1300c");
/*
TConfig conf(CONFIG_DITTA);
int annoiva = conf.get_int("AnLiIv");
msk.set(F_ANNO, annoiva);
*/
while (msk.run() == K_ENTER)
{
pri = new TProgind(2,"Aggiornamento in corso...",FALSE,TRUE,50);
_pass = msk.get_bool(F_PASS);
if (_pass)
{
_anno = msk.get_int(F_ANNO);
_da = msk.get(F_DA); //se c'e' _da c'e' anche _a e viceversa
_a = msk.get(F_A); //_da e' la vecchia attivita'
//_a e' la nuova attivita'
pri->addstatus(1);
aggiorna_att("PIM");
aggiorna_att("PUM");
aggiorna_att("POM");
aggiorna_att("PAM");
aggiorna_att("PPA");
aggiorna_att("PLA");
aggiorna_att("PLM");
}
else
{
pri->addstatus(1);
cancella_rec();
}
pri->addstatus(1);
msk.reset();
//msk.reset(F_ANNO);
//msk.reset(F_DA);
//msk.reset(F_A);
delete pri;
message_box("Aggiornamento codice attivita' completato");
}
return FALSE;
}
void TAgg_codatt::cancella_rec()
{
TTable plm("PLM");
for (plm.first(); !plm.eof(); plm.next())
plm.remove();
TTable pum("PUM");
for (pum.first(); !pum.eof(); pum.next())
pum.remove();
TTable pom("POM");
for (pom.first(); !pom.eof(); pom.next())
pom.remove();
TTable pam("PAM");
for (pam.first(); !pam.eof(); pam.next())
pam.remove();
TTable ppa("PPA");
for (ppa.first(); !ppa.eof(); ppa.next())
ppa.remove();
//non e' indicata la vecchia attivita' => :
TTable pim("PIM");
for (pim.first(); !pim.eof(); pim.next())
{
const TString80 codtab = pim.get("CODTAB");
int anno = atoi(codtab.mid(0,4));
const TString16 codatt = codtab.mid(4,5);
const TString16 codreg = codtab.mid(10,3);
if (codreg.not_empty())
{
TRegistro reg(codreg,anno);
if (!reg.name().empty()) //se esiste quel registro (ma perche' non dovrebbe?)
{
const TString16 cda = reg.attivita();
if (codatt != cda)
{
TRectype vecchio (pim.curr());
TRectype nuovo (pim.curr());
const TString80 cc = codtab.sub(9);
TString80 cod;
cod << anno << cda << cc;
nuovo.put("CODTAB", cod);
pim.write(nuovo);
pim.read(vecchio);
pim.remove();
}
}
}
}
TTable pla("PLA");
for (pla.first(); !pla.eof(); pla.next())
pla.remove();
/***
TTable rmb("RMB");
for (rmb.first(); !rmb.eof(); rmb.next())
rmb.remove();
***/
}
void TAgg_codatt::aggiorna_att(const char* nome)
{
TTable tab(nome);
tab.setkey(1);
tab.zero();
TString16 chiave;
TString16 old_att(_da); old_att.right_just(5,'0');
TString16 new_att(_a); new_att.right_just(5,'0');
chiave << _anno << old_att;
tab.put("CODTAB", chiave);
TRectype curr (tab.curr());
tab.read(_isgteq);
for (; !tab.eof(); tab.next())
{
if (tab.curr() != curr) break;
const TString80 codtab = tab.get("CODTAB");
//const TString16 cod_att = codtab.mid(4,5); //e' uguale a old_att
if (old_att != new_att)
{
TRectype vecchio (tab.curr());
TRectype nuovo (tab.curr());
const TString80 cc = codtab.sub(9);
TString80 cod;
cod << _anno << new_att << cc;
nuovo.put("CODTAB", cod);
tab.write(nuovo);
tab.read(vecchio);
tab.remove();
}
}
}
//*****************************************************
//* Aggiornamento codice attivita' su progressivi IVA *
//*****************************************************
#include <mov.h>
#include "cg1300.h"
#include "cg1304.h"
#include "cg2103.h"
HIDDEN TAgg_codatt& app() { return (TAgg_codatt&) main_app(); }
bool TAgg_codatt::create()
{
TApplication::create();
_tab = new TLocalisamfile(LF_TAB);
dispatch_e_menu (BAR_ITEM(1));
return TRUE;
}
bool TAgg_codatt::destroy()
{
delete _tab;
return TApplication::destroy();
}
bool TAgg_codatt::menu(MENU_TAG m)
{
TProgind* pri;
TMask msk("cg1300c");
/*
TConfig conf(CONFIG_DITTA);
int annoiva = conf.get_int("AnLiIv");
msk.set(F_ANNO, annoiva);
*/
while (msk.run() == K_ENTER)
{
pri = new TProgind(2,"Aggiornamento in corso...",FALSE,TRUE,50);
_pass = msk.get_bool(F_PASS);
if (_pass)
{
_anno = msk.get_int(F_ANNO);
_da = msk.get(F_DA); //se c'e' _da c'e' anche _a e viceversa
_a = msk.get(F_A); //_da e' la vecchia attivita'
//_a e' la nuova attivita'
pri->addstatus(1);
aggiorna_att("PIM");
aggiorna_att("PUM");
aggiorna_att("POM");
aggiorna_att("PAM");
aggiorna_att("PPA");
aggiorna_att("PLA");
aggiorna_att("PLM");
}
else
{
pri->addstatus(1);
cancella_rec();
}
pri->addstatus(1);
msk.reset();
//msk.reset(F_ANNO);
//msk.reset(F_DA);
//msk.reset(F_A);
delete pri;
message_box("Aggiornamento codice attivita' completato");
}
return FALSE;
}
void TAgg_codatt::cancella_rec()
{
TTable plm("PLM");
for (plm.first(); !plm.eof(); plm.next())
plm.remove();
TTable pum("PUM");
for (pum.first(); !pum.eof(); pum.next())
pum.remove();
TTable pom("POM");
for (pom.first(); !pom.eof(); pom.next())
pom.remove();
TTable pam("PAM");
for (pam.first(); !pam.eof(); pam.next())
pam.remove();
TTable ppa("PPA");
for (ppa.first(); !ppa.eof(); ppa.next())
ppa.remove();
//non e' indicata la vecchia attivita' => :
TTable pim("PIM");
for (pim.first(); !pim.eof(); pim.next())
{
const TString80 codtab = pim.get("CODTAB");
int anno = atoi(codtab.mid(0,4));
const TString16 codatt = codtab.mid(4,5);
const TString16 codreg = codtab.mid(10,3);
if (codreg.not_empty())
{
TRegistro reg(codreg,anno);
if (!reg.name().empty()) //se esiste quel registro (ma perche' non dovrebbe?)
{
const TString16 cda = reg.attivita();
if (codatt != cda)
{
TRectype vecchio (pim.curr());
TRectype nuovo (pim.curr());
const TString80 cc = codtab.sub(9);
TString80 cod;
cod << anno << cda << cc;
nuovo.put("CODTAB", cod);
pim.write(nuovo);
pim.read(vecchio);
pim.remove();
}
}
}
}
TTable pla("PLA");
for (pla.first(); !pla.eof(); pla.next())
pla.remove();
/***
TTable rmb("RMB");
for (rmb.first(); !rmb.eof(); rmb.next())
rmb.remove();
***/
}
void TAgg_codatt::aggiorna_att(const char* nome)
{
TTable tab(nome);
tab.setkey(1);
tab.zero();
TString16 chiave;
TString16 old_att(_da); old_att.right_just(5,'0');
TString16 new_att(_a); new_att.right_just(5,'0');
chiave << _anno << old_att;
tab.put("CODTAB", chiave);
TRectype curr (tab.curr());
tab.read(_isgteq);
for (; !tab.eof(); tab.next())
{
if (tab.curr() != curr) break;
const TString80 codtab = tab.get("CODTAB");
//const TString16 cod_att = codtab.mid(4,5); //e' uguale a old_att
if (old_att != new_att)
{
TRectype vecchio (tab.curr());
TRectype nuovo (tab.curr());
const TString80 cc = codtab.sub(9);
TString80 cod;
cod << _anno << new_att << cc;
nuovo.put("CODTAB", cod);
tab.write(nuovo);
tab.read(vecchio);
tab.remove();
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,160 +1,160 @@
//
// cg4400.h
//
#include <isam.h>
#include <printapp.h>
#include <mask.h>
#include <tabutil.h>
#include <utility.h>
#include <urldefid.h>
#include <text.h>
#include <mailbox.h>
#include <execp.h>
#include <sheet.h>
#include <config.h>
#include <prefix.h>
#include <progind.h>
#include <nditte.h>
#include <anagr.h>
#include <comuni.h>
#include <unloc.h>
#include <mov.h>
#include <rmoviva.h>
#include <clifo.h>
#include <occas.h>
#include <causali.h>
#include "cglib03.h"
#include "cglib04.h"
#include "conto.h"
enum messaggio {
no_liquidazione,
B0_settato,
non_proseguire,
prosegui_stampa,
prosegui_cal_stampa
};
class CG4400_application : public TPrintapp
{
TCursor * _cur;
TRelation *_rel, *_nditte;
TLocalisamfile *_clifo, *_occas, *_tab, *_tabcom, *_com, *_anag, *_unloc, *_attiv, *_indlib;
TTable *_tabreg, *_tablbu, *_tablim, *_tabpim, *_tablia, *_tabiva;
TTable *_tabpla, *_tabppa, *_tabvid;
TRigaiva_array _iva_array, _riga_rmi;
TTipodoc_array _doc_array;
TRiga_array _tot_iva_array;
TBit_array _selected;
TArray_sheet *_ditte;
TArray _nomiditte;
bool _st_liq[13];
bool _test;
TRecnotype _nrec;
bool _mov_empty, _stampa_ind_ditta, _stampa_tutti_i_registri, _auto_intraf, _stampa;
bool _corrispettivi, _liquidazione, _riep_liq, _stampa_ind_comp, _esiste_riga_iva, _stampa_cred_pre;
bool _rif_vid, _intesta_vidi, _intesta_liq, _stampa_data_reg, _ok_vidi;
bool _sosp_imposta;
char _frequiva, _tipo_riepilogativo;
TDate _data_da, _data_a, _data_stampa, _dataregp, _dataregs, _datareg;
TDate _u_data;
long _n_ditte, _u_stampata, _primast, __firm, _uprotivap, _ditta;
long _numini, _pagine_stampate;
int _fino_a_mese, _tipo_reg, _tipo_stampa, _cod_un_loc;
int _annoes, _r, _stampa_width, _mese_ultima_liq, _mese_credito;
int _stampa_len, _stampa_mese, _size_header;
real _totale_doc, _credito;
TString _codreg, _desc_lib, _codatt, _attivita, _tipoatt;
TString _tipodoc, _descr_doc, _codlib, _codice_vidi;
TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis;
TFilename _t, _pippo;
TParagraph_string* _desc27;
messaggio _scelta;
protected:
static bool filter_func (const TRelation * r);
static bool mask_tipo_stampa (TMask_field&, KEY);
static bool to_ditt_handler (TMask_field&, KEY);
static bool fr_ditt_handler (TMask_field&, KEY);
static bool to_butt_handler (TMask_field&, KEY);
static bool fr_butt_handler (TMask_field&, KEY);
static bool mask_cod (TMask_field&, KEY);
static bool mask_libun (TMask_field&, KEY);
static bool mask_data (TMask_field&, KEY);
static bool mask_mese (TMask_field&, KEY);
static bool mask_fino_a_mese (TMask_field&, KEY);
static bool mask_select (TMask_field&, KEY);
static bool mask_azzera (TMask_field&, KEY);
static bool year_handler (TMask_field&, KEY);
public:
const char* desc_attivita ();
const char* tipo_attivita ();
const char* descr_doc ();
const char* descr_iva (const char *);
TRectype& ricerca_occ(const char*);
TRectype& ricerca_cf (char, long);
TRectype& look_comuni(const char*);
TArray_sheet* get_ditte_sheet() { return _ditte; }
int setta_riga (int, const TRigaiva&, real&, real&, real&, real&);
int riga_rmoviva();
bool set_print(int);
bool set_ditte(TMask&);
bool compila_reg(const TMask&);
bool compila_lib();
messaggio controlla_liquidazione();
messaggio controlla_b0();
bool controlla_mov();
bool stampo_liquidazione(int);
bool ventilazione(const char*);
bool cerca_libro_gio(TString&, bool*);
bool look_reg (int, int, TString&, int, const char*, int*, long);
bool look_regs(int, TString&, int, int*, long, TProgind*);
bool stampa_totali_finali();
bool stampa_datareg();
bool stampa_registri_IVA(const TMask&);
bool look_lia(long ditta = 0l);
bool ricerca_mese(TString&,TString&,int,int,TMask_field&);
void set_choice_limits(TMask&);
void build_ditte_sheet();
void cerca_reg(const TString&, byte*);
void set_page_tot_reg();
void send_message(char, const TFilename&,int);
void aggiorna_reg(const bool aggiorna_vidi);
void aggiorna_lib();
void calcola_progressivi();
void stampa_liq_mesi_succ();
void look_reg();
void no_movimenti();
void liq_b0_settato();
void liq_other_case();
bool setta_mask(long);
bool preprocess_page(int, int);
int stampa_intestazione();
int stampa_prospetto();
long select_firm_range(long,long);
void stampa_plafonds(int);
void get_dati_ditta();
void stampa_vidi();
void scrivi_reg();
int stampa_acquisti(int);
real stampa_valori_plafonds(const real&, const int, TTable&, const char*);
void build_nomiditte(TProgind* pnd = NULL);
void set_year(int y) { _annoes = y; }
void clear_stliq();
virtual bool preprocess_print(int, int);
virtual bool user_create();
virtual bool user_destroy();
virtual print_action postprocess_page (int, int);
virtual void preprocess_header();
CG4400_application() : TPrintapp(), _ditte(NULL), _selected(10000), _nomiditte(100), _test(FALSE) {}
virtual ~CG4400_application() {}
};
//
// cg4400.h
//
#include <isam.h>
#include <printapp.h>
#include <mask.h>
#include <tabutil.h>
#include <utility.h>
#include <urldefid.h>
#include <text.h>
#include <mailbox.h>
#include <execp.h>
#include <sheet.h>
#include <config.h>
#include <prefix.h>
#include <progind.h>
#include <nditte.h>
#include <anagr.h>
#include <comuni.h>
#include <unloc.h>
#include <mov.h>
#include <rmoviva.h>
#include <clifo.h>
#include <occas.h>
#include <causali.h>
#include "cglib03.h"
#include "cglib04.h"
#include "conto.h"
enum messaggio {
no_liquidazione,
B0_settato,
non_proseguire,
prosegui_stampa,
prosegui_cal_stampa
};
class CG4400_application : public TPrintapp
{
TCursor * _cur;
TRelation *_rel, *_nditte;
TLocalisamfile *_clifo, *_occas, *_tab, *_tabcom, *_com, *_anag, *_unloc, *_attiv, *_indlib;
TTable *_tabreg, *_tablbu, *_tablim, *_tabpim, *_tablia, *_tabiva;
TTable *_tabpla, *_tabppa, *_tabvid;
TRigaiva_array _iva_array, _riga_rmi;
TTipodoc_array _doc_array;
TRiga_array _tot_iva_array;
TBit_array _selected;
TArray_sheet *_ditte;
TArray _nomiditte;
bool _st_liq[13];
bool _test;
TRecnotype _nrec;
bool _mov_empty, _stampa_ind_ditta, _stampa_tutti_i_registri, _auto_intraf, _stampa;
bool _corrispettivi, _liquidazione, _riep_liq, _stampa_ind_comp, _esiste_riga_iva, _stampa_cred_pre;
bool _rif_vid, _intesta_vidi, _intesta_liq, _stampa_data_reg, _ok_vidi;
bool _sosp_imposta;
char _frequiva, _tipo_riepilogativo;
TDate _data_da, _data_a, _data_stampa, _dataregp, _dataregs, _datareg;
TDate _u_data;
long _n_ditte, _u_stampata, _primast, __firm, _uprotivap, _ditta;
long _numini, _pagine_stampate;
int _fino_a_mese, _tipo_reg, _tipo_stampa, _cod_un_loc;
int _annoes, _r, _stampa_width, _mese_ultima_liq, _mese_credito;
int _stampa_len, _stampa_mese, _size_header;
real _totale_doc, _credito;
TString _codreg, _desc_lib, _codatt, _attivita, _tipoatt;
TString _tipodoc, _descr_doc, _codlib, _codice_vidi;
TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis;
TFilename _t, _pippo;
TParagraph_string* _desc27;
messaggio _scelta;
protected:
static bool filter_func (const TRelation * r);
static bool mask_tipo_stampa (TMask_field&, KEY);
static bool to_ditt_handler (TMask_field&, KEY);
static bool fr_ditt_handler (TMask_field&, KEY);
static bool to_butt_handler (TMask_field&, KEY);
static bool fr_butt_handler (TMask_field&, KEY);
static bool mask_cod (TMask_field&, KEY);
static bool mask_libun (TMask_field&, KEY);
static bool mask_data (TMask_field&, KEY);
static bool mask_mese (TMask_field&, KEY);
static bool mask_fino_a_mese (TMask_field&, KEY);
static bool mask_select (TMask_field&, KEY);
static bool mask_azzera (TMask_field&, KEY);
static bool year_handler (TMask_field&, KEY);
public:
const char* desc_attivita ();
const char* tipo_attivita ();
const char* descr_doc ();
const char* descr_iva (const char *);
TRectype& ricerca_occ(const char*);
TRectype& ricerca_cf (char, long);
TRectype& look_comuni(const char*);
TArray_sheet* get_ditte_sheet() { return _ditte; }
int setta_riga (int, const TRigaiva&, real&, real&, real&, real&);
int riga_rmoviva();
bool set_print(int);
bool set_ditte(TMask&);
bool compila_reg(const TMask&);
bool compila_lib();
messaggio controlla_liquidazione();
messaggio controlla_b0();
bool controlla_mov();
bool stampo_liquidazione(int);
bool ventilazione(const char*);
bool cerca_libro_gio(TString&, bool*);
bool look_reg (int, int, TString&, int, const char*, int*, long);
bool look_regs(int, TString&, int, int*, long, TProgind*);
bool stampa_totali_finali();
bool stampa_datareg();
bool stampa_registri_IVA(const TMask&);
bool look_lia(long ditta = 0l);
bool ricerca_mese(TString&,TString&,int,int,TMask_field&);
void set_choice_limits(TMask&);
void build_ditte_sheet();
void cerca_reg(const TString&, byte*);
void set_page_tot_reg();
void send_message(char, const TFilename&,int);
void aggiorna_reg(const bool aggiorna_vidi);
void aggiorna_lib();
void calcola_progressivi();
void stampa_liq_mesi_succ();
void look_reg();
void no_movimenti();
void liq_b0_settato();
void liq_other_case();
bool setta_mask(long);
bool preprocess_page(int, int);
int stampa_intestazione();
int stampa_prospetto();
long select_firm_range(long,long);
void stampa_plafonds(int);
void get_dati_ditta();
void stampa_vidi();
void scrivi_reg();
int stampa_acquisti(int);
real stampa_valori_plafonds(const real&, const int, TTable&, const char*);
void build_nomiditte(TProgind* pnd = NULL);
void set_year(int y) { _annoes = y; }
void clear_stliq();
virtual bool preprocess_print(int, int);
virtual bool user_create();
virtual bool user_destroy();
virtual print_action postprocess_page (int, int);
virtual void preprocess_header();
CG4400_application() : TPrintapp(), _ditte(NULL), _selected(10000), _nomiditte(100), _test(FALSE) {}
virtual ~CG4400_application() {}
};

View File

@ -1,59 +1,59 @@
#include "cg4400b.h"
PAGE "Stampa registri IVA" -1 -1 78 12
GROUPBOX DLG_NULL 78 3
BEGIN
PROMPT 1 0 ""
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 3 1 "Ditta "
FLAGS "D"
END
STRING F_RAGSOC 50
BEGIN
PROMPT 17 1 "Ragione "
FLAGS "D"
END
STRING COD_LIB 3
BEGIN
PROMPT 3 4 "Codice Libro "
FLAGS "D"
END
LISTBOX U_MESE 10
BEGIN
PROMPT 3 5 "Stampa mese "
FLAGS "MD"
ITEM "00|Nessuno"
END
NUMBER U_PAGINA 4
BEGIN
PROMPT 3 6 "Ult.num.pagina stampata libro ditta "
FLAGS "R"
END
DATE U_DATA
BEGIN
PROMPT 3 7 "Ultima data di stampa "
FLAGS "D"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_CANCEL 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
#include "cg4400b.h"
PAGE "Stampa registri IVA" -1 -1 78 12
GROUPBOX DLG_NULL 78 3
BEGIN
PROMPT 1 0 ""
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 3 1 "Ditta "
FLAGS "D"
END
STRING F_RAGSOC 50
BEGIN
PROMPT 17 1 "Ragione "
FLAGS "D"
END
STRING COD_LIB 3
BEGIN
PROMPT 3 4 "Codice Libro "
FLAGS "D"
END
LISTBOX U_MESE 10
BEGIN
PROMPT 3 5 "Stampa mese "
FLAGS "MD"
ITEM "00|Nessuno"
END
NUMBER U_PAGINA 4
BEGIN
PROMPT 3 6 "Ult.num.pagina stampata libro ditta "
FLAGS "R"
END
DATE U_DATA
BEGIN
PROMPT 3 7 "Ultima data di stampa "
FLAGS "D"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_CANCEL 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK