Patch level : 4.0 649

Ricompilazione Demo : [ ]
Commento            :

Riportata la versione 3.1 patch 848


git-svn-id: svn://10.65.10.50/trunk@14996 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2007-03-07 10:11:15 +00:00
parent acd1fe2dac
commit d17fef3cf2
43 changed files with 576 additions and 3954 deletions

View File

@ -71,7 +71,7 @@ protected:
virtual TRelation* get_relation() const { return _rel; }
virtual TMask* get_mask(int mode) { return _msk; }
virtual bool changing_mask(int mode) {return FALSE; }
virtual bool changing_mask(int mode) {return false; }
virtual bool remove();
void init_mask(TMask&);
@ -277,7 +277,7 @@ bool TCaus_app::m770_hndl (TMask_field& f, KEY k)
{
if (k == K_TAB && f.focusdirty())
app().fill_sheet(f.mask());
return TRUE;
return true;
}
void TCaus_app::set_reg_filter(int f)
@ -294,31 +294,30 @@ void TCaus_app::set_reg_filter(int f)
int TCaus_app::calc_filter(const TString& tpd)
{
const TRectype & tpd_rec = cache().get("%TPD", tpd);
int filtro = 0;
if (!tpd_rec.empty())
if (tpd.full())
{
const TipoIVA i = (TipoIVA)tpd_rec.get_int("I0"); // IVA acquisti, vendite, generica
const bool corrisp = tpd_rec.get_bool("B0");
if (i == iva_vendite) // vendite
const TRectype& tpd_rec = cache().get("%TPD", tpd);
if (!tpd_rec.empty())
{
if (corrisp) // vendite con corrispettivi
filtro = 2;
else // vendite senza corrispettivi
filtro = 1;
} else
if ( i == iva_acquisti ) // acquisti
filtro = 3;
else
if ( i == 9 ) // sia acquisti che vendite
const TipoIVA i = (TipoIVA)tpd_rec.get_int("I0"); // IVA acquisti, vendite, generica
if (i == iva_vendite) // vendite
{
const bool corrisp = tpd_rec.get_bool("B0"); // vendite con corrispettivi?
filtro = corrisp ? 2 : 1;
}
else
{
if (i == iva_acquisti) // acquisti
filtro = 3; else
if (i == iva_generica) // sia acquisti sia vendite
filtro = 4;
}
}
}
set_reg_filter(filtro);
return filtro;
}
@ -357,18 +356,18 @@ bool TCaus_app::tipodoc_hndl (TMask_field& f, KEY k)
// Ma davvero esiste il registro ?
const TString& codreg = field_reg.get();
if (codreg.not_empty())
if (codreg.full())
{
TRegistro registro(codreg, app().anno_iva());
if (registro.name().empty())
return f.error_box(FR("Non esiste il registro %s per l'anno %d"),
(const char *)codreg, app().anno_iva());
(const char*)codreg, app().anno_iva());
}
app().mostra_campi();
app().fill_sheet(m);
}
return TRUE;
return true;
}
bool TCaus_app::tipomov_hndl (TMask_field& f, KEY k)
@ -379,7 +378,7 @@ bool TCaus_app::tipomov_hndl (TMask_field& f, KEY k)
if (f.focusdirty())
app().fill_sheet(f.mask());
}
return TRUE;
return true;
}
bool TCaus_app::mostra_campi()
@ -395,7 +394,8 @@ bool TCaus_app::mostra_campi()
m.hide(F_OP_INTRACOM);
m.hide(F_VALINTRA);
m.hide(F_COD_CAUS_IM);
m.hide(F_COD_CAUS_IM);
m.hide(F_CODCAUREG);
const int tpm = m.get_int(F_TIPO_MOV);
switch (tpm)
@ -426,6 +426,7 @@ bool TCaus_app::mostra_campi()
m.enable(F_MOV_VALU, valuta());
m.show(F_COD_CAUS_IM);
m.enable(F_COD_CAUS_IM, !saldaconto());
m.show(F_CODCAUREG);
m.show(F_AUTO_FAT);
m.show(F_ALLEGAT);
@ -434,7 +435,7 @@ bool TCaus_app::mostra_campi()
m.show(F_OP_INTRACOM);
m.show(F_VALINTRA);
}
return TRUE;
return true;
}
bool TCaus_app::cod_reg_hndl (TMask_field& f, KEY k)
@ -442,8 +443,9 @@ bool TCaus_app::cod_reg_hndl (TMask_field& f, KEY k)
if (k == K_TAB)
{
app().mostra_campi();
if (f.focusdirty()) app().fill_sheet(f.mask());
return TRUE;
if (f.focusdirty())
app().fill_sheet(f.mask());
return true;
}
// controllo di consistenza tra codice (tipo) registro e tipo documento
@ -468,7 +470,7 @@ bool TCaus_app::cod_reg_hndl (TMask_field& f, KEY k)
}
}
}
return TRUE;
return true;
}
@ -478,16 +480,16 @@ bool TCaus_app::cod_reg_hndl (TMask_field& f, KEY k)
bool TCaus_app::ss_notify(TSheet_field& s, int r, KEY k)
{
static bool selecting = FALSE;
static bool selecting = false;
switch(k)
{
case K_TAB:
if (!selecting && s.row(r).get_char(1) <= ' ') // riga azzerata
{
selecting = TRUE;
s.select(r, 1, FALSE); // Vado alla prima colonna delle righe vuote
selecting = FALSE;
selecting = true;
s.select(r, 1, false); // Vado alla prima colonna delle righe vuote
selecting = false;
}
break;
case K_ENTER:
@ -497,7 +499,7 @@ bool TCaus_app::ss_notify(TSheet_field& s, int r, KEY k)
default:
break;
}
return TRUE;
return true;
}
@ -516,7 +518,7 @@ bool TCaus_app::sezione_hndl(TMask_field& f, KEY k)
// f.reset();
}
return TRUE;
return true;
}
bool TCaus_app::conto_hndl (TMask_field& f, KEY k)
@ -558,7 +560,7 @@ bool TCaus_app::conto_hndl (TMask_field& f, KEY k)
TMask_field& cfld = f.mask().field(SS_TIPOCF);
const char cf = toupper(cfld.get()[0]);
bool ok = TRUE;
bool ok = true;
if (riga == 0 || riga == 8)
{
ok = cf != scarta;
@ -590,7 +592,7 @@ bool TCaus_app::conto_hndl (TMask_field& f, KEY k)
}
}
return TRUE;
return true;
}
// 1. Se specifico il sottoconto devono essere non vuoti gruppo e conto
@ -603,7 +605,7 @@ bool TCaus_app::sottoconto_hndl(TMask_field& f, KEY k)
const bool ok = m.get(SS_GRUPPO).not_empty() && m.get(SS_CONTO).not_empty();
if (!ok) return f.error_box(TR("Conto incompleto"));
}
return TRUE;
return true;
}
@ -611,14 +613,14 @@ void TCaus_app::compila_array(const TString& tpd, int tpm, int tpr, int m770)
{
if (tpd.empty() || tpd == "IN" || tpd == "AN" || tpd == "PG")
{
bool canc = TRUE;
bool canc = true;
switch (tpm)
{
case 0:
if (m770 == 6)
{
causale_ritenute();
canc = FALSE;
canc = false;
}
break;
case 3:
@ -627,7 +629,7 @@ void TCaus_app::compila_array(const TString& tpd, int tpm, int tpr, int m770)
if (saldaconto())
{
causale_inc_pag();
canc = FALSE;
canc = false;
};
break;
default:
@ -688,20 +690,22 @@ void TCaus_app::add_riga(int numrig, char sz, const TBill& tc, const TString& d,
void TCaus_app::load_rcaus(TMask& m)
{
const TString4 cod(_rel->curr().get(RCA_CODCAUS));
TString d, da(50);
ss().destroy();
const int last = _rcaus_rec->last_row();
for (int i = 1; i <= last; i++)
{
const TRectype & r = _rcaus_rec->row(i, TRUE);
const TRectype & r = _rcaus_rec->row(i, true);
const char sz = r.get_char(RCA_SEZIONE);
const char cf = r.get_char(RCA_TIPOCF);
const int g = r.get_int(RCA_GRUPPO);
const int c = r.get_int(RCA_CONTO);
const long s = r.get_long(RCA_SOTTOCONTO);
const TString8 d = r.get(RCA_CODDESC);
const TString& da = cache().get("%DPN", d, "S0");
d = r.get(RCA_CODDESC);
da = cache().get("%DPN", d, "S0");
const TBill tc(g,c,s,cf);
add_riga(i-1, sz, tc, d, da);
}
@ -710,37 +714,36 @@ void TCaus_app::load_rcaus(TMask& m)
bool TCaus_app::fill_sheet(TMask& m)
{
const TString8 codreg = m.get(F_COD_REG);
const TString8 tpd = m.get(F_TIPO_DOC);
const TString4 codreg = m.get(F_COD_REG);
const TString4 tpd = m.get(F_TIPO_DOC);
const int tpm = m.get_int(F_TIPO_MOV);
const int m770 = m.get_int(F_M_770);
int tpr = m.get_int(F_TIPO_REG);
if (!m.is_running())
{
TString16 chiave; chiave << anno_iva() << codreg;
const TRectype & reg = cache().get("REG", chiave);
TString8 chiave; chiave << anno_iva() << codreg;
const TRectype& reg = cache().get("REG", chiave);
tpr = reg.get_int("I0");
}
// carico le descrizioni fisse nell'array Righe_rcaus
compila_array(tpd,tpm,tpr,m770);
return TRUE;
return true;
}
int TCaus_app::write(const TMask& m)
{
int err = TRelation_application::write(m);
if (err == NOERR)
err = re_write(m, FALSE);
err = re_write(m, false);
return err;
}
int TCaus_app::rewrite(const TMask& m)
{
int err = re_write(m, TRUE);
int err = re_write(m, true);
int err1 = TRelation_application::rewrite(m);
return err == NOERR ? err1 : err;
}
@ -758,7 +761,7 @@ int TCaus_app::re_write(const TMask& m, bool re)
const char sezione = riga.get_char(1);
if (g > 0 || sezione > ' ')
{
TRectype & r = _rcaus_rec->row(i+1, TRUE);
TRectype & r = _rcaus_rec->row(i+1, true);
const char sezione = riga.get_char(1);
const char tipo_cf = riga.get_char();
const int c = riga.get_int(4);
@ -893,7 +896,7 @@ bool TCaus_app::user_create()
_rel = new TRelation (LF_CAUSALI);
_rcaus_rec = new TRecord_array(LF_RCAUSALI, RCA_NRIGA);
_msk = new TMask("cg0500a");
_sheet = &(TSheet_field&)_msk->field(F_SHEET_GCS);
_sheet = &_msk->sfield(F_SHEET_GCS);
_msk->set_handler(F_TIPO_DOC, tipodoc_hndl);
_msk->set_handler(F_COD_REG, cod_reg_hndl);
@ -907,7 +910,7 @@ bool TCaus_app::user_create()
cs.sheet_mask().set_handler(SS_SOTTOCONTO+100, sottoconto_hndl);
cs.sheet_mask().set_handler(SS_SOTTOCONTO+200, sottoconto_hndl);
return TRUE;
return true;
}
bool TCaus_app::user_destroy()
@ -916,7 +919,7 @@ bool TCaus_app::user_destroy()
delete _rcaus_rec;
delete _rel;
return TRUE;
return true;
}
int cg0500(int argc, char* argv[])

View File

@ -19,21 +19,22 @@
#define F_COLL_CESP 116
#define F_M_770 117
#define F_COLL_PRIMANOTA 118
#define F_SHEET_GCS 201
#define F_TIPO_REG 120
#define F_ANNOES 121
#define F_TIPO_MOV 122
#define F_SHEET_GCS 201
#define F_TIPO_REG 120
#define F_ANNOES 121
#define F_TIPO_MOV 122
#define F_OP_FINE_ANNO 123
#define F_VALINTRA 124
#define F_CORRISP 125
#define F_COD_CAUS2 126
#define F_DESCR2 127
#define F_DES_DOC 128
#define F_DES_REG 129
#define F_MOVIND 130
#define F_SOLAIVA 131
#define F_PROVV 132
#define F_VALINTRA 124
#define F_CORRISP 125
#define F_COD_CAUS2 126
#define F_DESCR2 127
#define F_DES_DOC 128
#define F_DES_REG 129
#define F_MOVIND 130
#define F_SOLAIVA 131
#define F_PROVV 132
#define F_CODCAUREG 133
#define SS_SEZIONE 102
#define SS_TIPOCF 103
#define SS_GRUPPO 104

View File

@ -89,16 +89,16 @@ END
STRING F_COD_REG 3
BEGIN
PROMPT 2 4 "Cod. registro "
PROMPT 2 4 "Registro "
FIELD REG
USE REG
INPUT CODTAB[1,4] F_ANNOES
INPUT CODTAB[5,7] F_COD_REG
DISPLAY "Anno" CODTAB[1,4]
DISPLAY "Codice registro " CODTAB[5,7]
DISPLAY "Registro" CODTAB[5,7]
DISPLAY "Tipo" I0
DISPLAY "Corrispettivi" B0
DISPLAY "Descrizione @50" S0
DISPLAY "Descrizione@50" S0
OUTPUT F_COD_REG CODTAB[5,7]
OUTPUT F_TIPO_REG I0
OUTPUT F_CORRISP B0
@ -303,8 +303,6 @@ BEGIN
ITEM "C|Cespiti"
END
LIST F_OP_FINE_ANNO 1 11
BEGIN
PROMPT 2 14 "Operazioni di fine anno "
@ -356,6 +354,21 @@ BEGIN
FIELD MOVIND
END
STRING F_CODCAUREG 3
BEGIN
PROMPT 2 18 "Codice causale regolarizzazione IVA "
FLAGS "UZ"
FIELD CODCAUREG
USE LF_CAUSALI SELECT SOLOIVA="X"
INPUT CODCAUS F_CODCAUREG
DISPLAY "Codice" CODCAUS
DISPLAY "Descrizione@50" DESCR
DISPLAY "Registro" REG
DISPLAY "Documento" TIPODOC
OUTPUT F_CODCAUREG CODCAUS
CHECKTYPE NORMAL
END
ENDPAGE
ENDMASK

View File

@ -51,31 +51,50 @@ void TAgg_codes::calcola_codes()
for (mov.first(); !mov.eof() && err == NOERR; mov.next())
{
bool mod = false;
p.addstatus(1);
data=mov.get_date(MOV_DATACOMP);
const int codes = mov.get_int(MOV_ANNOES);
int codes = mov.get_int(MOV_ANNOES);
const int newcodes = esercizi.date2esc(data);
if (codes != newcodes)
{
mov.put(MOV_ANNOES,newcodes);
err = mov.rewrite();
const long numreg = mov.get_long(MOV_NUMREG);
riga.put(RMV_NUMREG,numreg);
rigaiva.put(RMI_NUMREG,numreg);
righe.read(riga);
righeiva.read(rigaiva);
righe.renum_key(RMV_ANNOES,newcodes);
s_codes.format("%04d",newcodes);
righeiva.renum_key(RMI_ANNOES,s_codes);
if (err == NOERR)
{
err = righe.rewrite();
if (err == NOERR)
err = righeiva.rewrite();
if (err == NOERR)
modified_recs++;
}
mod = err == NOERR;
}
const long numreg = mov.get_long(MOV_NUMREG);
riga.put(RMV_NUMREG,numreg);
righe.read(riga);
bool update_es = false;
for(int i = righe.first_row() ; !update_es && i <= righe.last_row(); i = righe.succ_row(i))
{
codes = righe[i].get_int(RMV_ANNOES);
update_es = (codes != newcodes);
}
if (update_es)
{
righe.renum_key(RMV_ANNOES,newcodes);
err = righe.rewrite();
mod = err == NOERR;
}
rigaiva.put(RMI_NUMREG,numreg);
righeiva.read(rigaiva);
update_es = false;
for(int j = righeiva.first_row() ; !update_es && j <= righeiva.last_row(); j = righeiva.succ_row(j))
{
codes = righeiva[j].get_int(RMI_ANNOES);
update_es = (codes != newcodes);
}
if (update_es)
{
s_codes.format("%04d",newcodes);
righeiva.renum_key(RMI_ANNOES,s_codes);
err = righeiva.rewrite();
mod = err == NOERR;
}
if (mod)
modified_recs++;
}
if (err != NOERR)
warning_box(FR("Aggiornamento codice esercizio interrotta. Rilevato errore %d in riscrittura"),err);

View File

@ -1,33 +1,31 @@
#include <config.h>
#include "cg2102.h"
#include "cg21sld.h"
#include "cgpagame.h"
#include "../in/inlib01.h"
#include <execp.h>
#include <mailbox.h>
#include <modaut.h>
#include <msksheet.h>
#include <urldefid.h>
#include <utility.h>
#include "cgpagame.h"
#include <causali.h>
#include "cg2100.h"
#include "cg2102.h"
#include "cg21sld.h"
#include "../in/inlib01.h"
// Nomi dei campi
// Campi su file
#include <clifo.h>
#include <cfven.h>
#include <rcausali.h>
#include "../ca/movana.h"
// Campi su maschera
#include "cg2100.h"
///////////////////////////////////////////////////////////
// Dati incasso immediato
///////////////////////////////////////////////////////////
class TDati_incasso : public TObject
class TDati_mov_auto : public TObject
{
public:
int _step;
TString4 _causale;
int _tipo, _step;
TString4 _causale, _codiva;
TBill _clifo;
TDate _datadoc;
TString8 _numdoc;
@ -42,7 +40,7 @@ public:
TPrimanota_application::TPrimanota_application()
: _rel(NULL), _mode(0), _iva(nessuna_iva), _causale(NULL), _giornale(NULL),
_lastreg(0), _last_dreg(TODAY), _last_dcom(TODAY), _incasso(NULL), _swap_mask(false)
_lastreg(0), _last_dreg(TODAY), _last_dcom(TODAY), _automatico(NULL), _swap_mask(false)
{
memset(_msk, 0, sizeof(_msk));
}
@ -184,7 +182,7 @@ bool TPrimanota_application::user_create()
open_files(LF_MOV, LF_RMOV, LF_RMOVIVA, LF_SALDI, 0);
open_files(LF_PARTITE, LF_SCADENZE, LF_PAGSCA, LF_AGENTI, 0);
_incasso = new TDati_incasso;
_automatico = new TDati_mov_auto;
_rel = new TMovimentoPN;
_rel->add(LF_PARTITE, "NREG=NUMREG", 2); // Collega la partita aperta dalla fattura
@ -210,7 +208,7 @@ bool TPrimanota_application::user_create()
bool TPrimanota_application::save_and_new() const
{
return _savenew || _incasso->_step == 1;
return _savenew || _automatico->_step == 1;
}
bool TPrimanota_application::user_destroy()
@ -224,7 +222,7 @@ bool TPrimanota_application::user_destroy()
delete _causale;
delete _rel;
delete _incasso;
delete _automatico;
return true;
}
@ -588,7 +586,7 @@ void TPrimanota_application::init_query_mode(TMask& m)
m.set(F_DATAREG, _last_dreg);
}
_incasso->_step = 0; // Azzera flag di incasso immediato
_automatico->_step = 0; // Azzera flag di incasso immediato
TFilename tmp;
if (get_mask_swap_file(tmp))
@ -636,17 +634,17 @@ bool TPrimanota_application::get_next_key(TToken_string& tmp)
if (m.insert_mode())
{
tmp.add(F_CODCAUS); // Ricopia causale
switch (_incasso->_step)
switch (_automatico->_step)
{
case 1:
tmp.add(_incasso->_causale);
_msk[0]->set(F_CODCAUS, _incasso->_causale); // Joke get_mask
tmp.add(_automatico->_causale);
_msk[0]->set(F_CODCAUS, _automatico->_causale); // Joke get_mask
_iva = nessuna_iva; // Impedisce incremento del numero documento
break;
case 2:
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
tmp.add(_automatico->_causale_fattura);
_msk[0]->set(F_CODCAUS, _automatico->_causale_fattura); // Joke get_mask
_iva = _automatico->_iva_fattura; // Provoca incremento del numero documento
break;
default:
tmp.add(m.get(F_CODCAUS)); // Ultima causale usata
@ -708,8 +706,8 @@ void TPrimanota_application::init_insert_mode(TMask& m)
_saldi.reset(); // Inizializza saldi
if (_incasso->_step == 1)
genera_incasso(NULL);
if (_automatico->_step == 1)
genera_automatico(_automatico->_tipo, NULL);
else
m.reset(F_DATACOMP); // Azzera quasi sempre la data di competenza
// La preservo solo per l'incasso immediato
@ -1168,6 +1166,9 @@ int TPrimanota_application::write(const TMask& m)
if (iva() != nessuna_iva)
{
int tipauto = 0; // Tipo movimento automatico
TString4 causauto; // Possibile causale per incasso immediato
causale().reg().reread(); // Aggiorna protocollo IVA
if (is_saldaconto())
{
@ -1185,15 +1186,21 @@ int TPrimanota_application::write(const TMask& m)
}
else
{
// Genera incasso immediato se e' una fattura e non c'e' gestione saldaconto
if (!m.get_bool(F_SOLAIVA) && !gestione_saldaconto())
if (!m.get_bool(F_SOLAIVA) && !gestione_saldaconto())
{
const TString4 causimm(causale().causale_inc_imm());
if (causimm.not_empty())
genera_incasso(causimm);
causauto = causale().causale_inc_imm();
tipauto = causauto.full() ? 1 : 0;
}
}
if (iva() == iva_acquisti && tipauto <= 0)
{
// Genera regolarizzazione IVA acquisti
causauto = causale().causale_reg_iva();
tipauto = causauto.full() ? 2 : 0;
}
if (tipauto > 0 && causauto.full())
genera_automatico(tipauto, causauto);
}
else
{
@ -1300,46 +1307,80 @@ bool TPrimanota_application::remove()
// Gestione incasso immediato
///////////////////////////////////////////////////////////
void TPrimanota_application::genera_incasso(const char* causimm)
void TPrimanota_application::genera_automatico(int tipo, const char* causimm)
{
const TCausale& caus = causale();
TMask& m = curr_mask();
if (causimm)
if (causimm && *causimm) // Step 0
{
_incasso->_causale = causimm;
_incasso->_causale_fattura = m.get(F_CODCAUS);
_incasso->_iva_fattura = causale().iva();
_incasso->_datadoc = m.get(F_DATADOC);
_incasso->_numdoc = m.get(F_NUMDOC);
_incasso->_clifo.get(_rel->cg(0));
_incasso->_totale = m.get_real(F_TOTALE);
_incasso->_step = 1;
}
else
{
const TCausale& caus = causale();
m.set(F_DATADOC, _incasso->_datadoc);
m.set(F_NUMDOC, _incasso->_numdoc);
TBill contro; caus.bill(2, contro);
if (tipo > 0)
{
// Parte comune a tutti i movimenti automatici
_automatico->_tipo = tipo;
_automatico->_causale = causimm;
_automatico->_causale_fattura = m.get(F_CODCAUS);
_automatico->_iva_fattura = caus.iva();
_automatico->_datadoc = m.get(F_DATADOC);
_automatico->_numdoc = m.get(F_NUMDOC);
_automatico->_clifo.get(_rel->cg(0));
_automatico->_totale = m.get_real(F_TOTALE);
cgs().reset();
TToken_string& row1 = cgs().row(0);
TImporto imp(caus.sezione_clifo(), _incasso->_totale);
imp.add_to(row1, 0);
row1.add(_incasso->_clifo.string(0x3));
row1.add(" ");
row1.add(" ");
row1.add(contro.string(0x3));
// Solo regolarizzazioni IVA
if (_automatico->_tipo == 2)
{
_automatico->_totale += m.get_real(F_RITFIS);
_automatico->_codiva = m.get(F_CODIVA);
if (_automatico->_codiva.blank() && _rel->iva_items() > 0)
_automatico->_codiva = _rel->iva(0).get(RMI_CODIVA);
}
_automatico->_step = 1;
}
}
else // Step 1
{
m.set(F_DATADOC, _automatico->_datadoc);
m.set(F_NUMDOC, _automatico->_numdoc);
switch (_automatico->_tipo)
{
case 1:
{ // Incasso Immediato
TBill contro; caus.bill(2, contro);
cgs().reset();
TToken_string& row1 = cgs().row(0);
TImporto imp(caus.sezione_clifo(), _automatico->_totale);
imp.add_to(row1, 0);
row1.add(_automatico->_clifo.string(0x3));
row1.add(" ");
row1.add(" ");
row1.add(contro.string(0x3));
TToken_string& row2 = cgs().row(1);
imp.swap_section();
imp.add_to(row2, 0);
row2.add(contro.string(0x3));
row2.add(" ");
row2.add(caus.desc_agg(2));
row2.add(_incasso->_clifo.string(0x3));
_incasso->_step = 2;
fill_sheet(m);
TToken_string& row2 = cgs().row(1);
imp.swap_section();
imp.add_to(row2, 0);
row2.add(contro.string(0x3));
row2.add(" ");
row2.add(caus.desc_agg(2));
row2.add(_automatico->_clifo.string(0x3));
fill_sheet(m);
}
break;
case 2: // Regolarizzazione IVA
{
// Reperisce l'eventuale cliente associato al fornitore e lo propone
TString16 forn; forn.format("F|%ld", _automatico->_clifo.codclifo());
const TString& clnt = cache().get(LF_CFVEN, forn, CFV_CODCFASS);
m.set(F_CLIENTE, clnt);
m.set(F_TOTALE, _automatico->_totale); // Imposta il totale documento e ...
m.set(F_CODIVA, _automatico->_codiva, true); // ... scatena creazione prima riga IVA
}
break;
default:
break;
}
_automatico->_step = 2;
}
}
@ -1555,7 +1596,7 @@ HIDDEN void ini2bill(TConfig& ini, TBill& bil, bool contro)
HIDDEN bool set_not_empty(TMask& msk, int id, TConfig& ini, const char* var)
{
const TString& val = ini.get(var);
bool ok = val.not_empty();
bool ok = val.full();
if (ok)
msk.set(id, val);
return ok;
@ -1564,7 +1605,7 @@ HIDDEN bool set_not_empty(TMask& msk, int id, TConfig& ini, const char* var)
HIDDEN bool add_not_empty(TToken_string& str, int pos, TConfig& ini, const char* var)
{
const TString& val = ini.get(var);
bool ok = val.not_empty();
bool ok = val.full();
if (ok)
str.add(val, pos);
return ok;

View File

@ -367,13 +367,13 @@ BEGIN
CHECKTYPE NORMAL
END
STRING F_RICALTCLIENTE 21 18
STRING F_RICALTCLIENTE 30 18
BEGIN
PROMPT 54 11 "Alt. "
USE LF_CLIFO KEY 6
INPUT TIPOCF "C"
INPUT RICALT F_RICALTCLIENTE
DISPLAY "Codice alternativo@21" RICALT
DISPLAY "Codice alternativo@30" RICALT
DISPLAY "Ragione Sociale@50" RAGSOC
DISPLAY "Codice" CODCF
DISPLAY "Sospeso" SOSPESO
@ -385,13 +385,13 @@ BEGIN
GROUP 1
END
STRING F_RICALTFORNITORE 21 18
STRING F_RICALTFORNITORE 30 18
BEGIN
PROMPT 54 11 "Alt. "
USE LF_CLIFO KEY 6
INPUT TIPOCF "F"
INPUT RICALT F_RICALTFORNITORE
DISPLAY "Codice alternativo@21" RICALT
DISPLAY "Codice alternativo@30" RICALT
DISPLAY "Ragione Sociale@50" RAGSOC
DISPLAY "Codice" CODCF
DISPLAY "Sospeso" SOSPESO

View File

@ -224,6 +224,22 @@ int TMovimentoPN::registra(bool re, bool force)
}
}
r.put(RMI_TIPOATT, tipoatt);
const TString & indetr = r.get(RMI_TIPODET);
if (indetr.full())
{
const TRectype & det = cache().get("%DET", indetr);
if (!det.empty() && !det.get_bool("FPC"))
{
TTable tab("%DET");
tab.curr() = det;
tab.curr().put("FPC", "X");
tab.rewrite();
}
}
}
_iva.renum_key(MOV_NUMREG, numreg);

View File

@ -875,6 +875,10 @@ int TPrimanota_application::crea_somma_spese(TImporto& imp)
void TPrimanota_application::update_saldo_riga(int r)
{
TMask& m = curr_mask();
if (m.id2pos(F_SHEETCG) < 0)
return;
TSheet_field& sheet = m.sfield(F_SHEETCG);
TToken_string row = sheet.row(r);
TBill bill; bill.get(row, 2, 0x1);
@ -1735,13 +1739,13 @@ bool TPrimanota_application::iva_sottoconto_handler(TMask_field& f, KEY key)
{
const TEdit_field& e = (const TEdit_field&)f;
const TRectype& piano = e.browse()->cursor()->curr();
int spric = piano.get_int("TIPOSPRIC");
int spric = piano.get_int(PCN_TIPOSPRIC);
if (app().iva() == iva_vendite)
{
const TCausale& caus = app().causale();
if (spric == 2 || spric == 3)
{
const TCausale& caus = app().causale();
const TString& td = caus.tipo_doc();
if (td == "FV" || td == "NC" || td == "ND")
spric = 4;

View File

@ -25,7 +25,7 @@
#include "cg2103.h"
#endif
class TDati_incasso;
class TDati_mov_auto;
class TPrimanota_application : public TRelation_application
{
@ -65,7 +65,7 @@ class TPrimanota_application : public TRelation_application
TDate _last_dreg; // Ultima data registrazione inserita
TDate _last_dcom; // Ultima data competenza inserita
TDati_incasso* _incasso; // Dati per gestire incasso immediato
TDati_mov_auto* _automatico;// Dati per gestire incasso immediato
TBill _conto_ricavo; // Conto di ricavo del clifo
@ -185,7 +185,7 @@ protected: // TRelation_application
protected:
void check_saldi();
void genera_incasso(const char* causimm);
void genera_automatico(int tipo, const char* causimm); // 0=nessuno, 1=incasso, 2=regolarizzazione
void gioca_cambi(int force = 0x00);
TMask* load_mask(int n);

View File

@ -135,6 +135,9 @@ bool TCausale::soloiva() const
const TString& TCausale::causale_inc_imm() const
{ return _rec.get(CAU_CODCAUSIM); }
const TString& TCausale::causale_reg_iva() const
{ return _rec.get(CAU_CODCAUREG); }
const TString& TCausale::tipo_doc() const
{ return _rec.get(CAU_TIPODOC); }

View File

@ -40,6 +40,7 @@ public:
bool soloiva() const;
char provvisorio() const { return _provvisorio; }
const TString& causale_inc_imm() const;
const TString& causale_reg_iva() const;
const TString& tipo_doc() const;
TRegistro& reg() const { return (TRegistro&)_reg; }

View File

@ -392,12 +392,12 @@ BEGIN
GROUP 8
END
RADIOBUTTON F_NUMCARAT 1 30
RADIOBUTTON F_NUMCARAT 1 31
BEGIN
PROMPT 1 11 ""
ITEM "1|Stampa Nomale (132 crt.)"
ITEM "1|Stampa Normale (132 crt.)"
MESSAGE HIDE,F_SALDO_DES
ITEM "2|Stampa Estesa (198 crt.)"
ITEM "2|Stampa Estesa (198 crt.)"
MESSAGE SHOW,F_SALDO_DES
END

View File

@ -31,7 +31,7 @@ struct TRigaiva : public TObject
TString _codiva;
int _tipodet;
TRigaiva (const real& imponibile, const real& imposta, const char* codiva, int tipodet, const real& imponibilep, const real& impostap):
TRigaiva (const char* codiva, const real& imponibile, const real& imposta, int tipodet, const real& imponibilep, const real& impostap):
_imponibile(imponibile),_imposta(imposta),_codiva(codiva),_tipodet(tipodet),_imponibilep(imponibilep),_impostap(impostap)
{}
};

View File

@ -1,20 +1,21 @@
#include <xinclude.h>
#include "cg3.h"
#include "cglib01.h"
#include "cglib02.h"
#include "cg3600.h"
#include <applicat.h>
#include <colors.h>
#include <controls.h>
#include <execp.h>
#include <progind.h>
#include <recarray.h>
#include <relation.h>
#include <recset.h>
#include <urldefid.h>
#include <utility.h>
#include <varmask.h>
#include "cg3.h"
#include "cglib02.h"
#include "cg3600.h"
#include <causali.h>
#include <mov.h>
#include <pconti.h>
@ -533,17 +534,25 @@ bool TMastrino::expand(long rec)
bool TMastrino::collapse(long rec)
{
bool ok = true; // Posso eliminare?
if (row(rec).tipo() != riga_mastrino) // Se non sono su una riga mastrino ...
rec = pred(rec, riga_mastrino); // ... mi sposto sulla precedente riga mastrino
else
ok = !expandable(rec); // Controlla che sia possibile
if (ok) // Posso effetivamente procedere
{
rec++; // Elimino ogni riga contropartita successiva
while (rec < items() && row(rec).tipo() != riga_mastrino)
_riga.remove(rec);
if (rec < 0)
{
for (long i = last(); i >= 0; i = pred(i))
collapse(i);
}
else
{
if (row(rec).tipo() != riga_mastrino) // Se non sono su una riga mastrino ...
rec = pred(rec, riga_mastrino); // ... mi sposto sulla precedente riga mastrino
ok = !expandable(rec); // Controlla che sia possibile
if (ok) // Posso effetivamente procedere
{
rec++; // Elimino ogni riga contropartita successiva
while (rec < items() && row(rec).tipo() != riga_mastrino)
_riga.remove(rec);
}
}
return ok;
}
@ -573,6 +582,8 @@ public:
TString& operator = (const char* str) { return set(str); }
TString& operator = (const TString& str) { return set(str); }
XI_EVENT* event() { return _xiev; }
TGrid_cell(XI_EVENT* xiev);
virtual ~TGrid_cell() { }
};
@ -585,9 +596,9 @@ protected: // TMask_field
virtual bool parse_item(TScanner& scanner);
virtual word class_id() const;
public:
TGrid_control& grid() const { return (TGrid_control&)*_ctl; }
public:
virtual bool handler(XI_EVENT* xiev);
virtual long items() const;
virtual void cell_request(long rec, short id, TGrid_cell& cell);
@ -651,7 +662,6 @@ protected:
void set_columns_order(TToken_string* order);
XI_OBJ* find_column(short cid) const;
XI_OBJ* find_column(const char* head) const;
public:
@ -660,6 +670,7 @@ public:
int visible_rows() const;
XI_OBJ* find_column(short cid) const;
byte& column_type(int c) { CHECKD(c >= 0 && c < MAX_COL, "Bad column ", c); return _type[c]; }
void update(long n = -1);
@ -1579,10 +1590,8 @@ public:
TRow_mask* TColor_mask::_sheet_mask = NULL;
TRow_mask::TRow_mask()
: TMask("cg2100k", 1)
{
}
TRow_mask::TRow_mask() : TMask("cg2100k", 1)
{ }
void TRow_mask::update()
{
@ -1751,13 +1760,13 @@ class TMastrini_grid : public TGrid_field
protected: // TGrid_field
virtual bool on_record(long rec);
virtual void cell_request(long rec, short id, TGrid_cell& cell);
virtual void on_grid_button();
virtual bool on_resize_column(short id, int new_size);
void update_mask() const;
public:
virtual void cell_request(long rec, short id, TGrid_cell& cell);
virtual void on_dbl_cell(long rec, short id);
virtual void on_record_button(long rec);
virtual long items() const { return _mastrino.items(); }
@ -1809,7 +1818,20 @@ HIDDEN void set_imp(TMask_field& f, const TImporto& imp)
}
void TMastrini_grid::cell_request(long rec, short id, TGrid_cell& cell)
{
{
if (rec < 0) // testate
{
XI_OBJ* col = grid().find_column(short(1000+id%1000));
if (col != NULL)
{
TString head;
xi_get_text(col, head.get_buffer(), head.size());
cell = head;
}
return;
}
const TRiga_mastrino& riga = _mastrino[rec];
switch (id)
@ -2101,7 +2123,7 @@ void TMastrini_grid::update_mask() const
void TMastrini_grid::load_colors()
{
TConfig conf(CONFIG_USER, "cg3600b");
_mas_back = conf.get_color("ColorMB", NULL, -1, FOCUS_BACK_COLOR);
_mas_back = conf.get_color("ColorMB", NULL, -1, REQUIRED_BACK_COLOR);
_mas_fore = conf.get_color("ColorMF", NULL, -1, FOCUS_COLOR);
_con_back = conf.get_color("ColorCB", NULL, -1, NORMAL_BACK_COLOR);
_con_fore = conf.get_color("ColorCF", NULL, -1, NORMAL_COLOR);
@ -2126,6 +2148,150 @@ void TMastrini_grid::set_colors()
}
}
///////////////////////////////////////////////////////////
// TMastrino_set
///////////////////////////////////////////////////////////
class TMastrino_set : public TRecordset
{
TMastrini_grid& _grid;
long _curr;
TArray _info;
protected:
void add_field(TFieldtypes t, short id, int width, const char* name = NULL);
long cell_request(long rec, short column, TString& str) const;
public:
virtual TRecnotype items() const { return _grid.items(); }
virtual unsigned int columns() const { return _info.items(); }
virtual const TRecordset_column_info& column_info(unsigned int column) const;
virtual bool move_to(TRecnotype n);
virtual TRecnotype current_row() const { return _curr; }
virtual void requery() {}
virtual const TVariant& get(unsigned int column) const;
TMastrino_set(TMastrini_grid& g);
};
const TRecordset_column_info& TMastrino_set::column_info(unsigned int column) const
{
return (const TRecordset_column_info&)_info[column];
}
bool TMastrino_set::move_to(TRecnotype n)
{
const bool ok = n >= 0 && n < items();
_curr = n;
return ok;
}
long TMastrino_set::cell_request(long rec, short column, TString& str) const
{
XI_EVENT xiev; memset(&xiev, 0, sizeof(xiev));
xiev.type = XIE_CELL_REQUEST;
xiev.v.cell_request.s = str.get_buffer();
xiev.v.cell_request.len = str.size();
TGrid_cell cell(&xiev);
_grid.cell_request(rec, column, cell);
return xiev.v.cell_request.attrib;
}
const TVariant& TMastrino_set::get(unsigned int column) const
{
CHECK(_curr>=0 && _curr<items() && column>=0 && column< columns(), "Cella errata");
const TRecordset_column_info& info = column_info(column);
TString80 str;
cell_request(_curr, abs(info._pos), str);
if (str.full())
{
TVariant& tmp = get_tmp_var();
switch (info._type)
{
case _realfld:
tmp = real(real::ita2eng(str));
break;
case _longfld:
tmp = atol(str);
break;
case _datefld:
{
const int cr = str.find(' ');
if (cr >= 0)
{
if (info._pos > 0)
str.cut(cr);
else
str.ltrim(cr);
str.trim();
}
tmp = TDate(str);
}
break;
default:
if (info._width == 1)
tmp = str.right(1);
else
tmp = str;
break;
}
return tmp;
}
return NULL_VARIANT;
}
void TMastrino_set::add_field(TFieldtypes tipo, short id, int width, const char* name)
{
TRecordset_column_info* i = new TRecordset_column_info;
TString& n = i->_name;
if (name && *name)
n = name;
else
{
cell_request(-1, abs(id), n);
const int cr = n.find('\n');
if (cr > 0)
{
if (id > 0)
n.cut(cr);
else
n.ltrim(cr+1);
n.trim();
}
}
i->_type = tipo;
i->_pos = id;
i->_width = width;
_info.add(i);
}
TMastrino_set::TMastrino_set(TMastrini_grid& g)
: _grid(g), _curr(-1)
{
_grid.mastrino().collapse(-1);// Nascondo tutte le righe di contropartita
add_field(_datefld, 101, 10); // Data reg
add_field(_datefld,-101, 10); // Data comp
add_field(_alfafld, 102, 1); // Movimento di competenza?
add_field(_alfafld, 103, 25); // Causale
add_field(_alfafld, 104, 45); // Descrizione
add_field(_realfld, 105, 13); // Dare
add_field(_realfld, 106, 13); // Avere
add_field(_alfafld, 107, 7); // Num doc
add_field(_longfld,-107, 7); // Num prot
add_field(_realfld, 108, 13); // Saldo
add_field(_alfafld,-108, 1, "Sezione"); // Sezione
add_field(_realfld, 109, 13); // Saldo giornaliero
add_field(_alfafld,-109, 1, "Sezione"); // Sezione giornaliera
}
///////////////////////////////////////////////////////////
// TGrid_mask
///////////////////////////////////////////////////////////
@ -2141,6 +2307,7 @@ protected: // TMask
static bool link_handler(TMask_field& f, KEY k);
static bool new_handler(TMask_field& f, KEY k);
static bool edit_handler(TMask_field& f, KEY k);
public:
TMastrini_grid& grid() { CHECK(_grid, "What's grid?"); return *_grid; }
@ -2153,8 +2320,9 @@ TGrid_mask::TGrid_mask()
: _grid(NULL)
{
read_mask("cg3600b", 0, 0);
set_handler(DLG_LINK, link_handler);
set_handler(DLG_LINK, link_handler);
set_handler(DLG_NEWREC, new_handler);
set_handler(DLG_EDIT, edit_handler);
}
TMask_field* TGrid_mask::parse_field(TScanner& sc)
@ -2196,6 +2364,23 @@ bool TGrid_mask::new_handler(TMask_field& f, KEY k)
return true;
}
bool TGrid_mask::edit_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
TGrid_mask& gm = (TGrid_mask&)f.mask();
TMastrini_grid& grid = gm.grid();
TMastrino_set ms(grid);
TFilename n; n.tempdir(); n.add("mastrino.slk");
ms.save_as(n);
xvt_sys_goto_url(n, "open");
xvt_fsys_removefile(n);
}
return true;
}
bool TGrid_mask::on_key(KEY k)
{
long rec = grid().selected();
@ -2418,7 +2603,7 @@ void TQuery_mask::do_query(TGrid_mask& gm)
gm.run();
}
///////////////////////////////////////////////////////////
// TMastrini_video
///////////////////////////////////////////////////////////

View File

@ -4,20 +4,26 @@ TOOLBAR "" 0 -2 0 2
BUTTON DLG_LINK 10 2
BEGIN
PROMPT -13 -11 "Colle~ga"
PROMPT -14 -11 "Colle~ga"
PICTURE BMP_LINK
END
BUTTON DLG_NEWREC 10 2
BEGIN
PROMPT -23 -11 "~Nuovo"
PROMPT -24 -11 "~Nuovo"
PICTURE BMP_NEWREC
PICTURE BMP_NEWRECDN
END
BUTTON DLG_EDIT 10 2
BEGIN
PROMPT -34 -11 "~Edit"
PICTURE BMP_EDIT
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -11 ""
PROMPT -44 -11 ""
END
ENDPAGE

View File

@ -311,7 +311,8 @@ bool TParaliq_app::user_create()
_msk->set_handler(F_CODDITTA,ditta_handler);
_msk->set_handler(F_UTCR_IVA,utcred_handler);
_msk->sfield(F_SHEET_PLA).set_notify(sheet_action);
return TRUE;
return true;
}
bool TParaliq_app::user_destroy()

View File

@ -1,22 +0,0 @@
#include <xvt.h>
#include "cg7.h"
int main(int argc, char** argv)
{
const int op = argc < 2 ? 0 : argv[1][1]-'0';
switch (op)
{
case 1: cg7100(argc,argv); break; // Invio ad altra procedura (zucchetti)
case 2: cg7200(argc,argv); break; // Invio ad altra procedura (proforma)
case 3: cg7300(argc,argv); break; // Invio ad altra procedura (Sispac/Cosmo)
default: cg7100(argc,argv); break;
}
exit(0);
return 0;
}

View File

@ -1,22 +0,0 @@
#ifndef __CG7_H
#define __CG7_H
int cg7100(int argc, char** argv);
int cg7200(int argc, char** argv);
int cg7300(int argc, char** argv);
#endif // __CG7_H

View File

@ -1,626 +0,0 @@
#include <applicat.h>
#include <assoc.h>
#include <automask.h>
#include <currency.h>
#include <filetext.h>
#include <msksheet.h>
#include <printer.h>
#include <recarray.h>
#include <relation.h>
#include <sort.h>
#include <utility.h>
#include "cg7.h"
#include "cg7100a.h"
#include <clifo.h>
#include <mov.h>
#include <rmov.h>
#include <rmoviva.h>
#define ALIAS_REG 100
class TInvio_file: public TFile_text
{
protected:
virtual void validate(TCursor& cur,TRecord_text &rec, TToken_string &val, TString& str);
public:
TInvio_file(const TString& file_name);
virtual ~TInvio_file() { }
};
TInvio_file::TInvio_file(const TString& file_name)
: TFile_text(file_name, "zucchett.ini")
{
}
class TInvio_mask : public TAutomask
{
protected:
bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TInvio_mask();
virtual ~TInvio_mask(){};
};
TInvio_mask::TInvio_mask() :TAutomask ("cg7100a")
{
}
bool TInvio_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
{
case F_CODDITTA:
if (e==fe_init && o.empty())
{
set(F_CODDITTA, main_app().get_firm());
((TEdit_field&) o).check();
disable(F_CODDITTA);
}
break;
default:
break;
}
return TRUE;
}
class TInvio : public TSkeleton_application
{
TCursor* _cur;
TInvio_mask* _msk;
TInvio_file* _trasfile;
long _nrecords, _nrecsfattvend, _nrecsfattacqu, _nrecsmocontab;
int _nfiles;
long _nrecsdettaglio;
TString16 _descrdettaglio;
TDate _dataini, _datafin;
bool _totale, _finemov;
protected:
virtual bool create(void);
virtual bool destroy(void);
virtual void main_loop() ;
void invio_zucchetti();
long i_zucchetti_causali(const bool invio = TRUE);
long i_zucchetti_clifor(const bool invio = TRUE);
long i_zucchetti_conti(const bool invio = TRUE);
long i_zucchetti_movcont(const bool invio = TRUE);
long i_zucchetti_moviva(const char acqven, const bool invio = TRUE);
void i_zucchetti_testa_dettaglio(const TString16& descr, const long nrecs);
void i_zucchetti_coda_dettaglio(const TString16& descr, const long nrecs);
void i_zucchetti_testa();
void i_zucchetti_coda();
public:
int get_nfiles() {return _nfiles;};
long get_nrecords() {return _nrecords;};
long get_nrecsdettaglio() {return _nrecsdettaglio;};
TString16& get_descrdettaglio() {return _descrdettaglio;};
const bool totale() {return _totale;};
const bool finemov() {return _finemov;};
TInvio() {} ;
virtual ~TInvio() {} ;
};
// restituisce un riferimento all' applicazione
inline TInvio& app() { return (TInvio&) main_app();}
// gestione dei messaggi estesi nei campi
void TInvio_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TString& str)
{
const TString code(s.get(0));
TString valore;
if (code == "_FISSO")
{
// gestione dei campi fissi per i record delle riba
// sintassi: _FISSO,!<valore>
// dove: <valore> è la stringa fissa da emettere
TString in(s.get());
CHECK(in[0]=='!',"Macro _FISSO senza carattere '!'");
in.ltrim(1);
in.trim();
valore = in;
}
else if (code == "_ANNO")
{
TDate data(str);
int anno = data.year();
valore.format("%ld", anno);
}
else if (code == "_MESE")
{
TDate data(str);
int mese = data.month();
valore.format("%ld", mese);
}
else if (code == "_SEZIONE")
{
valore = str;
const char sezione = s.get()[0];
const char sezriga = cur.curr(LF_RMOV).get_char(RMV_SEZIONE);
if (sezione != sezriga)
valore = "";
}
else if (code == "_CAUSALE")
{
TFilename configname = "cg7100a.ini";
TConfig configfile(configname);
TToken_string causali = configfile.get("STANDARD", "CAUSALI");
const char sezione = cur.curr(LF_RMOV).get_char(RMV_SEZIONE);
if (sezione == 'D')
valore = causali.get(0);
else
valore = causali.get(1);
}
else if (code == "_NUMFILES")
{
const int nfiles = app().get_nfiles();
valore.format("%ld", nfiles);
}
else if (code == "_NUMRECORDS")
{
const long nrecords = app().get_nrecords();
valore.format("%ld", nrecords);
}
else if (code == "_NUMRECORDSDETTAGLIO")
{
const long nrecords = app().get_nrecsdettaglio();
valore.format("%ld", nrecords);
}
else if (code == "_TIPOFILE")
{
valore = app().get_descrdettaglio();
}
else if (code == "_OPZIONI")
{
TString in(s.get());
TFilename configname = "cg7100a.ini";
TConfig configfile(configname);
valore = configfile.get(in, "OPZIONI");
}
else if (code == "_OGGI")
{
TDate data(TODAY);
valore = data.string(full, '-', full, full, amg_date);
valore.strip("-");
}
else if (code == "_CODIFICA")
{
const char tipocf = str[0];
if (tipocf == 'C')
valore = "P";
else
valore = "R";
}
else if (code == "_NUMDOC")
{
if (cur.file("REG").get("I0") == 1)
valore = cur.curr().get(MOV_NUMDOC);
else
valore = cur.curr().get(MOV_PROTIVA);
}
else if (code == "_SEGNO")
{
TString archivio(s.get());
TString campo(s.get());
const real importo = cur.curr(archivio).get_real(campo);
valore = "+";
if (importo < 0)
valore = "-";
}
else if (code == "_IMPORTO")
{
real importo(str);
valore = importo.string(0,2);
valore.strip("-");
valore.strip("+");
valore.strip(".");
}
else if (code == "_TIPODOC")
{
const char tipodoc = str[0];
valore = (tipodoc == 'F') ? "1" : "2";
}
else if (code == "_DIVERSI")
{
valore = (app().finemov() ? "X" : " ");
}
else if (code == "_TOTALE")
{
real importo(ZERO);
if (app().totale())
{
importo = cur.curr(LF_MOV).get_real(MOV_TOTDOC);
importo+=cur.curr(LF_MOV).get_real(MOV_RITFIS);
}
valore = importo.string(11,2);
valore.strip("-");
valore.strip("+");
valore.strip(".");
}
else if (code == "_SEGNOTOTALE")
{
real importo(ZERO);
if (app().totale())
{
importo = cur.curr(LF_MOV).get_real(MOV_TOTDOC);
importo+=cur.curr(LF_MOV).get_real(MOV_RITFIS);
}
valore = importo.string(11,2);
valore.trim();
valore = valore.sub(0,1);
if (valore[0] != '-' && valore[0] != '+')
valore = "+";
}
else if (code == "_GIUFIS")
{
const char tipopers = cur.curr(LF_CLIFO).get_char(CLI_TIPOPERS);
valore = (tipopers == 'F') ? " " : "S";
}
else if (code == "_BLACKLIST")
{
const bool sospeso = cur.curr(LF_CLIFO).get_bool(CLI_SOSPESO);
valore = (sospeso == true) ? "S" : " ";
}
else NFCHECK("Macro non definita: %s", (const char *)code);
str = valore;
}
void TInvio::i_zucchetti_testa()
{
// cursore fittizio
TRelation rel(LF_CAUSALI);
TCursor cur(&rel);
_nrecords = 0;
_nfiles = 0;
if (_msk->get_bool(F_CAUSALI))
{
_nrecords += i_zucchetti_causali(FALSE)+2;
_nfiles++;
}
if (_msk->get_bool(F_CLIFOR))
{
_nrecords += i_zucchetti_clifor(FALSE)+2;
_nfiles++;
}
if (_msk->get_bool(F_CONTI))
{
_nrecords += i_zucchetti_conti(FALSE)+2;
_nfiles++;
}
if (_msk->get_bool(F_MOVCONT))
{
_nrecsmocontab = i_zucchetti_movcont(FALSE);
if (_nrecsmocontab > 0)
{
_nrecords += _nrecsmocontab+2;
_nfiles++;
}
}
if (_msk->get_bool(F_MOVIVA))
{
_nrecsfattvend = i_zucchetti_moviva('V', FALSE);
if (_nrecsfattvend > 0)
{
_nrecords += _nrecsfattvend+2;
_nfiles++;
}
_nrecsfattacqu = i_zucchetti_moviva('A', FALSE);
if (_nrecsfattacqu > 0)
{
_nrecords += _nrecsfattacqu+2;
_nfiles++;
}
}
TRecord_text rec;
rec.set_type("I");
_trasfile->autoload(rec, cur);
_trasfile->write(rec);
}
void TInvio::i_zucchetti_testa_dettaglio(const TString16& descr, const long nrecs)
{
// cursore fittizio
TRelation rel(LF_CAUSALI);
TCursor cur(&rel);
_nrecsdettaglio = nrecs;
_descrdettaglio = descr;
TRecord_text rec;
rec.set_type("F");
_trasfile->autoload(rec, cur);
_trasfile->write(rec);
}
void TInvio::i_zucchetti_coda_dettaglio(const TString16& descr, const long nrecs)
{
// cursore fittizio
TRelation rel(LF_CAUSALI);
TCursor cur(&rel);
_nrecsdettaglio = nrecs;
_descrdettaglio = descr;
TRecord_text rec;
rec.set_type("E");
_trasfile->autoload(rec, cur);
_trasfile->write(rec);
}
void TInvio::i_zucchetti_coda()
{
TRelation rel(LF_CAUSALI);
TCursor cur(&rel);
TRecord_text rec;
rec.set_type("C");
_trasfile->autoload(rec, cur);
_trasfile->write(rec);
}
long TInvio::i_zucchetti_causali(const bool invio)
{
TRelation rel(LF_CAUSALI);
TCursor cur(&rel);
const long cur_items = cur.items();
if (cur_items != 0 && invio)
{
i_zucchetti_testa_dettaglio("CAUSMOVM", cur_items);
cur.freeze();
TRectype& cur_rec = cur.curr();
for (cur = 0; cur.pos() < cur_items; ++(cur))
{
TRecord_text rec;
rec.set_type("21");
_trasfile->autoload(rec, cur);
_trasfile->write(rec);
}
i_zucchetti_coda_dettaglio("CAUSMOVM", cur_items);
}
return cur_items;
}
long TInvio::i_zucchetti_conti(const bool invio)
{
TRelation rel(LF_PCON);
TCursor cur(&rel);
const long cur_items = cur.items();
if (cur_items != 0 && invio)
{
i_zucchetti_testa_dettaglio("DESCONTI", cur_items);
cur.freeze();
TRectype& cur_rec = cur.curr();
for (cur = 0; cur.pos() < cur_items; ++(cur))
{
TRecord_text rec;
rec.set_type("20");
_trasfile->autoload(rec, cur);
_trasfile->write(rec);
}
i_zucchetti_coda_dettaglio("DESCONTI", cur_items);
}
return cur_items;
}
long TInvio::i_zucchetti_movcont(const bool invio)
{
TRectype da(LF_MOV);
TRectype a(LF_MOV);
da.put(MOV_DATAREG, _dataini);
a.put(MOV_DATAREG, _datafin);
TRelation rel(LF_MOV);
rel.add(LF_RMOV, "NUMREG==NUMREG", 1);
TCursor cur(&rel, "23->PROTIVA == \"\"", 2, &da, &a);
const long cur_items = cur.items();
long totrec = 0;
if (cur_items != 0)
{
if (invio)
i_zucchetti_testa_dettaglio("MOCONTAB", _nrecsmocontab);
cur.freeze();
TRectype& cur_rec = cur.curr();
for (cur = 0; cur.pos() < cur_items; ++(cur))
{
const long numreg = cur.curr().get_long(MOV_NUMREG);
bool continua = TRUE;
while (continua)
{
const long numregrig = cur.curr(LF_RMOV).get_long(RMV_NUMREG);
if (numreg == numregrig)
{
if (invio)
{
TRectype& cur_rec_righe = cur.curr(LF_RMOV);
TRecord_text recrighe;
recrighe.set_type("50");
cur.save_status();
_finemov = !(cur.next_match(LF_RMOV, "NUMREG"));
cur.restore_status();
_trasfile->autoload(recrighe, cur);
_trasfile->write(recrighe);
}
totrec++;
}
continua = cur.next_match(LF_RMOV, "NUMREG");
}
}
if (invio)
i_zucchetti_coda_dettaglio("MOCONTAB", _nrecsmocontab);
}
return totrec;
}
long TInvio::i_zucchetti_moviva(const char acqven, const bool invio)
{
TRectype da(LF_MOV);
TRectype a(LF_MOV);
da.put(MOV_DATAREG, _dataini);
a.put(MOV_DATAREG, _datafin);
TRelation rel(LF_MOV);
rel.add(LF_RMOVIVA, "NUMREG==NUMREG", 1);
rel.add("REG", "CODTAB[1,4]==ANNOIVA|CODTAB[5,7]==REG", 1);
TString filtro = "(23->PROTIVA != \"\") && ";
if (acqven == 'V')
filtro << "(REG->I0 == 1)";
else
filtro << "(REG->I0 == 2)";
TCursor cur(&rel, "", 2, &da, &a);
cur.setfilter(filtro, TRUE);
const long cur_items = cur.items();
long totrec = 0;
if (cur_items != 0)
{
if (invio)
i_zucchetti_testa_dettaglio(acqven == 'V' ? "FATTVEND" : "FATTACQU", acqven == 'V' ? _nrecsfattvend : _nrecsfattacqu);
cur.freeze();
TRectype& cur_rec = cur.curr();
for (cur = 0; cur.pos() < cur_items; ++(cur))
{
if (invio)
{
TRecord_text rec;
rec.set_type("30");
_trasfile->autoload(rec, cur);
_trasfile->write(rec);
}
totrec++;
const long numreg = cur.curr().get_long(MOV_NUMREG);
bool continua = TRUE;
while (continua)
{
const long numregrig = cur.curr(LF_RMOVIVA).get_long(RMI_NUMREG);
if (numreg == numregrig)
{
if (invio)
{
TRectype& cur_rec_righe = cur.curr(LF_RMOVIVA);
TRecord_text recrighe;
recrighe.set_type("31");
cur.save_status();
_totale = !(cur.next_match(LF_RMOVIVA, "NUMREG"));
cur.restore_status();
_trasfile->autoload(recrighe, cur);
_trasfile->write(recrighe);
}
totrec++;
}
continua = cur.next_match(LF_RMOVIVA, "NUMREG");
}
}
if (invio)
i_zucchetti_coda_dettaglio(acqven == 'V' ? "FATTVEND" : "FATTACQU", acqven == 'V' ? _nrecsfattvend : _nrecsfattacqu);
}
return totrec;
}
long TInvio::i_zucchetti_clifor(const bool invio)
{
TRelation rel(LF_CLIFO);
TCursor cur(&rel);
const long cur_items = cur.items();
if (cur_items != 0 && invio)
{
i_zucchetti_testa_dettaglio("CLIEFORN", cur_items*2);
cur.freeze();
TRectype& cur_rec = cur.curr();
for (cur = 0; cur.pos() < cur_items; ++(cur))
{
TRecord_text rec;
rec.set_type("10");
_trasfile->autoload(rec, cur);
_trasfile->write(rec);
rec.set_type("11");
_trasfile->autoload(rec, cur);
_trasfile->write(rec);
}
i_zucchetti_coda_dettaglio("CLIEFORN", cur_items*2);
}
return cur_items+cur_items;
}
//metodone globale che chiama, come un menu, i vari sottometodi in base alle scelte sulla maschera
void TInvio::invio_zucchetti()
{
//prende i parametri dal file di configurazione dell'applicazione
TFilename configname = "cg7100a.ini";
TConfig configfile(configname);
//prepara il file su cui scrivere, ovvero il _trasfile
TFilename filename = _msk->get(F_DESTINAZIONE);
filename.add(configfile.get("NOMEFILE", "OPZIONI"));
if (fexist(filename))
remove(filename);
_trasfile = new TInvio_file(filename);
_trasfile->open(filename,'w');
i_zucchetti_testa();
if (_msk->get_bool(F_CAUSALI))
i_zucchetti_causali();
if (_msk->get_bool(F_CLIFOR))
i_zucchetti_clifor();
if (_msk->get_bool(F_CONTI))
i_zucchetti_conti();
if (_msk->get_bool(F_MOVCONT))
i_zucchetti_movcont();
if (_msk->get_bool(F_MOVIVA))
{
i_zucchetti_moviva('V');
i_zucchetti_moviva('A');
}
i_zucchetti_coda();
_trasfile->close();
delete _trasfile;
_trasfile = NULL;
}
bool TInvio::create()
{
_msk = new TInvio_mask();
_trasfile = NULL;
return TSkeleton_application::create();
}
bool TInvio::destroy()
{
if (_trasfile)
delete _trasfile;
delete _msk;
return TSkeleton_application::destroy();
}
void TInvio::main_loop()
{
TFilename configname = "cg7100a.ini";
configname.custom_path();
TConfig configfile(configname);
_msk->set(F_NUMEROINVIO, configfile.get_int("NUMEROINVIO","OPZIONI")+1);
_msk->set(F_DATAINI, configfile.get("DATA","OPZIONI"));
_msk->set(F_DESTINAZIONE, configfile.get("PERCORSO","OPZIONI"));
while (_msk->run() != K_QUIT)
{
_totale = false;
_finemov = false;
configfile.set("NUMEROINVIO", _msk->get(F_NUMEROINVIO),"OPZIONI");
configfile.set("DATA", _msk->get_date(F_DATAFIN),"OPZIONI");
configfile.set("PERCORSO", _msk->get(F_DESTINAZIONE),"OPZIONI");
configfile.set_paragraph("CAUSALI");
_dataini = _msk->get_date(F_DATAINI);
_datafin = _msk->get_date(F_DATAFIN);
const char tipoinvio = _msk->get(F_TIPOINVIO)[0];
if (tipoinvio == 'Z')
invio_zucchetti();
}
}
int cg7100(int argc, char **argv)
{
TInvio a;
a.run(argc, argv, "Invio dati contabilità Zucchetti");
return 0;
}

View File

@ -1,18 +0,0 @@
// invio dati ad altra procedura
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_CAUSALI 110
#define F_CONTI 111
#define F_CLIFOR 112
#define F_MOVCONT 113
#define F_MOVIVA 114
#define F_CORRISP 115
#define F_SALDACONTO 116
#define F_TIPOINVIO 120
#define F_DESTINAZIONE 121
#define F_NUMEROINVIO 122
#define F_DATAINI 123
#define F_DATAFIN 124
#define F_RIPRISTINA 125
#define F_DATARIPRISTINO 126

View File

@ -1,10 +0,0 @@
[OPZIONI]
CODICEDITTA =
DATA =
NOMEFILE =
NUMEROINVIO =
PERCORSO =
[CAUSALI]
STANDARD=

View File

@ -1,121 +0,0 @@
#include "cg7100a.h"
PAGE "Invio dati contabilita'" -1 -1 78 20
GROUPBOX DLG_NULL 76 3
BEGIN
PROMPT 2 1 "@bDitta corrente"
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 3 2 "Codice "
FLAGS "FD"
USE LF_NDITTE
INPUT CODDITTA F_CODDITTA
OUTPUT F_RAGSOC RAGSOC
CHECKTYPE REQUIRED
END
STRING F_RAGSOC 50
BEGIN
PROMPT 23 2 ""
FLAGS "D"
END
GROUPBOX DLG_NULL 76 6
BEGIN
PROMPT 2 4 "Dati da inviare"
END
BOOLEAN F_CAUSALI
BEGIN
PROMPT 3 5 "Causali"
FLAGS "D"
END
BOOLEAN F_CONTI
BEGIN
PROMPT 3 6 "Conti"
END
BOOLEAN F_CLIFOR
BEGIN
PROMPT 3 7 "Clienti/Fornitori"
END
BOOLEAN F_MOVCONT
BEGIN
PROMPT 3 8 "Movimenti contabili"
MESSAGE TRUE,ENABLE F_DATAFIN
END
BOOLEAN F_MOVIVA
BEGIN
PROMPT 40 5 "Movimenti IVA"
MESSAGE TRUE,ENABLE F_DATAFIN
END
BOOLEAN F_CORRISP
BEGIN
PROMPT 40 6 "Corrispettivi"
MESSAGE TRUE,ENABLE F_DATAFIN
END
BOOLEAN F_SALDACONTO
BEGIN
PROMPT 40 7 "Saldaconto"
FLAGS "D"
END
LISTBOX F_TIPOINVIO 20
BEGIN
PROMPT 2 10 "Invio a "
ITEM "Z|Zucchetti"
END
STRING F_DESTINAZIONE 20
BEGIN
PROMPT 2 11 "Destinazione "
END
NUMBER F_NUMEROINVIO 2
BEGIN
PROMPT 2 12 "Numero invio "
END
DATE F_DATAINI
BEGIN
PROMPT 20 12 "Data iniz. "
END
DATE F_DATAFIN
BEGIN
PROMPT 44 12 "Data fin. "
END
BUTTON F_RIPRISTINA 20
BEGIN
PROMPT 2 14 "Annulla invio"
MESSAGE SHOW,F_DATARIPRISTINO|ENABLE,F_DATARIPRISTINO
END
DATE F_DATARIPRISTINO
BEGIN
PROMPT 25 14 "Annulla invio fino al "
FLAGS "HD"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
// invio dati ad altra procedura (Proforma)
#define F_CODDITTA 301
#define F_RAGSOC 302
#define F_MOVIMENTI 303
#define F_CLIENTI 304
#define F_FORNITORI 305
#define F_CONTI 306
#define F_PAGAMENTI 307
#define F_TIPOINVIO 308
#define F_DESTINAZIONE 309
#define F_DATAINI 310
#define F_DATAFIN 311
#define F_RIPRISTINA 312
#define F_DATARIPRISTINO 313
#define F_PDCC 315
#define S_TIPO 101
#define S_GRUPPO 102
#define S_CONTO 103
#define S_SOTTOCONTO 104
#define S_DESCRIZIONE 105

View File

@ -1,234 +0,0 @@
#include "cg7200a.h"
TOOLBAR "" 0 -2 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -11 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -11 ""
END
ENDPAGE
PAGE "Invio dati contabilita'" -1 -1 78 20
GROUPBOX DLG_NULL 76 3
BEGIN
PROMPT 2 1 "@bDitta corrente"
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 3 2 "Codice "
FLAGS "FD"
USE LF_NDITTE
INPUT CODDITTA F_CODDITTA
OUTPUT F_RAGSOC RAGSOC
CHECKTYPE REQUIRED
END
STRING F_RAGSOC 50
BEGIN
PROMPT 23 2 ""
FLAGS "D"
END
GROUPBOX DLG_NULL 76 6
BEGIN
PROMPT 2 4 "Dati da inviare"
END
BOOLEAN F_MOVIMENTI
BEGIN
PROMPT 3 5 "Movimenti contabili"
MESSAGE FALSE CLEAR,F_PAGAMENTI|DISABLE,F_DATAFIN
MESSAGE TRUE ENABLE,F_PAGAMENTI|ENABLE,F_DATAFIN
END
BOOLEAN F_CLIENTI
BEGIN
PROMPT 3 6 "Clienti"
END
BOOLEAN F_FORNITORI
BEGIN
PROMPT 3 7 "Fornitori"
END
BOOLEAN F_CONTI
BEGIN
PROMPT 3 8 "Piano dei conti"
END
BOOLEAN F_PAGAMENTI
BEGIN
PROMPT 40 5 "Pagamenti"
END
LISTBOX F_TIPOINVIO 20
BEGIN
PROMPT 2 10 "Invio a "
ITEM "P|Proforma"
END
STRING F_DESTINAZIONE 20
BEGIN
PROMPT 2 11 "Destinazione "
END
DATE F_DATAINI
BEGIN
PROMPT 2 12 "Data iniziale "
END
DATE F_DATAFIN
BEGIN
PROMPT 40 12 "Data finale "
END
BUTTON F_RIPRISTINA 20 2
BEGIN
PROMPT 2 14 "Annulla invio"
MESSAGE SHOW,F_DATARIPRISTINO|ENABLE,F_DATARIPRISTINO
END
DATE F_DATARIPRISTINO
BEGIN
PROMPT 25 14 "Annulla invio fino al "
FLAGS "HD"
END
ENDPAGE
PAGE "Conti" -1 -1 78 20
TEXT -1
BEGIN
PROMPT 1 1 "@bPiano dei conti contabile"
END
SPREADSHEET F_PDCC 78 -6
BEGIN
PROMPT 1 2 "Pdcc"
ITEM "Tipo"
ITEM "Gruppo"
ITEM "Conto"
ITEM "Sottoconto"
ITEM "Descrizione@50"
END
TEXT -1
BEGIN
PROMPT 1 17 "Inserire conti di tipo F per ritenute Fiscali"
END
TEXT -1
BEGIN
PROMPT 1 18 "S per ritenute Sociali, C per Costi, P per Pagamenti"
END
BUTTON DLG_SAVEREC 12 2
BEGIN
PROMPT -11 19 ""
PICTURE BMP_SAVEREC
PICTURE BMP_SAVERECDN
END
ENDPAGE
ENDMASK
//--------------------------------------------------------------------
// Riga dello sheet dei conti
//--------------------------------------------------------------------
PAGE "Riga Piano dei conti contabile" -1 -1 78 8
LIST S_TIPO 1 18
BEGIN
PROMPT 1 1 "Tipo "
ITEM "C|Costi"
ITEM "P|Pagamenti"
ITEM "F|Ritenute fiscali"
ITEM "S|Ritenute sociali"
END
NUMBER S_GRUPPO 3
BEGIN
PROMPT 1 2 "Gruppo "
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO S_GRUPPO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT S_GRUPPO GRUPPO
CHECKTYPE REQUIRED
END
NUMBER S_CONTO 3
BEGIN
PROMPT 1 3 "Conto "
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO=""))
COPY INPUT S_GRUPPO
INPUT CONTO S_CONTO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT S_GRUPPO GRUPPO
OUTPUT S_CONTO CONTO
CHECKTYPE NORMAL
VALIDATE REQIF_FUNC 1 S_SOTTOCONTO
END
NUMBER S_SOTTOCONTO 6
BEGIN
PROMPT 1 4 "Sottoconto "
USE LF_PCON KEY 1 SELECT SOTTOCONTO!=""
COPY INPUT S_CONTO
INPUT SOTTOCONTO S_SOTTOCONTO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT S_SOTTOCONTO SOTTOCONTO
OUTPUT S_CONTO CONTO
OUTPUT S_GRUPPO GRUPPO
OUTPUT S_DESCRIZIONE DESCR
CHECKTYPE NORMAL
END
STRING S_DESCRIZIONE 50
BEGIN
PROMPT 1 5 "Descrizione "
KEY 2
USE LF_PCON KEY 2
INPUT DESCR S_DESCRIZIONE
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT S_SOTTOCONTO
CHECKTYPE REQUIRED
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -249,32 +249,36 @@ const char* iva2name(TipoIVA iva)
const TString& cap2comune(const TString& cap, const TString& denom)
{
TString8 cappone = cap;
if (cappone[2] == '1') //e' un capoluogo di provincia
cappone.overwrite("00", 3, 2);
TRelation relcom(LF_COMUNI);
TRectype& comrec = relcom.curr();
comrec.put(COM_CAPCOM, cappone);
TCursor comuni (&relcom, "", 3, &comrec, &comrec);
const TRecnotype items = comuni.items();
comuni.freeze();
TString4 codcom;
double cmp = 0.69;
for (comuni = 0L; comuni.pos() < items; ++comuni)
if (cap.len() == 5 && denom.full())
{
const TString& denominazione = comrec.get(COM_DENCOM);
const double fc = xvt_str_fuzzy_compare (denom, denominazione);
if (fc > cmp)
{
codcom = comrec.get(COM_COM);
cmp = fc;
}
}
return get_tmp_string() = codcom;
TString8 cappone = cap;
if (cappone[2] == '1') //e' un capoluogo di provincia
cappone.overwrite("00", 3, 2);
TRelation relcom(LF_COMUNI);
TRectype& comrec = relcom.curr();
comrec.put(COM_CAPCOM, cappone);
TCursor comuni (&relcom, "", 3, &comrec, &comrec);
const TRecnotype items = comuni.items();
comuni.freeze();
TString4 codone;
double cmp = 0.69;
for (comuni = 0L; comuni.pos() < items; ++comuni)
{
const TString& denominazione = comrec.get(COM_DENCOM);
const double fc = xvt_str_fuzzy_compare (denom, denominazione);
if (fc > cmp)
{
codone = comrec.get(COM_COM);
cmp = fc;
}
}
if (codone.full())
return get_tmp_string() = codone;
}
return EMPTY_STRING;
}
///////////////////////////////////////////////////////////

View File

@ -145,7 +145,7 @@ public: // TObject
const real percentuale() const { return get_real("R0"); }
const TString& tipo() const { return get("S1"); }
int detraibilita() const { return get_int("I1"); }
int allegato(char tipocf) const { return get_int(tipocf == 'F' ? "S8" : "S7"); }
int allegato(char tipocf) const { return get_int(tipocf == 'F' ? "S8" : "S7");}
real imposta(const real& imponibile, int ndec = AUTO_DECIMALS, const char * codval = "") const; // Calcola l'imposta sull'imponibile l'imposta e la ritorna
real scorpora(real& imponibile, int ndec = AUTO_DECIMALS, const char * codval = "") const; // Scorpora dall'imponibile l'imposta e la ritorna

View File

@ -87,7 +87,13 @@ TSaldo::TSaldo() : _saldi(LF_SALDI), _saldoiniziale(ZERO), _saldo_iniziale(ZERO)
_rec_presente_ec(FALSE), _rec_presente_ep(FALSE),
_causali_apertura(LF_CAUSALI, CAU_MOVAP)
{}
{
for (int i = 0; i < 12; i++)
{
_prg_dare_mese[i] = ZERO;
_prg_avere_mese[i] = ZERO;
}
}
real TSaldo::saldofin_esprec(int annoes, int g, int c, long s, bool saldo_chiusura, bool provvis)
{
@ -282,6 +288,12 @@ bool TSaldo::ultima_immissione_verifica(int annoes,int g,int c,long s,int indbil
_saldofin = ZERO;
_sezsf = ' ';
for (int i = 0; i < 12; i++)
{
_prg_dare_mese[i] = ZERO;
_prg_avere_mese[i] = ZERO;
}
_saldi.zero();
_saldi.put(SLD_ANNOES,annoes);
_saldi.put(SLD_GRUPPO,g);
@ -379,6 +391,12 @@ bool TSaldo::ultima_immissione_bilancio(int annoes,int g,int c,long s,int indbil
_rec_presente_ep = FALSE;
_prec = FALSE;
for (int i = 0; i < 12; i++)
{
_prg_dare_mese[i] = ZERO;
_prg_avere_mese[i] = ZERO;
}
_saldi.zero();
_saldi.put(SLD_ANNOES,annoes);
_saldi.put(SLD_GRUPPO,g);
@ -459,7 +477,13 @@ const real& TSaldo::saldo_periodo(int g, int c, long s, const TDate& dal, const
_rec_presente_ep = false;
_rec_presente_ec = false;
_prec = false;
for (int i = 0; i < 12; i++)
{
_prg_dare_mese[i] = ZERO;
_prg_avere_mese[i] = ZERO;
}
TEsercizi_contabili es;
const int codes = es.date2esc(dal);
const TDate inizio = es.esercizio(codes).inizio();
@ -523,11 +547,18 @@ const real& TSaldo::saldo_periodo(int g, int c, long s, const TDate& dal, const
if (_datacomp >= dal && _datacomp <= al)
{
_movimentato = true;
const int m = _datacomp.month() - 1;
if (sezione == 'D')
if (sezione == 'D')
{
_prg_dare += importo;
_prg_dare_mese[m] += importo;
}
else
{
_prg_avere += importo;
_prg_avere_mese[m] += importo;
}
}
else
if (_datacomp >= inizio && _datacomp < dal)

View File

@ -71,6 +71,8 @@ class TSaldo : public TObject
real _saldo_iniziale;
real _prg_dare;
real _prg_avere;
real _prg_dare_mese[12];
real _prg_avere_mese[12];
real _saldofin;
real _saldo;
int _annoes;
@ -95,7 +97,7 @@ protected:
real calcola_saldo_iniziale(int g, int c, long s, int indbil, bool provvis);
bool prg_saldo(int, TConto&, real&, real&, bool);
const real& iniziale() const { return _saldo_iniziale;}
void set_iniziale(const real& val) { _saldo_iniziale = val; }
void set_iniziale(const real& val) { _saldo_iniziale = val; }
public:
@ -109,10 +111,10 @@ public:
bool causale_mov(long, const TDate&, const TDate&, TString&);
bool ultima_immissione_bilancio(int anno,int g,int c,long s,int indbil,int prov,bool saldo_chiusura = TRUE);
bool ultima_immissione_verifica(int anno,int g,int c,long s,int indbil,int prov);
bool data_limite_bilancio(int,int,int,long,const TDate&,const TDate&,int,int, const char* = NULL);
const real& saldo_periodo(int g,int c,long s,const TDate& dal,const TDate& al,int indbil, bool provv);
bool ultima_immissione_bilancio(int annoes, int g,int c,long s,int indbil,int prov,bool saldo_chiusura = true);
bool ultima_immissione_verifica(int annoes, int g,int c,long s,int indbil,int prov);
bool data_limite_bilancio(int annoes,int g,int c,long s,const TDate& data_inf,const TDate& data_suo,int indbil,int stp_prov, const char* filter = NULL);
const real& saldo_periodo(int g,int c,long s,const TDate& dal,const TDate& al,int indbil, bool provv, const TString & codcomm = EMPTY_STRING);
bool ricerca_progr_prec(int, int, int, long);
@ -127,6 +129,8 @@ public:
const real& saldoinisusaldi() const { return _saldoiniziale;}
const real& prgdare() const { return _prg_dare;}
const real& prgavere() const { return _prg_avere;}
const real& prgdare(int month) const { return _prg_dare_mese[month - 1];}
const real& prgavere(int month) const { return _prg_avere_mese[month - 1];}
const real& saldofin() const { return _saldofin;}
const char sezsf() const { return _sezsf;}
const bool flagprec() { return _prec; }

View File

@ -1,19 +0,0 @@
#include <xvt.h>
#include "cgp4.h"
int main(int argc,char** argv)
{
const int s = (argc > 1) ? argv[1][1] - '0' : 0;
switch (s)
{
case 1 :
cgp4200(argc,argv) ; break; // Importa stipendi in prima nota (OMASA)
default: cgp4100(argc,argv) ; break; // Importazione clienti (GSA/CODFIDI)
}
exit(0);
return 0;
}

View File

@ -1,7 +0,0 @@
#ifndef __CGP4_H
#define __CGP4_H
int cgp4100(int argc, char* argv[]);
#endif // __CGP4_H

View File

@ -1,445 +0,0 @@
// OMASA
#include <applicat.h>
#include <automask.h>
#include <config.h>
#include <execp.h>
#include <filetext.h>
#include <progind.h>
#include <recarray.h>
#include <strings.h>
#include <utility.h>
#include "cgp4.h"
#include "cgp4100a.h"
#include "cgp4100b.h"
#include "cgp4100C.h"
#include "cglib01.h"
#include <causali.h>
#include <mov.h>
#include <pconti.h>
#include <rmov.h>
#define MAX_CG_ROWS 98
// tabella per la conversione dei numeri negativi (schede perforate????)
static unsigned char _tabella[10] = {'p','q','r','s','t','u','v','w','x','y'};
// TAutomask
class TOmasa_mask : public TAutomask
{
protected:
bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TOmasa_mask();
virtual ~TOmasa_mask(){};
};
TOmasa_mask::TOmasa_mask() :TAutomask ("cgp4100a")
{
}
bool TOmasa_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
{
return TRUE;
}
// TFile_text
class TOmasa_file: public TFile_text
{
protected:
virtual void validate(TCursor& cur,TRecord_text &rec, TToken_string &val, TString& str);
public:
TOmasa_file(const TString& file_name);
virtual ~TOmasa_file() { }
};
TOmasa_file::TOmasa_file(const TString& file_name)
: TFile_text(file_name, "omasa.ini")
{
}
void TOmasa_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TString& str)
{
const TString code(s.get(0));
TString valore = str;
if (code == "_UPPERCASE")
{
valore.upper();
}
else NFCHECK("Macro non definita: %s", (const char *)code);
str = valore;
}
// TSkeleton_application
class TOmasa : public TSkeleton_application
{
TOmasa_mask* _msk;
TOmasa_file* _trasfile;
TConfig* _configfile;
TRelation* _rel;
TCursor* _cur;
TProgind* _prog;
TEsercizi_contabili* _esc;
long _numreg;
public:
virtual bool create();
virtual bool destroy();
virtual void main_loop();
virtual void ini2mask();
virtual void mask2ini();
bool transfer();
void negativo(TString& importo);
int strip_zero(TString& importo);
bool my_isdigit(unsigned char ch);
int look(unsigned char carattere);
TOmasa() {}
};
TOmasa& app() { return (TOmasa&) main_app(); }
bool TOmasa::create()
{
open_files(LF_TABCOM, LF_TAB, LF_SALDI, LF_PCON, LF_MOV, LF_RMOV, LF_RMOVIVA,
LF_PARTITE, LF_SCADENZE, LF_PAGSCA, 0);
TFilename configname = "cgp4100a.ini";
configname.custom_path();
_configfile = new TConfig(configname);
_msk = new TOmasa_mask();
_rel = new TRelation (LF_PCON);
_cur = new TCursor(_rel,"((GRUPPO!=\"\")&&(CONTO!=\"\")&&(SOTTOCONTO==\"\"))",1);
_esc = new TEsercizi_contabili;
return TSkeleton_application::create();
}
bool TOmasa::destroy()
{
delete _esc;
delete _cur;
delete _rel;
delete _msk;
delete _configfile;
return TApplication::destroy();
}
int TOmasa::strip_zero(TString& importo)
{
TString16 app;
int size = importo.len();
for (int i = 0; i < size; i++)
if (importo[i] != '0') break;
if (i > 0)
{
app = importo.mid(importo[i] == '.' ? i - 1 : i);
importo = app;
}
return (i ? i - 1 : i);
}
bool TOmasa::my_isdigit(unsigned char ch)
{
return (ch >= '0' && ch <= '9');
}
int TOmasa::look(unsigned char carattere)
{
for (int i = 0; i < 10; i++)
if (_tabella[i] == carattere)
return i;
return -1;
}
void TOmasa::negativo(TString& importo)
{
strip_zero(importo);
int size = importo.len();
if (!size) return;
unsigned char last = importo[size - 1];
if (!my_isdigit(last))
{
int new_last = look(last);
TString16 dep; dep << new_last;
if (new_last >= 0)
{
importo[size - 1] = dep[0];
importo.insert("-");
}
}
}
void TOmasa::mask2ini()
{
TSheet_field& sheet = (TSheet_field&)_msk->field(F_SHEET_CONTI);
for (int i=0;i<sheet.items();i++)
{
TToken_string& row = sheet.row(i);
TString16 contoomasa = row.get(0);
TString16 conto;
const int gr = atoi(row.get(1));
const int co = atoi(row.get(2));
const long so = atol(row.get(3));
conto.format("%d|%d|%ld", gr, co, so);
_configfile->set(contoomasa, conto, "CONTI");
}
TSheet_field& sheetcms = (TSheet_field&)_msk->field(F_SHEET_CMS);
for (i=0;i<sheetcms.items();i++)
{
TToken_string& row = sheetcms.row(i);
TString16 cmsomasa = row.get(0);
TString80 cms = row.get(1);
_configfile->set(cmsomasa, cms, "COMMESSE");
}
_configfile->set_paragraph("CONTI");
}
void TOmasa::ini2mask()
{
TString_array vl;
_configfile->list_variables(vl,TRUE, "CONTI", TRUE);
TSheet_field& sheet = (TSheet_field&)_msk->field(F_SHEET_CONTI);
sheet.destroy();
int i=0;
FOR_EACH_ARRAY_ROW(vl,r,s)
{
TToken_string& riga = sheet.row(i);
TString16 contoomasa = (*s).get();
TToken_string conto = _configfile->get(contoomasa, "CONTI");
riga.add(contoomasa);
riga.add(conto.get(0));
riga.add(conto.get(1));
riga.add(conto.get(2));
sheet.check_row(i);
i++;
}
_configfile->list_variables(vl,TRUE, "COMMESSE", TRUE);
TSheet_field& sheetcms = (TSheet_field&)_msk->field(F_SHEET_CMS);
sheetcms.destroy();
i=0;
FOR_EACH_ARRAY_ROW(vl,rc,sc)
{
TToken_string& riga = sheetcms.row(i);
TString16 cmsomasa = (*sc).get();
TString80 cms = (*sc).get();
riga.add(cmsomasa);
riga.add(cms);
sheetcms.check_row(i);
i++;
}
}
void TOmasa::main_loop()
{
KEY tasto;
_msk->set(F_PERCORSO, _configfile->get("PERCORSO", "MAIN"));
_msk->set(F_CODCAUS, _configfile->get("CODCAUS", "MOVIMENTO"));
ini2mask();
tasto = _msk->run();
if (tasto == K_ENTER)
{
mask2ini();
_numreg = 0;
if (transfer())
{
_configfile->set("PERCORSO", _msk->get(F_PERCORSO), "MAIN");
_configfile->set("CODCAUS", _msk->get(F_CODCAUS), "MOVIMENTO");
message_box(TR("Importazione stipendi completata"));
}
}
}
bool TOmasa::transfer()
{
TString_array transactions;
TFilename tempdir;
tempdir.tempdir();
TString80 listfiles = tempdir;
listfiles << "\\oo*.ini";
list_files(listfiles, transactions);
FOR_EACH_ARRAY_ROW(transactions, row, name)
remove(*name);
TConfig* movpn=NULL;
_trasfile = new TOmasa_file(_msk->get(F_PERCORSO));
_trasfile->open(_msk->get(F_PERCORSO),'r');
// creazione file temporanei per commessa e conto dare e avere
const long dimension = fsize(_msk->get(F_PERCORSO));
TProgind pi(dimension,"Importazione in corso...");
TRecord_text curr;
while (_trasfile->read(curr) == NOERR)
{
pi.setstatus(_trasfile->read_file()->tellg());
TString impstr = curr.get(F_VALOREVOCE);
impstr.insert(".",11);
negativo(impstr);
const real importo(impstr);
TString16 contodare = curr.get(F_CONTODARE);
TString16 contoavere = curr.get(F_CONTOAVERE);
if ((!real::is_null(impstr)) && (!contodare.blank() || !contoavere.blank()))
{
TString16 codcms = curr.get(F_CENTROCOSTO);
codcms.trim();
TString80 cms = _configfile->get(codcms, "COMMESSE");
if (cms.empty())
{
TMask mskcms("cgp4100c");
mskcms.set(F_CMSOMASA, codcms);
if (mskcms.run() == K_ENTER)
_configfile->set(codcms, mskcms.get(F_CODCMS), "COMMESSE");
else
return TRUE;
}
TFilename name;
name.tempdir();
name.add(format("oo%s", (const char*) codcms));
name.ext(".ini");
movpn = new TConfig(name);
movpn->set_paragraph("MAIN");
movpn->set("CODCMS",codcms);
if (!contodare.blank())
{
movpn->set_paragraph("IMPORTI");
contodare.trim();
impstr = movpn->get(contodare, "IMPORTI");
real importomem(impstr);
importomem+=importo;
movpn->set(contodare, importomem.string());
}
if (!contoavere.blank())
{
movpn->set_paragraph("IMPORTI");
contoavere.trim();
impstr = movpn->get(contoavere, "IMPORTI");
real importomem(impstr);
importomem-=importo;
movpn->set(contoavere, importomem.string());
}
delete movpn;
if (pi.iscancelled())
return TRUE;
}
}
_trasfile->close();
delete _trasfile;
// creazione .ini per la prima nota
const TDate datareg = _msk->get_date(F_DATAREG);
const int annoes = _esc->date2esc(datareg);
const TString8 codcaus = _msk->get(F_CODCAUS);
listfiles = tempdir;
listfiles << "\\oo*.ini";
list_files(listfiles, transactions);
FOR_EACH_ARRAY_ROW(transactions, row_oo, name_oo)
{
TConfig* movpn=NULL;
TConfig file_oo(*name_oo);
TString16 codcms = file_oo.get("CODCMS", "MAIN");
codcms.trim();
TFilename name;
name.tempdir();
name.add(format("ooo%s", (const char*) codcms));
name.ext(".ini");
movpn = new TConfig(name);
movpn->set_paragraph("Transaction");
movpn->set("Action","INSERT");
movpn->set("Mode","AUTO");
movpn->set_paragraph(format("%d",LF_MOV));
movpn->set("ANNOES", annoes);
movpn->set("DATACOMP", datareg);
movpn->set("DATAREG", datareg);
movpn->set("DESCR", cache().get(LF_CAUSALI, codcaus, CAU_DESCR));
movpn->set("CODCAUS", codcaus);
int numrig = 0;
TString_array vl;
file_oo.list_variables(vl,TRUE, "IMPORTI", TRUE);
FOR_EACH_ARRAY_ROW(vl,r,s)
{
TString16 contoomasa = (*s).get();
TString16 importos = (*s).get();
TToken_string conto = _configfile->get(contoomasa, "CONTI");
if (conto.empty())
{
TMask mskconto("cgp4100b");
mskconto.set(F_CONTOOMASA, contoomasa);
if (mskconto.run() == K_ENTER)
{
const int gr = mskconto.get_int(F_GRUPPO);
const int co = mskconto.get_int(F_CONTO);
const long so = mskconto.get_long(F_SOTTOCONTO);
conto.format("%d|%d|%ld", gr, co, so);
_configfile->set(contoomasa, conto, "CONTI");
}
else
return TRUE;
}
numrig++;
movpn->set_paragraph(format("%d,%d",LF_RMOV, numrig));
movpn->set("ANNOES", annoes);
movpn->set("DATAREG", datareg);
movpn->set("NUMRIG", numrig);
real importo(importos);
if (importo > 0)
movpn->set("SEZIONE", "D");
else
movpn->set("SEZIONE", "A");
importos.strip("-");
movpn->set("IMPORTO", importos);
TString16 contoindbil;
contoindbil.format("%s|%s", conto.get(0), conto.get(1));
const char indbil = cache().get(LF_PCON, contoindbil, PCN_INDBIL)[0];
if ((indbil != '1') && (indbil != '2'))
movpn->set("CODCMS", _configfile->get(codcms, "COMMESSE"));
movpn->set("GRUPPO", conto.get(0));
movpn->set("CONTO", conto.get(1));
movpn->set("SOTTOCONTO", conto.get(2));
}
delete movpn;
}
tempdir.tempdir();
TString80 applicat = "cg2.exe -0 -i";
applicat << tempdir;
applicat << "\\ooo*.ini";
TExternal_app primanota(applicat);
primanota.run();
listfiles = tempdir;
listfiles << "\\oo*.ini";
list_files(listfiles, transactions);
FOR_EACH_ARRAY_ROW(transactions, rowf, namef)
remove(*namef);
return TRUE;
}
int cgp4100 (int argc, char* argv[])
{
TOmasa main_app;
main_app.run(argc, argv, TR("Importazione stipendi"));
return TRUE;
}

View File

@ -1,40 +0,0 @@
// campi della maschera principale
#define F_PERCORSO 101
#define F_DATAREG 102
#define F_CODCAUS 103
#define F_DESCR 104
#define F_SHEET_CONTI 105
#define F_SHEET_CMS 106
// campi della maschera di conversione conti
#define F_S_CONTOOMASA 101
#define F_S_GRUPPO 102
#define F_S_CONTO 103
#define F_S_SOTTOCONTO 104
#define F_S_DESCRIZIONE 105
// campi della maschera di conversione commesse
#define F_S_CMSOMASA 101
#define F_S_CODCMS 102
#define F_S_DESCRCMS 103
// campi del tracciato record
#define F_CODAZIENDA 0
#define F_CODDIP 1
#define F_VOCE 2
#define F_TIPOVOCE 3
#define F_QUOTAVOCE 4
#define F_VALOREVOCE 5
#define F_IMPORTO 6
#define F_CONTODARE 7
#define F_CONTOAVERE 8
#define F_CENTROCOSTO 9
#define F_SEDELAVORO 10
#define F_SEDEINPS 11
#define F_QUALIFICA 12
#define F_POSINAIL 13
#define F_VARIABILE 14
#define F_CONTRATTO 15
#define F_FILLER 16

View File

@ -1,14 +0,0 @@
[MAIN]
PERCORSO = c:\temp\outretr.seq
[CONTI]
420010=15|70|1
421000=15|70|1
421100=15|70|1
424000=15|70|1
601000=15|70|1
601050=15|70|1
601010=15|70|1
601300=15|70|1
601385=15|70|1

View File

@ -1,188 +0,0 @@
#include "cgp4100a.h"
TOOLBAR "" 0 20 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
PAGE "Importazione stipendi" 0 -1 0 19
STRING F_PERCORSO 50
BEGIN
PROMPT 2 2 "File da trasferire "
CHECKTYPE REQUIRED
VALIDATE FILENAME_FUNC
FLAGS "A"
HELP "Percorso e nome file da trasferire"
WARNING "E' necessario specificare il nome del file da trasferire"
END
DATE F_DATAREG
BEGIN
PROMPT 2 3 "Data registrazione "
CHECKTYPE REQUIRED
HELP "Data di registrazione dei movimenti contabili"
WARNING "E' necessario specificare la data di registrazione"
END
STRING F_CODCAUS 4
BEGIN
PROMPT 2 4 "Causale "
FLAGS "UZ"
USE LF_CAUSALI
INPUT CODCAUS F_CODCAUS
DISPLAY "Codice" CODCAUS
DISPLAY "Descrizione@60" DESCR
OUTPUT F_CODCAUS CODCAUS
OUTPUT F_DESCR DESCR
CHECKTYPE SEARCH
END
STRING F_DESCR 50
BEGIN
PROMPT 17 4 ""
USE LF_CAUSALI KEY 2
INPUT DESCR F_DESCR
DISPLAY "Descrizione@60" DESCR
DISPLAY "Codice" CODCAUS
COPY OUTPUT F_CODCAUS
CHECKTYPE SEARCH
END
SPREADSHEET F_SHEET_CONTI 70 6
BEGIN
PROMPT 2 6 "Tabella conversione conti"
ITEM "Conto OMASA"
ITEM "Gruppo"
ITEM "Conto"
ITEM "Sottoc."
ITEM "Descrizione"
END
SPREADSHEET F_SHEET_CMS 70 6
BEGIN
PROMPT 2 14 "Tabella conversione commesse"
ITEM "Cms OMASA"
ITEM "Corrispondente"
ITEM "Descrizione"
END
ENDPAGE
ENDMASK
PAGE "Conversione conti" 0 -1 0 10
STRING F_S_CONTOOMASA 14
BEGIN
PROMPT 2 2 "Conto OMASA "
FLAGS "D"
END
NUMBER F_S_GRUPPO 3
BEGIN
PROMPT 2 4 "Conto corrispon."
USE LF_PCON KEY 1 SELECT (CONTO="")
INPUT GRUPPO F_S_GRUPPO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_S_GRUPPO GRUPPO
CHECKTYPE NORMAL
END
NUMBER F_S_CONTO 3
BEGIN
PROMPT 24 4 ""
USE LF_PCON KEY 1 SELECT (SOTTOCONTO="")
INPUT GRUPPO F_S_GRUPPO
INPUT CONTO F_S_CONTO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_S_CONTO CONTO
OUTPUT F_S_GRUPPO GRUPPO
CHECKTYPE NORMAL
END
NUMBER F_S_SOTTOCONTO 6
BEGIN
PROMPT 30 4 ""
USE LF_PCON
INPUT GRUPPO F_S_GRUPPO
INPUT CONTO F_S_CONTO
INPUT SOTTOCONTO F_S_SOTTOCONTO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_S_SOTTOCONTO SOTTOCONTO
OUTPUT F_S_GRUPPO GRUPPO
OUTPUT F_S_CONTO CONTO
OUTPUT F_S_DESCRIZIONE DESCR
CHECKTYPE NORMAL
END
STRING F_S_DESCRIZIONE 50
BEGIN
PROMPT 39 4 ""
USE LF_PCON KEY 2
INPUT DESCR F_S_DESCRIZIONE
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
OUTPUT F_S_SOTTOCONTO SOTTOCONTO
OUTPUT F_S_CONTO CONTO
OUTPUT F_S_GRUPPO GRUPPO
OUTPUT F_S_DESCRIZIONE DESCR
CHECKTYPE NORMAL
END
ENDPAGE
ENDMASK
PAGE "Conversione commesse" 0 -1 0 10
STRING F_S_CMSOMASA 14
BEGIN
PROMPT 2 2 "Commessa OMASA "
FLAGS "D"
END
STRING F_S_CODCMS 20
BEGIN
PROMPT 2 4 "Commessa corrispondente "
FLAGS "UZ"
USE CMS
INPUT CODTAB F_S_CODCMS
DISPLAY "Codice@20" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_S_CODCMS CODTAB
OUTPUT F_S_DESCRCMS S0
CHECKTYPE NORMAL
END
STRING F_S_DESCRCMS 50
BEGIN
PROMPT 39 4 ""
USE CMS KEY 2
INPUT S0 F_S_DESCRCMS
DISPLAY "Descrizione@50" S0
DISPLAY "Codice@20" CODTAB
COPY OUTPUT F_S_CODCMS
CHECKTYPE NORMAL
END
ENDPAGE
ENDMASK

View File

@ -1,7 +0,0 @@
// campi della maschera cgp4100b.uml
#define F_CONTOOMASA 101
#define F_GRUPPO 102
#define F_CONTO 103
#define F_SOTTOCONTO 104
#define F_DESCRIZIONE 105

View File

@ -1,87 +0,0 @@
#include "cgp4100b.h"
TOOLBAR "" 0 20 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
PAGE "Conversione conti" 0 -1 0 10
STRING F_CONTOOMASA 14
BEGIN
PROMPT 2 2 "Conto OMASA "
FLAGS "D"
END
NUMBER F_GRUPPO 3
BEGIN
PROMPT 2 4 "Conto corrispondente "
USE LF_PCON KEY 1 SELECT (CONTO="")
INPUT GRUPPO F_GRUPPO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPO GRUPPO
CHECKTYPE NORMAL
END
NUMBER F_CONTO 3
BEGIN
PROMPT 29 4 ""
USE LF_PCON KEY 1 SELECT (SOTTOCONTO="")
INPUT GRUPPO F_GRUPPO
INPUT CONTO F_CONTO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_CONTO CONTO
OUTPUT F_GRUPPO GRUPPO
CHECKTYPE NORMAL
END
NUMBER F_SOTTOCONTO 6
BEGIN
PROMPT 35 4 ""
USE LF_PCON
INPUT GRUPPO F_GRUPPO
INPUT CONTO F_CONTO
INPUT SOTTOCONTO F_SOTTOCONTO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_SOTTOCONTO SOTTOCONTO
OUTPUT F_GRUPPO GRUPPO
OUTPUT F_CONTO CONTO
OUTPUT F_DESCRIZIONE DESCR
CHECKTYPE NORMAL
END
STRING F_DESCRIZIONE 50
BEGIN
PROMPT 44 4 ""
USE LF_PCON KEY 2
INPUT DESCR F_DESCRIZIONE
DISPLAY "Descrizione@50" DESCR
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
OUTPUT F_SOTTOCONTO SOTTOCONTO
OUTPUT F_CONTO CONTO
OUTPUT F_GRUPPO GRUPPO
OUTPUT F_DESCRIZIONE DESCR
CHECKTYPE NORMAL
END
ENDPAGE
ENDMASK

View File

@ -1,5 +0,0 @@
// campi della maschera cgp4100c.uml
#define F_CMSOMASA 101
#define F_CODCMS 102
#define F_DESCRCMS 103

View File

@ -1,52 +0,0 @@
#include "cgp4100c.h"
TOOLBAR "" 0 20 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
PAGE "Conversione commesse" 0 -1 0 10
STRING F_CMSOMASA 14
BEGIN
PROMPT 2 2 "Commessa OMASA "
FLAGS "D"
END
STRING F_CODCMS 20
BEGIN
PROMPT 2 4 "Commessa corrispondente "
FLAGS "UZ"
USE CMS
INPUT CODTAB F_CODCMS
DISPLAY "Codice@20" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_CODCMS CODTAB
OUTPUT F_DESCRCMS S0
CHECKTYPE NORMAL
END
STRING F_DESCRCMS 50
BEGIN
PROMPT 2 5 "Descrizione "
USE CMS KEY 2
INPUT S0 F_DESCRCMS
DISPLAY "Descrizione@50" S0
DISPLAY "Codice@20" CODTAB
COPY OUTPUT F_CODCMS
CHECKTYPE NORMAL
END
ENDPAGE
ENDMASK

View File

@ -1,3 +1,4 @@
26
0
$caus|0|0|79|0|Causali contabili|60||
$caus|0|0|82|0|Causali contabili|60||

View File

@ -1,5 +1,5 @@
26
22
23
CODCAUS|1|3|0|Codice causale
DESCR|1|50|0|Descrizione causale
TIPODOC|1|2|0|Tipo documento
@ -22,6 +22,7 @@ VALINTRA|8|1|0|Gestione valuta intra-comunitaria
MOVIND|1|1|0|Causale per contabilita' industriale
SOLOIVA|8|1|0|Movimento di sola IVA
PROVV|1|1|0|Tipo movimento (" " Normale, "P" Provvisorio cancellabile, "C" Provvisorio da cepiti)
CODCAUREG|1|3|0|Causale regolarizzazione IVA
2
CODCAUS|
UPPER(DESCR)|X

View File

@ -1,141 +0,0 @@
[MAIN]
DECSEP =
FIELDSEP =
RECORDSEP = \n
RECORDSIZE = 0
SKIPLINES = 0
TYPEFIELD = -1
TYPELEN = -1
TYPEPOS = -1
[TYPE FISSO]
ALIGN =
DATA =
DECIMAL = 0
FILLER = ' '
LENGTH = 0
PICTURE =
[TYPE DATA]
ALIGN =
DATA = D
DECIMAL = 0
FILLER =
LENGTH = 8
PICTURE =
[TYPE NUMERO]
ALIGN = R
DATA =
DECIMAL = 0
FILLER = '0'
LENGTH = 0
PICTURE =
[TYPE IMPORTO]
ALIGN = R
DATA =
DECIMAL = 2
FILLER = '0'
LENGTH = 13
PICTURE =
[TYPE STRINGA]
ALIGN = L
DATA = S
DECIMAL = 0
FILLER = ' '
LENGTH = 0
PICTURE =
[RECORD]
NAME(0) = CODICE AZIENDA
TYPE(0) = NUMERO
POSITION(0) = 0
LENGTH(0) = 4
NAME(1) = CODICE DIPENDENTE
TYPE(1) = NUMERO
POSITION(1) = 4
LENGTH(1) = 6
NAME(2) = VOCE
TYPE(2) = NUMERO
POSITION(2) = 10
LENGTH(2) = 4
NAME(3) = TIPO VOCE
TYPE(3) = STRINGA
POSITION(3) = 14
LENGTH(3) = 1
NAME(4) = QUOTA VOCE
TYPE(4) = NUMERO
POSITION(4) = 15
LENGTH(4) = 6
DECIMAL(4) = 2
NAME(5) = VALORE VOCE
TYPE(5) = NUMERO
POSITION(5) = 21
LENGTH(5) = 13
DECIMAL(5) = 2
MESSAGE(5) = _IMPORTO
NAME(6) = IMPORTO UNITARIO
TYPE(6) = IMPORTO
POSITION(6) = 34
LENGTH(6) = 13
DECIMAL(6) = 2
MESSAGE(6) = _IMPORTO
NAME(7) = CONTO DARE
TYPE(7) = STRINGA
POSITION(7) = 47
LENGTH(7) = 14
NAME(8) = CONTO AVERE
TYPE(8) = STRINGA
POSITION(8) = 61
LENGTH(8) = 14
NAME(9) = CENTRO DI COSTO
TYPE(9) = STRINGA
POSITION(9) = 75
LENGTH(9) = 12
NAME(10) = SEDE DI LAVORO
TYPE(10) = STRINGA
POSITION(10) = 87
LENGTH(10) = 2
NAME(11) = SEDE INPS
TYPE(11) = STRINGA
POSITION(11) = 89
LENGTH(11) = 2
NAME(12) = QUALIFICA
TYPE(12) = STRINGA
POSITION(12) = 91
LENGTH(12) = 1
NAME(13) = POSIZIONE INAIL
TYPE(13) = STRINGA
POSITION(13) = 92
LENGTH(13) = 2
NAME(14) = VARIABILE
TYPE(14) = STRINGA
POSITION(14) = 94
LENGTH(14) = 40
NAME(15) = CONTRATTO
TYPE(15) = STRINGA
POSITION(15) = 134
LENGTH(15) = 2
NAME(16) = FILLER
TYPE(16) = STRINGA
POSITION(16) = 136
LENGTH(16) = 6

View File

@ -580,7 +580,6 @@ NAME(29) = SEGNO
TYPE(29) = STRINGA
POSITION(29) = 155
LENGTH(29) = 1
MESSAGE(29) = _SEGNO
NAME(30) = RITENUTA ACCONTO
TYPE(30) = IMPORTO