Aggiornato uso della TRelapp::get_next_key e tolte format e

#include inutili (a decinaia)


git-svn-id: svn://10.65.10.50/trunk@6593 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1998-05-04 09:34:04 +00:00
parent 6466854067
commit 36a51e5877
30 changed files with 182 additions and 213 deletions

View File

@ -41,7 +41,7 @@ protected:
virtual bool changing_mask(int mode) { return FALSE; } virtual bool changing_mask(int mode) { return FALSE; }
virtual bool save_and_new() const { return _savenew; } virtual bool save_and_new() const { return _savenew; }
virtual bool protected_record(TRectype &rec); virtual bool protected_record(TRectype &rec);
virtual const char* get_next_key(); virtual bool get_next_key(TToken_string& key);
void init_pages(TMask& m); void init_pages(TMask& m);
virtual void init_query_mode(TMask& m); virtual void init_query_mode(TMask& m);
virtual void init_query_insert_mode(TMask& m) {init_query_mode(m);} virtual void init_query_insert_mode(TMask& m) {init_query_mode(m);}
@ -89,8 +89,7 @@ bool TClifo_application::protected_record(TRectype &rec)
return tipocf == _mov->get(MOV_TIPO) && codice == atol(_mov->get(MOV_CODCF)); return tipocf == _mov->get(MOV_TIPO) && codice == atol(_mov->get(MOV_CODCF));
} }
const char* TClifo_application::get_next_key() bool TClifo_application::get_next_key(TToken_string& key)
{ {
TLocalisamfile& clifo = _rel->lfile() ; TLocalisamfile& clifo = _rel->lfile() ;
long codcf = 1L ; long codcf = 1L ;
@ -116,8 +115,8 @@ const char* TClifo_application::get_next_key()
codcf += clifo.get_long(CLI_CODCF); codcf += clifo.get_long(CLI_CODCF);
} }
} }
_tmp.format("%d|%s|%d|%ld", F_TIPOCF, (const char*) tipo, F_CODCF, codcf); key.format("%d|%s|%d|%ld", F_TIPOCF, (const char*) tipo, F_CODCF, codcf);
return _tmp; return TRUE;
} }
HIDDEN bool no_dup_fis(TMask_field& f, KEY key) HIDDEN bool no_dup_fis(TMask_field& f, KEY key)

View File

