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:
parent
6466854067
commit
36a51e5877
@ -41,7 +41,7 @@ protected:
|
||||
virtual bool changing_mask(int mode) { return FALSE; }
|
||||
virtual bool save_and_new() const { return _savenew; }
|
||||
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);
|
||||
virtual void init_query_mode(TMask& 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));
|
||||
}
|
||||
|
||||
const char* TClifo_application::get_next_key()
|
||||
|
||||
bool TClifo_application::get_next_key(TToken_string& key)
|
||||
{
|
||||
TLocalisamfile& clifo = _rel->lfile() ;
|
||||
long codcf = 1L ;
|
||||
@ -116,8 +115,8 @@ const char* TClifo_application::get_next_key()
|
||||
codcf += clifo.get_long(CLI_CODCF);
|
||||
}
|
||||
}
|
||||
_tmp.format("%d|%s|%d|%ld", F_TIPOCF, (const char*) tipo, F_CODCF, codcf);
|
||||
return _tmp;
|
||||
key.format("%d|%s|%d|%ld", F_TIPOCF, (const char*) tipo, F_CODCF, codcf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
HIDDEN bool no_dup_fis(TMask_field& f, KEY key)
|
||||
|
22
cg/cg1.cpp
22
cg/cg1.cpp
@ -1,34 +1,26 @@
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
|
||||
#define __MAIN__
|
||||
#include "cg1.h"
|
||||
|
||||
#define usage "Error - usage : %s -{0|1|2|3|4|5} [params]"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
const int n = (argc > 1) ? atoi(argv[1]+1) : -1;
|
||||
switch(n)
|
||||
{
|
||||
case 0:
|
||||
cg1100(argc,argv); break;
|
||||
case 1:
|
||||
cg1200(argc,argv); break;
|
||||
cg1200(argc,argv); break; // Stampa clienti/fornitori
|
||||
case 2:
|
||||
cg1300(argc,argv); break;
|
||||
cg1300(argc,argv); break; // Aggiornamenti
|
||||
case 3:
|
||||
cg1400(argc,argv); break;
|
||||
cg1400(argc,argv); break; // Stampa versamenti
|
||||
case 4:
|
||||
cg1500(argc,argv); break;
|
||||
cg1500(argc,argv); break; // Stampa bilanci
|
||||
case 5:
|
||||
cg1600(argc,argv); break;
|
||||
cg1600(argc,argv); break; // Stampa bilancio IV direttiva
|
||||
case 6:
|
||||
cg1700(argc,argv); break;
|
||||
// case 7:
|
||||
// cg1800(argc,argv); break;
|
||||
cg1700(argc,argv); break; // Stampa causali
|
||||
default:
|
||||
error_box(usage, argv[0]); break;
|
||||
cg1100(argc,argv); break; // Stampa Piano dei conti
|
||||
}
|
||||
exit(n < 0); // Altrimenti non esce mai!
|
||||
return n < 0;
|
||||
|
15
cg/cg1.h
15
cg/cg1.h
@ -1,10 +1,6 @@
|
||||
#ifndef __CG1_H
|
||||
#define __CG1_H
|
||||
|
||||
#ifndef __STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
int cg1100(int argc, char* argv[]);
|
||||
int cg1200(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 cg1800(int argc, char* argv[]);
|
||||
|
||||
#ifdef __MAIN__
|
||||
#define extern
|
||||
#endif
|
||||
|
||||
extern TString80 tmp;
|
||||
|
||||
#ifdef __MAIN__
|
||||
#undef extern
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __CG1_H
|
||||
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <mailbox.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
#include <relation.h>
|
||||
#include <sort.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
@ -76,6 +75,8 @@ class CG1100_application : public TPrintapp
|
||||
byte _sottoc_classificato;
|
||||
bool _prima_volta, _stampa_g, _stampa_c;
|
||||
TDate _data_stampa;
|
||||
|
||||
TString tmp; // Stringa per porcate galattiche
|
||||
|
||||
public:
|
||||
|
||||
|
@ -12,11 +12,11 @@
|
||||
#include <indsp.h>
|
||||
#include <mov.h>
|
||||
#include <nditte.h>
|
||||
#include <pconti.h>
|
||||
|
||||
#include "cg1.h"
|
||||
#include "cg1200a.h"
|
||||
#include "cg1200b.h"
|
||||
#include <pconti.h>
|
||||
|
||||
#define COMRF_ALIAS 50
|
||||
#define COMNASC_ALIAS 51
|
||||
@ -50,6 +50,9 @@ class TPrintclifo_app : public TPrintapp
|
||||
long _codice;
|
||||
char _tipocf,_tipoaper;
|
||||
bool _gia_iniziati_fornitori;
|
||||
|
||||
TString tmp; // Stringa per porcate galattiche
|
||||
|
||||
public:
|
||||
// @cmember Disabilita la verifica del modulo : essendo una anagrafica, va sempre abilitata
|
||||
virtual bool check_autorization() const
|
||||
|
@ -116,6 +116,8 @@ class TStampa_bilanci : public TPrintapp
|
||||
int _stampa_mov_prov;
|
||||
|
||||
TArray _clienti, _fornitori;
|
||||
|
||||
TString tmp; // Stringa per porcate galattiche
|
||||
|
||||
public:
|
||||
TDate _inizioEs, _fineEs;
|
||||
|
@ -214,7 +214,9 @@ class TStampa_IVdirettiva : public TPrintapp
|
||||
bool _sbilancio_ordine, _quadratura;
|
||||
long _items_sort;
|
||||
|
||||
protected:
|
||||
TString tmp; // Stringa per porcate galattiche
|
||||
|
||||
protected:
|
||||
void aggiungi_anno(int anno, TDate& inizio, TDate& fine);
|
||||
|
||||
public:
|
||||
|
@ -61,7 +61,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
||||
m->set_handler(F_NUMREG, num_handler);
|
||||
m->set_handler(F_CODCAUS, caus_query_handler);
|
||||
m->set_handler(F_DATAREG, datareg_handler);
|
||||
// DATACOM new way
|
||||
// DATACOMP new way
|
||||
// m->set_handler(F_DATACOMP, datacomp_handler);
|
||||
|
||||
TConfig c(CONFIG_STUDIO, "cg");
|
||||
@ -424,8 +424,8 @@ TMask* TPrimanota_application::get_mask(int mode)
|
||||
caus = _msk[0]->get(F_CODCAUS);
|
||||
break;
|
||||
case MODE_MOD:
|
||||
annoiva = _rel->curr().get_int("ANNOIVA");
|
||||
caus = _rel->curr().get("CODCAUS");
|
||||
annoiva = _rel->curr().get_int(MOV_ANNOIVA);
|
||||
caus = _rel->curr().get(MOV_CODCAUS);
|
||||
break;
|
||||
default:
|
||||
return load_mask(0);
|
||||
@ -574,55 +574,54 @@ void TPrimanota_application::fill_sheet(TMask& m) const
|
||||
|
||||
// Ritorna il prossimo numero di registrazione libero
|
||||
// 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
|
||||
{
|
||||
TMask& m = curr_mask();
|
||||
if (m.insert_mode())
|
||||
{
|
||||
_tmp.add(F_CODCAUS); // Ricopia causale
|
||||
tmp.add(F_CODCAUS); // Ricopia causale
|
||||
switch (_incasso->_step)
|
||||
{
|
||||
case 1:
|
||||
_tmp.add(_incasso->_causale);
|
||||
tmp.add(_incasso->_causale);
|
||||
_msk[0]->set(F_CODCAUS, _incasso->_causale); // Joke get_mask
|
||||
_iva = nessuna_iva; // Impedisce incremento del numero documento
|
||||
break;
|
||||
case 2:
|
||||
_tmp.add(_incasso->_causale_fattura);
|
||||
tmp.add(_incasso->_causale_fattura);
|
||||
_msk[0]->set(F_CODCAUS, _incasso->_causale_fattura); // Joke get_mask
|
||||
_iva = _incasso->_iva_fattura; // Provoca incremento del numero documento
|
||||
break;
|
||||
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));
|
||||
break;
|
||||
}
|
||||
|
||||
_tmp.add(F_DATAREG); // Ricopia data operazione
|
||||
_tmp.add(m.get(F_DATAREG));
|
||||
tmp.add(F_DATAREG); // Ricopia data operazione
|
||||
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())
|
||||
_tmp.add(m.get(F_DATAREG));
|
||||
tmp.add(m.get(F_DATAREG));
|
||||
else
|
||||
_tmp.add(m.get(F_DATACOMP));
|
||||
tmp.add(m.get(F_DATACOMP));
|
||||
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include <tabutil.h>
|
||||
#include <prefix.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "cg2101.h"
|
||||
#include "cg2103.h"
|
||||
@ -160,7 +159,8 @@ bool TMovimentoPN::controlla_liquidazione(const TDate& data, TRegistro& registro
|
||||
{
|
||||
TString16 chiave;
|
||||
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);
|
||||
if (plm.read() == NOERR)
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ protected: // TRelation_application
|
||||
virtual void init_insert_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
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 write(const TMask& m);
|
||||
virtual int rewrite(const TMask& m);
|
||||
|
@ -323,7 +323,9 @@ bool TPrimanota_application::test_prorata()
|
||||
if (esistono_righe_senza_tipo_detrazione)
|
||||
{
|
||||
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 esiste_riga_iva_detraibile = type2pos('D') >= 0;
|
||||
if (prorata100)
|
||||
@ -344,7 +346,8 @@ bool TPrimanota_application::aggiusta_prorata()
|
||||
|
||||
TRegistro& reg = causale().reg();
|
||||
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 vecchio_prorata = prorata_attuale < 100.0 ? 100.0 : 0.0;
|
||||
|
||||
|
@ -6,8 +6,6 @@
|
||||
#include <printapp.h>
|
||||
#include <progind.h>
|
||||
#include <recarray.h>
|
||||
#include <utility.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
#include <mov.h>
|
||||
#include <rmov.h>
|
||||
@ -1114,7 +1112,11 @@ void TStampa_giornale::set_rows (int file, int counter)
|
||||
set_row(r," Comp. %04d", _annoEsMov);
|
||||
|
||||
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())
|
||||
{
|
||||
@ -1192,7 +1194,11 @@ void TStampa_giornale::set_rows (int file, int counter)
|
||||
set_row (r, _sezione == 'D' ? "@152g%r" : "@174g%r", &_importo);
|
||||
|
||||
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;
|
||||
|
@ -19,7 +19,7 @@ int main(int argc,char** argv)
|
||||
case 2:
|
||||
cg4300(argc,argv); break; // Calcolo liquidazione
|
||||
case 3:
|
||||
cg4400(argc,argv); break; // Stampa registri
|
||||
cg4400(argc,argv); break; // Stampa Registri IVA
|
||||
case 4:
|
||||
cg4500(argc,argv); break; // Apertura nuovo esercizio
|
||||
case 5:
|
||||
|
@ -1,9 +1,7 @@
|
||||
#include <applicat.h>
|
||||
#include <assoc.h>
|
||||
#include <isam.h>
|
||||
#include <mask.h>
|
||||
#include <prefix.h>
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "cg4.h"
|
||||
@ -11,14 +9,15 @@
|
||||
|
||||
#include <pconti.h>
|
||||
|
||||
class TCopia_archivi : public TApplication
|
||||
class TCopia_archivi : public TSkeleton_application
|
||||
{
|
||||
TMask* _msk;
|
||||
long _default_firm;
|
||||
|
||||
virtual bool create() ;
|
||||
virtual bool destroy() ;
|
||||
bool menu(MENU_TAG);
|
||||
virtual void main_loop();
|
||||
|
||||
bool copyfile(int logicnum, long from, long to);
|
||||
bool check_comfile(int logicnum);
|
||||
void clearivd(long to);
|
||||
@ -166,20 +165,18 @@ void TCopia_archivi::copyivd(long from, long to)
|
||||
|
||||
bool TCopia_archivi::create()
|
||||
{
|
||||
TApplication::create();
|
||||
_msk = new TMask("cg4200a") ;
|
||||
_default_firm = get_firm();
|
||||
dispatch_e_menu(BAR_ITEM(1));
|
||||
return TRUE;
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TCopia_archivi::destroy()
|
||||
{
|
||||
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)
|
||||
{
|
||||
@ -271,7 +268,6 @@ bool TCopia_archivi::menu(MENU_TAG)
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int cg4200(int argc, char* argv[])
|
||||
|
@ -21,7 +21,7 @@ END
|
||||
NUMBER F_FROMFIRM 5
|
||||
BEGIN
|
||||
PROMPT 4 5 "Ditta "
|
||||
FLAGS "R"
|
||||
FLAGS "F"
|
||||
USE LF_NDITTE KEY 1
|
||||
CHECKTYPE NORMAL
|
||||
INPUT CODDITTA F_FROMFIRM
|
||||
@ -30,6 +30,7 @@ BEGIN
|
||||
OUTPUT F_FROMFIRM CODDITTA
|
||||
OUTPUT F_DFROMFIRM RAGSOC
|
||||
HELP "Codice della ditta da cui prelevare i dati"
|
||||
VALIDATE CHECK_FIRM_FUNC
|
||||
WARNING "Ditta assente"
|
||||
END
|
||||
|
||||
@ -44,6 +45,7 @@ BEGIN
|
||||
COPY OUTPUT F_FROMFIRM
|
||||
HELP "Ragione sociale della ditta da cui prelevare i dati"
|
||||
WARNING "Ditta assente"
|
||||
VALIDATE CHECK_FIRM_FUNC
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 76 3
|
||||
@ -54,7 +56,6 @@ END
|
||||
NUMBER F_TOFIRM 5
|
||||
BEGIN
|
||||
PROMPT 4 8 "Ditta "
|
||||
FLAGS "FR"
|
||||
COPY USE F_FROMFIRM
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODDITTA F_TOFIRM
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include <prefix.h>
|
||||
#include <progind.h>
|
||||
#include <sheet.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "cg4300.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;
|
||||
_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
|
||||
_previous_perc = c; // usa quella attuale ricordandosi la segnalazione
|
||||
else
|
||||
_previous_perc = p;
|
||||
}
|
||||
}
|
||||
|
||||
// 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),
|
||||
(wht)m.get_int(CG43_RDB_VERS));
|
||||
app().set_choice_limits(m);
|
||||
m.field(CG43_FLD_SELECTED).set(format("%ld", l));
|
||||
m.set(CG43_FLD_SELECTED, l);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -696,7 +697,7 @@ bool TLiquidazione_app::what_freq_handler(TMask_field& f, KEY key)
|
||||
while (!is_trim(month)) month--;
|
||||
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().reset_choices(f.mask());
|
||||
@ -853,8 +854,8 @@ bool TLiquidazione_app::set_liquidazione()
|
||||
m.set_handler(CG43_CHK_FINAL, chk_final_handler);
|
||||
|
||||
|
||||
m.field(CG43_FLD_SELECTED).set(format("%ld",_selected.ones()));
|
||||
m.field(CG43_FLD_ANNO).set(_year);
|
||||
m.set(CG43_FLD_SELECTED, _selected.ones());
|
||||
m.set(CG43_FLD_ANNO, _year);
|
||||
set_choice_limits(m);
|
||||
|
||||
KEY k;
|
||||
@ -865,7 +866,7 @@ bool TLiquidazione_app::set_liquidazione()
|
||||
|
||||
do
|
||||
{
|
||||
m.field(CG43_RDB_VERS).set(format("%d",(int)_what));
|
||||
m.set(CG43_RDB_VERS, _what);
|
||||
|
||||
if ((k = m.run()) == K_ESC) break;
|
||||
|
||||
|
@ -213,12 +213,14 @@ class _ProrataItem : public TObject
|
||||
real _current_perc; // Percentuale prorata anno in corso
|
||||
real _previous_perc; // Percentuale prorata anno precedente
|
||||
bool _previous_ok; // Flag per indicare se presente tabella anno precedente
|
||||
|
||||
public:
|
||||
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);
|
||||
const real& current() { return _current_perc; }
|
||||
const real& previous() { return _previous_perc; }
|
||||
const bool flag() { return _previous_ok; }
|
||||
const real& current() const { return _current_perc; }
|
||||
const real& previous() const { return _previous_perc; }
|
||||
const bool previous_ok() const { return _previous_ok; }
|
||||
|
||||
_ProrataItem() {}
|
||||
virtual ~_ProrataItem() {}
|
||||
};
|
||||
|
@ -89,8 +89,7 @@ bool TLiquidazione_app::is_in_liq_period(TDate& d)
|
||||
|
||||
bool TLiquidazione_app::is_first_month(int m)
|
||||
{
|
||||
return _freqviva == "M" ?
|
||||
m == 1 : m == 3;
|
||||
return _freqviva == "M" ? m == 1 : m == 3;
|
||||
}
|
||||
|
||||
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 ok = FALSE;
|
||||
_pla_r->zero();
|
||||
|
||||
// forza il tipoatt a 1
|
||||
TString buf(a);
|
||||
buf.ltrim();
|
||||
@ -517,14 +513,13 @@ bool TLiquidazione_app::look_pla(const char* a, bool create)
|
||||
buf << "1";
|
||||
while (buf.len() < 6) buf.insert("0");
|
||||
|
||||
_pla_r->zero();
|
||||
(*_pla_ditta) = format("%05ld", get_firm());
|
||||
(*_pla_anno) = _year;
|
||||
(*_pla_codatt) = buf;
|
||||
|
||||
TString16 s = _pla_r->get("CODTAB");
|
||||
_pla->read();
|
||||
ok = _pla->good();
|
||||
|
||||
const TString16 s = _pla_r->get("CODTAB");
|
||||
bool ok = _pla->read() == NOERR;
|
||||
if (!ok && create)
|
||||
{
|
||||
_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;
|
||||
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");
|
||||
else
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -443,7 +443,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
real cre_pre = 0.0;
|
||||
real acq_intr = 0.0;
|
||||
bool isdifferita = FALSE;
|
||||
bool error = FALSE;
|
||||
int error = FALSE;
|
||||
// MI3262...
|
||||
isdifferita = is_differita();
|
||||
TString16 tipo_acc;
|
||||
@ -458,7 +458,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
|
||||
char thh = *_freqviva;
|
||||
|
||||
TString16 thyear = _year;
|
||||
_year = format("%d", atoi(_year)-1);
|
||||
_year.format("%d", atoi(_year)-1);
|
||||
|
||||
if (!look_lia())
|
||||
error = 3;
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include <confapp.h>
|
||||
#include <isam.h>
|
||||
#include <tabutil.h>
|
||||
#include <prefix.h>
|
||||
#include <attiv.h>
|
||||
#include <extcdecl.h>
|
||||
#include <utility.h>
|
||||
#include <modaut.h>
|
||||
#include <prefix.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include <attiv.h>
|
||||
|
||||
#include "cg5100a.h"
|
||||
|
||||
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)
|
||||
{
|
||||
TDir dir;
|
||||
TString file(16);
|
||||
TFilename file;
|
||||
|
||||
dir.get(logicnum, _lock, _nordir, _sysdirop);
|
||||
file = dir.name();
|
||||
@ -126,7 +126,8 @@ void TParametri_ditta::swap_file(int logicnum, bool tocom)
|
||||
else
|
||||
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);
|
||||
TSystemisamfile s(logicnum);
|
||||
@ -138,16 +139,16 @@ void TParametri_ditta::swap_file(int logicnum, bool tocom)
|
||||
void TParametri_ditta::load_file(int logicnum)
|
||||
{
|
||||
TDir dir;
|
||||
|
||||
dir.get(logicnum);
|
||||
|
||||
TSystemisamfile f(logicnum);
|
||||
TFilename lf;
|
||||
|
||||
if (dir.eox() == 0L)
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -217,7 +217,10 @@ bool TRic_archivi::leggi_marker()
|
||||
_sequenza = TRUE;
|
||||
|
||||
if (letti == 0)
|
||||
{
|
||||
fclose(i);
|
||||
return error_box("Rilevati ERRORI nel file MARKER: impossibile proseguire");
|
||||
}
|
||||
|
||||
_nomeid = buffer.sub(0,10);
|
||||
_dittainv = atol(buffer.sub(10,14));
|
||||
@ -246,7 +249,7 @@ bool TRic_archivi::leggi_marker()
|
||||
if (_dittaric != 0)
|
||||
{
|
||||
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
|
||||
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);
|
||||
}
|
||||
|
||||
FILE* i;
|
||||
|
||||
const word size = 64;
|
||||
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));
|
||||
_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");
|
||||
_sequenza = FALSE;
|
||||
fclose(i);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@ -313,8 +315,6 @@ bool TRic_archivi::leggi_marker_rep()
|
||||
_numinvp = _numinv;
|
||||
_datatrasp = _datatras;
|
||||
|
||||
fclose(i);
|
||||
|
||||
if (_numdisk == 1) // Va fatto solo per il primo disco
|
||||
{
|
||||
_dittaric = leggi_tabella_tras();
|
||||
@ -322,7 +322,7 @@ bool TRic_archivi::leggi_marker_rep()
|
||||
if (_dittaric != 0)
|
||||
{
|
||||
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
|
||||
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 FALSE;
|
||||
return error_box("Impossibile accedere al file %s", (const char*)_marker);
|
||||
}
|
||||
|
||||
void TRic_archivi::main_loop()
|
||||
@ -546,7 +546,6 @@ int TRic_archivi::controllo_ripartenza()
|
||||
_tras_file->open(trasfer);
|
||||
|
||||
TConfig conf(CONFIG_DITTA);
|
||||
|
||||
std = conf.get("FlStTra");
|
||||
|
||||
if (_tras_file->read_control_rec())
|
||||
|
@ -1,10 +1,5 @@
|
||||
|
||||
#include <applicat.h>
|
||||
#include <tabapp.h>
|
||||
#include <strings.h>
|
||||
#include <stdtypes.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
#include <prefix.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)
|
||||
{
|
||||
TTable ind ("%IND");
|
||||
TString dep;
|
||||
TString16 dep;
|
||||
char stato = '\0';
|
||||
|
||||
dep = format("%05ld", ditta);
|
||||
dep.format("%05ld", ditta);
|
||||
|
||||
ind.zero();
|
||||
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)
|
||||
{
|
||||
TTable ind ("%IND");
|
||||
TString dep;
|
||||
TString16 dep;
|
||||
|
||||
dep = format("%05ld", app()._ditta_tab);
|
||||
dep.format("%05ld", app()._ditta_tab);
|
||||
|
||||
ind.zero();
|
||||
ind.put("CODTAB", dep);
|
||||
@ -420,11 +415,11 @@ bool Tabinv_application::nome_id(TMask_field& f, KEY k)
|
||||
f.mask().set(F_RAGSOC, "");
|
||||
|
||||
TTable ind ("%IND");
|
||||
TString dep;
|
||||
TString16 dep;
|
||||
|
||||
if (ditta != 0)
|
||||
{
|
||||
dep = format("%05ld", ditta);
|
||||
dep.format("%05ld", ditta);
|
||||
|
||||
ind.zero();
|
||||
ind.put("CODTAB", dep);
|
||||
@ -666,12 +661,12 @@ int Tabinv_application::write(const TMask& m)
|
||||
if (_ditte_uguali)
|
||||
{
|
||||
_control_rec = _tras_file.record();
|
||||
str = format("%03d", num);
|
||||
str.format("%03d", num);
|
||||
_control_rec.overwrite(str,75);
|
||||
str = riconverti(data,TRUE);
|
||||
_control_rec.overwrite(str,78);
|
||||
_control_rec.overwrite(sigla,240);
|
||||
str = format("%-60s", (const char*) chiave);
|
||||
str.format("%-60s", (const char*) chiave);
|
||||
_control_rec.overwrite(str,241);
|
||||
|
||||
_tras_file.write_control_rec(_control_rec,1024);
|
||||
@ -709,12 +704,12 @@ int Tabinv_application::rewrite(const TMask& m)
|
||||
if (_ditte_uguali)
|
||||
{
|
||||
_control_rec = _tras_file.record();
|
||||
str = format("%03d", num);
|
||||
str.format("%03d", num);
|
||||
_control_rec.overwrite(str,75);
|
||||
str = riconverti(data,TRUE);
|
||||
_control_rec.overwrite(str,78);
|
||||
_control_rec.overwrite(sigla,240);
|
||||
str = format("%-60s", (const char*) chiave);
|
||||
str.format("%-60s", (const char*) chiave);
|
||||
_control_rec.overwrite(str,241);
|
||||
|
||||
_tras_file.write_control_rec(_control_rec,1024);
|
||||
|
@ -6,8 +6,6 @@
|
||||
#include <tabutil.h>
|
||||
#include <prefix.h>
|
||||
#include <progind.h>
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "cglib01.h"
|
||||
#include "cglib02.h"
|
||||
@ -27,7 +25,7 @@
|
||||
#include <occas.h>
|
||||
#include <pconti.h>
|
||||
|
||||
class TRic_tab : public TApplication
|
||||
class TRic_tab : public TSkeleton_application
|
||||
{
|
||||
|
||||
TTable* _tab_tra;
|
||||
@ -51,17 +49,16 @@ class TRic_tab : public TApplication
|
||||
long _protiva,_uprotiva,_nprotiva,_nuprotiva,_numreg,_numreg_p,_numreg_piva,_nuovareg;
|
||||
char _sez;
|
||||
real _importo,_totdoc;
|
||||
TString _tmpcaus,_tmprcaus,_tmpclifo,_tmpcon,_tmpmov,_tmprmov,_tmpriva;
|
||||
TString _tmpoccas,_tmppart,_tmpscad,_tmppagsca;
|
||||
TFilename _tmpcaus,_tmprcaus,_tmpclifo,_tmpcon,_tmpmov,_tmprmov,_tmpriva;
|
||||
TFilename _tmpoccas,_tmppart,_tmpscad,_tmppagsca;
|
||||
|
||||
public:
|
||||
TString _titolo;
|
||||
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual bool menu(MENU_TAG m);
|
||||
virtual void main_loop();
|
||||
virtual void on_config_change();
|
||||
bool main_loop();
|
||||
bool video();
|
||||
bool leggi_trasfer();
|
||||
bool controlli();
|
||||
@ -124,8 +121,6 @@ void TRic_tab::on_config_change()
|
||||
|
||||
bool TRic_tab::create()
|
||||
{
|
||||
TApplication::create();
|
||||
|
||||
_tab_tra = new TTable ("%TRA");
|
||||
|
||||
_reg = new TTable ("REG");
|
||||
@ -157,9 +152,7 @@ bool TRic_tab::create()
|
||||
_nreg = 0;
|
||||
_sld.reset();
|
||||
|
||||
dispatch_e_menu (BAR_ITEM(1));
|
||||
|
||||
return TRUE;
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TRic_tab::destroy()
|
||||
@ -195,7 +188,7 @@ void TRic_tab::leggi_record_controllo()
|
||||
_record = _tras_file.record();
|
||||
}
|
||||
|
||||
bool TRic_tab::main_loop()
|
||||
void TRic_tab::main_loop()
|
||||
{
|
||||
int posiz;
|
||||
|
||||
@ -252,7 +245,7 @@ bool TRic_tab::main_loop()
|
||||
{
|
||||
if (_std == "")
|
||||
if (!controllo_pre_ricezione())
|
||||
return FALSE;
|
||||
return;
|
||||
|
||||
apri_file_temp();
|
||||
|
||||
@ -296,8 +289,6 @@ bool TRic_tab::main_loop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TRic_tab::trasferimento()
|
||||
@ -1744,28 +1735,28 @@ void TRic_tab::apri_file_temp()
|
||||
tmpcaus << "\\" << TEMP_CAUS;
|
||||
_tmpcaus = tmpcaus.mid(1);
|
||||
_tmpcaus << ".dbf";
|
||||
if(fexist(_tmpcaus))
|
||||
if(_tmpcaus.exist())
|
||||
_tcaus = new TIsamtempfile(LF_CAUSALI, tmpcaus, 0);
|
||||
TString80 tmprcaus = "%";
|
||||
tmprcaus << get_firm_dir();
|
||||
tmprcaus << "\\" << TEMP_RCAUS;
|
||||
_tmprcaus = tmprcaus.mid(1);
|
||||
_tmprcaus << ".dbf";
|
||||
if (fexist(_tmprcaus))
|
||||
if (_tmprcaus.exist())
|
||||
_trcaus = new TIsamtempfile(LF_RCAUSALI, tmprcaus, 0);
|
||||
TString80 tmpclifo = "%";
|
||||
tmpclifo << get_firm_dir();
|
||||
tmpclifo << "\\" << TEMP_CLIFO;
|
||||
_tmpclifo = tmpclifo.mid(1);
|
||||
_tmpclifo << ".dbf";
|
||||
if (fexist(_tmpclifo))
|
||||
if (_tmpclifo.exist())
|
||||
_tclifo = new TIsamtempfile(LF_CLIFO, tmpclifo, 0);
|
||||
TString80 tmppcon = "%";
|
||||
tmppcon << get_firm_dir();
|
||||
tmppcon << "\\" << TEMP_PCON;
|
||||
_tmpcon = tmppcon.mid(1);
|
||||
_tmpcon << ".dbf";
|
||||
if (fexist(_tmpcon))
|
||||
if (_tmpcon.exist())
|
||||
_tpcon = new TIsamtempfile(LF_PCON, tmppcon, 0);
|
||||
}
|
||||
else
|
||||
@ -1775,49 +1766,49 @@ void TRic_tab::apri_file_temp()
|
||||
tmpmov << "\\" << TEMP_MOV;
|
||||
_tmpmov = tmpmov.mid(1);
|
||||
_tmpmov << ".dbf";
|
||||
if (fexist(_tmpmov))
|
||||
if (_tmpmov.exist())
|
||||
_tmov = new TIsamtempfile(LF_MOV, tmpmov, 0);
|
||||
TString80 tmprmov = "%";
|
||||
tmprmov << get_firm_dir();
|
||||
tmprmov << "\\" << TEMP_RMOV;
|
||||
_tmprmov = tmprmov.mid(1);
|
||||
_tmprmov << ".dbf";
|
||||
if (fexist(_tmprmov))
|
||||
if (_tmprmov.exist())
|
||||
_trmov = new TIsamtempfile(LF_RMOV, tmprmov, 0);
|
||||
TString80 tmpriva = "%";
|
||||
tmpriva << get_firm_dir();
|
||||
tmpriva << "\\" << TEMP_RMOVIVA;
|
||||
_tmpriva = tmpriva.mid(1);
|
||||
_tmpriva << ".dbf";
|
||||
if (fexist(_tmpriva))
|
||||
if (_tmpriva.exist())
|
||||
_triva = new TIsamtempfile(LF_RMOVIVA, tmpriva, 0);
|
||||
TString80 tmpoccas = "%";
|
||||
tmpoccas << get_firm_dir();
|
||||
tmpoccas << "\\" << TEMP_OCC;
|
||||
_tmpoccas = tmpoccas.mid(1);
|
||||
_tmpoccas << ".dbf";
|
||||
if (fexist(_tmpoccas))
|
||||
if (_tmpoccas.exist())
|
||||
_toccas = new TIsamtempfile(LF_OCCAS, tmpoccas, 0);
|
||||
TString80 tmppart = "%";
|
||||
tmppart << get_firm_dir();
|
||||
tmppart << "\\" << TEMP_PART;
|
||||
_tmppart = tmppart.mid(1);
|
||||
_tmppart << ".dbf";
|
||||
if (fexist(_tmppart))
|
||||
if (_tmppart.exist())
|
||||
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, 0);
|
||||
TString80 tmpscad = "%";
|
||||
tmpscad << get_firm_dir();
|
||||
tmpscad << "\\" << TEMP_SCAD;
|
||||
_tmpscad = tmpscad.mid(1);
|
||||
_tmpscad << ".dbf";
|
||||
if (fexist(_tmpscad))
|
||||
if (_tmpscad.exist())
|
||||
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, 0);
|
||||
TString80 tmppagsca = "%";
|
||||
tmppagsca << get_firm_dir();
|
||||
tmppagsca << "\\" << TEMP_PAGSCA;
|
||||
_tmppagsca = tmppagsca.mid(1);
|
||||
_tmppagsca << ".dbf";
|
||||
if (fexist(_tmppagsca))
|
||||
if (_tmppagsca.exist())
|
||||
_tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, 0);
|
||||
}
|
||||
}
|
||||
@ -1826,41 +1817,34 @@ void TRic_tab::chiudi_file_temp()
|
||||
{
|
||||
if (_scelta == 'T')
|
||||
{
|
||||
if (fexist(_tmpcaus))
|
||||
if (_tmpcaus.exist())
|
||||
delete _tcaus;
|
||||
if (fexist(_tmprcaus))
|
||||
if (_tmprcaus.exist())
|
||||
delete _trcaus;
|
||||
if (fexist(_tmpclifo))
|
||||
if (_tmpclifo.exist())
|
||||
delete _tclifo;
|
||||
if (fexist(_tmpcon))
|
||||
if (_tmpcon.exist())
|
||||
delete _tpcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fexist(_tmpmov))
|
||||
if (_tmpmov.exist())
|
||||
delete _tmov;
|
||||
if (fexist(_tmprmov))
|
||||
if (_tmprmov.exist())
|
||||
delete _trmov;
|
||||
if (fexist(_tmpriva))
|
||||
if (_tmpriva.exist())
|
||||
delete _triva;
|
||||
if (fexist(_tmpoccas))
|
||||
if (_tmpoccas.exist())
|
||||
delete _toccas;
|
||||
if (fexist(_tmppart))
|
||||
if (_tmppart.exist())
|
||||
delete _tpart;
|
||||
if (fexist(_tmpscad))
|
||||
if (_tmpscad.exist())
|
||||
delete _tscad;
|
||||
if (fexist(_tmppagsca))
|
||||
if (_tmppagsca.exist())
|
||||
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[])
|
||||
{
|
||||
char p3 = '\0';
|
||||
|
@ -19,7 +19,7 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_LISTA 34
|
||||
RADIOBUTTON F_LISTA 38
|
||||
BEGIN
|
||||
PROMPT 2 4 "Scelta controllo "
|
||||
HELP "Indicare il tipo di controllo"
|
||||
@ -67,12 +67,12 @@ BEGIN
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
@ -4,20 +4,20 @@ TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON DLG_SAVEREC 10 2
|
||||
BEGIN
|
||||
PROMPT -15 -1 "~Registra"
|
||||
PROMPT -13 -1 "~Registra"
|
||||
MESSAGE EXIT,K_SAVE
|
||||
PICTURE BMP_SAVEREC
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -45 -1 ""
|
||||
PROMPT -23 -1 ""
|
||||
MESSAGE EXIT,K_ESC
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -55 -1 ""
|
||||
PROMPT -33 -1 ""
|
||||
MESSAGE EXIT,K_QUIT
|
||||
END
|
||||
|
||||
|
@ -1542,7 +1542,8 @@ bool TVar_sc::datasoll_handler(TMask_field& f, KEY k)
|
||||
TString datasoll (f.get());
|
||||
datasoll.trim();
|
||||
|
||||
if (datasoll.empty) return TRUE;
|
||||
if (datasoll.empty())
|
||||
return TRUE;
|
||||
|
||||
if (!(TDate::isdate(datasoll)))
|
||||
return f.warning_box("Data sollecito errata");
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <os_dep.h>
|
||||
#include <progind.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <progind.h>
|
||||
|
||||
#include "cg6900.h"
|
||||
#include "cg6900a.h"
|
||||
#include <math.h>
|
||||
|
||||
bool TInv_cont::invio_contabilita_PC()
|
||||
{
|
||||
|
@ -16,8 +16,8 @@
|
||||
const int size = 256; //Lunghezza del record del TRASFER
|
||||
const int sizeH = 1024; //Lunghezza del record dell'HEADER
|
||||
|
||||
const char* tracciato_AS = "cgtrc.ini";
|
||||
const char* tracciato_PC = "cgtrcpc.ini";
|
||||
const char* const tracciato_AS = "cgtrc.ini";
|
||||
const char* const tracciato_PC = "cgtrcpc.ini";
|
||||
|
||||
const int RIC_SIZE = 512;
|
||||
|
||||
@ -144,7 +144,7 @@ void setdec(char * s,int dec)
|
||||
}
|
||||
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';
|
||||
}
|
||||
return;
|
||||
@ -187,7 +187,7 @@ void setdec(char * s,int dec)
|
||||
}
|
||||
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';
|
||||
}
|
||||
}
|
||||
@ -324,11 +324,11 @@ TTransfer_file::TTransfer_file(char scelta)
|
||||
_numreg_piva = 0L;
|
||||
_scelta = scelta;
|
||||
_control_rec = new TFixed_string(__dep, LEN_REC_HEAD);
|
||||
|
||||
if (scelta == 'S')
|
||||
_trc.leggi_modulo(tracciato_AS);
|
||||
else
|
||||
if (scelta == 'P')
|
||||
_trc.leggi_modulo(tracciato_PC);
|
||||
_trc.leggi_modulo(tracciato_PC);
|
||||
|
||||
_npoccas = 0L;
|
||||
}
|
||||
@ -424,11 +424,12 @@ void TTransfer_file::remove_all(bool file_ditta)
|
||||
}
|
||||
if (sigla == 'A')
|
||||
{
|
||||
TString80 path;
|
||||
path << dir << "\\tclifo.dbf";
|
||||
TFilename path(dir);
|
||||
path.add("tclifo.dbf");
|
||||
::remove(path);
|
||||
path = "";
|
||||
path << dir << "\\tclifo.cdx";
|
||||
path.ext("cdx");
|
||||
::remove(path);
|
||||
path.ext("fpt");
|
||||
::remove(path);
|
||||
}
|
||||
if (sigla == 'P')
|
||||
@ -5048,11 +5049,10 @@ void TTransfer_file::write_pagsca(TString& record)
|
||||
// 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;
|
||||
|
||||
TScanner s(tracciato);
|
||||
while (s.ok())
|
||||
{
|
||||
const TString& line = s.line();
|
||||
@ -5064,10 +5064,8 @@ void TMappa_trc::leggi_modulo(const char* tracciato)
|
||||
key.format("%2s%d", (const char*)sigla,numrec);
|
||||
|
||||
add(key, record);
|
||||
}
|
||||
#ifdef DBG
|
||||
long item = items();
|
||||
#endif
|
||||
}
|
||||
return items() > 0;
|
||||
}
|
||||
|
||||
int TMappa_trc::from(const char* key)
|
||||
|
12
cg/cglib04.h
12
cg/cglib04.h
@ -8,7 +8,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef __PROGIND_H
|
||||
#include <progind.h>
|
||||
class TProgind;
|
||||
#endif
|
||||
|
||||
#include <mov.h>
|
||||
@ -99,13 +99,14 @@ class TRic_recfield : public TObject
|
||||
TRectype& record() const { return *_rec;} // Ritorna puntatore a inizio record
|
||||
|
||||
TRic_recfield(TRectype& rec, const char* name, int from = 0, int len = 0);
|
||||
virtual ~TRic_recfield() {}
|
||||
};
|
||||
|
||||
|
||||
class TMappa_trc : public TAssoc_array
|
||||
{
|
||||
public :
|
||||
void leggi_modulo(const char* tracciato);
|
||||
public :
|
||||
bool leggi_modulo(const char* tracciato);
|
||||
|
||||
int from (const char* key);
|
||||
int to (const char* key);
|
||||
@ -115,6 +116,7 @@ class TMappa_trc : public TAssoc_array
|
||||
int flag_bis (const char* key);
|
||||
|
||||
TMappa_trc() {};
|
||||
virtual ~TMappa_trc() {}
|
||||
};
|
||||
|
||||
class TTransfer_file
|
||||
@ -179,8 +181,8 @@ class TTransfer_file
|
||||
TString _nrec_file;
|
||||
TString _ult_file;
|
||||
TString _key;
|
||||
TString80 _tmpcaus,_tmprcaus,_tmpclifo,_tmppcon,_tmpmov;
|
||||
TString80 _tmprmov,_tmprmoviva,_tmppart,_tmpscad,_tmppagsca;
|
||||
TFilename _tmpcaus,_tmprcaus,_tmpclifo,_tmppcon,_tmpmov;
|
||||
TFilename _tmprmov,_tmprmoviva,_tmppart,_tmpscad,_tmppagsca;
|
||||
TString _recprec;
|
||||
|
||||
long _SCAnreg,_SCAnreg_p;
|
||||
|
Loading…
x
Reference in New Issue
Block a user