Corretto MI0363 liquidiazione piu' altre cose qua e la'

Altri modificati per cause spurie cvs-related


git-svn-id: svn://10.65.10.50/trunk@801 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1994-12-29 14:49:03 +00:00
parent f3c7cb1e11
commit 929a349a3c
18 changed files with 1001 additions and 884 deletions

View File

@ -9,21 +9,21 @@
#define N_CODCF "CODCF" #define N_CODCF "CODCF"
#define F_ANNO 101 #define F_ANNO 101
#define F_CODATT 102 #define F_CODATT 102
#define F_TIPOCF 103 #define F_TIPOCF 103
#define F_CODCF 104 #define F_CODCF 104
#define F_IMMESSO 105 #define F_IMMESSO 105
#define F_IMPESC 106 #define F_IMPESC 106
#define F_IVAESC 107 #define F_IVAESC 107
#define F_NIESC 108 #define F_NIESC 108
#define F_E8ESC 109 #define F_E8ESC 109
#define F_NDOCESC 110 #define F_NDOCESC 110
#define F_IMPESP 111 #define F_IMPESP 111
#define F_IVAESP 112 #define F_IVAESP 112
#define F_NIESP 113 #define F_NIESP 113
#define F_E8ESP 114 #define F_E8ESP 114
#define F_NDOCESP 115 #define F_NDOCESP 115
#define F_PROG101102 116 #define F_PROG101102 116
#define F_CODDITTA 117 #define F_CODDITTA 117
#define F_RAGSOC 118 #define F_RAGSOC 118
#define F_COFI 119 #define F_COFI 119
@ -38,7 +38,7 @@
#define F_PROMPT 128 #define F_PROMPT 128
#define F_RAGSOC_D 129 #define F_RAGSOC_D 129
#define F_DENATT 130 #define F_DENATT 130
#define F_CODATTH 131 #define F_CODATTH 131
#define F_CODCFH 132 #define F_CODCFH 132
#endif // __CG0300_H #endif // __CG0300_H

View File

@ -1,13 +1,13 @@
#ifndef __CG0400_H #ifndef __CG0400_H
#define __CG0400_H #define __CG0400_H
/**** /****
#define TCLI "C" #define TCLI "C"
#define N_CODDITTA "CODDITTA" #define N_CODDITTA "CODDITTA"
#define N_CODATTPREV "CODATTPREV" #define N_CODATTPREV "CODATTPREV"
#define N_CODATT "CODATT" #define N_CODATT "CODATT"
#define N_CODCF "CODCF" #define N_CODCF "CODCF"
***/ ***/
#define TAB_REG "REG" #define TAB_REG "REG"
#define TAB_PIM "PIM" #define TAB_PIM "PIM"
@ -25,16 +25,16 @@
#define F_VUOILORDI 111 #define F_VUOILORDI 111
#define F_TIPO1 112 #define F_TIPO1 112
/* /*
#define F_TOTALE1 122 #define F_TOTALE1 122
#define F_TOTALE2 123 #define F_TOTALE2 123
#define F_TOTALE3 124 #define F_TOTALE3 124
#define F_TOTALE4 125 #define F_TOTALE4 125
#define F_TOTALE5 126 #define F_TOTALE5 126
#define F_TOTALE6 127 #define F_TOTALE6 127
#define F_PROMPT 128 #define F_PROMPT 128
*/ */
#endif // __CG0400_H #endif // __CG0400_H

View File

