Rifatto sheet causali e corretta gestione sezione D/A
git-svn-id: svn://10.65.10.50/trunk@493 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8a0f601db7
commit
14abd67ee4
@ -20,12 +20,6 @@
|
||||
#include "cg0201.h"
|
||||
|
||||
|
||||
bool gest_vend()
|
||||
{
|
||||
TConfig c(CONFIG_DITTA,"cg");
|
||||
return c.get("GesVen") == "X";
|
||||
}
|
||||
|
||||
class CG0200_application : public TRelation_application
|
||||
{
|
||||
TMask* _msk;
|
||||
@ -36,13 +30,15 @@ class CG0200_application : public TRelation_application
|
||||
TLocalisamfile* _comuni;
|
||||
TLocalisamfile* _pcon;
|
||||
|
||||
bool _lbcn;
|
||||
bool _lbcn, _gesven;
|
||||
bool _savenew;
|
||||
|
||||
protected:
|
||||
bool user_create();
|
||||
bool user_destroy();
|
||||
virtual TMask* get_mask(int mode) { return _msk; }
|
||||
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();
|
||||
void init_pages(TMask& m);
|
||||
@ -356,16 +352,17 @@ HIDDEN bool codalleg_handler(TMask_field& f, KEY key)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CG0200_application::init_pages(TMask& m)
|
||||
|
||||
void CG0200_application::init_pages(TMask& m)
|
||||
{
|
||||
TConfig conf(CONFIG_DITTA, "cg");
|
||||
|
||||
_lbcn = (conf.get("GsLbCn") == "X");
|
||||
_lbcn = conf.get_bool("GsLbCn");
|
||||
_gesven = conf.get_bool("GesVen");
|
||||
|
||||
m.send_key(K_SHIFT + K_CTRL + (_lbcn ? 's' : 'h'), -5);
|
||||
// Se non e' abilitata la gestione delle vendite disabilita le
|
||||
// maschere dalla 4 in poi
|
||||
if (!gest_vend())
|
||||
if (_gesven)
|
||||
{
|
||||
for (int j=3; j<8;j++)
|
||||
m.disable_page(j);
|
||||
@ -381,7 +378,7 @@ void CG0200_application::init_query_mode(TMask& m)
|
||||
|
||||
{
|
||||
init_pages(m);
|
||||
if (gest_vend())
|
||||
if (_gesven)
|
||||
reset_sheet();
|
||||
|
||||
if (argc() > 2 && *argv(2) == 'F')
|
||||
@ -390,7 +387,6 @@ void CG0200_application::init_query_mode(TMask& m)
|
||||
|
||||
int CG0200_application::read(TMask& m)
|
||||
{
|
||||
|
||||
TToken_string riga(240);
|
||||
|
||||
m.autoload(_rel);
|
||||
@ -584,7 +580,6 @@ default:
|
||||
|
||||
bool CG0200_application::user_create() // initvar e arrmask
|
||||
{
|
||||
|
||||
_rel = new TClifoVI;
|
||||
|
||||
_mov = new TLocalisamfile(LF_MOV);
|
||||
@ -592,7 +587,9 @@ bool CG0200_application::user_create() // initvar e arrmask
|
||||
_fis = new TLocalisamfile(LF_ANAGFIS);
|
||||
_pcon = new TLocalisamfile(LF_PCON);
|
||||
_comuni = new TLocalisamfile(LF_COMUNI);
|
||||
|
||||
_msk = new TMask("cg0200a") ;
|
||||
|
||||
_msk->set_handler(F_OCCASIONALE, occas_handler);
|
||||
_msk->set_handler(F_RAGSOCA, autoexit_rsoc_handler);
|
||||
_msk->set_handler(F_COFI, autoexit_handler);
|
||||
@ -606,10 +603,12 @@ bool CG0200_application::user_create() // initvar e arrmask
|
||||
_msk->set_handler(F_SHEET_G_VEN, indsp_handler);
|
||||
|
||||
TSheet_field& ind = (TSheet_field&) _msk->field(F_SHEET_G_VEN);
|
||||
|
||||
ind.set_notify(indsp_notify);
|
||||
|
||||
_mov->setkey(3);
|
||||
|
||||
TConfig config(CONFIG_STUDIO);
|
||||
_savenew = !config.get_bool("Cg02SN");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,20 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "cg0201.h"
|
||||
|
||||
#include <clifo.h>
|
||||
#include <indsp.h>
|
||||
|
||||
extern bool gest_vend();
|
||||
// Definizione dei metodi relativi alla classe TClifoVI
|
||||
|
||||
// Definizione dei metodi relativi alla classe TClifoVI
|
||||
|
||||
TClifoVI::TClifoVI():TRelation(LF_CLIFO), _oldindirizzi(0)
|
||||
{
|
||||
add(LF_CFVEN,"TIPOCF=TIPOCF|CODCF=CODCF");
|
||||
add(LF_INDSP,"TIPOCF=TIPOCF|CODCF=CODCF");
|
||||
|
||||
TConfig conf(CONFIG_DITTA, "cg");
|
||||
_gesven = conf.get_bool("GesVen");
|
||||
}
|
||||
|
||||
void TClifoVI::destroy_rows()
|
||||
@ -32,10 +36,9 @@ TRectype& TClifoVI::indirizzo(int i)
|
||||
|
||||
int TClifoVI::read_indirizzi()
|
||||
{
|
||||
const TLocalisamfile& rind = lfile(LF_INDSP);
|
||||
// Put here gest_vend() discrimination
|
||||
if (gest_vend())
|
||||
if (_gesven)
|
||||
{
|
||||
const TLocalisamfile& rind = lfile(LF_INDSP);
|
||||
position_rels();
|
||||
destroy_rows();
|
||||
for (bool ok=is_first_match(LF_INDSP); ok; ok=next_match(LF_INDSP))
|
||||
@ -43,7 +46,7 @@ int TClifoVI::read_indirizzi()
|
||||
const int nriga=rind.get_int(IND_CODIND) -1;
|
||||
indirizzo(nriga)=rind.curr();
|
||||
}
|
||||
}
|
||||
}
|
||||
_oldindirizzi=indirizzi_items();
|
||||
return NOERR;
|
||||
}
|
||||
@ -90,7 +93,7 @@ int TClifoVI::registra(bool re, bool force)
|
||||
if (err!=NOERR) return err;
|
||||
|
||||
// Put here gest_vend() discrimination
|
||||
if (gest_vend())
|
||||
if (_gesven)
|
||||
{
|
||||
TLocalisamfile& v=lfile(LF_CFVEN);
|
||||
err=write_rec(TRUE,v.curr(),v);
|
||||
@ -135,7 +138,7 @@ int TClifoVI::remove(TDate&)
|
||||
c.remove();
|
||||
|
||||
// Put here gest_vend() discrimination
|
||||
if (gest_vend())
|
||||
if (_gesven)
|
||||
{
|
||||
TLocalisamfile& v=lfile(LF_CFVEN);
|
||||
TLocalisamfile& rind=lfile(LF_INDSP);
|
||||
|
@ -6,7 +6,9 @@ class TClifoVI:public TRelation
|
||||
{
|
||||
// @DPRIV
|
||||
TArray _indirizzi;
|
||||
int _oldindirizzi;
|
||||
int _oldindirizzi;
|
||||
bool _gesven;
|
||||
|
||||
// @END
|
||||
protected:
|
||||
// @FPROT
|
||||
|
335
cg/cg0500.cpp
335
cg/cg0500.cpp
@ -16,10 +16,6 @@
|
||||
#include "cg2103.h"
|
||||
#include "cg0500.h"
|
||||
|
||||
#define SS_TIPOCF 102
|
||||
#define SS_GRUPPO 103
|
||||
#define SS_CONTO 104
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Funzioni legate ai parametri ditta
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@ -80,37 +76,26 @@ HIDDEN int anno_iva()
|
||||
class TRiga_caus : public TToken_string
|
||||
{
|
||||
public:
|
||||
const TString& operator = (const TString& s)
|
||||
{return TToken_string::operator=(s);}
|
||||
const TString& operator = (const TString& s) {return TToken_string::operator=(s);}
|
||||
const TString& operator = (const char* s) {return TToken_string::operator=(s);}
|
||||
|
||||
TRiga_caus (TConto& tc, // il conto
|
||||
const char *df="", // descrizione fissa
|
||||
char tipocf=' ', // tipo C/F
|
||||
TRiga_caus (const char *df="", // descrizione fissa
|
||||
char sezione=' ', // dare/avere
|
||||
const char * des="", // descrizione del conto
|
||||
const char * desagg="", // codice descr. aggiuntiva
|
||||
char rigaiva=' ', // se e' una riga iva
|
||||
const char * codiva=""); // codice iva
|
||||
TConto* tc = NULL, // il conto
|
||||
const char * coddes="", // codice descr. aggiuntiva
|
||||
const char * descagg=""); // descrizione aggiuntiva
|
||||
};
|
||||
|
||||
TRiga_caus::TRiga_caus (TConto& tc,const char * df, char tipocf, char sez,
|
||||
const char * des, const char * desagg,
|
||||
char rigaiva, const char * codiva)
|
||||
TRiga_caus::TRiga_caus (const char * df, char sez, TConto* tc,
|
||||
const char * coddes, const char * descagg)
|
||||
: TToken_string(128)
|
||||
{
|
||||
add(df); add(tipocf);
|
||||
// add(tc.tipo());
|
||||
if (tc.ok())
|
||||
{
|
||||
add(tc.gruppo());
|
||||
add(tc.conto());
|
||||
add(tc.sottoconto());
|
||||
}
|
||||
else add(" | | ");
|
||||
add(sez); add(des);
|
||||
add(desagg);
|
||||
add(rigaiva);
|
||||
add(codiva);
|
||||
add(df);
|
||||
add(sez);
|
||||
if (tc != NULL) add(tc->string(0x3));
|
||||
else add(" | | | | ");
|
||||
add(coddes);
|
||||
add(descagg);
|
||||
}
|
||||
|
||||
class TRighe_rcaus : public TArray
|
||||
@ -127,6 +112,7 @@ public:
|
||||
TRighe_rcaus() : TArray(20) {}
|
||||
};
|
||||
|
||||
// Cancella tutte le descrizioni delle righe
|
||||
void TRighe_rcaus::clear_descr()
|
||||
{
|
||||
for (int i=0; i < items(); i++)
|
||||
@ -136,29 +122,21 @@ void TRighe_rcaus::clear_descr()
|
||||
}
|
||||
}
|
||||
|
||||
// Cancella tutta la riga tranne la descrizione
|
||||
void TRighe_rcaus::clear(int row)
|
||||
{
|
||||
TRiga_caus* r = (TRiga_caus*)objptr(row);
|
||||
|
||||
if (r)
|
||||
{
|
||||
/*
|
||||
r->add("", 1); r->add(0, 2); r->add(0, 3);
|
||||
r->add(0L, 4); r->add("", 5); r->add("", 6);
|
||||
r->add("", 7); r->add("", 8); r->add("", 9);
|
||||
*/
|
||||
*r = r->get(0);
|
||||
}
|
||||
if (r != NULL) *r = (const char*)r->get(0);
|
||||
}
|
||||
|
||||
// Setta la descrizione di una riga senza cmbiare il resto
|
||||
void TRighe_rcaus::set_descr(int i, const char * dfi)
|
||||
{
|
||||
TRiga_caus *r = (TRiga_caus*)objptr(i);
|
||||
|
||||
if (r == NULL)
|
||||
{
|
||||
TConto tc;
|
||||
r = new TRiga_caus(tc, dfi);
|
||||
r = new TRiga_caus(dfi);
|
||||
add(r,i);
|
||||
}
|
||||
else
|
||||
@ -229,7 +207,6 @@ public:
|
||||
bool _forcedCopy;
|
||||
TRighe_rcaus _righe_rcaus; // Array delle descrizioni delle righe
|
||||
tipo_descr _tipo_des; // Il tipo di causale corrente
|
||||
int _riga; // Riga corrente dello sheet (set_notify)
|
||||
|
||||
void compilaarray (const TString&, int, int, int);
|
||||
void array2sheet(); // Copia le descrizioni dall'array allo sheet
|
||||
@ -237,8 +214,7 @@ public:
|
||||
TMask* main_mask() const { return _msk; }
|
||||
TMask& ss_mask() const { return ss().sheet_mask(); }
|
||||
TSheet_field& ss() const { return (TSheet_field&)_msk->field(F_SHEET_GCS);}
|
||||
void add_riga (int numrig, char cf, char sz, TString& d, TString& da,
|
||||
bool riva, TString& civa, TConto& tc);
|
||||
void add_riga (int numrig, char sz, TConto& tc, const TString& d, const TString& da);
|
||||
bool mostra_campi(TMask_field& f);
|
||||
TLocalisamfile & conti() { return *_conti; }
|
||||
|
||||
@ -251,22 +227,16 @@ HIDDEN TCaus_app& app() { return (TCaus_app&) main_app(); }
|
||||
// e per pulire la sezione Dare/avere in caso di riga azzerata
|
||||
bool TCaus_app::leggi_riga(int r, KEY k)
|
||||
{
|
||||
if (k == K_SPACE)
|
||||
app()._riga = r;
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
TToken_string &riga = app().ss().row(r);
|
||||
const int g = riga.get_int(2);
|
||||
const int g = riga.get_int(3);
|
||||
if (g == 0) // riga azzerata
|
||||
{
|
||||
riga.add("", 1); // pulisco tipo C/F
|
||||
riga.add("", 5); // pulisco Dare/Avere
|
||||
app()._righe_rcaus.clear(r); // pulisco la riga anche nell'array
|
||||
app().ss().force_update(r);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -528,63 +498,77 @@ bool TCaus_app::cod_reg_hndl (TMask_field& f, KEY k)
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
bool TCaus_app::conto_hndl (TMask_field& f, KEY k)
|
||||
{
|
||||
// Se specifico il conto deve essere non vuoto il gruppo
|
||||
if (f.to_check(k))
|
||||
{
|
||||
int io = f.dlg();
|
||||
int c = f.mask().get_int(io);
|
||||
int g = f.mask().get_int(io - 1);
|
||||
|
||||
if (c > 0)
|
||||
if (g == 0)
|
||||
return f.warning_box("Non accetto un conto senza gruppo");
|
||||
}
|
||||
// Controllo: << se e' fattura solo la riga 1 o 7 possono essere C/F >>
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
char scarta = '\0';
|
||||
int ultima = 8;
|
||||
char cf = f.mask().get(SS_TIPOCF)[0];
|
||||
TMask_field& cfld = f.mask().field(SS_TIPOCF);
|
||||
const int tpr = app().main_mask()->get_int(F_TIPO_REG);
|
||||
bool puramente_contabile = FALSE;
|
||||
char scarta = 'Z';
|
||||
int ultima = 8;
|
||||
|
||||
const TipoIVA tpr = (TipoIVA)app().main_mask()->get_int(F_TIPO_REG);
|
||||
|
||||
switch (tpr)
|
||||
{
|
||||
case 1: scarta = 'F'; break;
|
||||
case 2: scarta = 'C'; break;
|
||||
case 0:
|
||||
scarta = 'Z'; // Accetto tutto
|
||||
puramente_contabile = TRUE;
|
||||
switch (app()._tipo_des)
|
||||
{
|
||||
case incasso_pagamento: ultima = 11; break;
|
||||
case incasso_pagamento_gesval: ultima = 12; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!puramente_contabile)
|
||||
{
|
||||
if (app()._riga > ultima) // se sono nelle righe libere accetto TUTTO..
|
||||
return TRUE;
|
||||
else
|
||||
if (app()._riga == 0 || app()._riga == 6)
|
||||
{
|
||||
if (cf == scarta)
|
||||
return cfld.warning_box(
|
||||
"Impossibile inserire un %s con registro di tipo %s nella riga %d",
|
||||
cf == 'C' ? "cliente" : "fornitore",
|
||||
tpr == 1 ? "vendite" : "acquisti", app()._riga+1);
|
||||
}
|
||||
else
|
||||
if (cf == 'C' || cf == 'F')
|
||||
return cfld.warning_box(
|
||||
"Impossibile inserire un %s con registro di tipo %s nella riga %d",
|
||||
cf == 'C' ? "cliente" : "fornitore",
|
||||
tpr == 1 ? "vendite" : "acquisti", app()._riga+1);
|
||||
case iva_vendite:
|
||||
scarta = 'F'; break; // Scarta vendite a fornitori
|
||||
case iva_acquisti:
|
||||
scarta = 'C'; break; // Scarta acquisti da clienti
|
||||
default:
|
||||
scarta = 'Z'; // Accetta tutto
|
||||
switch (app()._tipo_des)
|
||||
{
|
||||
case incasso_pagamento:
|
||||
ultima = 11; break;
|
||||
case incasso_pagamento_gesval:
|
||||
ultima = 12; break;
|
||||
default:
|
||||
ultima = 8; break;
|
||||
}
|
||||
}
|
||||
|
||||
TMask_field& sez = f.mask().field(SS_SEZIONE);
|
||||
char sezione = toupper(sez.get()[0]);
|
||||
if (sezione != 'A' && sezione != 'D') sezione = ' ';
|
||||
char sezione_consigliata = ' ';
|
||||
const bool full = f.get().not_empty();
|
||||
|
||||
const int riga = app().ss().selected();
|
||||
if (tpr != nessuna_iva && riga <= ultima)
|
||||
{
|
||||
TMask_field& cfld = f.mask().field(SS_TIPOCF);
|
||||
const char cf = toupper(cfld.get()[0]);
|
||||
|
||||
bool ok = TRUE;
|
||||
if (riga == 0 || riga == 8)
|
||||
{
|
||||
ok = cf != scarta;
|
||||
if (full && sezione == ' ')
|
||||
{
|
||||
if (riga == 0)
|
||||
sezione_consigliata = cf == 'C' ? 'D' : 'A';
|
||||
else
|
||||
sezione_consigliata = app().ss().row(0).get_char(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ok = cf != 'C' && cf != 'F';
|
||||
if (full && sezione == ' ')
|
||||
sezione_consigliata = app().ss().row(0).get_char(1) == 'D' ? 'A' : 'D';
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
return cfld.error_box(
|
||||
"%s non valido con registro %s", cf == 'C' ? "Cliente" : "Fornitore", iva2name(tpr));
|
||||
}
|
||||
|
||||
if (sezione == ' ')
|
||||
{
|
||||
const char sc[2] = { sezione_consigliata, '\0' };
|
||||
sez.set(sc);
|
||||
if (full && sezione_consigliata == ' ')
|
||||
return sez.error_box("E' necessario specificare la sezione D/A");
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -595,42 +579,16 @@ bool TCaus_app::sottoconto_hndl (TMask_field& f, KEY k)
|
||||
{
|
||||
if (f.to_check(k))
|
||||
{
|
||||
int io = f.dlg();
|
||||
int s = f.mask().get_int(io);
|
||||
int g = f.mask().get_int(SS_GRUPPO);
|
||||
int c = f.mask().get_int(SS_CONTO);
|
||||
const int g = f.mask().get_int(SS_GRUPPO);
|
||||
const int c = f.mask().get_int(SS_CONTO);
|
||||
const int s = atoi(f.get());
|
||||
|
||||
if (s > 0)
|
||||
if (g == 0 || c == 0)
|
||||
return f.warning_box("Non accetto un sottoconto con gruppo o conto vuoti");
|
||||
|
||||
/* A che cavolo serve CHECKTYPE NORMAL ????????????????????????????????????????
|
||||
TConto tc(g,c,s);
|
||||
if (!tc.read(app().conti().curr()))
|
||||
return f.warning_box("Conto inesistente");
|
||||
*/
|
||||
if (s != 0 && (g == 0 || c == 0))
|
||||
return f.error_box("Conto incompleto");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Handler del campo tipocf della maschera di edit dello sheet
|
||||
// Abilita 109 e 110 (rigaiva e codiva) SOLO SE registro 1 o 2
|
||||
bool TCaus_app::tipocf_hndl (TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
const int tpr = app().main_mask()->get_int(F_TIPO_REG);
|
||||
if (tpr == 1 || tpr == 2) {
|
||||
f.mask().enable(109); f.mask().enable(110);
|
||||
}
|
||||
else {
|
||||
f.mask().disable(109); f.mask().disable(110);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Funzioni che caricano le varie descrizioni fisse nell'array
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@ -776,61 +734,56 @@ int TCaus_app::read(TMask& m)
|
||||
return NOERR;
|
||||
}
|
||||
|
||||
void TCaus_app::add_riga(int numrig,
|
||||
char cf, char sz, TString& d, TString& da, bool riva,
|
||||
TString& civa, TConto& tc)
|
||||
void TCaus_app::add_riga(int numrig, char sz, TConto& tc, const TString& d, const TString& da)
|
||||
{
|
||||
TSheet_field& cs = ss();
|
||||
TToken_string & riga = cs.row(numrig);
|
||||
riga.add(cf, 1);
|
||||
riga.add(tc.gruppo(), 2);
|
||||
riga.add(tc.conto(), 3);
|
||||
riga.add(tc.sottoconto(),4);
|
||||
riga.add(sz, 5);
|
||||
riga.add(d, 6);
|
||||
riga.add(da,7);
|
||||
riga.add(riva ? "X" : "", 8);
|
||||
riga.add(civa, 9);
|
||||
TToken_string& riga = ss().row(numrig);
|
||||
riga = " ";
|
||||
riga.add(sz);
|
||||
riga.add(tc.string(0x3));
|
||||
riga.add(d);
|
||||
riga.add(da);
|
||||
}
|
||||
|
||||
void TCaus_app::read_rcaus(TMask& m)
|
||||
{
|
||||
int numrig, g, c;
|
||||
long s;
|
||||
TString d(50), da(3), civa(3);
|
||||
char sz, cf;
|
||||
bool riva;
|
||||
TLocalisamfile& rcaus = _rel->lfile(LF_RCAUSALI);
|
||||
TTable dpn("%DPN");
|
||||
|
||||
_rel->update(); // chiamo position_rels()
|
||||
const TString cod(_rel->lfile().get(RCA_CODCAUS));
|
||||
const TString16 cod(_rel->lfile().get(RCA_CODCAUS));
|
||||
TString16 d;
|
||||
TString80 da;
|
||||
|
||||
_righe_gia_presenti.reset();
|
||||
// _righe_rcaus.destroy();
|
||||
|
||||
rcaus.zero();
|
||||
rcaus.put(RCA_CODCAUS, cod);
|
||||
int e = rcaus.read(_isgteq);
|
||||
|
||||
while (e == NOERR && rcaus.get(RCA_CODCAUS) == cod)
|
||||
for (int err = rcaus.read(_isgteq);
|
||||
err == NOERR && rcaus.get(RCA_CODCAUS) == cod;
|
||||
err = rcaus.next())
|
||||
{
|
||||
numrig = rcaus.get_int(RCA_NRIGA);
|
||||
const numrig = rcaus.get_int(RCA_NRIGA);
|
||||
CHECK(numrig > 0, "Causale con numero riga nullo");
|
||||
g = rcaus.get_int(RCA_GRUPPO);
|
||||
c = rcaus.get_int(RCA_CONTO);
|
||||
s = rcaus.get_long(RCA_SOTTOCONTO);
|
||||
sz = rcaus.get_char(RCA_SEZIONE);
|
||||
d = rcaus.get(RCA_DESC);
|
||||
da = rcaus.get(RCA_CODDESC);
|
||||
cf = rcaus.get_char(RCA_TIPOCF);
|
||||
riva = rcaus.get_bool(RCA_RIGAIVA);
|
||||
civa = rcaus.get(RCA_CODIVA);
|
||||
TConto tc(g,c,s,cf);
|
||||
const char sz = rcaus.get_char(RCA_SEZIONE);
|
||||
const char cf = rcaus.get_char(RCA_TIPOCF);
|
||||
const int g = rcaus.get_int(RCA_GRUPPO);
|
||||
const int c = rcaus.get_int(RCA_CONTO);
|
||||
const long s = rcaus.get_long(RCA_SOTTOCONTO);
|
||||
d = rcaus.get(RCA_CODDESC);
|
||||
|
||||
if (d.not_empty())
|
||||
{
|
||||
dpn.put("CODTAB", d);
|
||||
dpn.read() ;
|
||||
da = dpn.get("S0");
|
||||
} else da.cut(0);
|
||||
|
||||
add_riga(numrig-1, cf, sz, d, da, riva, civa, tc);
|
||||
TConto tc(g,c,s,cf);
|
||||
add_riga(numrig-1, sz, tc, d, da);
|
||||
|
||||
_righe_gia_presenti.set(numrig);
|
||||
e = rcaus.next();
|
||||
}
|
||||
}
|
||||
|
||||
@ -892,7 +845,6 @@ bool TCaus_app::descr2array(TMask& m, bool fromHandler)
|
||||
m770 = m.get_int(F_M_770);
|
||||
}
|
||||
|
||||
{
|
||||
TString16 chiave; chiave << anno_iva() << codreg;
|
||||
TTable reg("REG");
|
||||
reg.put("CODTAB", chiave);
|
||||
@ -900,12 +852,11 @@ bool TCaus_app::descr2array(TMask& m, bool fromHandler)
|
||||
tpr = reg.get_int("I0");
|
||||
else
|
||||
tpr = 0;
|
||||
}
|
||||
|
||||
// carico le descrizioni fisse nell'array Righe_rcaus
|
||||
compilaarray(tpd,tpm,tpr,m770);
|
||||
// carico le descrizioni fisse nell'array Righe_rcaus
|
||||
compilaarray(tpd,tpm,tpr,m770);
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TCaus_app::togli_dal_file(const TString& cau)
|
||||
@ -942,8 +893,8 @@ int TCaus_app::rewrite(const TMask& m)
|
||||
int TCaus_app::re_write(const TMask& m,bool rewrite)
|
||||
{
|
||||
const TString16 cau(m.get(F_COD_CAUS));
|
||||
TString80 desc;
|
||||
TString16 coddesc;
|
||||
|
||||
TLocalisamfile& caus = _rel->lfile(LF_CAUSALI);
|
||||
TLocalisamfile& rcaus = _rel->lfile(LF_RCAUSALI);
|
||||
|
||||
@ -958,28 +909,29 @@ int TCaus_app::re_write(const TMask& m,bool rewrite)
|
||||
TToken_string &riga = cs.row(i);
|
||||
if (riga.empty_items()) continue;
|
||||
|
||||
const char tipo_cf = riga.get_char(1);
|
||||
const int g = riga.get_int(2);
|
||||
const int c = riga.get_int(3);
|
||||
long s = riga.get_long(4);
|
||||
char sezione = riga.get_char(5);
|
||||
desc = riga.get(6);
|
||||
coddesc = riga.get(7);
|
||||
char sezione = riga.get_char(1);
|
||||
const char tipo_cf = riga.get_char();
|
||||
const int g = riga.get_int();
|
||||
const int c = riga.get_int();
|
||||
long s = riga.get_long();
|
||||
riga.get(); // Salta descrizione conto
|
||||
coddesc = riga.get();
|
||||
|
||||
if (g > 0 || c > 0 || s > 0L)
|
||||
if (g > 0)
|
||||
{
|
||||
rcaus.zero();
|
||||
rcaus.put (RCA_CODCAUS, (const char *)cau);
|
||||
rcaus.put (RCA_CODCAUS, cau);
|
||||
rcaus.put (RCA_NRIGA, i+1); // Numerare da uno!
|
||||
rcaus.put (RCA_SEZIONE, sezione);
|
||||
rcaus.put (RCA_TIPOCF, tipo_cf);
|
||||
rcaus.put (RCA_GRUPPO , g);
|
||||
rcaus.put (RCA_CONTO , c);
|
||||
rcaus.put (RCA_SOTTOCONTO, s);
|
||||
rcaus.put (RCA_SEZIONE, sezione);
|
||||
rcaus.put (RCA_DESC , (const char *)desc);
|
||||
rcaus.put (RCA_CODDESC, (const char *)coddesc);
|
||||
rcaus.put (RCA_TIPOCF, tipo_cf);
|
||||
if (rewrite) {
|
||||
if (_righe_gia_presenti[i+1]) {
|
||||
if (rewrite)
|
||||
{
|
||||
if (_righe_gia_presenti[i+1])
|
||||
{
|
||||
rcaus.rewrite();
|
||||
_righe_gia_presenti.reset(i+1);
|
||||
}
|
||||
@ -1089,11 +1041,10 @@ bool TCaus_app::user_create()
|
||||
TSheet_field& cs = ss();
|
||||
cs.set_notify(leggi_riga);
|
||||
|
||||
cs.sheet_mask().set_handler(102, tipocf_hndl); // 102 e' il TIPOCF
|
||||
cs.sheet_mask().set_handler(104, conto_hndl);
|
||||
cs.sheet_mask().set_handler(105, sottoconto_hndl);
|
||||
cs.sheet_mask().set_handler(205, sottoconto_hndl);
|
||||
cs.sheet_mask().set_handler(305, sottoconto_hndl);
|
||||
cs.sheet_mask().set_handler(SS_CONTO, conto_hndl);
|
||||
cs.sheet_mask().set_handler(SS_SOTTOCONTO, sottoconto_hndl);
|
||||
cs.sheet_mask().set_handler(SS_SOTTOCONTO+100, sottoconto_hndl);
|
||||
cs.sheet_mask().set_handler(SS_SOTTOCONTO+200, sottoconto_hndl);
|
||||
|
||||
_forcedCopy = FALSE;
|
||||
|
||||
|
@ -28,3 +28,10 @@
|
||||
#define F_CORRISP 125
|
||||
#define F_COD_CAUS2 126
|
||||
#define F_DESCR2 127
|
||||
|
||||
#define SS_SEZIONE 102
|
||||
#define SS_TIPOCF 103
|
||||
#define SS_GRUPPO 104
|
||||
#define SS_CONTO 105
|
||||
#define SS_SOTTOCONTO 106
|
||||
#define SS_DESCAGG 108
|
@ -77,13 +77,12 @@ BEGIN
|
||||
DISPLAY "Anno" CODTAB[1,4]
|
||||
DISPLAY "Codice registro " CODTAB[5,7]
|
||||
DISPLAY "Tipo" I0
|
||||
DISPLAY "Registro corrispettivi" B0
|
||||
DISPLAY "Corrispettivi" B0
|
||||
DISPLAY "Descrizione @50" S0
|
||||
OUTPUT F_ANNOES CODTAB[1,4]
|
||||
OUTPUT F_COD_REG CODTAB[5,7]
|
||||
OUTPUT F_TIPO_REG I0
|
||||
OUTPUT F_CORRISP B0
|
||||
HELP "Codice registro"
|
||||
WARNING "Registro assente"
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "DU"
|
||||
@ -122,14 +121,14 @@ BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
LISTBOX F_M_770 1 40
|
||||
LISTBOX F_M_770 1 48
|
||||
BEGIN
|
||||
PROMPT 2 6 "Collegamento Mod.770 "
|
||||
PROMPT 2 5 "Collegamento Mod.770 "
|
||||
FIELD LF_CAUSALI->M770
|
||||
HELP "Inserire il tipo di collegamento Mod.770"
|
||||
ITEM " |Nessuno"
|
||||
ITEM "1|Ricevuta e/o pagamento fattura percip."
|
||||
ITEM "2|Versamento ritenute percip."
|
||||
ITEM "1|Ricevuta e/o pagamento fattura percipipiente"
|
||||
ITEM "2|Versamento ritenute percipiente"
|
||||
ITEM "3|Versamento ritenute dipendente"
|
||||
ITEM "4|Versamento contributi dipendente"
|
||||
ITEM "5|Compensi non soggetti"
|
||||
@ -158,15 +157,22 @@ SPREADSHEET F_SHEET_GCS
|
||||
BEGIN
|
||||
PROMPT 0 7 ""
|
||||
ITEM "Tipo conto@21F"
|
||||
ITEM "D/A"
|
||||
ITEM "C/F"
|
||||
ITEM "Gr."
|
||||
ITEM "Co."
|
||||
ITEM "Sottoc.@6"
|
||||
<<<<<<< cg0500a.uml
|
||||
ITEM "Descrizione Conto@50"
|
||||
ITEM "Desc. agg.@5"
|
||||
ITEM "Descrizione Aggiuntiva@50"
|
||||
=======
|
||||
ITEM "D/A"
|
||||
ITEM "Descrizione conto@50"
|
||||
ITEM "Descr. agg.@5"
|
||||
ITEM "Iva"
|
||||
ITEM "Cod.Iva@4"
|
||||
>>>>>>> 1.27
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
126
cg/cg0500b.uml
126
cg/cg0500b.uml
@ -8,27 +8,27 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
LISTBOX 102 1 11
|
||||
LISTBOX SS_TIPOCF 1 11
|
||||
BEGIN
|
||||
PROMPT 33 1 "C/F "
|
||||
ITEM " |Conto" MESSAGE SHOW,105|HIDE,205|HIDE,305|SHOW,107|HIDE,207|HIDE,307
|
||||
ITEM "C|Cliente" MESSAGE SHOW,205|HIDE,105|HIDE,305|SHOW,207|HIDE,107|HIDE,307
|
||||
ITEM "F|Fornitore" MESSAGE SHOW,305|HIDE,105|HIDE,205|SHOW,307|HIDE,107|HIDE,207
|
||||
ITEM " |Conto" MESSAGE SHOW,106|HIDE,206|HIDE,306|SHOW,107|HIDE,207|HIDE,307
|
||||
ITEM "C|Cliente" MESSAGE SHOW,206|HIDE,106|HIDE,306|SHOW,207|HIDE,107|HIDE,307
|
||||
ITEM "F|Fornitore" MESSAGE SHOW,306|HIDE,106|HIDE,206|SHOW,307|HIDE,107|HIDE,207
|
||||
FLAGS "DGU"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
NUMBER 103 3
|
||||
NUMBER SS_GRUPPO 3
|
||||
BEGIN
|
||||
PROMPT 1 3 "Gruppo "
|
||||
FIELD LF_RCAUSALI->GRUPPO
|
||||
USE LF_PCON KEY 1 SELECT (CONTO="")
|
||||
INPUT GRUPPO 103
|
||||
INPUT GRUPPO SS_GRUPPO
|
||||
DISPLAY "Gruppo" GRUPPO
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
DISPLAY "Tipo C/F" TMCF
|
||||
CHECKTYPE NORMAL
|
||||
OUTPUT 103 GRUPPO
|
||||
OUTPUT SS_GRUPPO GRUPPO
|
||||
OUTPUT 107 DESCR
|
||||
WARNING "Gruppo assente"
|
||||
CHECKTYPE NORMAL
|
||||
@ -36,100 +36,101 @@ BEGIN
|
||||
ADD RUN CG0 -0
|
||||
END
|
||||
|
||||
NUMBER 104 3
|
||||
NUMBER SS_CONTO 3
|
||||
BEGIN
|
||||
PROMPT 15 3 "Conto "
|
||||
FIELD LF_RCAUSALI->CONTO
|
||||
USE LF_PCON KEY 1 SELECT SOTTOCONTO=""
|
||||
INPUT GRUPPO 103
|
||||
INPUT CONTO 104
|
||||
INPUT GRUPPO SS_GRUPPO
|
||||
INPUT CONTO SS_CONTO
|
||||
DISPLAY "Gruppo" GRUPPO
|
||||
DISPLAY "Conto" CONTO
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
DISPLAY "Tipo C/F" TMCF
|
||||
CHECKTYPE NORMAL
|
||||
OUTPUT 102 TMCF
|
||||
OUTPUT 104 CONTO
|
||||
OUTPUT 103 GRUPPO
|
||||
OUTPUT SS_TIPOCF TMCF
|
||||
OUTPUT SS_CONTO CONTO
|
||||
OUTPUT SS_GRUPPO GRUPPO
|
||||
OUTPUT 107 DESCR
|
||||
OUTPUT 207 DESCR
|
||||
OUTPUT 307 DESCR
|
||||
MESSAGE DIRTY,105|DIRTY,205|DIRTY,305
|
||||
MESSAGE DIRTY,106|DIRTY,206|DIRTY,306
|
||||
WARNING "Conto assente"
|
||||
ADD RUN CG0 -0
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
// Sottoconto NORMALE
|
||||
NUMBER 105 6
|
||||
NUMBER SS_SOTTOCONTO 6
|
||||
BEGIN
|
||||
PROMPT 29 3 "Sottoconto "
|
||||
FIELD LF_RCAUSALI->SOTTOCONTO
|
||||
USE LF_PCON
|
||||
INPUT GRUPPO 103
|
||||
INPUT CONTO 104
|
||||
INPUT SOTTOCONTO 105
|
||||
INPUT GRUPPO SS_GRUPPO
|
||||
INPUT CONTO SS_CONTO
|
||||
INPUT SOTTOCONTO SS_SOTTOCONTO
|
||||
DISPLAY "Gruppo" GRUPPO
|
||||
DISPLAY "Conto" CONTO
|
||||
DISPLAY "Sottoconto" SOTTOCONTO
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT 105 SOTTOCONTO
|
||||
OUTPUT 205 SOTTOCONTO
|
||||
OUTPUT 305 SOTTOCONTO
|
||||
OUTPUT 103 GRUPPO
|
||||
OUTPUT 104 CONTO
|
||||
OUTPUT SS_SOTTOCONTO SOTTOCONTO
|
||||
OUTPUT 206 SOTTOCONTO
|
||||
OUTPUT 306 SOTTOCONTO
|
||||
OUTPUT SS_GRUPPO GRUPPO
|
||||
OUTPUT SS_CONTO CONTO
|
||||
OUTPUT 107 DESCR
|
||||
ADD RUN CG0 -0
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Inserire il sottoconto"
|
||||
WARNING "Sottoconto inesistente"
|
||||
WARNING "Sottoconto assente"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
|
||||
// Sottoconto CLIENTI
|
||||
NUMBER 205 6
|
||||
NUMBER 206 6
|
||||
BEGIN
|
||||
PROMPT 29 3 "Cliente "
|
||||
FIELD LF_RCAUSALI->SOTTOCONTO
|
||||
USE LF_CLIFO KEY 1
|
||||
INPUT TIPOCF "C"
|
||||
INPUT CODCF 205
|
||||
INPUT CODCF 206
|
||||
DISPLAY "Sottoconto" CODCF
|
||||
DISPLAY "Ragione sociale cliente@50" RAGSOC
|
||||
DISPLAY "Gruppo" GRUPPO
|
||||
DISPLAY "Conto" CONTO
|
||||
OUTPUT 205 CODCF
|
||||
OUTPUT 105 CODCF
|
||||
OUTPUT 305 CODCF
|
||||
OUTPUT 206 CODCF
|
||||
OUTPUT 106 CODCF
|
||||
OUTPUT 306 CODCF
|
||||
OUTPUT 207 RAGSOC
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Cliente assente"
|
||||
ADD RUN CG0 -1
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
// Sottoconto FORNITORI
|
||||
NUMBER 305 6
|
||||
NUMBER 306 6
|
||||
BEGIN
|
||||
PROMPT 29 3 "Fornitore "
|
||||
FIELD LF_RCAUSALI->SOTTOCONTO
|
||||
USE LF_CLIFO KEY 1
|
||||
INPUT TIPOCF "F"
|
||||
INPUT CODCF 305
|
||||
INPUT CODCF 306
|
||||
DISPLAY "Sottoconto" CODCF
|
||||
DISPLAY "Ragione sociale fornitore@50" RAGSOC
|
||||
DISPLAY "Gruppo" GRUPPO
|
||||
DISPLAY "Conto" CONTO
|
||||
OUTPUT 305 CODCF
|
||||
OUTPUT 105 CODCF
|
||||
OUTPUT 205 CODCF
|
||||
OUTPUT 306 CODCF
|
||||
OUTPUT 106 CODCF
|
||||
OUTPUT 206 CODCF
|
||||
OUTPUT 307 RAGSOC
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Fornitore assente"
|
||||
ADD RUN CG0 -1
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
LISTBOX 106 5
|
||||
LISTBOX SS_SEZIONE 5
|
||||
BEGIN
|
||||
PROMPT 51 3 "Sezione "
|
||||
ITEM " | "
|
||||
@ -150,9 +151,9 @@ BEGIN
|
||||
DISPLAY "Gruppo" GRUPPO
|
||||
DISPLAY "Conto" CONTO
|
||||
DISPLAY "Sottoconto" SOTTOCONTO
|
||||
OUTPUT 105 SOTTOCONTO
|
||||
OUTPUT 104 CONTO
|
||||
OUTPUT 103 GRUPPO
|
||||
OUTPUT SS_SOTTOCONTO SOTTOCONTO
|
||||
OUTPUT SS_CONTO CONTO
|
||||
OUTPUT SS_GRUPPO GRUPPO
|
||||
OUTPUT 107 DESCR
|
||||
ADD RUN CG0 -0
|
||||
GROUP 1
|
||||
@ -165,13 +166,13 @@ BEGIN
|
||||
FIELD LF_RCAUSALI->DESC
|
||||
USE LF_CLIFO KEY 2
|
||||
INPUT TIPOCF "C"
|
||||
INPUT CODCF 205
|
||||
INPUT RAGSOC 207
|
||||
DISPLAY "Tipo C/F" TIPOCF
|
||||
DISPLAY "Ragione sociale@50" RAGSOC
|
||||
DISPLAY "Ragione sociale Cliente@50" RAGSOC
|
||||
DISPLAY "Gruppo" GRUPPO
|
||||
DISPLAY "Conto" CONTO
|
||||
DISPLAY "Sottoconto" CODCF
|
||||
OUTPUT 205 CODCF
|
||||
OUTPUT 206 CODCF
|
||||
OUTPUT 207 RAGSOC
|
||||
GROUP 1
|
||||
END
|
||||
@ -183,65 +184,52 @@ BEGIN
|
||||
FIELD LF_RCAUSALI->DESC
|
||||
USE LF_CLIFO KEY 2
|
||||
INPUT TIPOCF "F"
|
||||
INPUT CODCF 305
|
||||
INPUT RAGSOC 307
|
||||
DISPLAY "Tipo C/F" TIPOCF
|
||||
DISPLAY "Ragione sociale@50" RAGSOC
|
||||
DISPLAY "Ragione sociale Fornitore@50" RAGSOC
|
||||
DISPLAY "Gruppo" GRUPPO
|
||||
DISPLAY "Conto" CONTO
|
||||
DISPLAY "Sottoconto" CODCF
|
||||
OUTPUT 305 CODCF
|
||||
OUTPUT 306 CODCF
|
||||
OUTPUT 307 RAGSOC
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING 108 5
|
||||
STRING SS_DESCAGG 5
|
||||
BEGIN
|
||||
PROMPT 1 7 "Descrizione aggiuntiva "
|
||||
FIELD LF_RCAUSALI->CODDESC
|
||||
FLAGS "U"
|
||||
USE %DPN
|
||||
INPUT CODTAB 108
|
||||
INPUT CODTAB SS_DESCAGG
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione @50" S0
|
||||
OUTPUT 108 CODTAB
|
||||
FLAGS "R"
|
||||
OUTPUT SS_DESCAGG CODTAB
|
||||
OUTPUT 109 S0
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
BOOLEAN 109
|
||||
STRING 109 5
|
||||
BEGIN
|
||||
PROMPT 34 7 "Riga iva "
|
||||
FIELD LF_RCAUSALI->RIGAIVA
|
||||
PROMPT 1 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING 110 4
|
||||
BEGIN
|
||||
USE %IVA
|
||||
PROMPT 48 7 "Codice iva "
|
||||
INPUT CODTAB 110
|
||||
FIELD LF_RCAUSALI->CODIVA
|
||||
DISPLAY "Codice " CODTAB
|
||||
DISPLAY "Descrizione @50" S0
|
||||
OUTPUT 110 CODTAB
|
||||
FLAGS "D"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -13 -1 ""
|
||||
PROMPT -13 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 9 2
|
||||
BEGIN
|
||||
PROMPT -23 -1 ""
|
||||
PROMPT -23 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_NULL 9 2
|
||||
BEGIN
|
||||
PROMPT -33 -1 "Azzera"
|
||||
MESSAGE RESET,1@
|
||||
PROMPT -33 -1 "Azzera"
|
||||
MESSAGE RESET,1@
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
@ -55,7 +55,6 @@ TMask* TPrimanota_application::load_mask(int n)
|
||||
break;
|
||||
case 1:
|
||||
m->set_handler(F_VISVAL, visval_handler);
|
||||
m->set_handler(F_DESCR, descr_handler);
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
@ -95,6 +94,7 @@ if (n == 1 || n == 2)
|
||||
{
|
||||
m->set_handler(F_DATAREG, datareg_handler);
|
||||
m->set_handler(F_DATACOMP, datacomp_handler);
|
||||
m->set_handler(F_DESCR, descr_handler);
|
||||
m->set_handler(F_CODCAUS, caus_modify_handler);
|
||||
m->set_handler(F_SHEETCG, cg_handler);
|
||||
|
||||
@ -842,6 +842,7 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
||||
m.set(F_DATAREG, curr_mask().get(F_DATAREG));
|
||||
m.set(F_DATACOMP, curr_mask().get(F_DATACOMP));
|
||||
m.set(F_DATADOC, curr_mask().get(F_DATADOC));
|
||||
m.set(F_NUMDOC, curr_mask().get(F_NUMDOC));
|
||||
m.set(F_NUMREG, ++_lastreg); // Incrementa numero di registrazione
|
||||
m.set(F_DESCR, caus.desc_agg(1)); // Descrizione
|
||||
m.set(F_CODCAUS, causimm); // Cambia causale
|
||||
@ -871,10 +872,13 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
||||
inc.lfile().put("TIPODOC", caus.tipo_doc()); // Tipo documento
|
||||
inc.lfile().put("REG", caus.reg().name()); // Registro
|
||||
|
||||
const int annoes = m.get_int(F_ANNOES);
|
||||
|
||||
TRectype& r = inc.cg(0);
|
||||
r.zero();
|
||||
r.put("NUMREG", _lastreg);
|
||||
r.put("NUMRIG", 1);
|
||||
r.put("ANNOES", annoes);
|
||||
r.put("SEZIONE", m.get(I_SEZIONE1));
|
||||
r.put("IMPORTO", m.get(F_TOTALE));
|
||||
r.put("TIPOC", m.get(F_CLIFO));
|
||||
@ -896,6 +900,7 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
||||
r.put("IMPORTO", imp);
|
||||
r.put("NUMREG", _lastreg);
|
||||
r.put("NUMRIG", i);
|
||||
r.put("ANNOES", annoes);
|
||||
r.put("SEZIONE", m.get(sid));
|
||||
r.put("TIPOC", ' ');
|
||||
r.put("GRUPPO", m.get(sid+2));
|
||||
|
@ -535,6 +535,19 @@ bool TPrimanota_application::cg_notify(int r, KEY k)
|
||||
|
||||
bool TPrimanota_application::descr_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_TAB && f.focusdirty())
|
||||
{
|
||||
if (app().iva() != nessuna_iva)
|
||||
{
|
||||
const int first = type2pos('T');
|
||||
if (first >= 0)
|
||||
{
|
||||
TSheet_field& cg = app().cgs();
|
||||
cg.row(first).add(f.get(), 8);
|
||||
cg.force_update(first);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (k == K_ENTER && f.get().empty())
|
||||
{
|
||||
if (f.mask().get(F_CODCAUS).empty())
|
||||
|
@ -37,7 +37,7 @@ END
|
||||
|
||||
NUMBER 102 15
|
||||
BEGIN
|
||||
PROMPT 44 5 "Avere "
|
||||
PROMPT 42 5 "Avere "
|
||||
FLAGS "RV"
|
||||
PICTURE "."
|
||||
END
|
||||
|
@ -16,7 +16,7 @@ int main(int argc,char** argv)
|
||||
case 2:
|
||||
cg4300(argc,argv); break;
|
||||
case 3:
|
||||
/* cg4400(argc,argv); */ break;
|
||||
cg4400(argc,argv); break;
|
||||
case 4:
|
||||
cg4500(argc,argv); break;
|
||||
case 5:
|
||||
|
@ -1456,10 +1456,19 @@ print_action CG4400_application::postprocess_print(int file, int counter)
|
||||
bool CG4400_application::set_print(int n)
|
||||
{
|
||||
TMask m("cg4400a");
|
||||
<<<<<<< cg4400.cpp
|
||||
|
||||
const bool ok = set_ditte(m);
|
||||
=======
|
||||
int giorni_del_mese;
|
||||
>>>>>>> 1.17
|
||||
|
||||
<<<<<<< cg4400.cpp
|
||||
if (ok)
|
||||
=======
|
||||
// bool ok = set_ditte(m);
|
||||
if (set_ditte(m))
|
||||
>>>>>>> 1.17
|
||||
if (_selected.ones() > 0l)
|
||||
{
|
||||
_annoes = m.get_int(ANNO);//in realta' e' l'anno IVA !!!
|
||||
@ -1504,8 +1513,13 @@ bool CG4400_application::set_print(int n)
|
||||
stampa_registri_IVA(m);
|
||||
}
|
||||
else warning_box("Nessuna ditta selezionata!");
|
||||
<<<<<<< cg4400.cpp
|
||||
|
||||
return ok;
|
||||
=======
|
||||
return FALSE;
|
||||
// return ok;
|
||||
>>>>>>> 1.17
|
||||
}
|
||||
|
||||
void CG4400_application::stampa_registri_IVA(const TMask& m)
|
||||
@ -1530,6 +1544,16 @@ void CG4400_application::stampa_registri_IVA(const TMask& m)
|
||||
if (!ok) continue;
|
||||
|
||||
if (!_stampa_tutti_i_registri)
|
||||
<<<<<<< cg4400.cpp
|
||||
{
|
||||
*_cur = 0L;
|
||||
const long items = _cur->items();
|
||||
if (items > 0)
|
||||
print();
|
||||
if (_tipo_stampa != 3)
|
||||
aggiorna_reg();
|
||||
}
|
||||
=======
|
||||
{
|
||||
(*_cur) = 0L;
|
||||
const long item = _cur->items();
|
||||
@ -1537,6 +1561,7 @@ void CG4400_application::stampa_registri_IVA(const TMask& m)
|
||||
print();
|
||||
if (_tipo_stampa != 3) aggiorna_reg();
|
||||
}
|
||||
>>>>>>> 1.17
|
||||
else
|
||||
{
|
||||
TString16 codtab;
|
||||
|
@ -14,4 +14,6 @@
|
||||
#define CHK_NOVIIP 114
|
||||
#define CHK_NOVIPC 115
|
||||
#define CHK_GSACMI 116
|
||||
#define CHK_SAVENEW 117
|
||||
#define CHK_21SAVENEW 117
|
||||
#define CHK_02SAVENEW 118
|
||||
|
||||
|
@ -133,18 +133,36 @@ END
|
||||
|
||||
BOOLEAN CHK_POCUDR
|
||||
BEGIN
|
||||
<<<<<<< cg5000a.uml
|
||||
PROMPT 3 2 "Posizionare automaticamente il cursore sulla data di registrazione"
|
||||
=======
|
||||
PROMPT 3 2 "Posizionare cursore sulla data di operazione in fase di ricerca"
|
||||
>>>>>>> 1.6
|
||||
HELP "Determina il posizionamento automatico del cursore sulla data di registrazione invece che sulla causale"
|
||||
FIELD PoCuDr
|
||||
END
|
||||
|
||||
BOOLEAN CHK_SAVENEW
|
||||
BOOLEAN CHK_21SAVENEW
|
||||
BEGIN
|
||||
PROMPT 3 3 "Rimanere in modifica dopo la registrazione di un documento"
|
||||
HELP "Dopo aver effettuato una registrazione rimane in modifica dello stesso documento invece di passare all'inserimento di uno nuovo"
|
||||
FIELD Cg21SN
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 74 3
|
||||
BEGIN
|
||||
PROMPT 1 5 "Anagrafica Clienti/Fornitori"
|
||||
END
|
||||
|
||||
BOOLEAN CHK_02SAVENEW
|
||||
BEGIN
|
||||
PROMPT 3 6 "Rimanere in modifica dopo la registrazione di un cliente/fornitore"
|
||||
HELP "Dopo aver effettuato una registrazione rimane in modifica della stessa anagrafica invece di passare all'inserimento di una nuova"
|
||||
FIELD Cg02SN
|
||||
END
|
||||
|
||||
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
|
44
cg/conto.cpp
44
cg/conto.cpp
@ -62,15 +62,19 @@ const TBill& TBill::add_to(TToken_string& ts, int from, int mode)
|
||||
if (mode & 0x4)
|
||||
{
|
||||
const int cr = tipo_cr();
|
||||
ts.add(cr > 0 ? format("%d", cr) : " ", from++);
|
||||
if (cr > 0) ts.add(cr, from++); else ts.add(" ", from++);
|
||||
}
|
||||
|
||||
if (mode & 0x1)
|
||||
ts.add(_tipo, from++);
|
||||
ts.add(_gruppo, from++);
|
||||
ts.add(_conto, from++);
|
||||
ts.add(_sottoconto, from++);
|
||||
|
||||
if (_gruppo > 0) ts.add(_gruppo, from++); else ts.add(" ", from++);
|
||||
if (_conto > 0) ts.add(_conto, from++); else ts.add(" ", from++);
|
||||
if (_sottoconto > 0L) ts.add(_sottoconto, from++); else ts.add(" ", from++);
|
||||
|
||||
if (mode & 0x2)
|
||||
ts.add(descrizione(), from++);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -107,7 +111,7 @@ const char* TBill::describe()
|
||||
int err = NOERR;
|
||||
const char* desc = NULL;
|
||||
|
||||
if (_tipo != 'C' && _tipo != 'F')
|
||||
if ((_tipo != 'C' && _tipo != 'F') || _sottoconto == 0L)
|
||||
{
|
||||
TLocalisamfile pcon(LF_PCON, FALSE);
|
||||
pcon.setkey(1);
|
||||
@ -118,19 +122,11 @@ const char* TBill::describe()
|
||||
err = pcon.read();
|
||||
if (err == NOERR)
|
||||
{
|
||||
if (_sottoconto != 0)
|
||||
{
|
||||
const char c = pcon.get_char("TMCF");
|
||||
_tipo = (c < ' ') ? ' ' : c; // Force correct type
|
||||
}
|
||||
if (_tipo == ' ')
|
||||
{
|
||||
_tipo_cr = pcon.get_int("TIPOSPRIC");
|
||||
desc = pcon.get("DESCR");
|
||||
}
|
||||
_tipo_cr = pcon.get_int("TIPOSPRIC");
|
||||
desc = pcon.get("DESCR");
|
||||
}
|
||||
}
|
||||
if (_tipo == 'C' || _tipo == 'F')
|
||||
if ((_tipo == 'C' || _tipo == 'F') && _sottoconto != 0L)
|
||||
{
|
||||
TLocalisamfile clifo(LF_CLIFO, FALSE);
|
||||
clifo.setkey(1);
|
||||
@ -225,14 +221,26 @@ const char* TBill::string(int mode)
|
||||
{
|
||||
TFixed_string s(&__tmp_string[256], 80);
|
||||
s.cut(0);
|
||||
|
||||
if (mode & 0x4)
|
||||
{
|
||||
const int cr = tipo_cr();
|
||||
s << (cr > 0 ? format("%d", cr) : " ") << '|';
|
||||
if (cr > 0) s << cr << '|';
|
||||
else s << " |";
|
||||
}
|
||||
|
||||
if (mode & 0x1)
|
||||
s << _tipo << '|';
|
||||
s << _gruppo << '|' << _conto << '|' << _sottoconto;
|
||||
|
||||
if (_gruppo > 0) s << _gruppo << '|';
|
||||
else s << " |";
|
||||
|
||||
if (_conto > 0) s << _conto << '|';
|
||||
else s << " |";
|
||||
|
||||
if (_sottoconto > 0L) s << _sottoconto;
|
||||
else s << ' ';
|
||||
|
||||
if (mode & 0x2)
|
||||
s << '|' << descrizione();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user