Correzioni ai libri IVA

git-svn-id: svn://10.65.10.50/trunk@965 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1995-02-03 18:36:11 +00:00
parent ac405a66e7
commit 3c15e6a7e0
2 changed files with 50 additions and 35 deletions

View File

@ -5,6 +5,8 @@
#include "cg4400a.h" #include "cg4400a.h"
#include "cg4400b.h" #include "cg4400b.h"
static TString256 TMP;
inline CG4400_application& app() { return (CG4400_application&)main_app(); } inline CG4400_application& app() { return (CG4400_application&)main_app(); }
bool CG4400_application::filter_func (const TRelation * r) bool CG4400_application::filter_func (const TRelation * r)
@ -604,7 +606,7 @@ long CG4400_application::select_firm_range(long from, long to)
return _selected.ones(); return _selected.ones();
} }
void CG4400_application::build_nomiditte() void CG4400_application::build_nomiditte(TProgind* pnd)
{ {
_nomiditte.destroy(); _nomiditte.destroy();
// ricostruire _nomiditte e rifare build_ditte_sheet // ricostruire _nomiditte e rifare build_ditte_sheet
@ -629,11 +631,17 @@ void CG4400_application::build_nomiditte()
_nomiditte.add(d); _nomiditte.add(d);
} }
if (pnd) pnd->addstatus(1);
TApplication::set_firm(__firm); TApplication::set_firm(__firm);
} }
bool CG4400_application::user_create() bool CG4400_application::user_create()
{ {
TProgind* pnd = NULL;
pnd = new TProgind (3,"Preparazione archivi\nPrego attendere",
FALSE, TRUE, 30);
_com = new TLocalisamfile(LF_COMUNI); _com = new TLocalisamfile(LF_COMUNI);
_anag = new TLocalisamfile(LF_ANAG); _anag = new TLocalisamfile(LF_ANAG);
_unloc = new TLocalisamfile(LF_UNLOC); _unloc = new TLocalisamfile(LF_UNLOC);
@ -663,21 +671,27 @@ bool CG4400_application::user_create()
_ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Ditte", _ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Ditte",
"@1|Cod.@5|Ragione Sociale@50|Vers."); "@1|Cod.@5|Ragione Sociale@50|Vers.");
if (pnd) pnd->addstatus(1);
_n_ditte = 0l; _n_ditte = 0l;
__firm = TApplication::get_firm(); __firm = TApplication::get_firm();
TDate oggi(TODAY); TDate oggi(TODAY);
_annoes = oggi.year(); _annoes = oggi.year();
build_nomiditte(); build_nomiditte(pnd);
build_ditte_sheet(); build_ditte_sheet();
//set_real_picture(REAL_PICTURE); if (pnd) pnd->addstatus(1);
add_cursor(_cur); add_cursor(_cur);
add_file(LF_MOV); add_file(LF_MOV);
add_file(LF_RMOVIVA); add_file(LF_RMOVIVA);
//set_real_picture(REAL_PICTURE);
delete pnd;
return TRUE; return TRUE;
} }
@ -711,8 +725,8 @@ bool CG4400_application::user_destroy()
void CG4400_application::calcola_progressivi() void CG4400_application::calcola_progressivi()
{ {
TTable pim ("PIM"); TTable pim ("PIM");
TString chiave; TString80 chiave;
int i, num=0; int i, num=0;
if (_tipo_stampa == 3) if (_tipo_stampa == 3)
@ -1429,13 +1443,13 @@ void CG4400_application::stampa_plafonds(int r)
if (r1 > ZERO) if (r1 > ZERO)
{ {
real r8 = ZERO; real r8 = ZERO;
r8 = stampa_valori_plafonds(r1, num, ppa); r8 = stampa_valori_plafonds(r1, num, ppa, " 1");
if (r8 > ZERO) if (r8 > ZERO)
{ {
real pri = ZERO; real pri = ZERO;
real pre = ZERO; real pre = ZERO;
chiave = ""; chiave = "";
chiave << _annoes << _codatt << "1" << num << "1"; chiave << _annoes << _codatt << "1" << num << " 1";
ppa.put("CODTAB", chiave); ppa.put("CODTAB", chiave);
if (ppa.read() == NOERR) if (ppa.read() == NOERR)
{ {
@ -1443,7 +1457,7 @@ void CG4400_application::stampa_plafonds(int r)
pre = ppa.get_real("R1"); pre = ppa.get_real("R1");
} }
chiave = ""; chiave = "";
chiave << _annoes << _codatt << "2" << num << "1"; chiave << _annoes << _codatt << "2" << num << " 1";
ppa.put("CODTAB", chiave); ppa.put("CODTAB", chiave);
if (ppa.read() == NOERR) if (ppa.read() == NOERR)
{ {
@ -1460,13 +1474,13 @@ void CG4400_application::stampa_plafonds(int r)
if (r2 > ZERO) if (r2 > ZERO)
{ {
real r8b = ZERO; real r8b = ZERO;
r8b = stampa_valori_plafonds(r2, num, ppa); r8b = stampa_valori_plafonds(r2, num, ppa, " 2");
if (r8b > ZERO) if (r8b > ZERO)
{ {
real pri = ZERO; real pri = ZERO;
real pre = ZERO; real pre = ZERO;
chiave = ""; chiave = "";
chiave << _annoes << _codatt << "1" << num << "2"; chiave << _annoes << _codatt << "1" << num << " 2";
ppa.put("CODTAB", chiave); ppa.put("CODTAB", chiave);
if (ppa.read() == NOERR) if (ppa.read() == NOERR)
{ {
@ -1474,7 +1488,7 @@ void CG4400_application::stampa_plafonds(int r)
pre = ppa.get_real("R1"); pre = ppa.get_real("R1");
} }
chiave = ""; chiave = "";
chiave << _annoes << _codatt << "2" << num << "2"; chiave << _annoes << _codatt << "2" << num << " 2";
ppa.put("CODTAB", chiave); ppa.put("CODTAB", chiave);
if (ppa.read() == NOERR) if (ppa.read() == NOERR)
{ {
@ -1492,13 +1506,13 @@ void CG4400_application::stampa_plafonds(int r)
if (r3 > ZERO) if (r3 > ZERO)
{ {
real r9 = ZERO; real r9 = ZERO;
r9 = stampa_valori_plafonds(r3, num, ppa); r9 = stampa_valori_plafonds(r3, num, ppa, " 3");
if (r9 > ZERO) if (r9 > ZERO)
{ {
real pri = ZERO; real pri = ZERO;
real pre = ZERO; real pre = ZERO;
chiave = ""; chiave = "";
chiave << _annoes << _codatt << "1" << num << "3"; chiave << _annoes << _codatt << "1" << num << " 3";
ppa.put("CODTAB", chiave); ppa.put("CODTAB", chiave);
if (ppa.read() == NOERR) if (ppa.read() == NOERR)
{ {
@ -1506,7 +1520,7 @@ void CG4400_application::stampa_plafonds(int r)
pre = ppa.get_real("R1"); pre = ppa.get_real("R1");
} }
chiave = ""; chiave = "";
chiave << _annoes << _codatt << "2" << num << "3"; chiave << _annoes << _codatt << "2" << num << " 3";
ppa.put("CODTAB", chiave); ppa.put("CODTAB", chiave);
if (ppa.read() == NOERR) if (ppa.read() == NOERR)
{ {
@ -1522,7 +1536,7 @@ void CG4400_application::stampa_plafonds(int r)
} }
} }
real CG4400_application::stampa_valori_plafonds(const real& r1, const int mese, TTable& ppa) real CG4400_application::stampa_valori_plafonds(const real& r1, const int mese, TTable& ppa, const char* tipo)
{ {
real r, si8, se8; real r, si8, se8;
TString80 chiave; TString80 chiave;
@ -1535,7 +1549,7 @@ real CG4400_application::stampa_valori_plafonds(const real& r1, const int mese,
for (i=1; i<mese; i++) for (i=1; i<mese; i++)
{ {
chiave = ""; chiave = "";
chiave << _annoes << _codatt << "1" << i << "1"; chiave << _annoes << _codatt << "1" << i << tipo;
ppa.put("CODTAB", chiave); ppa.put("CODTAB", chiave);
if (ppa.read() == NOERR) if (ppa.read() == NOERR)
{ {
@ -1543,7 +1557,7 @@ real CG4400_application::stampa_valori_plafonds(const real& r1, const int mese,
se8 += ppa.get_real("R1"); se8 += ppa.get_real("R1");
} }
chiave = ""; chiave = "";
chiave << _annoes << _codatt << "2" << i << "1"; chiave << _annoes << _codatt << "2" << i << tipo;
ppa.put("CODTAB", chiave); ppa.put("CODTAB", chiave);
if (ppa.read() == NOERR) if (ppa.read() == NOERR)
{ {
@ -1736,9 +1750,9 @@ bool CG4400_application::preprocess_page(int file, int counter)
_datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione) _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione)
TFilename t; TFilename t;
t.temp("reg"); t.temp("reg");
//if (_tipo_stampa == 1) if (_tipo_stampa == 1)
send_message('L', t, m); send_message('L', t, m);
//else send_message('l', t, m); else send_message('l', t, m);
TString80 nomef; nomef = t.path(); nomef << "\\" << t.name(); TString80 nomef; nomef = t.path(); nomef << "\\" << t.name();
if (fexist(nomef)) if (fexist(nomef))
{ {
@ -2203,9 +2217,9 @@ print_action CG4400_application::postprocess_page (int file, int counter)
_st_liq[_datareg.month()] = TRUE; _st_liq[_datareg.month()] = TRUE;
TFilename t; TFilename t;
t.temp("rg"); t.temp("rg");
//if (_tipo_stampa == 1) if (_tipo_stampa == 1)
send_message('L',t, _datareg.month()); send_message('L',t, _datareg.month());
//else send_message('l',t, _datareg.month()); else send_message('l',t, _datareg.month());
TString80 nomef; TString80 nomef;
nomef = t.path(); nomef << "\\" << t.name(); nomef = t.path(); nomef << "\\" << t.name();
if (fexist(nomef)) if (fexist(nomef))
@ -2466,9 +2480,9 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
_datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header
TFilename t; TFilename t;
t.temp("rgp"); t.temp("rgp");
//if (_tipo_stampa == 1) if (_tipo_stampa == 1)
send_message('L',t, m); send_message('L',t, m);
//else send_message('l',t, m); else send_message('l',t, m);
TString80 nomef; TString80 nomef;
nomef = t.path(); nomef << "\\" << t.name(); nomef = t.path(); nomef << "\\" << t.name();
if (fexist(nomef)) if (fexist(nomef))
@ -2633,9 +2647,9 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
TFilename t; TFilename t;
t.temp("rgi"); t.temp("rgi");
TString80 nomef; nomef = t.path(); nomef << "\\" << t.name(); TString80 nomef; nomef = t.path(); nomef << "\\" << t.name();
//if (_tipo_stampa == 1) if (_tipo_stampa == 1)
send_message('L',t, m); send_message('L',t, m);
//else send_message('l',t, m); else send_message('l',t, m);
if (fexist(nomef)) if (fexist(nomef))
{ {
_intesta_liq = TRUE; _intesta_liq = TRUE;
@ -2678,9 +2692,9 @@ void CG4400_application::stampa_liq_mesi_succ()
_datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione) _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione)
TFilename t; TFilename t;
t.temp("iva"); t.temp("iva");
//if (_tipo_stampa == 1) if (_tipo_stampa == 1)
send_message('L',t, m); send_message('L',t, m);
//else send_message('l',t,m); else send_message('l',t,m);
TString80 nomef; nomef = t.path(); nomef << "\\" << t.name(); TString80 nomef; nomef = t.path(); nomef << "\\" << t.name();
if (fexist(nomef)) if (fexist(nomef))
{ {

View File

@ -13,7 +13,7 @@
#include <sheet.h> #include <sheet.h>
#include <config.h> #include <config.h>
#include <prefix.h> #include <prefix.h>
#include "conto.h" #include <progind.h>
#include <nditte.h> #include <nditte.h>
#include <anagr.h> #include <anagr.h>
#include <comuni.h> #include <comuni.h>
@ -24,6 +24,7 @@
#include <occas.h> #include <occas.h>
#include <causali.h> #include <causali.h>
#include "cglib03.h" #include "cglib03.h"
#include "conto.h"
const int TABREG = (int)TTable::name2log("REG"); const int TABREG = (int)TTable::name2log("REG");
@ -103,12 +104,12 @@ protected:
void get_dati_ditta(); void get_dati_ditta();
void stampa_vidi(); void stampa_vidi();
int stampa_acquisti(int); int stampa_acquisti(int);
real stampa_valori_plafonds(const real&, const int, TTable&); real stampa_valori_plafonds(const real&, const int, TTable&, const char*);
bool preprocess_print(int, int); bool preprocess_print(int, int);
//print_action postprocess_print(int, int); //print_action postprocess_print(int, int);
print_action postprocess_page (int, int); print_action postprocess_page (int, int);
void preprocess_header(); void preprocess_header();
void build_nomiditte(); void build_nomiditte(TProgind* pnd = NULL);
void set_year(int y) { _annoes = y; } void set_year(int y) { _annoes = y; }
void clear_stliq(); void clear_stliq();