@ -6,7 +6,7 @@ enum stampe {
modulo101=3, modulo101=3,
modulo102=4, modulo102=4,
entrambi=5 entrambi=5
}; };
class desc_campo : public TObject class desc_campo : public TObject
{ {
@ -27,7 +27,7 @@ public:
const desc_campo& campi(int i) { return (const desc_campo&) _campi[i]; } const desc_campo& campi(int i) { return (const desc_campo&) _campi[i]; }
int riga (int i) { return ((const desc_campo&)_campi[i])._riga; } int riga (int i) { return ((const desc_campo&)_campi[i])._riga; }
const char * formato (int i) const char * formato (int i)
{ return ((desc_campo&)_campi[i])._formato; } { return ((desc_campo&)_campi[i])._formato; }
void add (int, const char*); void add (int, const char*);
void leggi_modulo (const char *, const char *); void leggi_modulo (const char *, const char *);
@ -55,7 +55,7 @@ public:
real ivaesc_real() { return ivaesc; } real ivaesc_real() { return ivaesc; }
const char * tot_str() { return tot.string("@@@@@@@@@@@"); } const char * tot_str() { return tot.string("@@@@@@@@@@@"); }
// const char * esc_str() { return esc.string("@@@@@@@@@@@"); } // const char * esc_str() { return esc.string("@@@@@@@@@@@"); }
const char * impesc_str() { return impesc.string("@@@@@@@@@@@"); } const char * impesc_str() { return impesc.string("@@@@@@@@@@@"); }
const char * ivaesc_str() { return ivaesc.string("@@@@@@@@@@@"); } const char * ivaesc_str() { return ivaesc.string("@@@@@@@@@@@"); }
@ -70,7 +70,7 @@ struct alleg_sort {
char cognome_dic [31]; char cognome_dic [31];
char nome_dic [21]; char nome_dic [21];
char ragsoc_dic[51]; char ragsoc_dic[51];
// char datana_dic[11]; // char datana_dic[11];
TDate datana_dic; TDate datana_dic;
char sesso_dic [2]; char sesso_dic [2];
char comunena_dic [51]; char comunena_dic [51];
@ -127,7 +127,7 @@ class SortRecord {
TTable * _tpd; TTable * _tpd;
struct alleg_sort * _all; struct alleg_sort * _all;
protected: protected:
TRectype& look_com(const char *); TRectype& look_com(const char *);
long cerca_codice_all(TString tipo, long codcf) ; long cerca_codice_all(TString tipo, long codcf) ;
const char * decodifica_desc_att (TString & codatt); const char * decodifica_desc_att (TString & codatt);
@ -153,7 +153,7 @@ public:
struct Totali { struct Totali {
// Totali anno corrente // Totali anno corrente
real _tot_tot_rigac; real _tot_tot_rigac;
int _tot_esc; int _tot_esc;
real _tot_impesc; real _tot_impesc;
@ -161,7 +161,7 @@ struct Totali {
real _tot_niesc; real _tot_niesc;
real _tot_e8esc; real _tot_e8esc;
// Totali anno precedente // Totali anno precedente
real _tot_tot_rigap; real _tot_tot_rigap;
int _tot_esp; int _tot_esp;
real _tot_impesp; real _tot_impesp;
@ -169,7 +169,7 @@ struct Totali {
real _tot_niesp; real _tot_niesp;
real _tot_e8esp; real _tot_e8esp;
// Riporti // Riporti
real _rip_tot_riga; real _rip_tot_riga;
int _rip_tot_es; int _rip_tot_es;
real _rip_tot_impes; real _rip_tot_impes;
@ -211,7 +211,7 @@ enum modi_stampa {
modulo=1, modulo=1,
controllo=2, controllo=2,
dischetto=3 dischetto=3
}; };
enum posizioni { enum posizioni {
PAIVA_DIC = 0, PAIVA_DIC = 0,
@ -298,5 +298,5 @@ enum posizioni {
TOT_E8ESP, TOT_E8ESP,
TOT_SEGNO_TOTALE, TOT_SEGNO_TOTALE,
TOT_TOTALE TOT_TOTALE
}; };

View File

@ -8,6 +8,7 @@
#include <progind.h> #include <progind.h>
#include <sheet.h> #include <sheet.h>
#include <prefix.h> #include <prefix.h>
#include <utility.h>
#include "cg4300.h" #include "cg4300.h"
#include "cg4300a.h" #include "cg4300a.h"
@ -20,11 +21,12 @@ real TLiquidazione_app::CENTO(100.0);
inline TLiquidazione_app& app() inline TLiquidazione_app& app()
{ return (TLiquidazione_app&)main_app(); } { return (TLiquidazione_app&)main_app(); }
TLiquidazione_app::TLiquidazione_app() TLiquidazione_app::TLiquidazione_app() :
: _ditte(NULL), _selected(10000), _year(4), _nomiditte(100) _ditte(NULL), _selected(10000),
_year(4), _nomiditte(100)
{ {
_isprint = _is_interactive = TRUE; _recalc = needed; _isprint = _is_interactive = TRUE; _recalc = needed;
_isplafond = _isfinal = _is_visliq = FALSE; _isplafond = _printonly = _is_visliq = FALSE;
_isvent = _isagricolo = _isbenzinaro = _isviaggio = FALSE; _isvent = _isagricolo = _isbenzinaro = _isviaggio = FALSE;
_row = 1; _what = all; _comp_acconto = FALSE; _row = 1; _what = all; _comp_acconto = FALSE;
_isriepilogo = FALSE; _calcall = FALSE; _isriepilogo = FALSE; _calcall = FALSE;
@ -117,6 +119,7 @@ bool TLiquidazione_app::user_create()
// ACHTUNG: tutti i _codatt (codici attivita') sono // ACHTUNG: tutti i _codatt (codici attivita') sono
// in realta' composti dal codice attivita' piu' il // in realta' composti dal codice attivita' piu' il
// tipo attivita' (1 o 2) // tipo attivita' (1 o 2)
// sarebbe piu' saggio fare 2 campi ma ci vuole 1 vita
_pim_anno = new TRecfield(*_pim_r,"CODTAB",0,3); _pim_anno = new TRecfield(*_pim_r,"CODTAB",0,3);
_pim_codatt = new TRecfield(*_pim_r,"CODTAB",4,9); _pim_codatt = new TRecfield(*_pim_r,"CODTAB",4,9);
@ -154,15 +157,15 @@ bool TLiquidazione_app::user_create()
for (dt.first(); !dt.eof(); dt.next()) for (dt.first(); !dt.eof(); dt.next())
{ {
// no archivi // check no archivi
if (!prefhndl->exist(dt.get_long("CODDITTA"))) bool good = prefhndl->exist(dt.get_long("CODDITTA"));
continue;
TApplication::set_firm(dt.get_long("CODDITTA")); if (good)
{
// no parametri liquidazione // check no parametri liquidazione
if (!look_lia()) TApplication::set_firm(dt.get_long("CODDITTA"));
continue; if (!look_lia()) good = FALSE;
}
_n_ditte++; _n_ditte++;
@ -171,7 +174,8 @@ bool TLiquidazione_app::user_create()
// add record // add record
d->add(dt.get("CODDITTA")); d->add(dt.get("CODDITTA"));
d->add(dt.get("RAGSOC")); d->add(dt.get("RAGSOC"));
d->add(_lia->get("S7")); if (good) d->add(_lia->get("S7"));
else d->add("??");
_nomiditte.add(d); _nomiditte.add(d);
} }
@ -339,141 +343,240 @@ bool TLiquidazione_app::set_print(int n)
long TLiquidazione_app::select_firm_range(long from, long to, wht freq) long TLiquidazione_app::select_firm_range(long from, long to, wht freq)
{ {
if (to == 0) to = 99999L; if (to == 0l) to = 99999L;
for (int i = 0; i < _nomiditte.items(); i++) for (int i = 0; i < _ditte->items(); i++)
{ {
TToken_string& d = (TToken_string&)_nomiditte[i]; if (_ditte->disabled(i))
const char vers = d.get_char(2);
if ((freq == mnt && vers == 'T') || (freq == quarter && vers == 'M'))
continue; continue;
const long cod = d.get_long(0);
TToken_string& d = _ditte->row(i);
const char vers = d.get_char(3);
if (vers == '?' || (freq == mnt && vers == 'T') || (freq == quarter && vers == 'M'))
continue;
const long cod = d.get_long(1);
if (cod >= from && cod <= to) if (cod >= from && cod <= to)
{
_selected.set(i); _selected.set(i);
_ditte->check(i);
}
else
{
_selected.set(i,FALSE);
_ditte->uncheck(i);
}
} }
return _selected.ones(); return _selected.ones();
} }
// ----------------------------------------------- handlers
bool TLiquidazione_app::to_ditta_handler(TMask_field& f, KEY key) bool TLiquidazione_app::to_ditt_handler(TMask_field& f, KEY key)
{ {
if (key == K_TAB && f.focusdirty() || key == K_ENTER) TMask& m = f.mask();
if (key == K_F9)
{ {
app().to_butt_handler(m.field(CG43_BUT_DTO), K_SPACE);
}
if (key == K_TAB && f.focusdirty())
{
const long l = app().select_firm_range(m.get_long(CG43_FLD_DFR),
m.get_long(CG43_FLD_DTO),
(wht)m.get_int(CG43_RDB_VERS));
app().set_choice_limits(m);
m.field(CG43_FLD_SELECTED).set(format("%ld", l));
}
return TRUE;
}
bool TLiquidazione_app::fr_ditt_handler(TMask_field& f, KEY key)
{
TMask& m = f.mask();
if (key == K_F9)
{
app().fr_butt_handler(m.field(CG43_BUT_DFR), K_SPACE);
}
else if (key == K_TAB && f.focusdirty())
{
const long l = app().select_firm_range(m.get_long(CG43_FLD_DFR),
m.get_long(CG43_FLD_DTO),
(wht)m.get_int(CG43_RDB_VERS));
app().set_choice_limits(m);
m.field(CG43_FLD_SELECTED).set(format("%ld", l));
}
return TRUE;
}
bool TLiquidazione_app::to_butt_handler(TMask_field& f, KEY key)
{
if (key == K_SPACE)
{
TArray_sheet* sh = app().get_ditte_sheet();
TMask& m = f.mask(); TMask& m = f.mask();
const long from = m.get_long(CG43_FLD_DFR);
const long to = m.get_long(CG43_FLD_DTO); sh->disable_check();
const wht freq = (wht)m.get_int(CG43_RDB_VERS); if (sh->run() == K_ENTER)
if (from > 0 || to > 0)
{ {
const long sel = app().select_firm_range(from, to, freq); app().select_firm_range(m.get_long(CG43_FLD_DFR),sh->row(sh->selected()).get_long(1),
m.set(CG43_FLD_SELECTED, sel); (wht)m.get_int(CG43_RDB_VERS));
// m.reset(CG43_FLD_DFR); app().set_choice_limits(m);
// m.reset(CG43_FLD_DTO);
} }
} }
return TRUE; return TRUE;
} }
bool TLiquidazione_app::fr_butt_handler(TMask_field& f, KEY key)
{
if (key == K_SPACE)
{
TMask& m = f.mask();
TArray_sheet* sh = ((TLiquidazione_app&)main_app()).get_ditte_sheet();
sh->disable_check();
if (sh->run() == K_ENTER)
{
app().select_firm_range(sh->row(sh->selected()).get_long(1), m.get_long(CG43_FLD_DTO),
(wht)m.get_int(CG43_RDB_VERS));
app().set_choice_limits(m);
}
}
return TRUE;
}
bool TLiquidazione_app::what_freq_handler(TMask_field& f, KEY key)
{
if (key == K_SPACE && f.dirty())
{
if (*(f.get()) == '3') // trimestre intelligente
{
int month = f.mask().get_int(CG43_LST_MESE);
if (month > 3)
while (!is_trim(month)) month--;
else month = 3;
f.mask().field(CG43_LST_TRIM).set(format("%d",month));
}
app().reset_choices(f.mask());
app().build_ditte_sheet((wht)atoi(f.get()));
}
return TRUE;
}
void TLiquidazione_app::reset_choices(TMask& m)
{
_selected.reset();
m.reset(CG43_FLD_SELECTED);
m.reset(CG43_FLD_DFR);
m.reset(CG43_FLD_DTO);
_ditte->check(-1, FALSE);
}
void TLiquidazione_app::set_choice_limits(TMask& m)
{
long first = -1l, last = -1l;
for (int i = 0; i < _ditte->items(); i++)
{
if (_selected[i])
{
long dit = _ditte->row(i).get_long(1);
if (first == -1l) first = dit;
if (last < dit) last = dit;
}
}
if (first != -1) m.field(CG43_FLD_DFR).set(format("%ld",first));
if (last != -1) m.field(CG43_FLD_DTO).set(format("%ld",last));
m.set(CG43_FLD_SELECTED, _selected.ones());
}
void TLiquidazione_app::build_ditte_sheet(wht what)
{
// build sheet
_ditte->destroy();
_what = what;
for (int i = 0; i < _nomiditte.items(); i++)
{
TToken_string* d = new TToken_string(64);
*d = (TToken_string&)_nomiditte[i];
const char vers = d->get_char(2);
bool selectable = vers == '?';
if ((what == mnt && vers == 'T') || (what == quarter && vers == 'M'))
continue;
d->insert(" |", 0);
const long pos = _ditte->add(d);
if (selectable) _ditte->disable(pos);
else if (_selected[i]) _ditte->check(pos);
}
}
// ----------------------------------------------------
bool TLiquidazione_app::set_liquidazione() bool TLiquidazione_app::set_liquidazione()
{ {
TMask m("cg4300a.msk"); TMask m("cg4300a.msk");
m.set_handler(CG43_FLD_DTO, to_ditta_handler);
m.set_handler(CG43_FLD_DTO, to_ditt_handler);
m.set_handler(CG43_FLD_DFR, fr_ditt_handler);
m.set_handler(CG43_BUT_DTO, to_butt_handler);
m.set_handler(CG43_BUT_DFR, fr_butt_handler);
m.set_handler(CG43_RDB_VERS, what_freq_handler);
m.field(CG43_FLD_SELECTED).set("0"); m.field(CG43_FLD_SELECTED).set("0");
_selected.reset();
KEY k; KEY k;
// stampa abilitata per default // stampa abilitata per default
m.set(CG43_CHK_STAMPA,"X"); m.set(CG43_CHK_STAMPA,"X");
_month = m.get_int(CG43_LST_MESE);
build_ditte_sheet(all);
do do
{ {
k = m.run(); if ((k = m.run()) == K_ESC) break;
if (k == K_ESC) break; // handlers have set everything
_month = _what == quarter ? m.get_int(CG43_LST_TRIM) :
m.get_int(CG43_LST_MESE);
_what = (wht)m.get_int(CG43_RDB_VERS); _year = m.get(CG43_FLD_ANNO);
_month = m.get_int(CG43_LST_MESE); _date = m.get(CG43_FLD_DATA);
_isprint = m.get_bool(CG43_CHK_STAMPA);
if (_what == all) _recalc = (recalc)m.get_long(CG43_LST_CALC);
{ _printonly = m.get_bool(CG43_CHK_FINAL);
if (_month != 3 && _month != 6 && _month != 9 &&
_month != 12 && _month != 13)
_what = mnt;
}
else if (_what == quarter)
_month = m.get_int(CG43_LST_TRIM);
_year = m.get(CG43_FLD_ANNO);
_date = m.get(CG43_FLD_DATA);
_isprint = m.get_bool(CG43_CHK_STAMPA);
_recalc = (recalc)m.get_long(CG43_LST_CALC);
_isfinal = m.get_bool(CG43_CHK_FINAL);
if (_isprint) printer().setdate(_date); if (_isprint) printer().setdate(_date);
if (_printonly) _recalc = never;
// ------------------------------------------------ // ------------------------------------------------
m.first_focus(k); m.first_focus(k);
int i;
switch(k) switch(k)
{ {
case DLG_SELECT: case DLG_SELECT:
// build sheet _ditte->enable_check();
_ditte->destroy();
for (i = 0; i < _nomiditte.items(); i++)
{
TToken_string* d = new TToken_string(64);
*d = (TToken_string&)_nomiditte[i];
const char vers = d->get_char(2);
if ((_what == mnt && vers == 'T') || (_what == quarter && vers == 'M'))
continue;
d->insert(" |", 0);
const long pos = _ditte->add(d);
if (_selected[i]) _ditte->check(pos);
}
// seleziona e aggiungi alle gia' selezionate // seleziona e aggiungi alle gia' selezionate
if (_ditte->run() == K_ENTER) if (_ditte->run() == K_ENTER)
{ {
for (long j = 0l; j < _ditte->items(); j++) for (long j = 0l; j < _ditte->items(); j++)
{ _selected.set(j, _ditte->checked(j));
const long cod = _ditte->row(j).get_long(1); set_choice_limits(m);
for (int d = 0; d < _nomiditte.items(); d++)
{
const long firm = ((TToken_string&)_nomiditte[d]).get_long(0);
if (firm == cod)
{
bool minchia = _ditte->checked(j);
_selected.set(d, _ditte->checked(j));
break;
}
}
#ifdef DBG
if (d >= _nomiditte.items())
yesnofatal_box("Non ritrovo piu' la ditta %ld", cod);
#endif
}
} }
m.set(CG43_FLD_SELECTED, _selected.ones());
break; break;
case CG43_BUT_ANN: case CG43_BUT_ANN:
_selected.reset(); reset_choices(m);
m.reset(CG43_FLD_SELECTED);
break; break;
} }
} }
while (k != K_ENTER && k != K_ESC); while (k != K_ENTER && k != K_ESC);
return k == K_ENTER; return k == K_ENTER;
} }

View File

@ -160,7 +160,7 @@ class TLiquidazione_app : public TPrint_application
int _month; // mese da calcolare int _month; // mese da calcolare
TDate _date; // data di stampa TDate _date; // data di stampa
bool _isprint; // vuoi stampare o no? bool _isprint; // vuoi stampare o no?
bool _isfinal; // calcolo definitivo bool _printonly; // calcolo definitivo
recalc _recalc; // tipo ricalcolo scelto recalc _recalc; // tipo ricalcolo scelto
bool _isplafond; // plafond importatori abituali bool _isplafond; // plafond importatori abituali
bool _isvent; // ventilazione bool _isvent; // ventilazione
@ -260,8 +260,16 @@ class TLiquidazione_app : public TPrint_application
TRecfield* _lim_mese; TRecfield* _lim_mese;
protected: protected:
long select_firm_range(long from, long to, wht freq); long select_firm_range(long from, long to, wht freq);
static bool to_ditta_handler(TMask_field& f, KEY key);
static bool to_ditt_handler(TMask_field& f, KEY key);
static bool fr_ditt_handler(TMask_field& f, KEY key);
static bool to_butt_handler(TMask_field& f, KEY key);
static bool fr_butt_handler(TMask_field& f, KEY key);
static bool what_freq_handler(TMask_field& f, KEY key);
static TLiquidazione_app& app() { return (TLiquidazione_app&)main_app(); }
public: public:
@ -269,6 +277,13 @@ public:
virtual bool user_destroy(); virtual bool user_destroy();
virtual bool set_print(int i); virtual bool set_print(int i);
// cazzatelle per handlers
TArray_sheet* get_ditte_sheet() { return _ditte; }
TBit_array& get_selected() { return _selected; }
void build_ditte_sheet(wht);
void reset_choices(TMask&);
void set_choice_limits(TMask&);
bool set_liquidazione(); bool set_liquidazione();
bool recalc_all(); bool recalc_all();
@ -362,7 +377,7 @@ public:
_VentItem* look_ventilation(int m, const char* codreg); _VentItem* look_ventilation(int m, const char* codreg);
// tutti i controlli del mondo sui mesi da calcolare // tutti i controlli del mondo sui mesi da calcolare
bool is_trim (int x); static bool is_trim (int x);
bool is_month_ok (int x, int month = -1); bool is_month_ok (int x, int month = -1);
bool is_date_ok (TDate& d, int month); bool is_date_ok (TDate& d, int month);
bool is_first_month (int m); bool is_first_month (int m);

View File

@ -13,3 +13,5 @@
#define CG43_FLD_DTO 114 #define CG43_FLD_DTO 114
#define CG43_LST_CALC 115 #define CG43_LST_CALC 115
#define CG43_CHK_FINAL 116 #define CG43_CHK_FINAL 116
#define CG43_BUT_DFR 117
#define CG43_BUT_DTO 118

View File

@ -4,7 +4,7 @@ PAGE "Calcolo Liquidazioni" -1 -1 68 15
RADIOBUTTON CG43_RDB_VERS 15 RADIOBUTTON CG43_RDB_VERS 15
BEGIN BEGIN
PROMPT 4 1 "Versamenti" PROMPT 4 1 "Versamenti"
HELP "Indicare di quali versamenti procedere con la liquidazione" HELP "Indicare di quali versamenti procedere con la liquidazione"
ITEM "1|Tutti" MESSAGE HIDE,CG43_LST_TRIM|SHOW,CG43_LST_MESE ITEM "1|Tutti" MESSAGE HIDE,CG43_LST_TRIM|SHOW,CG43_LST_MESE
ITEM "2|Mensili" MESSAGE HIDE,CG43_LST_TRIM|SHOW,CG43_LST_MESE ITEM "2|Mensili" MESSAGE HIDE,CG43_LST_TRIM|SHOW,CG43_LST_MESE
ITEM "3|Trimestrali" MESSAGE SHOW,CG43_LST_TRIM|HIDE,CG43_LST_MESE ITEM "3|Trimestrali" MESSAGE SHOW,CG43_LST_TRIM|HIDE,CG43_LST_MESE
@ -19,25 +19,25 @@ END
NUMBER CG43_FLD_DFR 5 NUMBER CG43_FLD_DFR 5
BEGIN BEGIN
PROMPT 24 2 "Da codice " PROMPT 24 2 "Da codice "
FLAGS "UR" HELP "Codice ditta di partenza per la selezione"
HELP "Codice ditta di partenza per la selezione" END
USE LF_NDITTE KEY 1
DISPLAY "Codice" CODDITTA BUTTON CG43_BUT_DFR 2 1
DISPLAY "Ragione sociale@50" RAGSOC BEGIN
DISPLAY "Vers" FREQVIVA PROMPT 40 2 "*"
OUTPUT CG43_FLD_DFR CODDITTA PICTURE 109
END END
NUMBER CG43_FLD_DTO 5 NUMBER CG43_FLD_DTO 5
BEGIN BEGIN
PROMPT 24 3 "A codice " PROMPT 24 3 "A codice "
FLAGS "UR" HELP "Codice ditta di fine selezione"
HELP "Codice ditta di fine selezione" END
COPY USE CG43_FLD_DFR
DISPLAY "Codice" CODDITTA BUTTON CG43_BUT_DTO 2 1
DISPLAY "Ragione sociale@50" RAGSOC BEGIN
DISPLAY "Vers" FREQVIVA PROMPT 40 3 "*"
OUTPUT CG43_FLD_DTO CODDITTA PICTURE 109
END END
STRING CG43_FLD_SELECTED 5 STRING CG43_FLD_SELECTED 5
@ -49,45 +49,36 @@ END
BUTTON DLG_SELECT 10 2 BUTTON DLG_SELECT 10 2
BEGIN BEGIN
PROMPT 48 2 "~Selezione" PROMPT 48 2 "~Selezione"
HELP "Selezione ditte di cui fare la liquidazione" HELP "Selezione ditte di cui fare la liquidazione"
MESSAGE EXIT, DLG_SELECT MESSAGE EXIT, DLG_SELECT
END END
BUTTON CG43_BUT_ANN 10 BUTTON CG43_BUT_ANN 10
BEGIN BEGIN
PROMPT 48 4 "A~zzera" PROMPT 48 4 "A~zzera"
HELP "Azzerare la selezione delle ditte da fare la liquidazione" HELP "Azzerare la selezione delle ditte da fare la liquidazione"
MESSAGE EXIT,CG43_BUT_ANN MESSAGE EXIT,CG43_BUT_ANN
END END
/*
BUTTON CG43_BUT_CHK 8
BEGIN
PROMPT 50 4 "Verifica"
MESSAGE EXIT,CG43_BUT_CHK
END
*/
NUMBER CG43_FLD_ANNO 4 NUMBER CG43_FLD_ANNO 4
BEGIN BEGIN
PROMPT 30 7 "Anno " PROMPT 31 7 "Anno "
HELP "Anno per cui effettuare il calcolo" HELP "Anno per cui effettuare il calcolo"
FLAGS "A" FLAGS "A"
END END
LIST CG43_LST_MESE 13
LIST CG43_LST_MESE 10
BEGIN BEGIN
PROMPT 4 7 "Periodo " PROMPT 4 7 "Periodo "
HELP "Mese per cui effettuare il calcolo liquidazione" HELP "Mese per cui effettuare il calcolo liquidazione"
ITEM "13|Annuale" ITEM "13|Annuale"
FLAGS "AM" FLAGS "AM"
END END
LIST CG43_LST_TRIM 12 LIST CG43_LST_TRIM 13
BEGIN BEGIN
PROMPT 4 7 "Periodo " PROMPT 4 7 "Periodo "
HELP "Trimestre di cui effettuare il calcolo liquidazione" HELP "Trimestre di cui effettuare il calcolo liquidazione"
ITEM "3|1 Trimestre " ITEM "3|1 Trimestre "
ITEM "6|2 Trimestre " ITEM "6|2 Trimestre "
ITEM "9|3 Trimestre " ITEM "9|3 Trimestre "
@ -98,7 +89,7 @@ END
LIST CG43_LST_CALC 13 LIST CG43_LST_CALC 13
BEGIN BEGIN
PROMPT 4 8 "Ricalcola " PROMPT 4 8 "Ricalcola "
HELP "Indicare se rifare il calcolo durante la stampa" HELP "Indicare se rifare il calcolo durante la stampa"
// ITEM "1|Se necessario" // ITEM "1|Se necessario"
ITEM "2|Mese corrente" ITEM "2|Mese corrente"
ITEM "3|Tutti i mesi" ITEM "3|Tutti i mesi"
@ -115,7 +106,7 @@ END
BOOLEAN CG43_CHK_STAMPA BOOLEAN CG43_CHK_STAMPA
BEGIN BEGIN
PROMPT 5 11 "Esegui " PROMPT 5 11 "Esegui "
HELP "Indicare se stampare il prospetto delle liquidazioni" HELP "Indicare se stampare il prospetto delle liquidazioni"
MESSAGE TRUE ENABLE,CG43_FLD_DATA MESSAGE TRUE ENABLE,CG43_FLD_DATA
MESSAGE FALSE DISABLE,CG43_FLD_DATA MESSAGE FALSE DISABLE,CG43_FLD_DATA
END END
@ -123,16 +114,18 @@ END
DATE CG43_FLD_DATA DATE CG43_FLD_DATA
BEGIN BEGIN
PROMPT 16 11 "con data " PROMPT 15 11 "con data "
HELP "Data di stampa del prospetto delle liquidazioni" HELP "Data di stampa del prospetto delle liquidazioni"
FLAGS "A" FLAGS "A"
END END
BOOLEAN CG43_CHK_FINAL BOOLEAN CG43_CHK_FINAL
BEGIN BEGIN
PROMPT 47 11 "Definitivo" PROMPT 47 11 "Solo stampa"
HELP "Indicare se la liquidazione e' registrata come definitiva" HELP "Indicare se si desidera la sola stampa delle liquidazioni calcolate"
MESSAGE TRUE DISABLE,CG43_LST_CALC
MESSAGE FALSE ENABLE,CG43_LST_CALC
END END

View File

@ -5,35 +5,40 @@
// ------------------------------------------------------------ // ------------------------------------------------------------
#include <progind.h> #include <progind.h>
#include <sheet.h>
#include "cg4300.h" #include "cg4300.h"
// -------------------- QUI comincia l'avventura -------------------------- // -------------------- QUI comincia l'avventura --------------------------
bool TLiquidazione_app::recalc_all() bool TLiquidazione_app::recalc_all()
{ {
_prind = new TProgind(_selected.ones()*2, _prind = new TProgind(_selected.ones()*2, _printonly ?
" Stampa liquidazione... \n"
" Preparazione archivi \n"
" " :
" Calcolo liquidazione... \n" " Calcolo liquidazione... \n"
" Preparazione archivi ", " Preparazione archivi \n"
" ",
TRUE,TRUE,45); TRUE,TRUE,45);
for (int l = 0; l < _nomiditte.items(); l++) for (int l = 0; l < _ditte->items(); l++)
{ {
if (_prind->iscancelled()) if (_prind->iscancelled())
break; break;
if (_selected[(long)l]) if (_selected[(long)l])
{ {
TToken_string& nomeditta = (TToken_string&)_nomiditte[l]; TToken_string& nomeditta = _ditte->row(l);
_nditte->zero(); _nditte->zero();
_nditte->curr().put("CODDITTA",nomeditta.get_long(0)); _nditte->curr().put("CODDITTA",nomeditta.get_long(1));
_nditte->read(); _nditte->read();
TApplication::set_firm(nomeditta.get_long(0)); TApplication::set_firm(nomeditta.get_long(1));
_prind->addstatus(1); _prind->addstatus(1);
// trimestrali impropriamente selezionate per mesi intermedi // trimestrali impropriamente selezionate per mesi intermedi
_freqviva = nomeditta.get(2); _freqviva = nomeditta.get(3);
if (!is_month_ok(_month)) continue; if (!is_month_ok(_month)) continue;
int need_refresh = FALSE; int need_refresh = FALSE;
@ -121,7 +126,8 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
// se diventa TRUE); // se diventa TRUE);
_mixed = FALSE; _mixed = FALSE;
sprintf (buf,"Calcolo liquidazioni (%d)...\n%s: %s", sprintf (buf, _printonly ? "Stampa liquidazione (%d)...\n%s: %s\n" :
"Calcolo liquidazione (%d)...\n%s: %s\n",
month, month,
(const char*)_nditte_r->get("RAGSOC"), (const char*)_nditte_r->get("RAGSOC"),
(const char*)desatt); (const char*)desatt);
@ -813,8 +819,6 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
_lim->put("R7",ris_cred); _lim->put("R7",ris_cred);
_lim->put("R8",ris_deb); _lim->put("R8",ris_deb);
_lim->put("B0","X"); _lim->put("B0","X");
if (_isfinal) _lim->put("B1","X");
_lim->rewrite(); _lim->rewrite();
if (month == 12) if (month == 12)

View File

@ -9,6 +9,6 @@
#define F_DESATT 150 #define F_DESATT 150
#define F_TIPOATT 102 #define F_TIPOATT 102
#define F_PRORATA 103 #define F_PRORATA 103
#define F_P8 104 #define F_P8 104
#define F_P8B 105 #define F_P8B 105
#define F_P9 106 #define F_P9 106