@ -1,34 +1,26 @@
#include <xvt.h> #include <xvt.h>
#include <checks.h>
#define __MAIN__
#include "cg1.h" #include "cg1.h"
#define usage "Error - usage : %s -{0|1|2|3|4|5} [params]"
int main(int argc,char** argv) int main(int argc,char** argv)
{ {
const int n = (argc > 1) ? atoi(argv[1]+1) : -1; const int n = (argc > 1) ? atoi(argv[1]+1) : -1;
switch(n) switch(n)
{ {
case 0:
cg1100(argc,argv); break;
case 1: case 1:
cg1200(argc,argv); break; cg1200(argc,argv); break; // Stampa clienti/fornitori
case 2: case 2:
cg1300(argc,argv); break; cg1300(argc,argv); break; // Aggiornamenti
case 3: case 3:
cg1400(argc,argv); break; cg1400(argc,argv); break; // Stampa versamenti
case 4: case 4:
cg1500(argc,argv); break; cg1500(argc,argv); break; // Stampa bilanci
case 5: case 5:
cg1600(argc,argv); break; cg1600(argc,argv); break; // Stampa bilancio IV direttiva
case 6: case 6:
cg1700(argc,argv); break; cg1700(argc,argv); break; // Stampa causali
// case 7:
// cg1800(argc,argv); break;
default: default:
error_box(usage, argv[0]); break; cg1100(argc,argv); break; // Stampa Piano dei conti
} }
exit(n < 0); // Altrimenti non esce mai! exit(n < 0); // Altrimenti non esce mai!
return n < 0; return n < 0;

View File

@ -1,10 +1,6 @@
#ifndef __CG1_H #ifndef __CG1_H
#define __CG1_H #define __CG1_H
#ifndef __STRINGS_H
#include <strings.h>
#endif
int cg1100(int argc, char* argv[]); int cg1100(int argc, char* argv[]);
int cg1200(int argc, char* argv[]); int cg1200(int argc, char* argv[]);
int cg1300(int argc, char* argv[]); int cg1300(int argc, char* argv[]);
@ -14,17 +10,6 @@ int cg1600(int argc, char* argv[]);
int cg1700(int argc, char* argv[]); int cg1700(int argc, char* argv[]);
//int cg1800(int argc, char* argv[]); //int cg1800(int argc, char* argv[]);
#ifdef __MAIN__
#define extern
#endif
extern TString80 tmp;
#ifdef __MAIN__
#undef extern
#endif
#endif // __CG1_H #endif // __CG1_H

View File

@ -5,7 +5,6 @@
#include <mailbox.h> #include <mailbox.h>
#include <mask.h> #include <mask.h>
#include <printapp.h> #include <printapp.h>
#include <relation.h>
#include <sort.h> #include <sort.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
@ -77,6 +76,8 @@ class CG1100_application : public TPrintapp
bool _prima_volta, _stampa_g, _stampa_c; bool _prima_volta, _stampa_g, _stampa_c;
TDate _data_stampa; TDate _data_stampa;
TString tmp; // Stringa per porcate galattiche
public: public:
virtual bool user_destroy() ; virtual bool user_destroy() ;

View File

@ -12,11 +12,11 @@
#include <indsp.h> #include <indsp.h>
#include <mov.h> #include <mov.h>
#include <nditte.h> #include <nditte.h>
#include <pconti.h>
#include "cg1.h" #include "cg1.h"
#include "cg1200a.h" #include "cg1200a.h"
#include "cg1200b.h" #include "cg1200b.h"
#include <pconti.h>
#define COMRF_ALIAS 50 #define COMRF_ALIAS 50
#define COMNASC_ALIAS 51 #define COMNASC_ALIAS 51
@ -50,6 +50,9 @@ class TPrintclifo_app : public TPrintapp
long _codice; long _codice;
char _tipocf,_tipoaper; char _tipocf,_tipoaper;
bool _gia_iniziati_fornitori; bool _gia_iniziati_fornitori;
TString tmp; // Stringa per porcate galattiche
public: public:
// @cmember Disabilita la verifica del modulo : essendo una anagrafica, va sempre abilitata // @cmember Disabilita la verifica del modulo : essendo una anagrafica, va sempre abilitata
virtual bool check_autorization() const virtual bool check_autorization() const

View File

@ -117,6 +117,8 @@ class TStampa_bilanci : public TPrintapp
TArray _clienti, _fornitori; TArray _clienti, _fornitori;
TString tmp; // Stringa per porcate galattiche
public: public:
TDate _inizioEs, _fineEs; TDate _inizioEs, _fineEs;

View File

@ -214,7 +214,9 @@ class TStampa_IVdirettiva : public TPrintapp
bool _sbilancio_ordine, _quadratura; bool _sbilancio_ordine, _quadratura;
long _items_sort; long _items_sort;
protected: TString tmp; // Stringa per porcate galattiche
protected:
void aggiungi_anno(int anno, TDate& inizio, TDate& fine); void aggiungi_anno(int anno, TDate& inizio, TDate& fine);
public: public:

View File

@ -61,7 +61,7 @@ TMask* TPrimanota_application::load_mask(int n)
m->set_handler(F_NUMREG, num_handler); m->set_handler(F_NUMREG, num_handler);
m->set_handler(F_CODCAUS, caus_query_handler); m->set_handler(F_CODCAUS, caus_query_handler);
m->set_handler(F_DATAREG, datareg_handler); m->set_handler(F_DATAREG, datareg_handler);
// DATACOM new way // DATACOMP new way
// m->set_handler(F_DATACOMP, datacomp_handler); // m->set_handler(F_DATACOMP, datacomp_handler);
TConfig c(CONFIG_STUDIO, "cg"); TConfig c(CONFIG_STUDIO, "cg");
@ -424,8 +424,8 @@ TMask* TPrimanota_application::get_mask(int mode)
caus = _msk[0]->get(F_CODCAUS); caus = _msk[0]->get(F_CODCAUS);
break; break;
case MODE_MOD: case MODE_MOD:
annoiva = _rel->curr().get_int("ANNOIVA"); annoiva = _rel->curr().get_int(MOV_ANNOIVA);
caus = _rel->curr().get("CODCAUS"); caus = _rel->curr().get(MOV_CODCAUS);
break; break;
default: default:
return load_mask(0); return load_mask(0);
@ -574,55 +574,54 @@ void TPrimanota_application::fill_sheet(TMask& m) const
// Ritorna il prossimo numero di registrazione libero // Ritorna il prossimo numero di registrazione libero
// Certified 100% // Certified 100%
const char* TPrimanota_application::get_next_key() bool TPrimanota_application::get_next_key(TToken_string& tmp)
{ {
_tmp.cut(0); tmp.add(F_NUMREG); tmp.add(_lastreg+1);
_tmp.add(F_NUMREG); _tmp.add(_lastreg+1);
if (_rel->good()) // Not reinsert if (_rel->good()) // Not reinsert
{ {
TMask& m = curr_mask(); TMask& m = curr_mask();
if (m.insert_mode()) if (m.insert_mode())
{ {
_tmp.add(F_CODCAUS); // Ricopia causale tmp.add(F_CODCAUS); // Ricopia causale
switch (_incasso->_step) switch (_incasso->_step)
{ {
case 1: case 1:
_tmp.add(_incasso->_causale); tmp.add(_incasso->_causale);
_msk[0]->set(F_CODCAUS, _incasso->_causale); // Joke get_mask _msk[0]->set(F_CODCAUS, _incasso->_causale); // Joke get_mask
_iva = nessuna_iva; // Impedisce incremento del numero documento _iva = nessuna_iva; // Impedisce incremento del numero documento
break; break;
case 2: case 2:
_tmp.add(_incasso->_causale_fattura); tmp.add(_incasso->_causale_fattura);
_msk[0]->set(F_CODCAUS, _incasso->_causale_fattura); // Joke get_mask _msk[0]->set(F_CODCAUS, _incasso->_causale_fattura); // Joke get_mask
_iva = _incasso->_iva_fattura; // Provoca incremento del numero documento _iva = _incasso->_iva_fattura; // Provoca incremento del numero documento
break; break;
default: default:
_tmp.add(m.get(F_CODCAUS)); // Ultima causale usata tmp.add(m.get(F_CODCAUS)); // Ultima causale usata
_msk[0]->set(F_CODCAUS, m.get(F_CODCAUS)); _msk[0]->set(F_CODCAUS, m.get(F_CODCAUS));
break; break;
} }
_tmp.add(F_DATAREG); // Ricopia data operazione tmp.add(F_DATAREG); // Ricopia data operazione
_tmp.add(m.get(F_DATAREG)); tmp.add(m.get(F_DATAREG));
_tmp.add(F_DATACOMP); // Ricopia data competenza tmp.add(F_DATACOMP); // Ricopia data competenza
if (m.field(F_DATACOMP).empty()) if (m.field(F_DATACOMP).empty())
_tmp.add(m.get(F_DATAREG)); tmp.add(m.get(F_DATAREG));
else else
_tmp.add(m.get(F_DATACOMP)); tmp.add(m.get(F_DATACOMP));
if (_iva == iva_vendite) if (_iva == iva_vendite)
{ {
_tmp.add(F_DATADOC); _tmp.add(m.get(F_DATADOC)); // Ricopia data documento tmp.add(F_DATADOC); tmp.add(m.get(F_DATADOC)); // Ricopia data documento
const long n = m.get_long(F_NUMDOC); const long n = m.get_long(F_NUMDOC);
if (n > 0) if (n > 0)
{ _tmp.add(F_NUMDOC); _tmp.add(n+1); } // incrementa numero documento { tmp.add(F_NUMDOC); tmp.add(n+1); } // incrementa numero documento
} }
} }
} }
return _tmp; return TRUE;
} }

View File

@ -2,7 +2,6 @@
#include <tabutil.h> #include <tabutil.h>
#include <prefix.h> #include <prefix.h>
#include <utility.h>
#include "cg2101.h" #include "cg2101.h"
#include "cg2103.h" #include "cg2103.h"
@ -160,7 +159,8 @@ bool TMovimentoPN::controlla_liquidazione(const TDate& data, TRegistro& registro
{ {
TString16 chiave; TString16 chiave;
TString16 attivita(registro.attivita()); attivita.right_just(5, '0'); TString16 attivita(registro.attivita()); attivita.right_just(5, '0');
chiave << data.year() << attivita << a << format("%02d", data.month()); TString16 mese; mese.format("%02d", data.month());
chiave << data.year() << attivita << a << mese;
plm.put("CODTAB", chiave); plm.put("CODTAB", chiave);
if (plm.read() == NOERR) if (plm.read() == NOERR)
{ {

View File

@ -162,7 +162,7 @@ protected: // TRelation_application
virtual void init_insert_mode(TMask& m); virtual void init_insert_mode(TMask& m);
virtual void init_modify_mode(TMask& m); virtual void init_modify_mode(TMask& m);
virtual bool save_and_new() const; virtual bool save_and_new() const;
virtual const char* get_next_key(); virtual bool get_next_key(TToken_string& key);
virtual int read(TMask& m); virtual int read(TMask& m);
virtual int write(const TMask& m); virtual int write(const TMask& m);
virtual int rewrite(const TMask& m); virtual int rewrite(const TMask& m);

View File

@ -323,7 +323,9 @@ bool TPrimanota_application::test_prorata()
if (esistono_righe_senza_tipo_detrazione) if (esistono_righe_senza_tipo_detrazione)
{ {
int annodoc = _msk[2]->get_date(F_DATADOC).year(); int annodoc = _msk[2]->get_date(F_DATADOC).year();
if (annodoc < 1900) annodoc = _msk[2]->get_int(F_ANNOIVA); if (annodoc < 1900)
annodoc = _msk[2]->get_int(F_ANNOIVA);
const bool prorata100 = causale().reg().prorata100(annodoc); const bool prorata100 = causale().reg().prorata100(annodoc);
const bool esiste_riga_iva_detraibile = type2pos('D') >= 0; const bool esiste_riga_iva_detraibile = type2pos('D') >= 0;
if (prorata100) if (prorata100)
@ -344,7 +346,8 @@ bool TPrimanota_application::aggiusta_prorata()
TRegistro& reg = causale().reg(); TRegistro& reg = causale().reg();
int annodoc = _msk[2]->get_date(F_DATADOC).year(); int annodoc = _msk[2]->get_date(F_DATADOC).year();
if (annodoc < 1900) annodoc = _msk[2]->get_int(F_ANNOIVA); if (annodoc < 1900)
annodoc = _msk[2]->get_int(F_ANNOIVA);
const real prorata_attuale = reg.prorata(annodoc); const real prorata_attuale = reg.prorata(annodoc);
const real vecchio_prorata = prorata_attuale < 100.0 ? 100.0 : 0.0; const real vecchio_prorata = prorata_attuale < 100.0 ? 100.0 : 0.0;

View File

@ -6,8 +6,6 @@
#include <printapp.h> #include <printapp.h>
#include <progind.h> #include <progind.h>
#include <recarray.h> #include <recarray.h>
#include <utility.h>
#include <urldefid.h>
#include <mov.h> #include <mov.h>
#include <rmov.h> #include <rmov.h>
@ -1114,7 +1112,11 @@ void TStampa_giornale::set_rows (int file, int counter)
set_row(r," Comp. %04d", _annoEsMov); set_row(r," Comp. %04d", _annoEsMov);
if (_MovGiaStampato && !_stampa_definitiva) if (_MovGiaStampato && !_stampa_definitiva)
set_row(r,format("@%dg*",_stampa_width == 132 ? 131 : 197)); {
TString16 str;
str.format("@%dg*",_stampa_width == 132 ? 131 : 197);
set_row(r,str);
}
if (caus.not_empty()) if (caus.not_empty())
{ {
@ -1192,7 +1194,11 @@ void TStampa_giornale::set_rows (int file, int counter)
set_row (r, _sezione == 'D' ? "@152g%r" : "@174g%r", &_importo); set_row (r, _sezione == 'D' ? "@152g%r" : "@174g%r", &_importo);
if (_MovGiaStampato && !_stampa_definitiva) if (_MovGiaStampato && !_stampa_definitiva)
set_row(r,format("@%dg*",_stampa_width == 132 ? 131 : 197)); {
TString16 str;
str.format("@%dg*",_stampa_width == 132 ? 131 : 197);
set_row(r, str);
}
{ {
const int rows = rdes - 1; const int rows = rdes - 1;

View File

@ -19,7 +19,7 @@ int main(int argc,char** argv)
case 2: case 2:
cg4300(argc,argv); break; // Calcolo liquidazione cg4300(argc,argv); break; // Calcolo liquidazione
case 3: case 3:
cg4400(argc,argv); break; // Stampa registri cg4400(argc,argv); break; // Stampa Registri IVA
case 4: case 4:
cg4500(argc,argv); break; // Apertura nuovo esercizio cg4500(argc,argv); break; // Apertura nuovo esercizio
case 5: case 5:

View File

@ -1,9 +1,7 @@
#include <applicat.h> #include <applicat.h>
#include <assoc.h>
#include <isam.h> #include <isam.h>
#include <mask.h> #include <mask.h>
#include <prefix.h> #include <prefix.h>
#include <urldefid.h>
#include <utility.h> #include <utility.h>
#include "cg4.h" #include "cg4.h"
@ -11,14 +9,15 @@
#include <pconti.h> #include <pconti.h>
class TCopia_archivi : public TApplication class TCopia_archivi : public TSkeleton_application
{ {
TMask* _msk; TMask* _msk;
long _default_firm; long _default_firm;
virtual bool create() ; virtual bool create() ;
virtual bool destroy() ; virtual bool destroy() ;
bool menu(MENU_TAG); virtual void main_loop();
bool copyfile(int logicnum, long from, long to); bool copyfile(int logicnum, long from, long to);
bool check_comfile(int logicnum); bool check_comfile(int logicnum);
void clearivd(long to); void clearivd(long to);
@ -166,20 +165,18 @@ void TCopia_archivi::copyivd(long from, long to)
bool TCopia_archivi::create() bool TCopia_archivi::create()
{ {
TApplication::create();
_msk = new TMask("cg4200a") ; _msk = new TMask("cg4200a") ;
_default_firm = get_firm(); _default_firm = get_firm();
dispatch_e_menu(BAR_ITEM(1)); return TSkeleton_application::create();
return TRUE;
} }
bool TCopia_archivi::destroy() bool TCopia_archivi::destroy()
{ {
if (_msk != NULL) delete _msk; if (_msk != NULL) delete _msk;
return TApplication::destroy(); return TSkeleton_application::destroy();
} }
bool TCopia_archivi::menu(MENU_TAG) void TCopia_archivi::main_loop()
{ {
while (_msk->run() == K_ENTER) while (_msk->run() == K_ENTER)
{ {
@ -271,7 +268,6 @@ bool TCopia_archivi::menu(MENU_TAG)
} }
} }
} }
return FALSE;
} }
int cg4200(int argc, char* argv[]) int cg4200(int argc, char* argv[])

View File

@ -21,7 +21,7 @@ END
NUMBER F_FROMFIRM 5 NUMBER F_FROMFIRM 5
BEGIN BEGIN
PROMPT 4 5 "Ditta " PROMPT 4 5 "Ditta "
FLAGS "R" FLAGS "F"
USE LF_NDITTE KEY 1 USE LF_NDITTE KEY 1
CHECKTYPE NORMAL CHECKTYPE NORMAL
INPUT CODDITTA F_FROMFIRM INPUT CODDITTA F_FROMFIRM
@ -30,6 +30,7 @@ BEGIN
OUTPUT F_FROMFIRM CODDITTA OUTPUT F_FROMFIRM CODDITTA
OUTPUT F_DFROMFIRM RAGSOC OUTPUT F_DFROMFIRM RAGSOC
HELP "Codice della ditta da cui prelevare i dati" HELP "Codice della ditta da cui prelevare i dati"
VALIDATE CHECK_FIRM_FUNC
WARNING "Ditta assente" WARNING "Ditta assente"
END END
@ -44,6 +45,7 @@ BEGIN
COPY OUTPUT F_FROMFIRM COPY OUTPUT F_FROMFIRM
HELP "Ragione sociale della ditta da cui prelevare i dati" HELP "Ragione sociale della ditta da cui prelevare i dati"
WARNING "Ditta assente" WARNING "Ditta assente"
VALIDATE CHECK_FIRM_FUNC
END END
GROUPBOX DLG_NULL 76 3 GROUPBOX DLG_NULL 76 3
@ -54,7 +56,6 @@ END
NUMBER F_TOFIRM 5 NUMBER F_TOFIRM 5
BEGIN BEGIN
PROMPT 4 8 "Ditta " PROMPT 4 8 "Ditta "
FLAGS "FR"
COPY USE F_FROMFIRM COPY USE F_FROMFIRM
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
INPUT CODDITTA F_TOFIRM INPUT CODDITTA F_TOFIRM

View File

@ -9,7 +9,6 @@
#include <prefix.h> #include <prefix.h>
#include <progind.h> #include <progind.h>
#include <sheet.h> #include <sheet.h>
#include <utility.h>
#include "cg4300.h" #include "cg4300.h"
#include "cg4300a.h" #include "cg4300a.h"
@ -51,11 +50,13 @@ void _ProrataItem::set(const int a, const real& c, const real& p, const bool fl)
_current_perc = c; _current_perc = c;
_previous_ok = a < 1998 ? TRUE : fl; _previous_ok = a < 1998 ? TRUE : fl;
if (a > 1997 ) // Se siamo prima del 1997 la percentuale prec vale 0 if (a > 1997) // Se siamo prima del 1997 la percentuale prec vale 0
{
if (!_previous_ok) // Se non ha trovato la percentuale anno precedente if (!_previous_ok) // Se non ha trovato la percentuale anno precedente
_previous_perc = c; // usa quella attuale ricordandosi la segnalazione _previous_perc = c; // usa quella attuale ricordandosi la segnalazione
else else
_previous_perc = p; _previous_perc = p;
}
} }
// Calcola prorata con percentuale attuale o corrente // Calcola prorata con percentuale attuale o corrente
@ -650,7 +651,7 @@ bool TLiquidazione_app::to_ditt_handler(TMask_field& f, KEY key)
m.get_long(CG43_FLD_DTO), m.get_long(CG43_FLD_DTO),
(wht)m.get_int(CG43_RDB_VERS)); (wht)m.get_int(CG43_RDB_VERS));
app().set_choice_limits(m); app().set_choice_limits(m);
m.field(CG43_FLD_SELECTED).set(format("%ld", l)); m.set(CG43_FLD_SELECTED, l);
} }
return TRUE; return TRUE;
} }
@ -696,7 +697,7 @@ bool TLiquidazione_app::what_freq_handler(TMask_field& f, KEY key)
while (!is_trim(month)) month--; while (!is_trim(month)) month--;
else month = 3; else month = 3;
f.mask().field(CG43_LST_TRIM).set(format("%d",month)); f.mask().set(CG43_LST_TRIM,month);
} }
app().set_month(month); app().set_month(month);
app().reset_choices(f.mask()); app().reset_choices(f.mask());
@ -853,8 +854,8 @@ bool TLiquidazione_app::set_liquidazione()
m.set_handler(CG43_CHK_FINAL, chk_final_handler); m.set_handler(CG43_CHK_FINAL, chk_final_handler);
m.field(CG43_FLD_SELECTED).set(format("%ld",_selected.ones())); m.set(CG43_FLD_SELECTED, _selected.ones());
m.field(CG43_FLD_ANNO).set(_year); m.set(CG43_FLD_ANNO, _year);
set_choice_limits(m); set_choice_limits(m);
KEY k; KEY k;
@ -865,7 +866,7 @@ bool TLiquidazione_app::set_liquidazione()
do do
{ {
m.field(CG43_RDB_VERS).set(format("%d",(int)_what)); m.set(CG43_RDB_VERS, _what);
if ((k = m.run()) == K_ESC) break; if ((k = m.run()) == K_ESC) break;

View File

@ -213,12 +213,14 @@ class _ProrataItem : public TObject
real _current_perc; // Percentuale prorata anno in corso real _current_perc; // Percentuale prorata anno in corso
real _previous_perc; // Percentuale prorata anno precedente real _previous_perc; // Percentuale prorata anno precedente
bool _previous_ok; // Flag per indicare se presente tabella anno precedente bool _previous_ok; // Flag per indicare se presente tabella anno precedente
public: public:
void set(const int a, const real& c, const real& p, const bool fl = TRUE); void set(const int a, const real& c, const real& p, const bool fl = TRUE);
real calc_prorata(const real& acq, const bool current = TRUE); real calc_prorata(const real& acq, const bool current = TRUE);
const real& current() { return _current_perc; } const real& current() const { return _current_perc; }
const real& previous() { return _previous_perc; } const real& previous() const { return _previous_perc; }
const bool flag() { return _previous_ok; } const bool previous_ok() const { return _previous_ok; }
_ProrataItem() {} _ProrataItem() {}
virtual ~_ProrataItem() {} virtual ~_ProrataItem() {}
}; };

View File

@ -89,8 +89,7 @@ bool TLiquidazione_app::is_in_liq_period(TDate& d)
bool TLiquidazione_app::is_first_month(int m) bool TLiquidazione_app::is_first_month(int m)
{ {
return _freqviva == "M" ? return _freqviva == "M" ? m == 1 : m == 3;
m == 1 : m == 3;
} }
int TLiquidazione_app::previous_month(int m) int TLiquidazione_app::previous_month(int m)
@ -507,9 +506,6 @@ bool TLiquidazione_app::look_lam(int m, bool create)
bool TLiquidazione_app::look_pla(const char* a, bool create) bool TLiquidazione_app::look_pla(const char* a, bool create)
{ {
bool ok = FALSE;
_pla_r->zero();
// forza il tipoatt a 1 // forza il tipoatt a 1
TString buf(a); TString buf(a);
buf.ltrim(); buf.ltrim();
@ -517,14 +513,13 @@ bool TLiquidazione_app::look_pla(const char* a, bool create)
buf << "1"; buf << "1";
while (buf.len() < 6) buf.insert("0"); while (buf.len() < 6) buf.insert("0");
_pla_r->zero();
(*_pla_ditta) = format("%05ld", get_firm()); (*_pla_ditta) = format("%05ld", get_firm());
(*_pla_anno) = _year; (*_pla_anno) = _year;
(*_pla_codatt) = buf; (*_pla_codatt) = buf;
TString16 s = _pla_r->get("CODTAB"); const TString16 s = _pla_r->get("CODTAB");
_pla->read(); bool ok = _pla->read() == NOERR;
ok = _pla->good();
if (!ok && create) if (!ok && create)
{ {
_pla->zero(); _pla->zero();
@ -913,9 +908,9 @@ bool TLiquidazione_app::is_differita(long firm, int year)
{ {
long d = (firm == 0) ? _nditte->lfile().get_long("CODDITTA") : firm; long d = (firm == 0) ? _nditte->lfile().get_long("CODDITTA") : firm;
int y = (year == 0) ? atoi(_year) : year; int y = (year == 0) ? atoi(_year) : year;
if (look_lia(d,atoi(_year))) if (look_lia(d, FALSE, atoi(_year)))
return _lia->get_bool("B1"); return _lia->get_bool("B1");
else else
return FALSE; return FALSE;
} }

View File

@ -443,7 +443,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
real cre_pre = 0.0; real cre_pre = 0.0;
real acq_intr = 0.0; real acq_intr = 0.0;
bool isdifferita = FALSE; bool isdifferita = FALSE;
bool error = FALSE; int error = FALSE;
// MI3262... // MI3262...
isdifferita = is_differita(); isdifferita = is_differita();
TString16 tipo_acc; TString16 tipo_acc;
@ -458,7 +458,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
char thh = *_freqviva; char thh = *_freqviva;
TString16 thyear = _year; TString16 thyear = _year;
_year = format("%d", atoi(_year)-1); _year.format("%d", atoi(_year)-1);
if (!look_lia()) if (!look_lia())
error = 3; error = 3;

View File

@ -1,11 +1,11 @@
#include <confapp.h> #include <confapp.h>
#include <isam.h> #include <isam.h>
#include <tabutil.h>
#include <prefix.h>
#include <attiv.h>
#include <extcdecl.h>
#include <utility.h>
#include <modaut.h> #include <modaut.h>
#include <prefix.h>
#include <tabutil.h>
#include <attiv.h>
#include "cg5100a.h" #include "cg5100a.h"
class TParametri_ditta : public TConfig_application class TParametri_ditta : public TConfig_application
@ -108,7 +108,7 @@ void TParametri_ditta::check_registers(int year)
void TParametri_ditta::swap_file(int logicnum, bool tocom) void TParametri_ditta::swap_file(int logicnum, bool tocom)
{ {
TDir dir; TDir dir;
TString file(16); TFilename file;
dir.get(logicnum, _lock, _nordir, _sysdirop); dir.get(logicnum, _lock, _nordir, _sysdirop);
file = dir.name(); file = dir.name();
@ -126,7 +126,8 @@ void TParametri_ditta::swap_file(int logicnum, bool tocom)
else else
dir.get(logicnum, _unlock, (tocom ? _comdir :_nordir), _sysdirop); dir.get(logicnum, _unlock, (tocom ? _comdir :_nordir), _sysdirop);
if (dir.eox() == 0L || !fexist(dir.filename())) file = dir.filename();
if (dir.eox() == 0L || !file.exist())
{ {
set_autoload_new_files(FALSE); set_autoload_new_files(FALSE);
TSystemisamfile s(logicnum); TSystemisamfile s(logicnum);
@ -138,16 +139,16 @@ void TParametri_ditta::swap_file(int logicnum, bool tocom)
void TParametri_ditta::load_file(int logicnum) void TParametri_ditta::load_file(int logicnum)
{ {
TDir dir; TDir dir;
dir.get(logicnum); dir.get(logicnum);
TSystemisamfile f(logicnum); TSystemisamfile f(logicnum);
TFilename lf;
if (dir.eox() == 0L) if (dir.eox() == 0L)
f.build(10L); f.build(10L);
lf.format("%sstd/lf%04d.txt", __ptprf, logicnum);
if (fexist(lf)) TFilename lf;
lf.format("%sstd/lf%04d.txt", firm2dir(-1), logicnum);
if (lf.exist())
f.load(lf, '|', '\0', '\n', TRUE, TRUE); f.load(lf, '|', '\0', '\n', TRUE, TRUE);
} }

View File

@ -217,7 +217,10 @@ bool TRic_archivi::leggi_marker()
_sequenza = TRUE; _sequenza = TRUE;
if (letti == 0) if (letti == 0)
{
fclose(i);
return error_box("Rilevati ERRORI nel file MARKER: impossibile proseguire"); return error_box("Rilevati ERRORI nel file MARKER: impossibile proseguire");
}
_nomeid = buffer.sub(0,10); _nomeid = buffer.sub(0,10);
_dittainv = atol(buffer.sub(10,14)); _dittainv = atol(buffer.sub(10,14));
@ -246,7 +249,7 @@ bool TRic_archivi::leggi_marker()
if (_dittaric != 0) if (_dittaric != 0)
{ {
if (!prefix().exist(_dittaric)) if (!prefix().exist(_dittaric))
return error_box("Libreria archivi ditta non presente su disco"); return error_box("Gli archivi della ditta %ld non sono presenti su disco", _dittaric);
} }
else else
return error_box("Codici NON PRESENTI in tabella ricezione: caricarli e riprovare"); return error_box("Codici NON PRESENTI in tabella ricezione: caricarli e riprovare");
@ -270,14 +273,14 @@ bool TRic_archivi::leggi_marker_rep()
return error_box("File marker non presente in %s: impossibile proseguire", (const char*)_pathname); return error_box("File marker non presente in %s: impossibile proseguire", (const char*)_pathname);
} }
FILE* i;
const word size = 64; const word size = 64;
TString buffer(size); TString buffer(size);
if ( (i = fopen(_marker,"r+t")) != NULL) FILE* inmark = fopen(_marker,"r");
if (inmark != NULL)
{ {
const word letti = fread((char*)(const char*)buffer,sizeof(char),size,i); const word letti = fread((char*)(const char*)buffer,sizeof(char),size,inmark);
fclose(inmark);
_progdisk = atoi(buffer.sub(34,36)); _progdisk = atoi(buffer.sub(34,36));
_numtotdisk = atoi(buffer.sub(32,34)); _numtotdisk = atoi(buffer.sub(32,34));
@ -286,7 +289,6 @@ bool TRic_archivi::leggi_marker_rep()
{ {
message_box("Il dischetto inserito non rispecchia la giusta sequenza"); message_box("Il dischetto inserito non rispecchia la giusta sequenza");
_sequenza = FALSE; _sequenza = FALSE;
fclose(i);
return TRUE; return TRUE;
} }
else else
@ -313,8 +315,6 @@ bool TRic_archivi::leggi_marker_rep()
_numinvp = _numinv; _numinvp = _numinv;
_datatrasp = _datatras; _datatrasp = _datatras;
fclose(i);
if (_numdisk == 1) // Va fatto solo per il primo disco if (_numdisk == 1) // Va fatto solo per il primo disco
{ {
_dittaric = leggi_tabella_tras(); _dittaric = leggi_tabella_tras();
@ -322,7 +322,7 @@ bool TRic_archivi::leggi_marker_rep()
if (_dittaric != 0) if (_dittaric != 0)
{ {
if (!prefix().exist(_dittaric)) if (!prefix().exist(_dittaric))
return error_box("Libreria archivi ditta non presente su disco"); return error_box("Gli archivi della ditta %ld non sono presenti su disco", _dittaric);
} }
else else
return error_box("Codici NON PRESENTI in tabella ricezione: caricarli e riprovare"); return error_box("Codici NON PRESENTI in tabella ricezione: caricarli e riprovare");
@ -331,7 +331,7 @@ bool TRic_archivi::leggi_marker_rep()
return TRUE; return TRUE;
} }
return FALSE; return error_box("Impossibile accedere al file %s", (const char*)_marker);
} }
void TRic_archivi::main_loop() void TRic_archivi::main_loop()
@ -546,7 +546,6 @@ int TRic_archivi::controllo_ripartenza()
_tras_file->open(trasfer); _tras_file->open(trasfer);
TConfig conf(CONFIG_DITTA); TConfig conf(CONFIG_DITTA);
std = conf.get("FlStTra"); std = conf.get("FlStTra");
if (_tras_file->read_control_rec()) if (_tras_file->read_control_rec())

View File

@ -1,10 +1,5 @@
#include <applicat.h>
#include <tabapp.h> #include <tabapp.h>
#include <strings.h>
#include <stdtypes.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h>
#include <prefix.h> #include <prefix.h>
#include <nditte.h> #include <nditte.h>
@ -63,10 +58,10 @@ HIDDEN inline Tabinv_application& app() {return (Tabinv_application&) main_app()
char Tabinv_application::cerca_stato(long ditta) char Tabinv_application::cerca_stato(long ditta)
{ {
TTable ind ("%IND"); TTable ind ("%IND");
TString dep; TString16 dep;
char stato = '\0'; char stato = '\0';
dep = format("%05ld", ditta); dep.format("%05ld", ditta);
ind.zero(); ind.zero();
ind.put("CODTAB", dep); ind.put("CODTAB", dep);
@ -177,9 +172,9 @@ bool Tabinv_application::ditta_handler(TMask_field& f, KEY k)
if (app()._ditta_tab == app()._ditta_tras) if (app()._ditta_tab == app()._ditta_tras)
{ {
TTable ind ("%IND"); TTable ind ("%IND");
TString dep; TString16 dep;
dep = format("%05ld", app()._ditta_tab); dep.format("%05ld", app()._ditta_tab);
ind.zero(); ind.zero();
ind.put("CODTAB", dep); ind.put("CODTAB", dep);
@ -420,11 +415,11 @@ bool Tabinv_application::nome_id(TMask_field& f, KEY k)
f.mask().set(F_RAGSOC, ""); f.mask().set(F_RAGSOC, "");
TTable ind ("%IND"); TTable ind ("%IND");
TString dep; TString16 dep;
if (ditta != 0) if (ditta != 0)
{ {
dep = format("%05ld", ditta); dep.format("%05ld", ditta);
ind.zero(); ind.zero();
ind.put("CODTAB", dep); ind.put("CODTAB", dep);
@ -666,12 +661,12 @@ int Tabinv_application::write(const TMask& m)
if (_ditte_uguali) if (_ditte_uguali)
{ {
_control_rec = _tras_file.record(); _control_rec = _tras_file.record();
str = format("%03d", num); str.format("%03d", num);
_control_rec.overwrite(str,75); _control_rec.overwrite(str,75);
str = riconverti(data,TRUE); str = riconverti(data,TRUE);
_control_rec.overwrite(str,78); _control_rec.overwrite(str,78);
_control_rec.overwrite(sigla,240); _control_rec.overwrite(sigla,240);
str = format("%-60s", (const char*) chiave); str.format("%-60s", (const char*) chiave);
_control_rec.overwrite(str,241); _control_rec.overwrite(str,241);
_tras_file.write_control_rec(_control_rec,1024); _tras_file.write_control_rec(_control_rec,1024);
@ -709,12 +704,12 @@ int Tabinv_application::rewrite(const TMask& m)
if (_ditte_uguali) if (_ditte_uguali)
{ {
_control_rec = _tras_file.record(); _control_rec = _tras_file.record();
str = format("%03d", num); str.format("%03d", num);
_control_rec.overwrite(str,75); _control_rec.overwrite(str,75);
str = riconverti(data,TRUE); str = riconverti(data,TRUE);
_control_rec.overwrite(str,78); _control_rec.overwrite(str,78);
_control_rec.overwrite(sigla,240); _control_rec.overwrite(sigla,240);
str = format("%-60s", (const char*) chiave); str.format("%-60s", (const char*) chiave);
_control_rec.overwrite(str,241); _control_rec.overwrite(str,241);
_tras_file.write_control_rec(_control_rec,1024); _tras_file.write_control_rec(_control_rec,1024);

View File

@ -6,8 +6,6 @@
#include <tabutil.h> #include <tabutil.h>
#include <prefix.h> #include <prefix.h>
#include <progind.h> #include <progind.h>
#include <urldefid.h>
#include <utility.h>
#include "cglib01.h" #include "cglib01.h"
#include "cglib02.h" #include "cglib02.h"
@ -27,7 +25,7 @@
#include <occas.h> #include <occas.h>
#include <pconti.h> #include <pconti.h>
class TRic_tab : public TApplication class TRic_tab : public TSkeleton_application
{ {
TTable* _tab_tra; TTable* _tab_tra;
@ -51,17 +49,16 @@ class TRic_tab : public TApplication
long _protiva,_uprotiva,_nprotiva,_nuprotiva,_numreg,_numreg_p,_numreg_piva,_nuovareg; long _protiva,_uprotiva,_nprotiva,_nuprotiva,_numreg,_numreg_p,_numreg_piva,_nuovareg;
char _sez; char _sez;
real _importo,_totdoc; real _importo,_totdoc;
TString _tmpcaus,_tmprcaus,_tmpclifo,_tmpcon,_tmpmov,_tmprmov,_tmpriva; TFilename _tmpcaus,_tmprcaus,_tmpclifo,_tmpcon,_tmpmov,_tmprmov,_tmpriva;
TString _tmpoccas,_tmppart,_tmpscad,_tmppagsca; TFilename _tmpoccas,_tmppart,_tmpscad,_tmppagsca;
public: public:
TString _titolo; TString _titolo;
virtual bool create(); virtual bool create();
virtual bool destroy(); virtual bool destroy();
virtual bool menu(MENU_TAG m); virtual void main_loop();
virtual void on_config_change(); virtual void on_config_change();
bool main_loop();
bool video(); bool video();
bool leggi_trasfer(); bool leggi_trasfer();
bool controlli(); bool controlli();
@ -124,8 +121,6 @@ void TRic_tab::on_config_change()
bool TRic_tab::create() bool TRic_tab::create()
{ {
TApplication::create();
_tab_tra = new TTable ("%TRA"); _tab_tra = new TTable ("%TRA");
_reg = new TTable ("REG"); _reg = new TTable ("REG");
@ -157,9 +152,7 @@ bool TRic_tab::create()
_nreg = 0; _nreg = 0;
_sld.reset(); _sld.reset();
dispatch_e_menu (BAR_ITEM(1)); return TSkeleton_application::create();
return TRUE;
} }
bool TRic_tab::destroy() bool TRic_tab::destroy()
@ -195,7 +188,7 @@ void TRic_tab::leggi_record_controllo()
_record = _tras_file.record(); _record = _tras_file.record();
} }
bool TRic_tab::main_loop() void TRic_tab::main_loop()
{ {
int posiz; int posiz;
@ -252,7 +245,7 @@ bool TRic_tab::main_loop()
{ {
if (_std == "") if (_std == "")
if (!controllo_pre_ricezione()) if (!controllo_pre_ricezione())
return FALSE; return;
apri_file_temp(); apri_file_temp();
@ -296,8 +289,6 @@ bool TRic_tab::main_loop()
} }
} }
} }
return FALSE;
} }
void TRic_tab::trasferimento() void TRic_tab::trasferimento()
@ -1744,28 +1735,28 @@ void TRic_tab::apri_file_temp()
tmpcaus << "\\" << TEMP_CAUS; tmpcaus << "\\" << TEMP_CAUS;
_tmpcaus = tmpcaus.mid(1); _tmpcaus = tmpcaus.mid(1);
_tmpcaus << ".dbf"; _tmpcaus << ".dbf";
if(fexist(_tmpcaus)) if(_tmpcaus.exist())
_tcaus = new TIsamtempfile(LF_CAUSALI, tmpcaus, 0); _tcaus = new TIsamtempfile(LF_CAUSALI, tmpcaus, 0);
TString80 tmprcaus = "%"; TString80 tmprcaus = "%";
tmprcaus << get_firm_dir(); tmprcaus << get_firm_dir();
tmprcaus << "\\" << TEMP_RCAUS; tmprcaus << "\\" << TEMP_RCAUS;
_tmprcaus = tmprcaus.mid(1); _tmprcaus = tmprcaus.mid(1);
_tmprcaus << ".dbf"; _tmprcaus << ".dbf";
if (fexist(_tmprcaus)) if (_tmprcaus.exist())
_trcaus = new TIsamtempfile(LF_RCAUSALI, tmprcaus, 0); _trcaus = new TIsamtempfile(LF_RCAUSALI, tmprcaus, 0);
TString80 tmpclifo = "%"; TString80 tmpclifo = "%";
tmpclifo << get_firm_dir(); tmpclifo << get_firm_dir();
tmpclifo << "\\" << TEMP_CLIFO; tmpclifo << "\\" << TEMP_CLIFO;
_tmpclifo = tmpclifo.mid(1); _tmpclifo = tmpclifo.mid(1);
_tmpclifo << ".dbf"; _tmpclifo << ".dbf";
if (fexist(_tmpclifo)) if (_tmpclifo.exist())
_tclifo = new TIsamtempfile(LF_CLIFO, tmpclifo, 0); _tclifo = new TIsamtempfile(LF_CLIFO, tmpclifo, 0);
TString80 tmppcon = "%"; TString80 tmppcon = "%";
tmppcon << get_firm_dir(); tmppcon << get_firm_dir();
tmppcon << "\\" << TEMP_PCON; tmppcon << "\\" << TEMP_PCON;
_tmpcon = tmppcon.mid(1); _tmpcon = tmppcon.mid(1);
_tmpcon << ".dbf"; _tmpcon << ".dbf";
if (fexist(_tmpcon)) if (_tmpcon.exist())
_tpcon = new TIsamtempfile(LF_PCON, tmppcon, 0); _tpcon = new TIsamtempfile(LF_PCON, tmppcon, 0);
} }
else else
@ -1775,49 +1766,49 @@ void TRic_tab::apri_file_temp()
tmpmov << "\\" << TEMP_MOV; tmpmov << "\\" << TEMP_MOV;
_tmpmov = tmpmov.mid(1); _tmpmov = tmpmov.mid(1);
_tmpmov << ".dbf"; _tmpmov << ".dbf";
if (fexist(_tmpmov)) if (_tmpmov.exist())
_tmov = new TIsamtempfile(LF_MOV, tmpmov, 0); _tmov = new TIsamtempfile(LF_MOV, tmpmov, 0);
TString80 tmprmov = "%"; TString80 tmprmov = "%";
tmprmov << get_firm_dir(); tmprmov << get_firm_dir();
tmprmov << "\\" << TEMP_RMOV; tmprmov << "\\" << TEMP_RMOV;
_tmprmov = tmprmov.mid(1); _tmprmov = tmprmov.mid(1);
_tmprmov << ".dbf"; _tmprmov << ".dbf";
if (fexist(_tmprmov)) if (_tmprmov.exist())
_trmov = new TIsamtempfile(LF_RMOV, tmprmov, 0); _trmov = new TIsamtempfile(LF_RMOV, tmprmov, 0);
TString80 tmpriva = "%"; TString80 tmpriva = "%";
tmpriva << get_firm_dir(); tmpriva << get_firm_dir();
tmpriva << "\\" << TEMP_RMOVIVA; tmpriva << "\\" << TEMP_RMOVIVA;
_tmpriva = tmpriva.mid(1); _tmpriva = tmpriva.mid(1);
_tmpriva << ".dbf"; _tmpriva << ".dbf";
if (fexist(_tmpriva)) if (_tmpriva.exist())
_triva = new TIsamtempfile(LF_RMOVIVA, tmpriva, 0); _triva = new TIsamtempfile(LF_RMOVIVA, tmpriva, 0);
TString80 tmpoccas = "%"; TString80 tmpoccas = "%";
tmpoccas << get_firm_dir(); tmpoccas << get_firm_dir();
tmpoccas << "\\" << TEMP_OCC; tmpoccas << "\\" << TEMP_OCC;
_tmpoccas = tmpoccas.mid(1); _tmpoccas = tmpoccas.mid(1);
_tmpoccas << ".dbf"; _tmpoccas << ".dbf";
if (fexist(_tmpoccas)) if (_tmpoccas.exist())
_toccas = new TIsamtempfile(LF_OCCAS, tmpoccas, 0); _toccas = new TIsamtempfile(LF_OCCAS, tmpoccas, 0);
TString80 tmppart = "%"; TString80 tmppart = "%";
tmppart << get_firm_dir(); tmppart << get_firm_dir();
tmppart << "\\" << TEMP_PART; tmppart << "\\" << TEMP_PART;
_tmppart = tmppart.mid(1); _tmppart = tmppart.mid(1);
_tmppart << ".dbf"; _tmppart << ".dbf";
if (fexist(_tmppart)) if (_tmppart.exist())
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, 0); _tpart = new TIsamtempfile(LF_PARTITE, tmppart, 0);
TString80 tmpscad = "%"; TString80 tmpscad = "%";
tmpscad << get_firm_dir(); tmpscad << get_firm_dir();
tmpscad << "\\" << TEMP_SCAD; tmpscad << "\\" << TEMP_SCAD;
_tmpscad = tmpscad.mid(1); _tmpscad = tmpscad.mid(1);
_tmpscad << ".dbf"; _tmpscad << ".dbf";
if (fexist(_tmpscad)) if (_tmpscad.exist())
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, 0); _tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, 0);
TString80 tmppagsca = "%"; TString80 tmppagsca = "%";
tmppagsca << get_firm_dir(); tmppagsca << get_firm_dir();
tmppagsca << "\\" << TEMP_PAGSCA; tmppagsca << "\\" << TEMP_PAGSCA;
_tmppagsca = tmppagsca.mid(1); _tmppagsca = tmppagsca.mid(1);
_tmppagsca << ".dbf"; _tmppagsca << ".dbf";
if (fexist(_tmppagsca)) if (_tmppagsca.exist())
_tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, 0); _tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, 0);
} }
} }
@ -1826,41 +1817,34 @@ void TRic_tab::chiudi_file_temp()
{ {
if (_scelta == 'T') if (_scelta == 'T')
{ {
if (fexist(_tmpcaus)) if (_tmpcaus.exist())
delete _tcaus; delete _tcaus;
if (fexist(_tmprcaus)) if (_tmprcaus.exist())
delete _trcaus; delete _trcaus;
if (fexist(_tmpclifo)) if (_tmpclifo.exist())
delete _tclifo; delete _tclifo;
if (fexist(_tmpcon)) if (_tmpcon.exist())
delete _tpcon; delete _tpcon;
} }
else else
{ {
if (fexist(_tmpmov)) if (_tmpmov.exist())
delete _tmov; delete _tmov;
if (fexist(_tmprmov)) if (_tmprmov.exist())
delete _trmov; delete _trmov;
if (fexist(_tmpriva)) if (_tmpriva.exist())
delete _triva; delete _triva;
if (fexist(_tmpoccas)) if (_tmpoccas.exist())
delete _toccas; delete _toccas;
if (fexist(_tmppart)) if (_tmppart.exist())
delete _tpart; delete _tpart;
if (fexist(_tmpscad)) if (_tmpscad.exist())
delete _tscad; delete _tscad;
if (fexist(_tmppagsca)) if (_tmppagsca.exist())
delete _tpagsca; delete _tpagsca;
} }
} }
bool TRic_tab::menu(MENU_TAG m)
{
if (m == BAR_ITEM(1))
return main_loop();
return FALSE;
}
int cg6600 (int argc, char* argv[]) int cg6600 (int argc, char* argv[])
{ {
char p3 = '\0'; char p3 = '\0';

View File

@ -19,7 +19,7 @@ BEGIN
FLAGS "D" FLAGS "D"
END END
RADIOBUTTON F_LISTA 34 RADIOBUTTON F_LISTA 38
BEGIN BEGIN
PROMPT 2 4 "Scelta controllo " PROMPT 2 4 "Scelta controllo "
HELP "Indicare il tipo di controllo" HELP "Indicare il tipo di controllo"
@ -67,12 +67,12 @@ BEGIN
FLAGS "DU" FLAGS "DU"
END END
BUTTON DLG_OK 9 2 BUTTON DLG_OK 10 2
BEGIN BEGIN
PROMPT -12 -1 "" PROMPT -12 -1 ""
END END
BUTTON DLG_QUIT 9 2 BUTTON DLG_QUIT 10 2
BEGIN BEGIN
PROMPT -22 -1 "" PROMPT -22 -1 ""
END END

View File

@ -4,20 +4,20 @@ TOOLBAR "" 0 20 0 2
BUTTON DLG_SAVEREC 10 2 BUTTON DLG_SAVEREC 10 2
BEGIN BEGIN
PROMPT -15 -1 "~Registra" PROMPT -13 -1 "~Registra"
MESSAGE EXIT,K_SAVE MESSAGE EXIT,K_SAVE
PICTURE BMP_SAVEREC PICTURE BMP_SAVEREC
END END
BUTTON DLG_CANCEL 10 2 BUTTON DLG_CANCEL 10 2
BEGIN BEGIN
PROMPT -45 -1 "" PROMPT -23 -1 ""
MESSAGE EXIT,K_ESC MESSAGE EXIT,K_ESC
END END
BUTTON DLG_QUIT 10 2 BUTTON DLG_QUIT 10 2
BEGIN BEGIN
PROMPT -55 -1 "" PROMPT -33 -1 ""
MESSAGE EXIT,K_QUIT MESSAGE EXIT,K_QUIT
END END

View File

@ -1542,7 +1542,8 @@ bool TVar_sc::datasoll_handler(TMask_field& f, KEY k)
TString datasoll (f.get()); TString datasoll (f.get());
datasoll.trim(); datasoll.trim();
if (datasoll.empty) return TRUE; if (datasoll.empty())
return TRUE;
if (!(TDate::isdate(datasoll))) if (!(TDate::isdate(datasoll)))
return f.warning_box("Data sollecito errata"); return f.warning_box("Data sollecito errata");

View File

@ -1,4 +1,5 @@
#include <os_dep.h> #include <os_dep.h>
#include <progind.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>

View File

@ -1,6 +1,7 @@
#include <progind.h>
#include "cg6900.h" #include "cg6900.h"
#include "cg6900a.h" #include "cg6900a.h"
#include <math.h>
bool TInv_cont::invio_contabilita_PC() bool TInv_cont::invio_contabilita_PC()
{ {

View File

@ -16,8 +16,8 @@
const int size = 256; //Lunghezza del record del TRASFER const int size = 256; //Lunghezza del record del TRASFER
const int sizeH = 1024; //Lunghezza del record dell'HEADER const int sizeH = 1024; //Lunghezza del record dell'HEADER
const char* tracciato_AS = "cgtrc.ini"; const char* const tracciato_AS = "cgtrc.ini";
const char* tracciato_PC = "cgtrcpc.ini"; const char* const tracciato_PC = "cgtrcpc.ini";
const int RIC_SIZE = 512; const int RIC_SIZE = 512;
@ -144,7 +144,7 @@ void setdec(char * s,int dec)
} }
if (carry) if (carry)
{ {
for (i = l; i > (*s1 == '-'); i--) s[i] = s[i - 1]; for (i = l; i > int(*s1 == '-'); i--) s[i] = s[i - 1];
s[(*s1 == '-')] = '1'; s[(*s1 == '-')] = '1';
} }
return; return;
@ -187,7 +187,7 @@ void setdec(char * s,int dec)
} }
if (carry) if (carry)
{ {
for (i = l; i > (*s1 == '-'); i--) s[i] = s[i - 1]; for (i = l; i > int(*s1 == '-'); i--) s[i] = s[i - 1];
s[(*s1 == '-')] = '1'; s[(*s1 == '-')] = '1';
} }
} }
@ -324,11 +324,11 @@ TTransfer_file::TTransfer_file(char scelta)
_numreg_piva = 0L; _numreg_piva = 0L;
_scelta = scelta; _scelta = scelta;
_control_rec = new TFixed_string(__dep, LEN_REC_HEAD); _control_rec = new TFixed_string(__dep, LEN_REC_HEAD);
if (scelta == 'S') if (scelta == 'S')
_trc.leggi_modulo(tracciato_AS); _trc.leggi_modulo(tracciato_AS);
else else
if (scelta == 'P') _trc.leggi_modulo(tracciato_PC);
_trc.leggi_modulo(tracciato_PC);
_npoccas = 0L; _npoccas = 0L;
} }
@ -424,11 +424,12 @@ void TTransfer_file::remove_all(bool file_ditta)
} }
if (sigla == 'A') if (sigla == 'A')
{ {
TString80 path; TFilename path(dir);
path << dir << "\\tclifo.dbf"; path.add("tclifo.dbf");
::remove(path); ::remove(path);
path = ""; path.ext("cdx");
path << dir << "\\tclifo.cdx"; ::remove(path);
path.ext("fpt");
::remove(path); ::remove(path);
} }
if (sigla == 'P') if (sigla == 'P')
@ -5048,11 +5049,10 @@ void TTransfer_file::write_pagsca(TString& record)
// Mappa dei campi da trasferire // Mappa dei campi da trasferire
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void TMappa_trc::leggi_modulo(const char* tracciato) bool TMappa_trc::leggi_modulo(const char* tracciato)
{ {
TScanner s(tracciato);
TString16 key,sigla; TString16 key,sigla;
TScanner s(tracciato);
while (s.ok()) while (s.ok())
{ {
const TString& line = s.line(); const TString& line = s.line();
@ -5065,9 +5065,7 @@ void TMappa_trc::leggi_modulo(const char* tracciato)
add(key, record); add(key, record);
} }
#ifdef DBG return items() > 0;
long item = items();
#endif
} }
int TMappa_trc::from(const char* key) int TMappa_trc::from(const char* key)

