Commit di guy per Enrica
git-svn-id: svn://10.65.10.50/trunk@1031 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
bf5d8d08fa
commit
429bebccbc
515
cg/cg0400.cpp
515
cg/cg0400.cpp
@ -1,3 +1,6 @@
|
|||||||
|
//
|
||||||
|
//Riepilogo Progressivi IVA
|
||||||
|
//
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <date.h>
|
#include <date.h>
|
||||||
#include <lffiles.h>
|
#include <lffiles.h>
|
||||||
@ -9,42 +12,39 @@
|
|||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <anagr.h>
|
#include <anagr.h>
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
|
#include "classpim.h"
|
||||||
#include "cg0.h"
|
#include "cg0.h"
|
||||||
#include "cg0400.h"
|
#include "cg0400.h"
|
||||||
|
|
||||||
|
struct Importi {
|
||||||
|
real imponibile;
|
||||||
|
real imposta;
|
||||||
|
};
|
||||||
|
|
||||||
class CG0400_application : public TPrintapp
|
class CG0400_application : public TPrintapp
|
||||||
{
|
{
|
||||||
|
TTable* _tabpim, * _tabreg;
|
||||||
TTable* _tabpim, * _tabreg;
|
|
||||||
TLocalisamfile* _nditte, * _attiv, * _anag, * _com;
|
TLocalisamfile* _nditte, * _attiv, * _anag, * _com;
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TDate _data;
|
TDate _data;
|
||||||
int _i, _sospmsk, _tipoprog, _livelloprog, _tipo_crmsk;
|
int _sospmsk, _tipoprog, _livelloprog, _tipo_crmsk, _annoiva, _i;
|
||||||
TString _cap,_cofi,_paiva,_ragsoc,_comunefis,_provfis,_viafis,_codivamsk,_codattmsk;
|
TString _cap,_cofi,_paiva,_ragsoc,_comunefis,_provfis,_viafis,_codivamsk,_codattmsk;
|
||||||
bool _vuoilordi;
|
//bool _vuoilordi;
|
||||||
real _imponibile, _imposta, _lordo, _imponibile_v, _imposta_v, _lordo_v;
|
Importi _mesi[12];
|
||||||
real _imponibile_vs, _imposta_vs, _lordo_vs, _totimponibile_v, _totimposta_v;
|
|
||||||
real _totlordo_v, _totimponibile_vs, _totimposta_vs, _totlordo_vs, _imponibile_acq;
|
|
||||||
real _imposta_acq, _lordo_acq, _totimponibile_acq, _totimposta_acq, _totlordo_acq;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool user_create();
|
virtual bool user_create();
|
||||||
bool user_destroy();
|
virtual bool user_destroy();
|
||||||
bool set_print(int);
|
virtual bool set_print(int);
|
||||||
|
|
||||||
bool menu(MENU_TAG m) { return TPrintapp::menu(m); }
|
|
||||||
|
|
||||||
virtual void preprocess_header();
|
|
||||||
virtual bool preprocess_page(int,int);
|
virtual bool preprocess_page(int,int);
|
||||||
virtual print_action postprocess_page(int,int);
|
virtual print_action postprocess_page(int,int);
|
||||||
virtual bool preprocess_print(int,int);
|
void cerca_i_pim();
|
||||||
|
void azzera_mesi();
|
||||||
|
void get_dati_ditta();
|
||||||
|
void setta_intestazione();
|
||||||
|
void calcola_totali(real&,real&);
|
||||||
|
int stampa_intestazione_ditta();
|
||||||
|
|
||||||
void fai_ricerca(int);
|
|
||||||
void get_dati_ditta();
|
|
||||||
int stampa_intestazione_ditta();
|
|
||||||
|
|
||||||
public:
|
|
||||||
CG0400_application(){};
|
CG0400_application(){};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -73,226 +73,229 @@ bool CG0400_application::user_destroy()
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG0400_application::fai_ricerca(int i)
|
void CG0400_application::azzera_mesi()
|
||||||
{
|
{
|
||||||
TString codtab,codreg,dep,codiva,codatt;
|
for (int i=0; i<12; i++)
|
||||||
int mese;
|
{
|
||||||
long anno;
|
_mesi[i].imponibile = ZERO;
|
||||||
|
_mesi[i].imposta = ZERO;
|
||||||
_imponibile=0;
|
}
|
||||||
_imponibile_v=0;
|
|
||||||
_imponibile_vs=0;
|
|
||||||
_imposta=0;
|
|
||||||
_imposta_v=0;
|
|
||||||
_imposta_vs=0;
|
|
||||||
_lordo=0;
|
|
||||||
_lordo_v=0;
|
|
||||||
_lordo_vs=0;
|
|
||||||
_imponibile_acq=0;
|
|
||||||
_imposta_acq=0;
|
|
||||||
_lordo_acq=0;
|
|
||||||
|
|
||||||
_tabpim->first();
|
|
||||||
while (!_tabpim->eof()) //Scorre tutti i record della tabella PIM
|
|
||||||
{
|
|
||||||
_imponibile = 0;
|
|
||||||
_imposta = 0;
|
|
||||||
_lordo = 0;
|
|
||||||
codtab = _tabpim->curr().get("CODTAB");
|
|
||||||
mese = atoi(codtab.mid(12,2));
|
|
||||||
if (_livelloprog == 1) //Se si tratta di una aliquota
|
|
||||||
{
|
|
||||||
codiva = codtab.mid(15,3);
|
|
||||||
codatt = codtab.mid(4,5);
|
|
||||||
}
|
|
||||||
else //altrimenti se si tratta di una attivita'
|
|
||||||
{
|
|
||||||
codatt = codtab.mid(4,5);
|
|
||||||
codiva = codtab.mid(55,3);
|
|
||||||
}
|
|
||||||
if (((mese==i)&&(codiva==_codivamsk))||((mese==i)&&(codatt==_codattmsk)))
|
|
||||||
{
|
|
||||||
codreg = codtab.mid(9,3);
|
|
||||||
anno = atoi(codtab.mid(0,4));
|
|
||||||
_tabreg->curr().zero();
|
|
||||||
dep = format("%04d", anno);
|
|
||||||
dep << format("%3s", (const char*)codreg);
|
|
||||||
_tabreg->curr().put("CODTAB", (const char*)dep);
|
|
||||||
_tabreg->read();
|
|
||||||
if (_tabreg->bad())
|
|
||||||
_tabreg->curr().zero();
|
|
||||||
int tipo = atoi(_tabreg->curr().get("I0"));
|
|
||||||
if ((tipo == 1) && (_tipoprog == 1)) //Se si tratta di una vendita
|
|
||||||
{
|
|
||||||
int tipo_importo = (int) _tabreg->curr().get_long("I0");
|
|
||||||
bool sosp = _tabreg->curr().get_bool("B0");
|
|
||||||
if (tipo_importo == 1) // 1=importo netto 2=importo lordo
|
|
||||||
{
|
|
||||||
_imponibile = _tabpim->curr().get_real("R0");
|
|
||||||
|
|
||||||
_imposta = _tabpim->curr().get_real("R1");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
_lordo = _tabpim->curr().get_real("R2");
|
|
||||||
if (sosp) //Se e' una vendita in sospensione d'imposta
|
|
||||||
{
|
|
||||||
_imponibile_vs += _imponibile;
|
|
||||||
_imposta_vs += _imposta;
|
|
||||||
_lordo_vs += _lordo;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_imponibile_v += _imponibile;
|
|
||||||
_imposta_v += _imposta;
|
|
||||||
_lordo_v += _lordo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ((tipo == 2) && (_tipoprog == 2)) //Se si tratta di un acquisto
|
|
||||||
{
|
|
||||||
int tipo_importo = atoi(codtab.mid(15,1));
|
|
||||||
int tipo_cr = atoi(codtab.mid(14,1));
|
|
||||||
if (_tipo_crmsk == tipo_cr)
|
|
||||||
{
|
|
||||||
if (tipo_importo == 1) // 1=importo netto 2=importo lordo
|
|
||||||
{
|
|
||||||
_imponibile = _tabpim->curr().get_real("R0");
|
|
||||||
|
|
||||||
_imposta = _tabpim->curr().get_real("R1");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
_lordo = _tabpim->curr().get_real("R2");
|
|
||||||
|
|
||||||
_imponibile_acq += _imponibile;
|
|
||||||
_imposta_acq += _imposta;
|
|
||||||
_lordo_acq += _lordo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_tabpim->next();
|
|
||||||
}
|
|
||||||
|
|
||||||
_totimponibile_v+=_imponibile_v;
|
|
||||||
_totimposta_v+=_imposta_v;
|
|
||||||
_totlordo_v+=_lordo_v;
|
|
||||||
_totimponibile_vs+=_imponibile_vs;
|
|
||||||
_totimposta_vs+=_imposta_vs;
|
|
||||||
_totlordo_vs+=_lordo_vs;
|
|
||||||
_totimponibile_acq+= _imponibile_acq;
|
|
||||||
_totimposta_acq+= _imposta_acq;
|
|
||||||
_totlordo_acq+= _lordo_acq;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CG0400_application::cerca_i_pim()
|
||||||
|
{
|
||||||
|
TTable pim("PIM");
|
||||||
|
for (pim.first(); !pim.eof(); pim.next())
|
||||||
|
{
|
||||||
|
real imponibile, imposta, impo, impos;
|
||||||
|
tiporec tipo;
|
||||||
|
|
||||||
|
TString80 codtab = pim.get("CODTAB");
|
||||||
|
int anno = atoi(codtab.mid(0,4));
|
||||||
|
TString16 codatt = codtab.mid(4,5);
|
||||||
|
int mese = atoi(codtab.mid(13,2));
|
||||||
|
TString16 codiva = codtab.mid(16,4);
|
||||||
|
|
||||||
|
if (anno != _annoiva) continue;
|
||||||
|
|
||||||
|
if (_livelloprog == 1) //riepilogo per aliquota
|
||||||
|
if (codiva.trim() != _codivamsk) continue;
|
||||||
|
|
||||||
|
if (_livelloprog == 2) //riepilogo per attivita'
|
||||||
|
if (codatt.trim() != _codattmsk) continue;
|
||||||
|
|
||||||
|
impo = impos = ZERO;
|
||||||
|
|
||||||
|
while (classify_pim(pim.curr(), imponibile, imposta, tipo))
|
||||||
|
{
|
||||||
|
switch(tipo)
|
||||||
|
{
|
||||||
|
case acq_norm:
|
||||||
|
if (_tipoprog == 1) break; //vendite
|
||||||
|
if (_tipo_crmsk == 1) //nella maschera e' stato richiesto
|
||||||
|
{ //acquisti in genere
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case vend_norm:
|
||||||
|
if (_tipoprog == 2) break; //acquisti
|
||||||
|
if (_tipo_crmsk == 1) //nella maschera e' stato richiesto
|
||||||
|
{ //vendite in genere
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case acq_ind_op_es:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 2)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case acq_ind_pass_int:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 3)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case acq_ind_art_19:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 4)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case base_ventilazione:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 5)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case bolle_doganali:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 6)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case acq_beni_riv:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 1)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case acq_beni_ammort:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 2)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case acq_beni_ammort_nd:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 3)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case acq_beni_leasing:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 4)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case acq_amm_ultdetr:
|
||||||
|
if (_tipoprog == 1) break;
|
||||||
|
if (_tipo_crmsk == 6)
|
||||||
|
{
|
||||||
|
impo += imponibile;
|
||||||
|
impos += imposta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} //fine while
|
||||||
|
_mesi[mese].imponibile += impo;
|
||||||
|
_mesi[mese].imposta += impos;
|
||||||
|
impo = impos = ZERO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CG0400_application::set_print(int)
|
bool CG0400_application::set_print(int)
|
||||||
{
|
{
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
tasto = _msk->run();
|
tasto = _msk->run();
|
||||||
if (tasto == K_ENTER)
|
if (tasto == K_ENTER)
|
||||||
{
|
{
|
||||||
_sospmsk = atoi(_msk->get(F_TIPOTAB));
|
_annoiva = _msk->get_int(F_ANNO);
|
||||||
_vuoilordi = (bool)(_msk->get(F_VUOILORDI) == "X");
|
//_vuoilordi = _msk->get_bool(F_VUOILORDI);
|
||||||
_tipoprog = atoi(_msk->get(F_TIPO));
|
_tipoprog = _msk->get_int(F_TIPO); // 1 <=> vendite; 2 <=> acquisti
|
||||||
_livelloprog = atoi(_msk->get(F_LIVELLO));
|
if (_tipoprog == 1)
|
||||||
if (_livelloprog == 1) //Se si tratta di una aliquota
|
_sospmsk = _msk->get_int(F_TIPOTAB); //vendite in genere; vendite in sospensione d'imposta
|
||||||
|
_livelloprog = _msk->get_int(F_LIVELLO);
|
||||||
|
if (_livelloprog == 1) //si tratta di una aliquota
|
||||||
{
|
{
|
||||||
_codivamsk = _msk->get(F_CODIVA);
|
_codivamsk = _msk->get(F_CODIVA);
|
||||||
_tipo_crmsk = atoi(_msk->get(F_TIPOTABE));
|
_tipo_crmsk = _msk->get_int(F_TIPOTABE);
|
||||||
}
|
}
|
||||||
else //altrimenti se si tratta di una attivita'
|
else //si tratta di una attivita'
|
||||||
{
|
{
|
||||||
_codattmsk = _msk->get(F_ATTIVITA);
|
_codattmsk = _msk->get(F_ATTIVITA);
|
||||||
_tipo_crmsk = atoi(_msk->get(F_TIPOTABEL));
|
_tipo_crmsk = _msk->get_int(F_TIPOTABEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_real_picture("###.###.###.###");
|
||||||
|
set_print_zero();
|
||||||
|
|
||||||
|
setta_intestazione();
|
||||||
|
|
||||||
|
azzera_mesi();
|
||||||
|
cerca_i_pim();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CG0400_application::calcola_totali(real& imp, real& imps)
|
||||||
bool CG0400_application::preprocess_print(int file,int counter)
|
|
||||||
{
|
{
|
||||||
set_real_picture("###.###.###.###");
|
for (int i=0; i<12; i++)
|
||||||
set_print_zero();
|
{
|
||||||
_totimponibile_v = 0;
|
imp += _mesi[i].imponibile;
|
||||||
_totimposta_v = 0;
|
imps += _mesi[i].imposta;
|
||||||
_totlordo_v = 0;
|
}
|
||||||
_totimponibile_vs = 0;
|
|
||||||
_totimposta_vs = 0;
|
|
||||||
_totlordo_vs = 0;
|
|
||||||
_totimponibile_acq = 0;
|
|
||||||
_totimposta_acq = 0;
|
|
||||||
_totlordo_acq = 0;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CG0400_application::preprocess_page(int file, int counter)
|
bool CG0400_application::preprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
const char* mese;
|
|
||||||
reset_print();
|
reset_print();
|
||||||
|
|
||||||
if (counter)
|
if (counter)
|
||||||
_i++;
|
_i++;
|
||||||
else
|
else
|
||||||
_i = 1;
|
_i = 1;
|
||||||
|
|
||||||
fai_ricerca(_i);
|
const char* mese = itom(_i);
|
||||||
mese = itom(_i);
|
|
||||||
set_row(1,"%s", mese);
|
set_row(1,"%s", mese);
|
||||||
if (_tipoprog == 1)
|
set_row(1,"@26g%r", &_mesi[_i].imponibile);
|
||||||
{
|
set_row(1,"@56g%r", &_mesi[_i].imposta);
|
||||||
if (_sospmsk == 1)
|
//if (_vuoilordi)
|
||||||
{
|
// set_row(1,"@48g%r", &_lordo_v);
|
||||||
set_row(1,"@16g%r", &_imponibile_v);
|
|
||||||
set_row(1,"@32g%r", &_imposta_v);
|
|
||||||
if (_vuoilordi)
|
|
||||||
set_row(1,"@48g%r", &_lordo_v);
|
|
||||||
}
|
|
||||||
else if (_sospmsk == 2)
|
|
||||||
{
|
|
||||||
set_row(1,"@16g%r", &_imponibile_vs);
|
|
||||||
set_row(1,"@32g%r", &_imposta_vs);
|
|
||||||
if (_vuoilordi)
|
|
||||||
set_row(1,"@48g%r",&_lordo_vs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_tipoprog == 2)
|
|
||||||
{
|
|
||||||
set_row(1,"@16g%r", &_imponibile_acq);
|
|
||||||
set_row(1,"@32g%r", &_imposta_acq);
|
|
||||||
if (_vuoilordi)
|
|
||||||
set_row(1,"@48g%r", &_lordo_acq);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_i == 12)
|
if (_i == 12)
|
||||||
{
|
{
|
||||||
|
real tot_impo = ZERO;
|
||||||
|
real tot_imposta = ZERO;
|
||||||
|
|
||||||
|
calcola_totali(tot_impo, tot_imposta);
|
||||||
|
|
||||||
TString dep = "";
|
TString dep = "";
|
||||||
set_row(2,(const char*) dep);
|
set_row(2,(const char*) dep);
|
||||||
set_row(3,"@10gTotale");
|
set_row(3,"@8gTotale");
|
||||||
if (_tipoprog == 1)
|
set_row(3,"@26g%r", &tot_impo);
|
||||||
{
|
set_row(3,"@56g%r", &tot_imposta);
|
||||||
if (_sospmsk == 1)
|
// if (_vuoilordi)
|
||||||
{
|
// set_row(3,"@48g%r", &_totlordo_v);
|
||||||
set_row(3,"@16g%r", &_totimponibile_v);
|
|
||||||
set_row(3,"@32g%r", &_totimposta_v);
|
|
||||||
if (_vuoilordi)
|
|
||||||
set_row(3,"@48g%r", &_totlordo_v);
|
|
||||||
}
|
|
||||||
else if (_sospmsk == 2)
|
|
||||||
{
|
|
||||||
set_row(3,"@16g%r", &_totimponibile_vs);
|
|
||||||
set_row(3,"@32g%r", &_totimposta_vs);
|
|
||||||
if (_vuoilordi)
|
|
||||||
set_row(3,"@48g%r", &_totlordo_vs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_tipoprog == 2)
|
|
||||||
{
|
|
||||||
set_row(3,"@16g%r", &_totimponibile_acq);
|
|
||||||
set_row(3,"@32g%r", &_totimposta_acq);
|
|
||||||
if (_vuoilordi)
|
|
||||||
set_row(3,"@48g%r", &_totlordo_acq);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,7 +306,7 @@ TRectype& look_com (const char * cod, TLocalisamfile *comuni)
|
|||||||
comuni->read();
|
comuni->read();
|
||||||
if (comuni->bad())
|
if (comuni->bad())
|
||||||
comuni->zero();
|
comuni->zero();
|
||||||
|
|
||||||
return comuni->curr();
|
return comuni->curr();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,7 +336,6 @@ void CG0400_application::get_dati_ditta()
|
|||||||
|
|
||||||
_cofi = anag.get(ANA_COFI);
|
_cofi = anag.get(ANA_COFI);
|
||||||
_paiva = anag.get(ANA_PAIV);
|
_paiva = anag.get(ANA_PAIV);
|
||||||
//_ragsoc = anag.get(ANA_RAGSOC);
|
|
||||||
_comunefis = anag.get(ANA_COMRF);
|
_comunefis = anag.get(ANA_COMRF);
|
||||||
|
|
||||||
if (_comunefis.empty())
|
if (_comunefis.empty())
|
||||||
@ -360,49 +362,102 @@ void CG0400_application::get_dati_ditta()
|
|||||||
|
|
||||||
int CG0400_application::stampa_intestazione_ditta()
|
int CG0400_application::stampa_intestazione_ditta()
|
||||||
{
|
{
|
||||||
int r = 3;
|
int r = 1;
|
||||||
TString codice_ditta;
|
TString codice_ditta;
|
||||||
TString riga(132);
|
TString riga(132);
|
||||||
|
|
||||||
get_dati_ditta();
|
get_dati_ditta();
|
||||||
codice_ditta << get_firm();
|
codice_ditta << get_firm();
|
||||||
|
|
||||||
set_header (r, "Ditta %s %s Via %s %s %s %s", (const char*)codice_ditta,
|
set_header (r, "Ditta %s %s %s %s %s %s", (const char*)codice_ditta,
|
||||||
(const char*)_ragsoc, (const char*)_viafis,
|
(const char*)_ragsoc, (const char*)_viafis,
|
||||||
(const char*)_cap, (const char*)_comunefis,
|
(const char*)_cap, (const char*)_comunefis,
|
||||||
(const char*)_provfis);
|
(const char*)_provfis);
|
||||||
r++;
|
r++;
|
||||||
printer().setdate(_data);
|
|
||||||
riga = "Data @< Pag. @#";
|
riga = "Data @< Pag. @#";
|
||||||
riga.right_just(127);
|
riga.right_just(127);
|
||||||
riga.overwrite (format ("Partita iva %s Codice fiscale %s", (const char*)_paiva, (const char*)_cofi));
|
riga.overwrite (format ("Partita iva %s Codice fiscale %s", (const char*)_paiva, (const char*)_cofi));
|
||||||
set_header (r, "%s", (const char*) riga);
|
set_header (r, "%s", (const char*) riga);
|
||||||
r++;
|
r+=3;
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG0400_application::preprocess_header()
|
void CG0400_application::setta_intestazione()
|
||||||
{
|
{
|
||||||
int r = 1;
|
int r = 1;
|
||||||
|
|
||||||
reset_header();
|
reset_header();
|
||||||
if (_livelloprog == 1)
|
|
||||||
set_header(1, "@30gProgressivi IVA per Aliquota");
|
|
||||||
else set_header(1, "@30gProgressivi IVA per Attivita'");
|
|
||||||
|
|
||||||
r = stampa_intestazione_ditta();
|
r = stampa_intestazione_ditta();
|
||||||
|
|
||||||
if (_tipoprog == 1)
|
|
||||||
set_header(r, "Vendite");
|
|
||||||
else set_header(r, "Acquisti");
|
|
||||||
if (_livelloprog == 1)
|
if (_livelloprog == 1)
|
||||||
set_header(r++, "@10gIVA %s",(const char*) _codivamsk);
|
set_header(r++, "Gestione Iva@b@50gPROGRESSIVI IVA PER ALIQUOTA");
|
||||||
else set_header(r++, "@10gCod.attivita' %s",(const char*)_codattmsk);
|
else set_header(r++, "Gestione Iva@b@50gPROGRESSIVI IVA PER ATTIVITA'");
|
||||||
r++;
|
r++;
|
||||||
if (_vuoilordi)
|
set_header(r++, "Anno liquidazione %d", _annoiva);
|
||||||
set_header(r, "@21gImponibile@40gImposta@50gImporto lordo");
|
if (_tipoprog == 1) //vendite
|
||||||
else set_header(r, "@21gImponibile@40gImposta");
|
{
|
||||||
|
if (_sospmsk == 1)
|
||||||
|
set_header(r, "Vendite in genere");
|
||||||
|
else set_header(r, "Vendite in sospensione d'imposta");
|
||||||
|
}
|
||||||
|
else //acquisti
|
||||||
|
{
|
||||||
|
if (_livelloprog == 1) //per codice iva
|
||||||
|
switch (_tipo_crmsk)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
set_header(r, "Acquisti in genere");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
set_header(r, "Acquisti indetraibili su operazioni esenti");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
set_header(r, "Acquisti indetraibili passaggi interni");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
set_header(r, "Acquisti indetraibili art.19");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
set_header(r, "Acquisti base di calcolo per la ventilazione");
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
set_header(r, "Bolle doganali");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else //per attivita'
|
||||||
|
switch (_tipo_crmsk)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
set_header(r, "Acquisti beni per rivendita");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
set_header(r, "Acquisti beni da ammortizzare detraibili");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
set_header(r, "Acquisti beni da ammortizzare non detraibili");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
set_header(r, "Altri beni strumentali acquisiti in leasing");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
set_header(r, "Acquisti beni da ammortizzare ult.detr. 6%");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
r++;
|
||||||
|
if (_livelloprog == 1)
|
||||||
|
set_header(r++, "IVA %s",(const char*) _codivamsk);
|
||||||
|
else set_header(r++, "ATTIVITA' %s",(const char*)_codattmsk);
|
||||||
|
set_header(++r, "@29gImponibile@60gImposta");
|
||||||
|
//if (_vuoilordi)
|
||||||
|
// set_header(r, "@21gImponibile@40gImposta@50gImporto lordo");
|
||||||
|
//else set_header(r, "@21gImponibile@40gImposta");
|
||||||
}
|
}
|
||||||
|
|
||||||
print_action CG0400_application::postprocess_page(int file, int counter)
|
print_action CG0400_application::postprocess_page(int file, int counter)
|
||||||
|
20
cg/cg0400.h
20
cg/cg0400.h
@ -1,13 +1,6 @@
|
|||||||
#ifndef __CG0400_H
|
#ifndef __CG0400_H
|
||||||
#define __CG0400_H
|
#define __CG0400_H
|
||||||
/****
|
|
||||||
#define TCLI "C"
|
|
||||||
|
|
||||||
#define N_CODDITTA "CODDITTA"
|
|
||||||
#define N_CODATTPREV "CODATTPREV"
|
|
||||||
#define N_CODATT "CODATT"
|
|
||||||
#define N_CODCF "CODCF"
|
|
||||||
***/
|
|
||||||
#define TAB_REG "REG"
|
#define TAB_REG "REG"
|
||||||
#define TAB_PIM "PIM"
|
#define TAB_PIM "PIM"
|
||||||
|
|
||||||
@ -22,18 +15,7 @@
|
|||||||
#define F_ATTIVITA 108
|
#define F_ATTIVITA 108
|
||||||
#define F_TIPOTABEL 109
|
#define F_TIPOTABEL 109
|
||||||
#define F_RAGSOC 110
|
#define F_RAGSOC 110
|
||||||
#define F_VUOILORDI 111
|
#define F_TIPO1 111
|
||||||
#define F_TIPO1 112
|
|
||||||
/*
|
|
||||||
#define F_TOTALE1 122
|
|
||||||
#define F_TOTALE2 123
|
|
||||||
#define F_TOTALE3 124
|
|
||||||
#define F_TOTALE4 125
|
|
||||||
#define F_TOTALE5 126
|
|
||||||
#define F_TOTALE6 127
|
|
||||||
#define F_PROMPT 128
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif // __CG0400_H
|
#endif // __CG0400_H
|
||||||
|
|
||||||
|
|
||||||
|
138
cg/cg0400a.uml
138
cg/cg0400a.uml
@ -1,41 +1,68 @@
|
|||||||
#include "cg0400.h"
|
#include "cg0400.h"
|
||||||
|
|
||||||
PAGE "Visualizzazione progressivi IVA" -1 -1 78 20
|
PAGE "Visualizzazione progressivi IVA" -1 -1 78 19
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 78 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 0 ""
|
||||||
|
END
|
||||||
|
|
||||||
NUMBER F_CODDITTA 5
|
NUMBER F_CODDITTA 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 1 "Ditta "
|
PROMPT 3 1 "Ditta "
|
||||||
FLAGS "FRD"
|
FLAGS "FRD"
|
||||||
USE LF_NDITTE KEY 1
|
USE LF_NDITTE KEY 1
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
INPUT CODDITTA F_CODDITTA
|
INPUT CODDITTA F_CODDITTA
|
||||||
DISPLAY "Codice" CODDITTA
|
DISPLAY "Codice" CODDITTA
|
||||||
DISPLAY "Ragione sociale @50" RAGSOC
|
DISPLAY "Ragione sociale @50" RAGSOC
|
||||||
OUTPUT F_CODDITTA CODDITTA
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
OUTPUT F_RAGSOC RAGSOC
|
OUTPUT F_ATTIVITA CODATTPREV
|
||||||
OUTPUT F_ATTIVITA CODATTPREV
|
|
||||||
KEY 1
|
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_RAGSOC 50
|
STRING F_RAGSOC 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 2 "Ragione sociale "
|
PROMPT 17 1 "Ragione "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
KEY 1
|
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_ANNO 4
|
NUMBER F_ANNO 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 3 "Anno liquidazione "
|
PROMPT 3 3 "Anno liquidazione "
|
||||||
HELP "Anno di cui si effettua la liquidazione"
|
HELP "Anno di cui si effettua la liquidazione"
|
||||||
FLAGS "A"
|
FLAGS "A"
|
||||||
KEY 1
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
|
RADIOBUTTON F_TIPO 18
|
||||||
|
BEGIN
|
||||||
|
PROMPT 3 5 "Tipo progressivi "
|
||||||
|
HELP "Tipo di riepilogo da effettuare"
|
||||||
|
ITEM "1|Vendite"
|
||||||
|
MESSAGE HIDE,F_TIPOTABE|SHOW,F_TIPOTAB|HIDE,F_TIPOTABEL
|
||||||
|
MESSAGE COPY,F_TIPO1
|
||||||
|
ITEM "2|Acquisti"
|
||||||
|
MESSAGE SHOW,F_TIPOTABE|HIDE,F_TIPOTABEL|HIDE,F_TIPOTAB
|
||||||
|
MESSAGE COPY,F_TIPO1
|
||||||
|
KEY 1
|
||||||
|
END
|
||||||
|
|
||||||
|
RADIOBUTTON F_TIPO1 18
|
||||||
|
BEGIN
|
||||||
|
PROMPT 3 5 "Tipo progressivi "
|
||||||
|
HELP "Tipo di riepilogo da effettuare"
|
||||||
|
ITEM "1|Vendite"
|
||||||
|
MESSAGE HIDE,F_TIPOTABE|HIDE,F_TIPOTABEL|SHOW,F_TIPOTAB
|
||||||
|
MESSAGE COPY,F_TIPO
|
||||||
|
ITEM "2|Acquisti"
|
||||||
|
MESSAGE HIDE,F_TIPOTABE|SHOW,F_TIPOTABEL|HIDE,F_TIPOTAB
|
||||||
|
MESSAGE COPY,F_TIPO
|
||||||
|
KEY 1
|
||||||
|
END
|
||||||
|
|
||||||
RADIOBUTTON F_LIVELLO 21
|
RADIOBUTTON F_LIVELLO 21
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 5 "Livello progressivi "
|
PROMPT 38 5 "Livello progressivi "
|
||||||
HELP "Tipo di raggruppamento dei riepiloghi"
|
HELP "Tipo di raggruppamento dei riepiloghi"
|
||||||
ITEM "1|Per aliquota"
|
ITEM "1|Per aliquota"
|
||||||
MESSAGE HIDE,F_ATTIVITA|SHOW,F_CODIVA
|
MESSAGE HIDE,F_ATTIVITA|SHOW,F_CODIVA
|
||||||
@ -45,43 +72,26 @@ BEGIN
|
|||||||
MESSAGE HIDE,F_TIPO|SHOW,F_TIPO1|K_SPACE,F_TIPO1
|
MESSAGE HIDE,F_TIPO|SHOW,F_TIPO1|K_SPACE,F_TIPO1
|
||||||
END
|
END
|
||||||
|
|
||||||
RADIOBUTTON F_TIPO 18
|
STRING F_CODIVA 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 38 5 "Tipo progressivi "
|
PROMPT 3 10 "Codice IVA "
|
||||||
HELP "Tipo di riepilogo da effettuare"
|
HELP "Aliquota IVA da riepilogare"
|
||||||
ITEM "1|Vendite"
|
FLAGS "U"
|
||||||
MESSAGE HIDE,F_TIPOTABE|SHOW,F_TIPOTAB|HIDE,F_TIPOTABEL
|
USE %IVA
|
||||||
MESSAGE COPY,F_TIPO1
|
INPUT CODTAB F_CODIVA
|
||||||
ITEM "2|Acquisti"
|
DISPLAY "Codice" CODTAB
|
||||||
MESSAGE SHOW,F_TIPOTABE|HIDE,F_TIPOTABEL|HIDE,F_TIPOTAB
|
DISPLAY "Descrizione@50" S0
|
||||||
MESSAGE COPY,F_TIPO1
|
DISPLAY "%@6" R0
|
||||||
KEY 1
|
DISPLAY "Tipo" S1
|
||||||
END
|
OUTPUT F_CODIVA CODTAB
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
RADIOBUTTON F_TIPO1 18
|
VALIDATE ZEROFILL_FUNC 2
|
||||||
BEGIN
|
WARNING "Codice IVA assente"
|
||||||
PROMPT 38 5 "Tipo progressivi "
|
|
||||||
HELP "Tipo di riepilogo da effettuare"
|
|
||||||
ITEM "1|Vendite"
|
|
||||||
MESSAGE HIDE,F_TIPOTABE|HIDE,F_TIPOTABEL|SHOW,F_TIPOTAB
|
|
||||||
MESSAGE COPY,F_TIPO
|
|
||||||
ITEM "2|Acquisti"
|
|
||||||
MESSAGE HIDE,F_TIPOTABE|SHOW,F_TIPOTABEL|HIDE,F_TIPOTAB
|
|
||||||
MESSAGE COPY,F_TIPO
|
|
||||||
KEY 1
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
STRING F_CODIVA 3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 4 10 "Codice IVA "
|
|
||||||
HELP "Aliquata IVA da riepilogare"
|
|
||||||
FLAGS "R"
|
|
||||||
END
|
END
|
||||||
|
|
||||||
RADIOBUTTON F_TIPOTAB 38
|
RADIOBUTTON F_TIPOTAB 38
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 12 "Tipo tabella "
|
PROMPT 3 12 "Tipo tabella "
|
||||||
HELP "Tipo di tabella da visualizzare"
|
HELP "Tipo di tabella da visualizzare"
|
||||||
ITEM "1|Vendite in genere"
|
ITEM "1|Vendite in genere"
|
||||||
ITEM "2|Vendite in sospensione d'imposta"
|
ITEM "2|Vendite in sospensione d'imposta"
|
||||||
@ -89,12 +99,12 @@ END
|
|||||||
|
|
||||||
STRING F_ATTIVITA 5
|
STRING F_ATTIVITA 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 10 "Codice attivita' "
|
PROMPT 3 10 "Codice attivita' "
|
||||||
HELP "Codice dell'attivita' di cui si vuole il riepilogo"
|
HELP "Codice dell'attivita' di cui si vuole il riepilogo"
|
||||||
USE LF_ATTIV
|
USE LF_ATTIV
|
||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
JOIN %AIS TO LF_ATTIV INTO CODTAB=CODATT
|
JOIN %AIS TO LF_ATTIV INTO CODTAB=CODATT
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE REQUIRED
|
||||||
INPUT CODDITTA F_CODDITTA SELECT
|
INPUT CODDITTA F_CODDITTA SELECT
|
||||||
INPUT CODATT F_ATTIVITA
|
INPUT CODATT F_ATTIVITA
|
||||||
DISPLAY "Codice attivita'" LF_TABCOM->CODTAB
|
DISPLAY "Codice attivita'" LF_TABCOM->CODTAB
|
||||||
@ -105,21 +115,21 @@ END
|
|||||||
|
|
||||||
NUMBER F_TIPOTABEL 1
|
NUMBER F_TIPOTABEL 1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 12 "Tipo tabella "
|
PROMPT 3 12 "Tipo tabella "
|
||||||
HELP "Tipo di tabella da visualizzare"
|
HELP "Tipo di tabella da visualizzare"
|
||||||
SHEET "Tipo|Descrizione@50"
|
SHEET "Tipo|Descrizione@50"
|
||||||
ITEM "1|Acquisti beni per rivendita"
|
ITEM "1|Acquisti beni per rivendita"
|
||||||
ITEM "2|Acquisti beni da ammortizzare detraibili"
|
ITEM "2|Acquisti beni da ammortizzare detraibili"
|
||||||
ITEM "3|Acquisti beni da ammortizzare non detraibili"
|
ITEM "3|Acquisti beni da ammortizzare non detraibili"
|
||||||
ITEM "4|Altri beni strumentali acquisiti in leasing"
|
ITEM "4|Altri beni strumentali acquisiti in leasing"
|
||||||
ITEM "5|Altri beni strumentali ult. detr. 6%"
|
ITEM "5|Acquisti beni da ammortizzare ult.detr. 6%"
|
||||||
INPUT F_TIPOTABEL
|
INPUT F_TIPOTABEL
|
||||||
OUTPUT F_TIPOTABEL
|
OUTPUT F_TIPOTABEL
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_TIPOTABE 1
|
NUMBER F_TIPOTABE 1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 12 "Tipo tabella "
|
PROMPT 3 12 "Tipo tabella "
|
||||||
HELP "Tipo di tabella da visualizzare"
|
HELP "Tipo di tabella da visualizzare"
|
||||||
SHEET "Tipo|Descrizione@50"
|
SHEET "Tipo|Descrizione@50"
|
||||||
ITEM "1|Acquisti in genere"
|
ITEM "1|Acquisti in genere"
|
||||||
@ -128,26 +138,30 @@ BEGIN
|
|||||||
ITEM "4|Acquisti indetraibili art. 19"
|
ITEM "4|Acquisti indetraibili art. 19"
|
||||||
ITEM "5|Acquisti base di calcolo per la ventilazione"
|
ITEM "5|Acquisti base di calcolo per la ventilazione"
|
||||||
ITEM "6|Bolle doganali"
|
ITEM "6|Bolle doganali"
|
||||||
ITEM "7|Acquisti indetraibili per cambio regime"
|
// ITEM "7|Acquisti indetraibili per cambio regime"
|
||||||
INPUT F_TIPOTABE
|
INPUT F_TIPOTABE
|
||||||
OUTPUT F_TIPOTABE
|
OUTPUT F_TIPOTABE
|
||||||
END
|
END
|
||||||
|
|
||||||
|
/*
|
||||||
BOOLEAN F_VUOILORDI
|
BOOLEAN F_VUOILORDI
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 16 "Visualizzazione importi lordi "
|
PROMPT 4 16 "Visualizzazione importi lordi "
|
||||||
HELP "Indicare se visualizzare anche gli importi"
|
HELP "Indicare se visualizzare anche gli importi lordi"
|
||||||
END
|
END
|
||||||
|
*/
|
||||||
|
|
||||||
BUTTON DLG_OK 9 2
|
BUTTON DLG_PRINT 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -12 -1 ""
|
PROMPT -12 -1 "~Stampa"
|
||||||
|
MESSAGE EXIT,K_ENTER
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_CANCEL 9 2
|
BUTTON DLG_QUIT 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -22 -1 ""
|
PROMPT -22 -1 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
@ -2986,7 +2986,7 @@ bool CG1500_application::set_print(int)
|
|||||||
{
|
{
|
||||||
TConfig conf(CONFIG_DITTA);
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
|
||||||
_causale_ap = conf.get("CoCaCh");
|
_causale_ap = conf.get("CoCaAp");
|
||||||
_causale_chi = conf.get("CoCaCh");
|
_causale_chi = conf.get("CoCaCh");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1911,7 +1911,14 @@ bool CG1600_application::calcola(int g, int c, long s,
|
|||||||
data = datareg;
|
data = datareg;
|
||||||
if (_annoese != 0)
|
if (_annoese != 0)
|
||||||
data = datacomp;
|
data = datacomp;
|
||||||
|
|
||||||
|
TString datastr = data.string();
|
||||||
|
TString datastr3 = _datafine.string();
|
||||||
|
TString datastr1 = _dataini.string();
|
||||||
|
TString datastr2 = _data_ini_ese.string();
|
||||||
|
|
||||||
|
TString codcausapp = causale_apertura();
|
||||||
|
|
||||||
//calcolo i movimenti del periodo
|
//calcolo i movimenti del periodo
|
||||||
if ( (data >= _dataini) && (data <= _datafine) )
|
if ( (data >= _dataini) && (data <= _datafine) )
|
||||||
if ((codcaus == causale_apertura() && _data_ini_ese != _dataini) ||
|
if ((codcaus == causale_apertura() && _data_ini_ese != _dataini) ||
|
||||||
@ -1955,7 +1962,7 @@ bool CG1600_application::set_print(int)
|
|||||||
{
|
{
|
||||||
TConfig conf(CONFIG_DITTA);
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
|
||||||
_causale_ap = conf.get("CoCaCh");
|
_causale_ap = conf.get("CoCaAp");
|
||||||
_causale_chi = conf.get("CoCaCh");
|
_causale_chi = conf.get("CoCaCh");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3117,7 +3124,7 @@ void CG1600_application::stampa_totali_verifica()
|
|||||||
if (classe > ris_imp && _risimp_fatto)
|
if (classe > ris_imp && _risimp_fatto)
|
||||||
{
|
{
|
||||||
if (_num_tot == "20" || _num_tot == "21")
|
if (_num_tot == "20" || _num_tot == "21")
|
||||||
{
|
{
|
||||||
set_row (_i,"@4gTotale delle partite straordinarie");
|
set_row (_i,"@4gTotale delle partite straordinarie");
|
||||||
set_row (_i,"@49g%r", &_tot_parz_prg_d);
|
set_row (_i,"@49g%r", &_tot_parz_prg_d);
|
||||||
set_row (_i,"@65g%r", &_tot_parz_prg_a);
|
set_row (_i,"@65g%r", &_tot_parz_prg_a);
|
||||||
|
450
cg/cg3200.cpp
450
cg/cg3200.cpp
@ -31,7 +31,6 @@ class TMastrini_application : public TPrintapp
|
|||||||
static bool data_fine (TMask_field& f, KEY k);
|
static bool data_fine (TMask_field& f, KEY k);
|
||||||
static bool gruppo_hnd (TMask_field& f, KEY k);
|
static bool gruppo_hnd (TMask_field& f, KEY k);
|
||||||
static bool conto_hnd (TMask_field& f, KEY k);
|
static bool conto_hnd (TMask_field& f, KEY k);
|
||||||
static bool sottoc_hnd (TMask_field& f, KEY k);
|
|
||||||
friend bool sottoc_handler_ini (TMask_field& f, KEY k);
|
friend bool sottoc_handler_ini (TMask_field& f, KEY k);
|
||||||
friend bool sottoc_handler_fine (TMask_field& f, KEY k);
|
friend bool sottoc_handler_fine (TMask_field& f, KEY k);
|
||||||
|
|
||||||
@ -69,7 +68,7 @@ class TMastrini_application : public TPrintapp
|
|||||||
bool _stampaprogre,_stampatotiva,_stampatot,_prima_volta,_stampa_mov_prov;
|
bool _stampaprogre,_stampatotiva,_stampatot,_prima_volta,_stampa_mov_prov;
|
||||||
|
|
||||||
int _annomsk,_annoesmsk,_annoes,_annomsksucc,_tipo_mask,_anno_ghost;
|
int _annomsk,_annoesmsk,_annoes,_annomsksucc,_tipo_mask,_anno_ghost;
|
||||||
int _anno_corrente,_anno_precedente,_indbil;
|
int _anno_corrente,_anno_precedente,_indbil,_numero_pag;
|
||||||
long _sottoc,_numreg,_numgio,_protiva;
|
long _sottoc,_numreg,_numgio,_protiva;
|
||||||
bool _stampa_progressivi_si,_competenza,_inizio_stampa,_puoi_stampare;
|
bool _stampa_progressivi_si,_competenza,_inizio_stampa,_puoi_stampare;
|
||||||
char _tmcf,_tipo_contr;
|
char _tmcf,_tipo_contr;
|
||||||
@ -96,6 +95,9 @@ public:
|
|||||||
TDate _inizioEs,_fineEs;
|
TDate _inizioEs,_fineEs;
|
||||||
void ricerca_clifo();
|
void ricerca_clifo();
|
||||||
void ricerca_gruppo();
|
void ricerca_gruppo();
|
||||||
|
int ricerca_clifo(int riga);
|
||||||
|
int ricerca_gruppo(int riga);
|
||||||
|
|
||||||
void calcola_progressivi();
|
void calcola_progressivi();
|
||||||
void calcola_progressivi_al();
|
void calcola_progressivi_al();
|
||||||
void stampa_progressivi();
|
void stampa_progressivi();
|
||||||
@ -104,6 +106,7 @@ public:
|
|||||||
void ricerca_regiva();
|
void ricerca_regiva();
|
||||||
void descrizione_causale();
|
void descrizione_causale();
|
||||||
void saldi_zero();
|
void saldi_zero();
|
||||||
|
void crea_intestazione(int riga);
|
||||||
void crea_intestazione();
|
void crea_intestazione();
|
||||||
void fai_stampa132();
|
void fai_stampa132();
|
||||||
void fai_stampa198();
|
void fai_stampa198();
|
||||||
@ -117,7 +120,8 @@ public:
|
|||||||
const char* descrizione_classe(char,char,int,int);
|
const char* descrizione_classe(char,char,int,int);
|
||||||
bool almeno_un_record();
|
bool almeno_un_record();
|
||||||
void ricerca_dati_ditta();
|
void ricerca_dati_ditta();
|
||||||
void conto(int,int,bool);
|
void conto(int,int,bool);
|
||||||
|
bool check_ordine(TMask_field& f, KEY k);
|
||||||
|
|
||||||
TMastrini_application() {}
|
TMastrini_application() {}
|
||||||
};
|
};
|
||||||
@ -233,6 +237,9 @@ bool sottoc_handler_fine(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
if (conto != 0 && gruppo == 0)
|
if (conto != 0 && gruppo == 0)
|
||||||
return f.warning_box("Manca il GRUPPO");
|
return f.warning_box("Manca il GRUPPO");
|
||||||
|
|
||||||
|
if (!app().check_ordine(f,key))
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( key == K_TAB )
|
if ( key == K_TAB )
|
||||||
@ -336,10 +343,9 @@ bool TMastrini_application::conto_hnd (TMask_field& f, KEY k)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMastrini_application::sottoc_hnd (TMask_field& f, KEY k)
|
bool TMastrini_application::check_ordine(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_ENTER)
|
// if (k == K_ENTER) {
|
||||||
{
|
|
||||||
int gruppof = f.mask().get_int(F_GRUPPOFINE);
|
int gruppof = f.mask().get_int(F_GRUPPOFINE);
|
||||||
|
|
||||||
if (gruppof == 0)
|
if (gruppof == 0)
|
||||||
@ -361,7 +367,7 @@ bool TMastrini_application::sottoc_hnd (TMask_field& f, KEY k)
|
|||||||
|
|
||||||
if (sottoci > sottocf)
|
if (sottoci > sottocf)
|
||||||
return f.error_box("Il sottoconto di partenza deve essere inferiore o uguale al sottoconto di arrivo");
|
return f.error_box("Il sottoconto di partenza deve essere inferiore o uguale al sottoconto di arrivo");
|
||||||
}
|
// }
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -585,7 +591,8 @@ void TMastrini_application::fai_stampa132()
|
|||||||
if (_stampanum == 2)
|
if (_stampanum == 2)
|
||||||
{
|
{
|
||||||
set_row (1,"@11g#7d", &_numgio);
|
set_row (1,"@11g#7d", &_numgio);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_row (1,"@19g#t", &_datadocs);
|
set_row (1,"@19g#t", &_datadocs);
|
||||||
set_row (1,"@30g#7t", &_numdoc);
|
set_row (1,"@30g#7t", &_numdoc);
|
||||||
set_row (1,"@38g#3t", &_codcaus);
|
set_row (1,"@38g#3t", &_codcaus);
|
||||||
@ -598,13 +605,17 @@ void TMastrini_application::fai_stampa132()
|
|||||||
void TMastrini_application::fai_stampa198()
|
void TMastrini_application::fai_stampa198()
|
||||||
{
|
{
|
||||||
set_row (1,"@0g#t", &_dataregs);
|
set_row (1,"@0g#t", &_dataregs);
|
||||||
if (_stampanum == 1)
|
if (_stampanum == 1)
|
||||||
|
{
|
||||||
set_row (1,"@11g$[r]#7d$[n]", &_numreg);
|
set_row (1,"@11g$[r]#7d$[n]", &_numreg);
|
||||||
|
set_row (1,"@18g/#3d", &_numrig);
|
||||||
|
}
|
||||||
else if (_stampanum == 2)
|
else if (_stampanum == 2)
|
||||||
set_row (1,"@11g#7d", &_numgio);
|
set_row (1,"@11g#7d", &_numgio);
|
||||||
set_row (1,"@19g#t", &_datadocs);
|
|
||||||
set_row (1,"@30g#7t", &_numdoc);
|
set_row (1,"@23g#t", &_datadocs);
|
||||||
set_row (1,"@38g#3t", &_codcaus);
|
set_row (1,"@34g#7t", &_numdoc);
|
||||||
|
set_row (1,"@42g#3t", &_codcaus);
|
||||||
|
|
||||||
// Stampa saldo movimenti
|
// Stampa saldo movimenti
|
||||||
|
|
||||||
@ -627,18 +638,27 @@ void TMastrini_application::stampa_totali132()
|
|||||||
_saldo_periodo = _totale_periodo_dare - _totale_periodo_avere;
|
_saldo_periodo = _totale_periodo_dare - _totale_periodo_avere;
|
||||||
_saldo_progre = _totprogre_dare - _totprogre_avere;
|
_saldo_progre = _totprogre_dare - _totprogre_avere;
|
||||||
_saldo_progre_al = _totprogre_dare_al - _totprogre_avere_al;
|
_saldo_progre_al = _totprogre_dare_al - _totprogre_avere_al;
|
||||||
set_row (3,"@32gTOTALI PERIODO@69g%15.0r", &_saldo_periodo);
|
TString string = _saldo_periodo.string("###.###.###.###");
|
||||||
set_row (3,"@85g%15.0r", &_totale_periodo_dare);
|
set_row (3,"@32gTOTALI PERIODO@69g%15s", (const char*)string);
|
||||||
set_row (3,"@101g%15.0r", &_totale_periodo_avere);
|
string = _totale_periodo_dare.string("###.###.###.###");
|
||||||
set_row (4,"@32gTOTALI PROGRESSIVI@69g%15.0r", &_saldo_progre);
|
set_row (3,"@85g%15s", (const char*)string);
|
||||||
set_row (4,"@85g%15.0r", &_totprogre_dare);
|
string = _totale_periodo_avere.string("###.###.###.###");
|
||||||
set_row (4,"@101g%15.0r", &_totprogre_avere);
|
set_row (3,"@101g%15s", (const char*)string);
|
||||||
|
string = _saldo_progre.string("###.###.###.###");
|
||||||
|
set_row (4,"@32gTOTALI PROGRESSIVI@69g%15s", (const char*)string);
|
||||||
|
string = _totprogre_dare.string("###.###.###.###");
|
||||||
|
set_row (4,"@85g%15s", (const char*)string);
|
||||||
|
string = _totprogre_avere.string("###.###.###.###");
|
||||||
|
set_row (4,"@101g%15s", (const char*)string);
|
||||||
if (_stampaprogre) //Progressivi attuali
|
if (_stampaprogre) //Progressivi attuali
|
||||||
{
|
{
|
||||||
|
TString str = _saldo_progre_al.string("###.###.###.###");
|
||||||
set_row (5,"@32gTOTALI PROGRESSIVI AL@55g%s",(const char*)_ultima_data_reg.string());
|
set_row (5,"@32gTOTALI PROGRESSIVI AL@55g%s",(const char*)_ultima_data_reg.string());
|
||||||
set_row (5,"@69g%15.0r", &_saldo_progre_al);
|
set_row (5,"@69g%15s", (const char*)str);
|
||||||
set_row (5,"@85g%15.0r", &_totprogre_dare_al);
|
str = _totprogre_dare_al.string("###.###.###.###");
|
||||||
set_row (5,"@101g%15.0r", &_totprogre_avere_al);
|
set_row (5,"@85g%15s", (const char*)str);
|
||||||
|
str = _totprogre_avere_al.string("###.###.###.###");
|
||||||
|
set_row (5,"@101g%15s", (const char*)str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,18 +671,27 @@ void TMastrini_application::stampa_totali198()
|
|||||||
|
|
||||||
_totprogre_dare=_progredare+_totale_periodo_dare;
|
_totprogre_dare=_progredare+_totale_periodo_dare;
|
||||||
_totprogre_avere=_progreavere+_totale_periodo_avere;
|
_totprogre_avere=_progreavere+_totale_periodo_avere;
|
||||||
set_row (3,"@32gTOTALI PERIODO@102g%15.0r", &_totale_periodo_dare);
|
TString string = _totale_periodo_dare.string("###.###.###.###");
|
||||||
set_row (3,"@119g%15.0r", &_totale_periodo_avere);
|
set_row (3,"@32gTOTALI PERIODO@102g%15s", (const char*)string);
|
||||||
set_row (3,"@153g%15.0r", &_saldo_movimenti);
|
string = _totale_periodo_avere.string("###.###.###.###");
|
||||||
set_row (4,"@32gTOTALI PROGRESSIVI@102g%15.0r", &_totprogre_dare);
|
set_row (3,"@119g%15s", (const char*)string);
|
||||||
set_row (4,"@119g%15.0r", &_totprogre_avere);
|
string = _saldo_movimenti.string("###.###.###.###");
|
||||||
set_row (4,"@136g%15.0r", &_saldo_progressivi);
|
set_row (3,"@153g%15s", (const char*)string);
|
||||||
|
string = _totprogre_dare.string("###.###.###.###");
|
||||||
|
set_row (4,"@32gTOTALI PROGRESSIVI@102g%15s",(const char*)string);
|
||||||
|
string = _totprogre_avere.string("###.###.###.###");
|
||||||
|
set_row (4,"@119g%15s", (const char*)string);
|
||||||
|
string = _saldo_progressivi.string("###.###.###.###");
|
||||||
|
set_row (4,"@136g%15s", (const char*)string);
|
||||||
if (_stampaprogre) //Progressivi attuali
|
if (_stampaprogre) //Progressivi attuali
|
||||||
{
|
{
|
||||||
set_row(5,"@32gTOTALI PROGRESSIVI AL@55g%s",(const char*)_ultima_data_reg.string());
|
set_row(5,"@32gTOTALI PROGRESSIVI AL@55g%s",(const char*)_ultima_data_reg.string());
|
||||||
set_row (5,"@102g%15.0r", &_totprogre_dare_al);
|
TString str = _totprogre_dare_al.string("###.###.###.###");
|
||||||
set_row (5,"@119g%15.0r", &_totprogre_avere_al);
|
set_row (5,"@102g%15s", (const char*)str);
|
||||||
set_row (5,"@136g%15.0r", &_saldo_progressivi);
|
str = _totprogre_avere_al.string("###.###.###.###");
|
||||||
|
set_row (5,"@119g%15s", (const char*)str);
|
||||||
|
str = _saldo_progressivi.string("###.###.###.###");
|
||||||
|
set_row (5,"@136g%15s", (const char*)str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -762,6 +791,7 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
|||||||
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||||
|
|
||||||
_numreg = atol (current_cursor()->curr(LF_RMOV).get(RMV_NUMREG));
|
_numreg = atol (current_cursor()->curr(LF_RMOV).get(RMV_NUMREG));
|
||||||
|
_numrig = atoi (current_cursor()->curr(LF_RMOV).get(RMV_NUMRIG));
|
||||||
|
|
||||||
_gruppocontr = rmov.get_int (RMV_GRUPPOC);
|
_gruppocontr = rmov.get_int (RMV_GRUPPOC);
|
||||||
_contocontr = rmov.get_int (RMV_CONTOC);
|
_contocontr = rmov.get_int (RMV_CONTOC);
|
||||||
@ -774,7 +804,7 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
|||||||
// nella maschera. Se non viene specificato li stampa tutti
|
// nella maschera. Se non viene specificato li stampa tutti
|
||||||
|
|
||||||
_importo = current_cursor()->curr(LF_RMOV).get_real(RMV_IMPORTO);
|
_importo = current_cursor()->curr(LF_RMOV).get_real(RMV_IMPORTO);
|
||||||
_importo_str = _importo.string("###############");
|
_importo_str = _importo.string("###.###.###.###");
|
||||||
_mov->setkey(1);
|
_mov->setkey(1);
|
||||||
_mov->curr().zero();
|
_mov->curr().zero();
|
||||||
_mov->curr().put(MOV_NUMREG,_numreg);
|
_mov->curr().put(MOV_NUMREG,_numreg);
|
||||||
@ -879,20 +909,20 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
|||||||
{
|
{
|
||||||
if (_descrizionemov != "")
|
if (_descrizionemov != "")
|
||||||
{
|
{
|
||||||
set_row (1,"@42g%.25s", (const char*) _descrizionemov);
|
set_row (1,"@46g%.23s", (const char*) _descrizionemov);
|
||||||
set_row (1,"@68g%.32s", (const char*) _descrizione);
|
set_row (1,"@70g%.30s", (const char*) _descrizione);
|
||||||
}
|
}
|
||||||
else if (_descrizionemov == "")
|
else if (_descrizionemov == "")
|
||||||
{
|
{
|
||||||
set_row (1,"@42g%.25s", (const char*) _descrcaus);
|
set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||||
set_row (1,"@68g%.32s", (const char*) _descrizione);
|
set_row (1,"@70g%.30s", (const char*) _descrizione);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_descrizione == "")
|
else if (_descrizione == "")
|
||||||
if (_descrizionemov != "")
|
if (_descrizionemov != "")
|
||||||
{
|
{
|
||||||
set_row (1,"@42g%.25s", (const char*) _descrcaus);
|
set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||||
set_row (1,"@68g%.32s", (const char*) _descrizionemov);
|
set_row (1,"@70g%.30s", (const char*) _descrizionemov);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (_descrizionemov == "")
|
if (_descrizionemov == "")
|
||||||
@ -900,9 +930,9 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
|||||||
conto(_gruppocontr,_contocontr,FALSE);
|
conto(_gruppocontr,_contocontr,FALSE);
|
||||||
TConto tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr);
|
TConto tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr);
|
||||||
TString descr_contr = tc.descrizione();
|
TString descr_contr = tc.descrizione();
|
||||||
set_row (1,"@42g%.25s", (const char*) _descrcaus);
|
set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||||
if (descr_contr != "Sconosciuto")
|
if (descr_contr != "Sconosciuto")
|
||||||
set_row (1,"@68g%.32s", (const char*) descr_contr);
|
set_row (1,"@70g%.30s", (const char*) descr_contr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -937,8 +967,8 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_saldo_progressivi_str=_saldo_progressivi.string("###############");
|
_saldo_progressivi_str=_saldo_progressivi.string("###.###.###.###");
|
||||||
_saldo_movimenti_str=_saldo_movimenti.string("###############");
|
_saldo_movimenti_str=_saldo_movimenti.string("###.###.###.###");
|
||||||
if (_numcarat == 2)
|
if (_numcarat == 2)
|
||||||
{
|
{
|
||||||
ricerca_regiva();
|
ricerca_regiva();
|
||||||
@ -1091,13 +1121,16 @@ print_action TMastrini_application::postprocess_print(int file, int counter)
|
|||||||
|
|
||||||
void TMastrini_application::stampa_totaliiva()
|
void TMastrini_application::stampa_totaliiva()
|
||||||
{
|
{
|
||||||
|
real totale;
|
||||||
|
|
||||||
if (_stampatotiva)
|
if (_stampatotiva)
|
||||||
for (int j = 0; j < _b.items(); j++)
|
for (int j = 0; j < _b.items(); j++)
|
||||||
{
|
{
|
||||||
TDociva& riga = (TDociva&)_b[j];
|
TDociva& riga = (TDociva&)_b[j];
|
||||||
set_row(7+j, "@0g%-50s",(const char*) riga._descrdoc);
|
set_row(7+j, "@0g%s",(const char*) riga._descrdoc);
|
||||||
set_row(7+j, "@61g%15.0r", &riga._totdociva);
|
totale = riga._totdociva;
|
||||||
|
TString string = totale.string("###.###.###.###");
|
||||||
|
set_row(7+j, " %15s", (const char*)string);
|
||||||
}
|
}
|
||||||
_b.destroy();
|
_b.destroy();
|
||||||
}
|
}
|
||||||
@ -1184,8 +1217,8 @@ bool TMastrini_application::set_print(int)
|
|||||||
TLocalisamfile* fl;
|
TLocalisamfile* fl;
|
||||||
TString data1,data2;
|
TString data1,data2;
|
||||||
|
|
||||||
_puoi_stampare = TRUE;
|
_puoi_stampare = TRUE;
|
||||||
|
|
||||||
_msk->set_handler (F_DATAINI ,data_inizio);
|
_msk->set_handler (F_DATAINI ,data_inizio);
|
||||||
_msk->set_handler (F_DATAFINE ,data_fine);
|
_msk->set_handler (F_DATAFINE ,data_fine);
|
||||||
|
|
||||||
@ -1377,7 +1410,8 @@ void TMastrini_application::crea_intestazione()
|
|||||||
sep.right_just(132);
|
sep.right_just(132);
|
||||||
set_header(1,(const char*) sep);
|
set_header(1,(const char*) sep);
|
||||||
sep ="";
|
sep ="";
|
||||||
set_header(2,"@1g%s",(const char*) sep);
|
set_header(2,"@1g%s",(const char*) sep);
|
||||||
|
//set_header(1,"@126gPag. %2d", _numero_pag++);
|
||||||
}
|
}
|
||||||
else if (_numcarat == 2)
|
else if (_numcarat == 2)
|
||||||
{
|
{
|
||||||
@ -1385,16 +1419,17 @@ void TMastrini_application::crea_intestazione()
|
|||||||
sep1.right_just(198);
|
sep1.right_just(198);
|
||||||
set_header(1,(const char*) sep1);
|
set_header(1,(const char*) sep1);
|
||||||
sep1 ="";
|
sep1 ="";
|
||||||
set_header(2,"@1g%s",(const char*) sep1);
|
set_header(2,"@1g%s",(const char*) sep1);
|
||||||
|
//set_header(1,"@190gPagina %2d", _numero_pag++);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_header (1, "@0gDITTA@6g%5ld", _codice_ditta);
|
set_header (1, "@0gDITTA@6g%5ld", _codice_ditta);
|
||||||
set_header (1, "@12g%-45s", (const char*) _ragsoc);
|
set_header (1, "@12g%-.45s", (const char*) _ragsoc);
|
||||||
set_header (1, "@59g%-25s", (const char*) _indulc);
|
set_header (1, "@59g%-.25s", (const char*) _indulc);
|
||||||
set_header (1, "@86g%-9s", (const char*) _civulc);
|
set_header (1, "@86g%-.9s", (const char*) _civulc);
|
||||||
set_header (1, "@97g%-5s", (const char*) _capulc);
|
set_header (1, "@97g%-.5s", (const char*) _capulc);
|
||||||
set_header (1, "@103g%-18s", (const char*) _com);
|
set_header (1, "@103g%-.18s", (const char*) _com);
|
||||||
set_header (1, "@122g%-3s", (const char*) _prov);
|
set_header (1, "@122g%-.3s", (const char*) _prov);
|
||||||
|
|
||||||
set_header (3, "@0gSottoconto@12g%d", _gruppo);
|
set_header (3, "@0gSottoconto@12g%d", _gruppo);
|
||||||
set_header (3, "@16g%d", _conto);
|
set_header (3, "@16g%d", _conto);
|
||||||
@ -1433,15 +1468,82 @@ void TMastrini_application::crea_intestazione()
|
|||||||
{
|
{
|
||||||
sep1.fill('-'); //Stampa 198 - (sep1(198))
|
sep1.fill('-'); //Stampa 198 - (sep1(198))
|
||||||
set_header (6,"@1g%s", (const char *) sep1);
|
set_header (6,"@1g%s", (const char *) sep1);
|
||||||
set_header (7,"Operazione@19gData@30gNumero@172gContro@182gReg@190gNumero@197gA");
|
set_header (7,"Operazione@23gData@34gNumero@172gContro@182gReg@190gNumero@197gA");
|
||||||
set_header (8,"Data");
|
set_header (8,"Data");
|
||||||
if (_stampanum < 3)
|
if (_stampanum < 3)
|
||||||
set_header (8,"@11gnumero");
|
set_header (8,"@11gnumero");
|
||||||
set_header (8,"@19gDocumento@38gCod.Causale@68gDescrizione@113gDare@129gAvere@136gSaldo progress.@156gSaldo movim.@172gPartita@182gIva@186gProtocollo@197gC");
|
set_header (8,"@23gDocumento@42gCod.Causale@70gDescrizione@113gDare@129gAvere@136gSaldo progress.@156gSaldo movim.@172gPartita@182gIva@186gProtocollo@197gC");
|
||||||
sep1.fill('-');
|
sep1.fill('-');
|
||||||
set_header (9,"@1g%s", (const char *) sep1);
|
set_header (9,"@1g%s", (const char *) sep1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TMastrini_application::crea_intestazione(int start_riga)
|
||||||
|
{
|
||||||
|
TString sep(132),sep1(198);
|
||||||
|
int r = start_riga;
|
||||||
|
|
||||||
|
reset_header();
|
||||||
|
|
||||||
|
if (_numcarat == 1)
|
||||||
|
set_header(1,"@126gPag. %2d", _numero_pag++);
|
||||||
|
else if (_numcarat == 2)
|
||||||
|
set_header(1,"@190gPagina %2d", _numero_pag++);
|
||||||
|
|
||||||
|
set_header (r, "@0gDITTA@6g%5ld", _codice_ditta);
|
||||||
|
set_row (r, "@12g%-45s", (const char*) _ragsoc);
|
||||||
|
set_row (r, "@59g%-25s", (const char*) _indulc);
|
||||||
|
set_row (r, "@86g%-9s", (const char*) _civulc);
|
||||||
|
set_row (r, "@97g%-5s", (const char*) _capulc);
|
||||||
|
set_row (r, "@103g%-18s", (const char*) _com);
|
||||||
|
set_row (r, "@122g%-3s", (const char*) _prov);
|
||||||
|
r += 2;
|
||||||
|
set_row (r, "@0gSottoconto@12g%d", _gruppo);
|
||||||
|
set_row (r, "@16g%d", _conto);
|
||||||
|
set_row (r, "@20g%ld", _sottoc);
|
||||||
|
|
||||||
|
if (_tmcf == 'C')
|
||||||
|
_tipo_mask = 1;
|
||||||
|
else if (_tmcf == 'F')
|
||||||
|
_tipo_mask = 2;
|
||||||
|
else if (_tmcf == '\0')
|
||||||
|
_tipo_mask = 3;
|
||||||
|
switch (_tipo_mask)
|
||||||
|
{
|
||||||
|
case 1: ricerca_clifo(r);
|
||||||
|
break;
|
||||||
|
case 2: ricerca_clifo(r);
|
||||||
|
break;
|
||||||
|
case 3: ricerca_gruppo(r);
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_numcarat == 1)
|
||||||
|
{
|
||||||
|
sep.fill('-'); //Stampa 132 - (sep(132))
|
||||||
|
set_row (6, (const char *) sep);
|
||||||
|
set_row (7,"Operazione@19gDocumento@117gContro@131gA");
|
||||||
|
set_row (8,"Data");
|
||||||
|
if (_stampanum < 3)
|
||||||
|
set_row (8,"@11gnumero");
|
||||||
|
set_row (8,"@19gData@30gNumero@38gCod.Causale@61gDescrizione@96gDare@111gAvere@117gPartita@131gC");
|
||||||
|
sep.fill('-');
|
||||||
|
set_row (9, (const char *) sep);
|
||||||
|
}
|
||||||
|
else if (_numcarat == 2)
|
||||||
|
{
|
||||||
|
sep1.fill('-'); //Stampa 198 - (sep1(198))
|
||||||
|
set_row (6,"@1g%s", (const char *) sep1);
|
||||||
|
set_row (7,"Operazione@23gData@34gNumero@172gContro@182gReg@190gNumero@197gA");
|
||||||
|
set_row (8,"Data");
|
||||||
|
if (_stampanum < 3)
|
||||||
|
set_row (8,"@11gnumero");
|
||||||
|
set_row (8,"@23gDocumento@42gCod.Causale@70gDescrizione@113gDare@129gAvere@136gSaldo progress.@156gSaldo movim.@172gPartita@182gIva@186gProtocollo@197gC");
|
||||||
|
sep1.fill('-');
|
||||||
|
set_row (9,"@1g%s", (const char *) sep1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TMastrini_application::stampa_progre_riporto()
|
void TMastrini_application::stampa_progre_riporto()
|
||||||
{
|
{
|
||||||
@ -1460,16 +1562,16 @@ void TMastrini_application::stampa_progre_riporto()
|
|||||||
_riporto_avere += _riporto_parziale_avere;
|
_riporto_avere += _riporto_parziale_avere;
|
||||||
if (_numcarat == 1)
|
if (_numcarat == 1)
|
||||||
{
|
{
|
||||||
TString string = _riporto_dare.string("###############");
|
TString string = _riporto_dare.string("###.###.###.###");
|
||||||
set_row (1,"@32gA RIPORTO@85g%15s",(const char*) string);
|
set_row (1,"@32gA RIPORTO@85g%15s",(const char*) string);
|
||||||
string = _riporto_avere.string("###############");
|
string = _riporto_avere.string("###.###.###.###");
|
||||||
set_row (1,"@101g%15s",(const char*) string);
|
set_row (1,"@101g%15s",(const char*) string);
|
||||||
}
|
}
|
||||||
if (_numcarat == 2)
|
if (_numcarat == 2)
|
||||||
{
|
{
|
||||||
TString string = _riporto_dare.string("###############");
|
TString string = _riporto_dare.string("###.###.###.###");
|
||||||
set_row (1,"@32gA RIPORTO@102g%15s",(const char*) string);
|
set_row (1,"@32gA RIPORTO@102g%15s",(const char*) string);
|
||||||
string = _riporto_avere.string("###############");
|
string = _riporto_avere.string("###.###.###.###");
|
||||||
set_row (1,"@119g%15s",(const char*) string);
|
set_row (1,"@119g%15s",(const char*) string);
|
||||||
}
|
}
|
||||||
_riporto_parziale_dare = 0;
|
_riporto_parziale_dare = 0;
|
||||||
@ -1614,7 +1716,7 @@ void TMastrini_application::calcola_progressivi()
|
|||||||
// progressivi dell'esercizio e i progressivi di quelli scaricati, tenendo
|
// progressivi dell'esercizio e i progressivi di quelli scaricati, tenendo
|
||||||
// conto del flag salini per sapere se il saldo e' dare oppure avere.
|
// conto del flag salini per sapere se il saldo e' dare oppure avere.
|
||||||
|
|
||||||
|
/*
|
||||||
if (_annomsk != 0 && _anno_corrente == annoes_saldi)
|
if (_annomsk != 0 && _anno_corrente == annoes_saldi)
|
||||||
{
|
{
|
||||||
if (saldo != ZERO)
|
if (saldo != ZERO)
|
||||||
@ -1631,12 +1733,13 @@ void TMastrini_application::calcola_progressivi()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
} // FOR
|
} // FOR
|
||||||
|
|
||||||
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
|
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
|
||||||
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
|
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
|
||||||
|
|
||||||
if (_annomsk != 0 && saldo == ZERO)
|
if (_annomsk != 0 /*&& saldo == ZERO*/)
|
||||||
{
|
{
|
||||||
if ((_indbil == 1) || (_indbil == 2) || (_indbil == 5))
|
if ((_indbil == 1) || (_indbil == 2) || (_indbil == 5))
|
||||||
{
|
{
|
||||||
@ -1691,21 +1794,21 @@ void TMastrini_application::stampa_progressivi()
|
|||||||
{
|
{
|
||||||
if (_numcarat == 1)
|
if (_numcarat == 1)
|
||||||
{
|
{
|
||||||
TString string = _saldo_progre_prec.string("###############");
|
TString string = _saldo_progre_prec.string("###.###.###.###");
|
||||||
set_row (1,"@32gPROGRESSIVI PRECEDENTI@69g%15s",(const char*) string);
|
set_row (1,"@42gPROGRESSIVI PRECEDENTI@69g%15s",(const char*) string);
|
||||||
string = _progredare.string("###############");
|
string = _progredare.string("###.###.###.###");
|
||||||
set_row (1,"@85g%15s",(const char*) string);
|
set_row (1,"@85g%15s",(const char*) string);
|
||||||
string = _progreavere.string("###############");
|
string = _progreavere.string("###.###.###.###");
|
||||||
set_row (1,"@101g%15s",(const char*) string);
|
set_row (1,"@101g%15s",(const char*) string);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_numcarat == 2)
|
if (_numcarat == 2)
|
||||||
{
|
{
|
||||||
TString string = _progredare.string("###############");
|
TString string = _progredare.string("###.###.###.###");
|
||||||
set_row (1,"@32gPROGRESSIVI PRECEDENTI@102g%15s",(const char*)string);
|
set_row (1,"@70gPROGRESSIVI PRECEDENTI@102g%15s",(const char*)string);
|
||||||
string = _progreavere.string("###############");
|
string = _progreavere.string("###.###.###.###");
|
||||||
set_row (1,"@119g%15s",(const char*) string);
|
set_row (1,"@119g%15s",(const char*) string);
|
||||||
string = _saldo_progre_prec.string("###############");
|
string = _saldo_progre_prec.string("###.###.###.###");
|
||||||
set_row (1,"@136g%15s",(const char*) string);
|
set_row (1,"@136g%15s",(const char*) string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1784,9 +1887,9 @@ void TMastrini_application::ricerca_clifo()
|
|||||||
else
|
else
|
||||||
descriz2 = "";
|
descriz2 = "";
|
||||||
|
|
||||||
set_header(3,"@27g%-30s",(const char*) descrizione_gruppo());
|
set_header(3,"@27g%-.30s",(const char*) descrizione_gruppo());
|
||||||
set_header(3,"@59g%-30s",(const char*) descrizione_conto());
|
set_header(3,"@59g%-.30s",(const char*) descrizione_conto());
|
||||||
set_header(3, "@91g%-30s",(const char*) ragsoc);
|
set_header(3, "@91g%-.41s",(const char*) ragsoc);
|
||||||
set_header(4, "Classe@8g%c", _lettivd);
|
set_header(4, "Classe@8g%c", _lettivd);
|
||||||
set_header(4, "@10g%-8s", (const char*) _numrivd);
|
set_header(4, "@10g%-8s", (const char*) _numrivd);
|
||||||
if (_numivd != 0)
|
if (_numivd != 0)
|
||||||
@ -1815,10 +1918,10 @@ void TMastrini_application::ricerca_clifo()
|
|||||||
|
|
||||||
set_header (5, "@33gP.I.@37g%-11s",(const char*) paiv);
|
set_header (5, "@33gP.I.@37g%-11s",(const char*) paiv);
|
||||||
set_header (5, "@49gCF@52g%-16s",(const char*) cofi);
|
set_header (5, "@49gCF@52g%-16s",(const char*) cofi);
|
||||||
set_header (5, "@69g%-25s",(const char*) indcf);
|
set_header (5, "@69g%-.25s",(const char*) indcf);
|
||||||
set_header (5, "@95g%-5s",(const char*) capcf);
|
set_header (5, "@95g%-5s",(const char*) capcf);
|
||||||
set_header (5, "@101g%-24s",(const char*) dencom);
|
set_header (5, "@101g%-.24s",(const char*) dencom);
|
||||||
set_header (5,"@126g%-5s",(const char*) provcom);
|
set_header (5, "@126g%-5s",(const char*) provcom);
|
||||||
|
|
||||||
if (_numcarat == 2)
|
if (_numcarat == 2)
|
||||||
{
|
{
|
||||||
@ -1827,6 +1930,124 @@ void TMastrini_application::ricerca_clifo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TMastrini_application::ricerca_clifo(int start)
|
||||||
|
{
|
||||||
|
TString ragsoc,paiv,cofi,indcf,capcf,ptel,tel,statocf,comcf,dencom,provcom,dep;
|
||||||
|
TLocalisamfile clifo(LF_CLIFO);
|
||||||
|
TLocalisamfile pconti(LF_PCON);
|
||||||
|
TString16 dataini,datafine;
|
||||||
|
TString descriz,descriz2;
|
||||||
|
int numrivd;
|
||||||
|
int r = start;
|
||||||
|
|
||||||
|
clifo.setkey(1);
|
||||||
|
clifo.zero();
|
||||||
|
clifo.put(CLI_TIPOCF, _tmcf);
|
||||||
|
clifo.put(CLI_CODCF, _sottoc);
|
||||||
|
clifo.read();
|
||||||
|
if (clifo.bad())
|
||||||
|
clifo.zero();
|
||||||
|
TConto tc (_gruppo,_conto,_sottoc,_tmcf);
|
||||||
|
|
||||||
|
ragsoc = tc.descrizione();
|
||||||
|
paiv = clifo.get(CLI_PAIV);
|
||||||
|
cofi = clifo.get(CLI_COFI);
|
||||||
|
indcf = clifo.get(CLI_INDCF);
|
||||||
|
indcf.trim();
|
||||||
|
indcf << " " << clifo.get(CLI_CIVCF);
|
||||||
|
capcf = clifo.get(CLI_CAPCF);
|
||||||
|
ptel = clifo.get(CLI_PTEL);
|
||||||
|
tel = clifo.get(CLI_TEL);
|
||||||
|
statocf = clifo.get(CLI_STATOCF);
|
||||||
|
comcf = clifo.get(CLI_COMCF);
|
||||||
|
|
||||||
|
_comuni->setkey(1);
|
||||||
|
_comuni->zero();
|
||||||
|
_comuni->put(COM_STATO, statocf);
|
||||||
|
_comuni->put(COM_COM, comcf);
|
||||||
|
_comuni->read();
|
||||||
|
if (_comuni->good())
|
||||||
|
{
|
||||||
|
dencom = _comuni->get(COM_DENCOM);
|
||||||
|
provcom = _comuni->get(COM_PROVCOM);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dencom="";
|
||||||
|
provcom="";
|
||||||
|
}
|
||||||
|
|
||||||
|
pconti.setkey(1);
|
||||||
|
pconti.zero();
|
||||||
|
pconti.put(PCN_GRUPPO, _gruppo);
|
||||||
|
pconti.put(PCN_CONTO, _conto);
|
||||||
|
pconti.read();
|
||||||
|
_sezivd = pconti.get_char(PCN_SEZIVD);
|
||||||
|
_lettivd = pconti.get_char(PCN_LETTIVD);
|
||||||
|
numrivd = pconti.get_int(PCN_NUMRIVD);
|
||||||
|
_numrivd = itor(numrivd);
|
||||||
|
_numivd = pconti.get_int(PCN_NUMIVD);
|
||||||
|
|
||||||
|
descriz = descrizione_classe(_sezivd,_lettivd,numrivd,_numivd);
|
||||||
|
|
||||||
|
if (_numivd != 0) //Ora devo stampare la descrizione del livello della
|
||||||
|
{ //classe immediatamente precedente a quello appena
|
||||||
|
if (_numrivd != "") //stampato
|
||||||
|
descriz2 = descrizione_classe(_sezivd,_lettivd,_numrivd_int,0);
|
||||||
|
else
|
||||||
|
descriz2 = descrizione_classe(_sezivd,_lettivd,0,0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (_numrivd != "")
|
||||||
|
descriz2 = descrizione_classe(_sezivd,_lettivd,0,0);
|
||||||
|
else
|
||||||
|
descriz2 = "";
|
||||||
|
|
||||||
|
set_row (r,"@27g%-30s",(const char*) descrizione_gruppo());
|
||||||
|
set_row (r,"@59g%-30s",(const char*) descrizione_conto());
|
||||||
|
set_row(r++, "@91g%-30s",(const char*) ragsoc);
|
||||||
|
set_row(r, "Classe@8g%c", _lettivd);
|
||||||
|
set_row(r, "@10g%-8s", (const char*) _numrivd);
|
||||||
|
if (_numivd != 0)
|
||||||
|
set_row(r, "@19g%2d", _numivd);
|
||||||
|
if (descriz2 != "")
|
||||||
|
{
|
||||||
|
set_row(r,"@23g%-50s",(const char*) descriz2);
|
||||||
|
set_row(r,"@80g%-50s",(const char*) descriz);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
set_row(r++,"@23g%-50s",(const char*) descriz);
|
||||||
|
|
||||||
|
dataini = _data_ini.string();
|
||||||
|
datafine = _data_fine.string();
|
||||||
|
|
||||||
|
if (_annomsk == 0)
|
||||||
|
{
|
||||||
|
set_row (r, "Periodo@10g%s", (const char*) dataini);
|
||||||
|
set_row (r, "@22g%s", (const char*) datafine);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
set_row (r, "Comp. da@9g%s", (const char*) dataini);
|
||||||
|
set_row (r, "@20ga@22g%s", (const char*) datafine);
|
||||||
|
}
|
||||||
|
|
||||||
|
set_row (r, "@33gP.I.@37g%-11s",(const char*) paiv);
|
||||||
|
set_row (r, "@49gCF@52g%-16s",(const char*) cofi);
|
||||||
|
set_row (r, "@69g%-25s",(const char*) indcf);
|
||||||
|
set_row (r, "@95g%-5s",(const char*) capcf);
|
||||||
|
set_row (r, "@101g%-24s",(const char*) dencom);
|
||||||
|
set_row (r, "@126g%-5s",(const char*) provcom);
|
||||||
|
|
||||||
|
if (_numcarat == 2)
|
||||||
|
{
|
||||||
|
set_row (r,"@134g%-4s",(const char*) ptel);
|
||||||
|
set_row (r++,"@138g/@139g%-10s",(const char*) tel);
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Se la ricerca selezionata sulla maschera e' per gruppo, conto, sottoconto
|
// Se la ricerca selezionata sulla maschera e' per gruppo, conto, sottoconto
|
||||||
// ricerca i corrispondenti su PCON, con relativa IV direttiva CEE
|
// ricerca i corrispondenti su PCON, con relativa IV direttiva CEE
|
||||||
|
|
||||||
@ -1873,10 +2094,10 @@ void TMastrini_application::ricerca_gruppo()
|
|||||||
else
|
else
|
||||||
descriz2 = "";
|
descriz2 = "";
|
||||||
|
|
||||||
set_header(3,"@27g%-30s",(const char*) descrizione_gruppo());
|
set_header(3,"@27g%-.30s",(const char*) descrizione_gruppo());
|
||||||
set_header(3,"@59g%-30s",(const char*) descrizione_conto());
|
set_header(3,"@59g%-.30s",(const char*) descrizione_conto());
|
||||||
|
|
||||||
set_header(3,"@91g%-30s",(const char*) _descr);
|
set_header(3,"@91g%-.41s",(const char*) _descr);
|
||||||
set_header(4, "@0gClasse@12g%c", _lettivd);
|
set_header(4, "@0gClasse@12g%c", _lettivd);
|
||||||
set_header(4, "@14g%-8s",(const char*) _numrivd);
|
set_header(4, "@14g%-8s",(const char*) _numrivd);
|
||||||
if (_numivd != 0)
|
if (_numivd != 0)
|
||||||
@ -1904,6 +2125,63 @@ void TMastrini_application::ricerca_gruppo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TMastrini_application::ricerca_gruppo(int start)
|
||||||
|
{
|
||||||
|
TString80 descr,descriz,descriz2,dep;
|
||||||
|
TString dataini,datafine;
|
||||||
|
int r = start;
|
||||||
|
|
||||||
|
ricerca_classe_IV (TRUE); //Esiste a livello di sottoconto
|
||||||
|
|
||||||
|
if (_sezivd == '0') //Non esiste a livello di sottoconto
|
||||||
|
ricerca_classe_IV (FALSE); //Allora la cerco a livello di conto
|
||||||
|
|
||||||
|
descriz = descrizione_classe(_sezivd,_lettivd,_numrivd_int,_numivd);
|
||||||
|
if (_numivd != 0) //Ora devo stampare la descrizione del livello della
|
||||||
|
{ //classe immediatamente precedente a quello appena
|
||||||
|
if (_numrivd != "") //stampato
|
||||||
|
descriz2 = descrizione_classe(_sezivd,_lettivd,_numrivd_int,0);
|
||||||
|
else
|
||||||
|
descriz2 = descrizione_classe(_sezivd,_lettivd,0,0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (_numrivd != "")
|
||||||
|
descriz2 = descrizione_classe(_sezivd,_lettivd,0,0);
|
||||||
|
else
|
||||||
|
descriz2 = "";
|
||||||
|
|
||||||
|
set_row(3,"@27g%-30s",(const char*) descrizione_gruppo());
|
||||||
|
set_row(3,"@59g%-30s",(const char*) descrizione_conto());
|
||||||
|
|
||||||
|
set_row(3,"@91g%-30s",(const char*) _descr);
|
||||||
|
set_row(4, "@0gClasse@12g%c", _lettivd);
|
||||||
|
set_row(4, "@14g%-8s",(const char*) _numrivd);
|
||||||
|
if (_numivd != 0)
|
||||||
|
set_row(4, "@23g%d", _numivd);
|
||||||
|
if (descriz2 != "")
|
||||||
|
{
|
||||||
|
set_row(4,"@27g%-50s",(const char*) descriz2);
|
||||||
|
set_row(4,"@80g%-50s",(const char*) descriz);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
set_row(4,"@27g%-50s",(const char*) descriz);
|
||||||
|
|
||||||
|
dataini = _data_ini.string();
|
||||||
|
datafine = _data_fine.string();
|
||||||
|
|
||||||
|
if (_annomsk == 0)
|
||||||
|
{
|
||||||
|
set_row (5, "Periodo@12g%s", (const char*) dataini);
|
||||||
|
set_row (5, "@24g%s", (const char*) datafine);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
set_row (5, "Periodo di competenza@23g%s", (const char*) dataini);
|
||||||
|
set_row (5, "@35g%s", (const char*) datafine);
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
const char* TMastrini_application::descrizione_classe(char sezione, char lettera, int numr, int numero)
|
const char* TMastrini_application::descrizione_classe(char sezione, char lettera, int numr, int numero)
|
||||||
{
|
{
|
||||||
TTable tabivd(TAB_IVD);
|
TTable tabivd(TAB_IVD);
|
||||||
@ -2003,11 +2281,13 @@ bool TMastrini_application::user_create()
|
|||||||
_msk->set_handler (F_CONTOFINE_CLIENTE ,conto_hnd);
|
_msk->set_handler (F_CONTOFINE_CLIENTE ,conto_hnd);
|
||||||
_msk->set_handler (F_CONTOFINE_FORN ,conto_hnd);
|
_msk->set_handler (F_CONTOFINE_FORN ,conto_hnd);
|
||||||
|
|
||||||
_msk->set_handler (F_SOTTOCFINE_CONTO ,sottoc_hnd);
|
// _msk->set_handler (F_SOTTOCFINE_CONTO ,sottoc_hnd);
|
||||||
_msk->set_handler (F_SOTTOCFINE_CLIENTE ,sottoc_hnd);
|
// _msk->set_handler (F_SOTTOCFINE_CLIENTE ,sottoc_hnd);
|
||||||
_msk->set_handler (F_SOTTOCFINE_FORN ,sottoc_hnd);
|
// _msk->set_handler (F_SOTTOCFINE_FORN ,sottoc_hnd);
|
||||||
|
|
||||||
|
_inizio_stampa = TRUE;
|
||||||
|
_numero_pag = 1;
|
||||||
|
|
||||||
_inizio_stampa = TRUE;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,15 +5,15 @@ PAGE "Stampa Mastrini" -1 -1 78 20
|
|||||||
|
|
||||||
NUMBER F_CODDITTA 5
|
NUMBER F_CODDITTA 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 1 "Ditta "
|
PROMPT 4 1 "Ditta "
|
||||||
FLAGS "FRD"
|
FLAGS "FRD"
|
||||||
USE LF_NDITTE KEY 1
|
USE LF_NDITTE KEY 1
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
INPUT CODDITTA F_CODDITTA
|
INPUT CODDITTA F_CODDITTA
|
||||||
DISPLAY "Codice" CODDITTA
|
DISPLAY "Codice" CODDITTA
|
||||||
DISPLAY "Ragione sociale @50" RAGSOC
|
DISPLAY "Ragione sociale @50" RAGSOC
|
||||||
OUTPUT F_CODDITTA CODDITTA
|
OUTPUT F_CODDITTA CODDITTA
|
||||||
OUTPUT F_RAGSOC RAGSOC
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_RAGSOC 50
|
STRING F_RAGSOC 50
|
||||||
@ -148,7 +148,7 @@ NUMBER F_SOTTOCINI_CONTO 6
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 48 5 ""
|
PROMPT 48 5 ""
|
||||||
HELP "Codice conto da cui iniziare la stampa"
|
HELP "Codice conto da cui iniziare la stampa"
|
||||||
USE LF_PCON //SELECT SOTTOCONTO!=""
|
USE LF_PCON SELECT SOTTOCONTO!=""
|
||||||
INPUT GRUPPO F_GRUPPOINI
|
INPUT GRUPPO F_GRUPPOINI
|
||||||
INPUT CONTO F_CONTOINI_CONTO
|
INPUT CONTO F_CONTOINI_CONTO
|
||||||
INPUT SOTTOCONTO F_SOTTOCINI_CONTO
|
INPUT SOTTOCONTO F_SOTTOCINI_CONTO
|
||||||
@ -476,7 +476,7 @@ END
|
|||||||
LIST F_STAMPANUM 15
|
LIST F_STAMPANUM 15
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 15 "Stampa numerazione "
|
PROMPT 4 15 "Stampa numerazione "
|
||||||
HELP "Indicare il tipo di numerazione da stampare"
|
HELP "Indicare il tipo di numerazione da stampare"
|
||||||
ITEM "1|Operazione"
|
ITEM "1|Operazione"
|
||||||
ITEM "2|Riga giornale"
|
ITEM "2|Riga giornale"
|
||||||
ITEM "3|Nessuna"
|
ITEM "3|Nessuna"
|
||||||
@ -500,12 +500,12 @@ END
|
|||||||
|
|
||||||
BUTTON DLG_OK 9 2
|
BUTTON DLG_OK 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -12 -1 ""
|
PROMPT -12 -1 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_QUIT 9 2
|
BUTTON DLG_QUIT 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -22 -1 ""
|
PROMPT -22 -1 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
@ -528,23 +528,24 @@ BEGIN
|
|||||||
ITEM "72|12 pollici (30,48 cm)"
|
ITEM "72|12 pollici (30,48 cm)"
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST F_NUMMAST 5
|
LIST F_NUMMAST 10
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 6 "Numero mastrini per pagina "
|
PROMPT 4 6 "Numero mastrini per pagina "
|
||||||
HELP "Indicare il numero di mastrini contenuti in una pagina"
|
HELP "Indicare il numero di mastrini contenuti in una pagina"
|
||||||
ITEM "1|Uno"
|
ITEM "1|Uno"
|
||||||
ITEM "2|Due"
|
ITEM "2|Due"
|
||||||
|
ITEM "3|Continua"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_PRINT 9 2
|
BUTTON DLG_PRINT 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -12 -1 "~Stampa"
|
PROMPT -12 -1 "~Stampa"
|
||||||
MESSAGE EXIT,K_ENTER
|
MESSAGE EXIT,K_ENTER
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_QUIT 9 2
|
BUTTON DLG_QUIT 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -22 -1 ""
|
PROMPT -22 -1 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
@ -270,8 +270,6 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
static bool can_print = TRUE;
|
static bool can_print = TRUE;
|
||||||
|
|
||||||
if (!can_print) return FALSE;
|
|
||||||
|
|
||||||
if (k == K_ENTER) return can_print;
|
if (k == K_ENTER) return can_print;
|
||||||
|
|
||||||
if (k==K_TAB && f.mask().is_running())
|
if (k==K_TAB && f.mask().is_running())
|
||||||
@ -286,7 +284,7 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k)
|
|||||||
int last_mese = 13;
|
int last_mese = 13;
|
||||||
int mese = 0;
|
int mese = 0;
|
||||||
|
|
||||||
app().__firm = app().get_firm();
|
app().__firm = app().get_firm();
|
||||||
|
|
||||||
for (int i = 0; i < app()._ditte->items(); i++)
|
for (int i = 0; i < app()._ditte->items(); i++)
|
||||||
{
|
{
|
||||||
@ -301,11 +299,8 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (app()._selected[i]) f.message_box("Ditta %ld: il registro %s non soddisfa i parametri indicati", ditta, (const char*)cod);
|
if (app()._selected[i]) f.message_box("Ditta %ld: il registro %s non soddisfa i parametri indicati", ditta, (const char*)cod);
|
||||||
if (app()._selected.last_one() == i)
|
if (app()._selected.last_one() == i)
|
||||||
{
|
|
||||||
can_print = FALSE;
|
|
||||||
break;
|
break;
|
||||||
}
|
else
|
||||||
else
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (mese != 0 && mese < fino_a_mese - 1) //indipendentemente se si tratta di una ditta selezionata oppure no
|
if (mese != 0 && mese < fino_a_mese - 1) //indipendentemente se si tratta di una ditta selezionata oppure no
|
||||||
@ -328,10 +323,9 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k)
|
|||||||
last_mese = (last_mese < mese) ? last_mese : mese;
|
last_mese = (last_mese < mese) ? last_mese : mese;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
app().set_firm(app().__firm);
|
||||||
app().set_firm(app().__firm);
|
|
||||||
if (last_mese == 13)
|
if (last_mese == 13)
|
||||||
//return FALSE;
|
|
||||||
last_mese = 0; //l'ultima data di stampa sul/sui registri specificati e' vuota (cioe' non sono ancora stati stampati sul libro unico specificato per l'anno specificato)
|
last_mese = 0; //l'ultima data di stampa sul/sui registri specificati e' vuota (cioe' non sono ancora stati stampati sul libro unico specificato per l'anno specificato)
|
||||||
const char* me = "";
|
const char* me = "";
|
||||||
me = format("%02d", last_mese);
|
me = format("%02d", last_mese);
|
||||||
@ -1634,10 +1628,8 @@ bool CG4400_application::compila_reg(const TMask& m)
|
|||||||
if (_tabreg->read() != NOERR)
|
if (_tabreg->read() != NOERR)
|
||||||
{
|
{
|
||||||
if (_tipo_stampa != 3)
|
if (_tipo_stampa != 3)
|
||||||
{
|
|
||||||
warning_box("Il registro IVA specificato non esiste nella \n Ditta %ld", _ditta);
|
warning_box("Il registro IVA specificato non esiste nella \n Ditta %ld", _ditta);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1830,18 +1822,6 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
|||||||
mov.rewrite();
|
mov.rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if ( intra && autof)
|
|
||||||
{
|
|
||||||
_auto_intraf = TRUE;
|
|
||||||
tipo_op = "3";
|
|
||||||
}
|
|
||||||
else if (intra)
|
|
||||||
tipo_op = "1";
|
|
||||||
else if (autof)
|
|
||||||
tipo_op = "2";
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (codcf == 0l)
|
if (codcf == 0l)
|
||||||
ragsoc = descrcau;
|
ragsoc = descrcau;
|
||||||
else
|
else
|
||||||
@ -1890,14 +1870,13 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
|||||||
_r = 1;
|
_r = 1;
|
||||||
if (!_stampa_data_reg)
|
if (!_stampa_data_reg)
|
||||||
set_row(_r, "%s", (const char*) _datareg.string(2, '/'));
|
set_row(_r, "%s", (const char*) _datareg.string(2, '/'));
|
||||||
set_row(_r, "@9g%5d", protiva);
|
set_row(_r, "@9g%5ld", protiva);
|
||||||
if (datadoc.ok())
|
if (datadoc.ok())
|
||||||
set_row(_r, "@15g%s", (const char*) app);
|
set_row(_r, "@15g%s", (const char*) app);
|
||||||
set_row(_r, "@24g%s", (const char*) numdoc);
|
set_row(_r, "@24g%s", (const char*) numdoc);
|
||||||
if (codcf != 0l)
|
if (codcf != 0l)
|
||||||
set_row(_r, "@31g%6ld", codcf);
|
set_row(_r, "@31g%6ld", codcf);
|
||||||
set_row(_r, "@38g%-.29s",(const char*) ragsoc);
|
set_row(_r, "@38g%-.30s",(const char*) ragsoc);
|
||||||
//set_row(_r, "@68g%s", (const char*) tipo_op);
|
|
||||||
set_row(_r, "@70g%2s", (const char*) _tipodoc);
|
set_row(_r, "@70g%2s", (const char*) _tipodoc);
|
||||||
if (_stampa_width == 132)
|
if (_stampa_width == 132)
|
||||||
set_row(_r, "@72g%r", &totdoc);
|
set_row(_r, "@72g%r", &totdoc);
|
||||||
@ -2472,7 +2451,9 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
|
|||||||
send_message('C',t, _fino_a_mese);
|
send_message('C',t, _fino_a_mese);
|
||||||
}
|
}
|
||||||
|
|
||||||
print();
|
print();
|
||||||
|
|
||||||
|
if (is_cancelled()) return FALSE;
|
||||||
|
|
||||||
if (_tipo_stampa != 3 && _liquidazione)
|
if (_tipo_stampa != 3 && _liquidazione)
|
||||||
stampa_liq_mesi_succ();
|
stampa_liq_mesi_succ();
|
||||||
@ -2642,6 +2623,8 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
|
|||||||
|
|
||||||
print();
|
print();
|
||||||
|
|
||||||
|
if (is_cancelled()) return FALSE;
|
||||||
|
|
||||||
if (_tipo_stampa != 3 && _liquidazione)
|
if (_tipo_stampa != 3 && _liquidazione)
|
||||||
stampa_liq_mesi_succ();
|
stampa_liq_mesi_succ();
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,7 @@ BEGIN
|
|||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
WARNING "Inserire il codice del libro unico"
|
WARNING "Inserire il codice del libro unico"
|
||||||
VALIDATE ZEROFILL_FUNC 3
|
VALIDATE ZEROFILL_FUNC 3
|
||||||
|
MESSAGE K_TAB, CODICE_LIBRO_IVA
|
||||||
GROUP 2
|
GROUP 2
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -499,7 +499,7 @@ bool TSaldo::ultima_immissione_verifica(int annoes,int g,int c,long s,int indbil
|
|||||||
_prg_avere = saldi.get_real(SLD_PAVERE);
|
_prg_avere = saldi.get_real(SLD_PAVERE);
|
||||||
sezione = saldi.get_char(SLD_FLAGSALINI);
|
sezione = saldi.get_char(SLD_FLAGSALINI);
|
||||||
|
|
||||||
if (_prg_dare == ZERO && _prg_avere == ZERO)
|
if (_saldo_iniziale == ZERO && _prg_dare == ZERO && _prg_avere == ZERO)
|
||||||
return esito;
|
return esito;
|
||||||
|
|
||||||
if (sezione == 'A') _saldo_iniziale = -_saldo_iniziale;
|
if (sezione == 'A') _saldo_iniziale = -_saldo_iniziale;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user