View File

@ -8,7 +8,7 @@
#endif #endif
#ifndef __PROGIND_H #ifndef __PROGIND_H
#include <progind.h> class TProgind;
#endif #endif
#include <mov.h> #include <mov.h>
@ -99,13 +99,14 @@ class TRic_recfield : public TObject
TRectype& record() const { return *_rec;} // Ritorna puntatore a inizio record TRectype& record() const { return *_rec;} // Ritorna puntatore a inizio record
TRic_recfield(TRectype& rec, const char* name, int from = 0, int len = 0); TRic_recfield(TRectype& rec, const char* name, int from = 0, int len = 0);
virtual ~TRic_recfield() {}
}; };
class TMappa_trc : public TAssoc_array class TMappa_trc : public TAssoc_array
{ {
public : public :
void leggi_modulo(const char* tracciato); bool leggi_modulo(const char* tracciato);
int from (const char* key); int from (const char* key);
int to (const char* key); int to (const char* key);
@ -115,6 +116,7 @@ class TMappa_trc : public TAssoc_array
int flag_bis (const char* key); int flag_bis (const char* key);
TMappa_trc() {}; TMappa_trc() {};
virtual ~TMappa_trc() {}
}; };
class TTransfer_file class TTransfer_file
@ -179,8 +181,8 @@ class TTransfer_file
TString _nrec_file; TString _nrec_file;
TString _ult_file; TString _ult_file;
TString _key; TString _key;
TString80 _tmpcaus,_tmprcaus,_tmpclifo,_tmppcon,_tmpmov; TFilename _tmpcaus,_tmprcaus,_tmpclifo,_tmppcon,_tmpmov;
TString80 _tmprmov,_tmprmoviva,_tmppart,_tmpscad,_tmppagsca; TFilename _tmprmov,_tmprmoviva,_tmppart,_tmpscad,_tmppagsca;
TString _recprec; TString _recprec;
long _SCAnreg,_SCAnreg_p; long _SCAnreg,_SCAnreg_p;