Aggiustamenti alle maschere
git-svn-id: svn://10.65.10.50/trunk@695 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9c32b12f28
commit
f86f671813
@ -609,21 +609,30 @@ void TCaus_app::compila_array(const TString& tpd, int tpm, int tpr, int m770)
|
|||||||
{
|
{
|
||||||
if (tpd.empty() || tpd == "IN" || tpd == "AN" || tpd == "PG")
|
if (tpd.empty() || tpd == "IN" || tpd == "AN" || tpd == "PG")
|
||||||
{
|
{
|
||||||
|
bool canc = TRUE;
|
||||||
switch (tpm)
|
switch (tpm)
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
|
if (m770 == 6)
|
||||||
|
{
|
||||||
|
causale_ritenute();
|
||||||
|
canc = FALSE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
case 5:
|
case 5:
|
||||||
case 6:
|
case 6:
|
||||||
if (saldaconto())
|
if (saldaconto())
|
||||||
|
{
|
||||||
causale_inc_pag();
|
causale_inc_pag();
|
||||||
|
canc = FALSE;
|
||||||
|
};
|
||||||
break;
|
break;
|
||||||
case 0:
|
|
||||||
if (m770 == 6)
|
|
||||||
causale_ritenute();
|
|
||||||
default:
|
default:
|
||||||
clear_descr();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (canc)
|
||||||
|
clear_descr();
|
||||||
}
|
}
|
||||||
else // C'e' il tipodoc.
|
else // C'e' il tipodoc.
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,6 @@ BEGIN
|
|||||||
MESSAGE HIDE,96|HIDE,97|HIDE,98|HIDE,99
|
MESSAGE HIDE,96|HIDE,97|HIDE,98|HIDE,99
|
||||||
MESSAGE HIDE,F_MODULO|RESET,F_MODULO
|
MESSAGE HIDE,F_MODULO|RESET,F_MODULO
|
||||||
MESSAGE SHOW,F_STAMPA|K_SPACE,F_STAMPA
|
MESSAGE SHOW,F_STAMPA|K_SPACE,F_STAMPA
|
||||||
MESSAGE HIDE,DLG_PAGE
|
|
||||||
ITEM "2|Bilancio di verifica"
|
ITEM "2|Bilancio di verifica"
|
||||||
MESSAGE HIDE,F_STAMPA|RESET,F_STAMPA
|
MESSAGE HIDE,F_STAMPA|RESET,F_STAMPA
|
||||||
MESSAGE HIDE,F_DATALIM|RESET,F_DATALIM|HIDE,F_TOTALI|RESET,F_TOTALI
|
MESSAGE HIDE,F_DATALIM|RESET,F_DATALIM|HIDE,F_TOTALI|RESET,F_TOTALI
|
||||||
@ -65,7 +64,6 @@ BEGIN
|
|||||||
MESSAGE SHOW,F_VERIFICA|K_SPACE,F_VERIFICA|SHOW,F_STAMPA1|K_SPACE,F_STAMPA1
|
MESSAGE SHOW,F_VERIFICA|K_SPACE,F_VERIFICA|SHOW,F_STAMPA1|K_SPACE,F_STAMPA1
|
||||||
MESSAGE SHOW,F_MODULO|K_SPACE,F_MODULO
|
MESSAGE SHOW,F_MODULO|K_SPACE,F_MODULO
|
||||||
MESSAGE SHOW,96|SHOW,97|SHOW,98|SHOW,99
|
MESSAGE SHOW,96|SHOW,97|SHOW,98|SHOW,99
|
||||||
MESSAGE SHOW,DLG_PAGE
|
|
||||||
END
|
END
|
||||||
|
|
||||||
RADIOBUTTON F_STAMPA 28
|
RADIOBUTTON F_STAMPA 28
|
||||||
|
@ -824,7 +824,7 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
|||||||
m.set(F_DATACOMP, curr_mask().get(F_DATACOMP));
|
m.set(F_DATACOMP, curr_mask().get(F_DATACOMP));
|
||||||
m.set(F_DATADOC, curr_mask().get(F_DATADOC));
|
m.set(F_DATADOC, curr_mask().get(F_DATADOC));
|
||||||
m.set(F_NUMDOC, curr_mask().get(F_NUMDOC));
|
m.set(F_NUMDOC, curr_mask().get(F_NUMDOC));
|
||||||
m.set(F_NUMREG, ++_lastreg); // Incrementa numero di registrazione
|
m.set(F_NUMREG, _lastreg+1); // Incrementa numero di registrazione
|
||||||
m.set(F_DESCR, caus.desc_agg(1)); // Descrizione
|
m.set(F_DESCR, caus.desc_agg(1)); // Descrizione
|
||||||
m.set(F_CODCAUS, causimm); // Cambia causale
|
m.set(F_CODCAUS, causimm); // Cambia causale
|
||||||
m.set(F_DESCRCAUS, caus.descrizione());
|
m.set(F_DESCRCAUS, caus.descrizione());
|
||||||
@ -855,10 +855,11 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
|||||||
|
|
||||||
const int annoes = m.get_int(F_ANNOES);
|
const int annoes = m.get_int(F_ANNOES);
|
||||||
const TString16 datareg = m.get(F_DATAREG);
|
const TString16 datareg = m.get(F_DATAREG);
|
||||||
|
long num = m.get_long(F_NUMREG);
|
||||||
|
|
||||||
TRectype& r = inc.cg(0);
|
TRectype& r = inc.cg(0);
|
||||||
r.zero();
|
r.zero();
|
||||||
r.put("NUMREG", _lastreg);
|
r.put("NUMREG", num);
|
||||||
r.put("NUMRIG", 1);
|
r.put("NUMRIG", 1);
|
||||||
r.put("DATAREG", datareg);
|
r.put("DATAREG", datareg);
|
||||||
r.put("ANNOES", annoes);
|
r.put("ANNOES", annoes);
|
||||||
@ -896,7 +897,7 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
|||||||
TRectype& r = inc.cg(i-1);
|
TRectype& r = inc.cg(i-1);
|
||||||
r.zero();
|
r.zero();
|
||||||
r.put("IMPORTO", imp);
|
r.put("IMPORTO", imp);
|
||||||
r.put("NUMREG", _lastreg);
|
r.put("NUMREG", num);
|
||||||
r.put("NUMRIG", i);
|
r.put("NUMRIG", i);
|
||||||
r.put("DATAREG", datareg);
|
r.put("DATAREG", datareg);
|
||||||
r.put("ANNOES", annoes);
|
r.put("ANNOES", annoes);
|
||||||
@ -917,10 +918,15 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (inc.write() == _isreinsert) // In caso di riscrittura
|
while (inc.write() == _isreinsert) // In caso di riscrittura
|
||||||
inc.lfile().put("NUMREG", ++_lastreg); // Incrementa numero registrazione
|
{
|
||||||
|
num++; // Incrementa numero registrazione
|
||||||
|
inc.lfile().put("NUMREG", num);
|
||||||
|
}
|
||||||
|
|
||||||
if (inc.good())
|
if (inc.good())
|
||||||
{
|
{
|
||||||
|
if (num > _lastreg) _lastreg = num;
|
||||||
|
|
||||||
_saldi.reset(); // Inizializza saldi
|
_saldi.reset(); // Inizializza saldi
|
||||||
_saldi.set_movprovv(FALSE);
|
_saldi.set_movprovv(FALSE);
|
||||||
_saldi.set_movap(FALSE);
|
_saldi.set_movap(FALSE);
|
||||||
|
@ -18,8 +18,6 @@ BEGIN
|
|||||||
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 "Ragione sociale @50" RAGSOC
|
|
||||||
OUTPUT F_RAGSOC RAGSOC
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -31,7 +29,7 @@ END
|
|||||||
|
|
||||||
NUMBER F_NUMREG 6
|
NUMBER F_NUMREG 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 4 "Operazione n. "
|
PROMPT 1 4 "Numero operazione "
|
||||||
HELP "Numero del movimento di prima nota da gestire"
|
HELP "Numero del movimento di prima nota da gestire"
|
||||||
FLAGS "R"
|
FLAGS "R"
|
||||||
FIELD LF_MOV->NUMREG
|
FIELD LF_MOV->NUMREG
|
||||||
@ -41,6 +39,7 @@ BEGIN
|
|||||||
DISPLAY "Data@10" DATAREG
|
DISPLAY "Data@10" DATAREG
|
||||||
DISPLAY "Causale" CODCAUS
|
DISPLAY "Causale" CODCAUS
|
||||||
DISPLAY "Documento" NUMDOC
|
DISPLAY "Documento" NUMDOC
|
||||||
|
DISPLAY "Protoc." PROTIVA
|
||||||
DISPLAY "Descrizione@50" DESCR
|
DISPLAY "Descrizione@50" DESCR
|
||||||
OUTPUT F_NUMREG NUMREG
|
OUTPUT F_NUMREG NUMREG
|
||||||
KEY 1
|
KEY 1
|
||||||
@ -48,10 +47,9 @@ END
|
|||||||
|
|
||||||
DATE F_DATAREG
|
DATE F_DATAREG
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 6 "Data dell'operazione "
|
PROMPT 1 6 "Data operazione "
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
FLAGS "A"
|
FLAGS "A"
|
||||||
WARNING "E' obbligatorio specificare la data dell'operazione"
|
|
||||||
HELP "Data in cui viene registrata l'operazione"
|
HELP "Data in cui viene registrata l'operazione"
|
||||||
MESSAGE COPY,F_ANNOIVA,7,10
|
MESSAGE COPY,F_ANNOIVA,7,10
|
||||||
END
|
END
|
||||||
@ -64,10 +62,9 @@ END
|
|||||||
|
|
||||||
DATE F_DATACOMP
|
DATE F_DATACOMP
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 7 "Data di competenza "
|
PROMPT 1 7 "Data di competenza "
|
||||||
HELP "Data di competenza dell'operazione"
|
HELP "Data di competenza dell'operazione"
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
WARNING "La data di competenza non appartiene all'esercizio"
|
|
||||||
FLAGS "A"
|
FLAGS "A"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -79,8 +76,8 @@ END
|
|||||||
|
|
||||||
STRING F_CODCAUS 3
|
STRING F_CODCAUS 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 9 "Causale "
|
PROMPT 1 9 "Causale "
|
||||||
HELP "Codice della causale generante l'operazione"
|
HELP "Codice della causale dell'operazione"
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
FIELD LF_MOV->CODCAUS
|
FIELD LF_MOV->CODCAUS
|
||||||
USE LF_CAUSALI KEY 1
|
USE LF_CAUSALI KEY 1
|
||||||
@ -93,12 +90,13 @@ BEGIN
|
|||||||
OUTPUT F_DESCRCAUS DESCR
|
OUTPUT F_DESCRCAUS DESCR
|
||||||
ADD RUN cg0 -4
|
ADD RUN cg0 -4
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
|
WARNING "Causale assente"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DESCRCAUS 50
|
STRING F_DESCRCAUS 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 9 ""
|
PROMPT 21 9 ""
|
||||||
HELP "Descrizione della causale generante l'operazione"
|
HELP "Descrizione della causale dell'operazione"
|
||||||
USE LF_CAUSALI KEY 2
|
USE LF_CAUSALI KEY 2
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
INPUT DESCR F_DESCRCAUS
|
INPUT DESCR F_DESCRCAUS
|
||||||
|
@ -4,7 +4,7 @@ PAGE "Movimento di incasso immediato" -1 -1 75 13
|
|||||||
|
|
||||||
DATE F_DATAREG
|
DATE F_DATAREG
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Data di registrazione "
|
PROMPT 1 1 "Data dell' operazione "
|
||||||
HELP "Data in cui viene registrata l'operazione"
|
HELP "Data in cui viene registrata l'operazione"
|
||||||
FIELD LF_MOV->DATAREG
|
FIELD LF_MOV->DATAREG
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
|
@ -21,6 +21,11 @@ END
|
|||||||
STRING 109 50
|
STRING 109 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 14 2 ""
|
PROMPT 14 2 ""
|
||||||
|
USE %DPN
|
||||||
|
INPUT S0 109
|
||||||
|
DISPLAY "Descrizione@50" S0
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
COPY OUTPUT 108
|
||||||
HELP "Descrizione aggiuntiva di riga"
|
HELP "Descrizione aggiuntiva di riga"
|
||||||
FIELD DESCR
|
FIELD DESCR
|
||||||
END
|
END
|
||||||
|
@ -326,10 +326,6 @@ bool TSaldibrowse_application::user_create()
|
|||||||
|
|
||||||
void TSaldibrowse_application::disable_all()
|
void TSaldibrowse_application::disable_all()
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
for (int i = 0; i < 17; i++)
|
|
||||||
ss().enable_column(i,FALSE);
|
|
||||||
*/
|
|
||||||
ss().disable();
|
ss().disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
// cg5300.cpp
|
// cg5300.cpp
|
||||||
// modifica parametri contabilita' relativi alla liquidazione
|
// modifica parametri contabilita' relativi alla liquidazione
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <msksheet.h>
|
||||||
#include <relapp.h>
|
#include <relapp.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <msksheet.h>
|
|
||||||
#include <config.h>
|
|
||||||
#include <attiv.h>
|
|
||||||
#include <nditte.h>
|
|
||||||
#include "cg5.h"
|
#include "cg5.h"
|
||||||
#include "cg5300a.h"
|
#include "cg5300a.h"
|
||||||
|
|
||||||
|
#include <attiv.h>
|
||||||
|
#include <nditte.h>
|
||||||
|
|
||||||
#define TAB_LIA "LIA"
|
#define TAB_LIA "LIA"
|
||||||
#define TAB_PLA "PLA"
|
#define TAB_PLA "PLA"
|
||||||
|
@ -35,7 +35,7 @@ END
|
|||||||
NUMBER F_YEAR 4
|
NUMBER F_YEAR 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 6 3 "Anno "
|
PROMPT 6 3 "Anno "
|
||||||
HELP "Anno d'esercizio ??????"
|
HELP "Anno d'esercizio"
|
||||||
FIELD LIA->CODTAB
|
FIELD LIA->CODTAB
|
||||||
USE LIA
|
USE LIA
|
||||||
INPUT CODTAB F_YEAR
|
INPUT CODTAB F_YEAR
|
||||||
@ -43,7 +43,7 @@ BEGIN
|
|||||||
DISPLAY "@2" S0
|
DISPLAY "@2" S0
|
||||||
OUTPUT F_YEAR CODTAB
|
OUTPUT F_YEAR CODTAB
|
||||||
KEY 1
|
KEY 1
|
||||||
FLAGS "RZ"
|
FLAGS "Z"
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
ADD NONE
|
ADD NONE
|
||||||
END
|
END
|
||||||
@ -62,22 +62,24 @@ BEGIN
|
|||||||
FIELD LIA->S7
|
FIELD LIA->S7
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_CRED_PREC 15 0
|
NUMBER F_CRED_PREC 15
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 6 6 "Credito precedente "
|
PROMPT 6 6 "Credito precedente "
|
||||||
HELP "Eventuale credito di imposta dell'anno precedente"
|
HELP "Eventuale credito di imposta dell'anno precedente"
|
||||||
FIELD LIA->R0
|
FIELD LIA->R0
|
||||||
PICTURE "."
|
PICTURE "."
|
||||||
FLAGS "R"
|
FLAGS "R"
|
||||||
|
NUM_CALC ROUND(#THIS_FIELD,-3)
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_CRED_COST 15 0
|
NUMBER F_CRED_COST 15
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 6 7 "Credito di costo "
|
PROMPT 6 7 "Credito di costo "
|
||||||
HELP "Eventuale crediti—o di costo dell'anno precedente"
|
HELP "Eventuale credito di costo dell'anno precedente"
|
||||||
FIELD LIA->R5
|
FIELD LIA->R5
|
||||||
PICTURE "."
|
PICTURE "."
|
||||||
FLAGS "R"
|
FLAGS "R"
|
||||||
|
NUM_CALC ROUND(#THIS_FIELD,-3)
|
||||||
END
|
END
|
||||||
|
|
||||||
SPREADSHEET F_SHEET_PLA 78 6
|
SPREADSHEET F_SHEET_PLA 78 6
|
||||||
@ -96,10 +98,10 @@ ENDMASK
|
|||||||
|
|
||||||
PAGE "" -1 -1 65 16
|
PAGE "" -1 -1 65 16
|
||||||
|
|
||||||
NUMBER F_CODATT 5
|
STRING F_CODATT 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 1 "Codice Attivita' "
|
PROMPT 4 1 "Codice Attivita' "
|
||||||
FLAGS "DZG"
|
FLAGS "DUZ"
|
||||||
USE %AIS
|
USE %AIS
|
||||||
INPUT CODTAB F_CODATT
|
INPUT CODTAB F_CODATT
|
||||||
DISPLAY "Codice" CODTAB
|
DISPLAY "Codice" CODTAB
|
||||||
@ -111,17 +113,16 @@ END
|
|||||||
|
|
||||||
STRING F_DESATT 50 30
|
STRING F_DESATT 50 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 31 1 ""
|
PROMPT 4 2 "Descrizione "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST F_TIPOATT 26
|
LIST F_TIPOATT 26
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 3 "Tipo "
|
PROMPT 4 3 "Tipo "
|
||||||
HELP "Tipo di attivita' a della ditta"
|
HELP "Tipo di attivita' della ditta"
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
ITEM " |Altre"
|
ITEM " |Altre"
|
||||||
ITEM "M|Mista"
|
|
||||||
ITEM "E|Mista evidenziata"
|
ITEM "E|Mista evidenziata"
|
||||||
ITEM "S|Servizio o mista generica"
|
ITEM "S|Servizio o mista generica"
|
||||||
END
|
END
|
||||||
@ -129,7 +130,7 @@ END
|
|||||||
NUMBER F_PRORATA 6 2
|
NUMBER F_PRORATA 6 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 5 "% Pro-Rata "
|
PROMPT 4 5 "% Pro-Rata "
|
||||||
HELP "Percentuale di pro-rata ???????"
|
HELP "Percentuale di pro-rata"
|
||||||
PICTURE ".2"
|
PICTURE ".2"
|
||||||
NUM_EXPR {(#F_PRORATA>=0.0)&&(#F_PRORATA<=100.0)}
|
NUM_EXPR {(#F_PRORATA>=0.0)&&(#F_PRORATA<=100.0)}
|
||||||
WARNING "La percentuale deve essere compresa tra 0 e 100"
|
WARNING "La percentuale deve essere compresa tra 0 e 100"
|
||||||
@ -140,7 +141,7 @@ END
|
|||||||
NUMBER F_P8 15
|
NUMBER F_P8 15
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 7 "Plafond art. 8 "
|
PROMPT 4 7 "Plafond art. 8 "
|
||||||
HELP "?????????????"
|
HELP "Ammontare plafond articolo 8"
|
||||||
PICTURE "."
|
PICTURE "."
|
||||||
FLAGS "R"
|
FLAGS "R"
|
||||||
GROUP 1
|
GROUP 1
|
||||||
@ -148,8 +149,8 @@ END
|
|||||||
|
|
||||||
NUMBER F_P8B 15
|
NUMBER F_P8B 15
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 9 "Plafond art. 8b "
|
PROMPT 4 9 "Plafond art. 8 bis "
|
||||||
HELP "????????????"
|
HELP "Ammontare plafond articolo 8 bis"
|
||||||
PICTURE "."
|
PICTURE "."
|
||||||
FLAGS "R"
|
FLAGS "R"
|
||||||
GROUP 1
|
GROUP 1
|
||||||
@ -158,7 +159,7 @@ END
|
|||||||
NUMBER F_P9 15
|
NUMBER F_P9 15
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 11 "Plafond art. 9 "
|
PROMPT 4 11 "Plafond art. 9 "
|
||||||
HELP "?????????????"
|
HELP "Ammontare plafond articolo 9"
|
||||||
PICTURE "."
|
PICTURE "."
|
||||||
FLAGS "R"
|
FLAGS "R"
|
||||||
GROUP 1
|
GROUP 1
|
||||||
|
394
cg/cg5400.cpp
394
cg/cg5400.cpp
@ -1,197 +1,197 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <date.h>
|
#include <date.h>
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
#include "cg5.h"
|
#include "cg5.h"
|
||||||
#include "cg5400.h"
|
#include "cg5400.h"
|
||||||
|
|
||||||
class TRipristina_stampa : public TApplication
|
class TRipristina_stampa : public TApplication
|
||||||
{
|
{
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
long _default_firm;
|
long _default_firm;
|
||||||
|
|
||||||
virtual bool create() ;
|
virtual bool create() ;
|
||||||
virtual bool destroy() ;
|
virtual bool destroy() ;
|
||||||
bool menu(MENU_TAG);
|
bool menu(MENU_TAG);
|
||||||
bool do_restore(long firm, const char * reg, const char * year, int month,
|
bool do_restore(long firm, const char * reg, const char * year, int month,
|
||||||
bool giornale);
|
bool giornale);
|
||||||
static bool firm_handler(TMask_field& f, KEY key);
|
static bool firm_handler(TMask_field& f, KEY key);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TRipristina_stampa() : _msk(NULL) {}
|
TRipristina_stampa() : _msk(NULL) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TRipristina_stampa::firm_handler(TMask_field& f, KEY key)
|
bool TRipristina_stampa::firm_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
if (f.to_check(key))
|
if (f.to_check(key))
|
||||||
{
|
{
|
||||||
const long firm = atol(f.get());
|
const long firm = atol(f.get());
|
||||||
|
|
||||||
if (firm < 0)
|
if (firm < 0)
|
||||||
return f.error_box("Codice ditta impossibile");
|
return f.error_box("Codice ditta impossibile");
|
||||||
else
|
else
|
||||||
if (firm == 0)
|
if (firm == 0)
|
||||||
return f.error_box("La ditta e' obbligatoria");
|
return f.error_box("La ditta e' obbligatoria");
|
||||||
else
|
else
|
||||||
if (!prefhndl->exist(firm))
|
if (!prefhndl->exist(firm))
|
||||||
return f.error_box("Gli archivi della ditta %d non sono stati ancora generati",firm);
|
return f.error_box("Gli archivi della ditta %d non sono stati ancora generati",firm);
|
||||||
else
|
else
|
||||||
main_app().set_firm(firm);
|
main_app().set_firm(firm);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TRipristina_stampa::do_restore(long firm, const char * regist,
|
bool TRipristina_stampa::do_restore(long firm, const char * regist,
|
||||||
const char * year, int month,
|
const char * year, int month,
|
||||||
bool giornale)
|
bool giornale)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
CHECK(firm > 0, "Non posso ripristinare sui dati comuni");
|
CHECK(firm > 0, "Non posso ripristinare sui dati comuni");
|
||||||
CHECK(regist != NULL && strlen(regist) < 4, "Registro impossibile");
|
CHECK(regist != NULL && strlen(regist) < 4, "Registro impossibile");
|
||||||
CHECK(month > 0 && month < 13, "Mese impossibile");
|
CHECK(month > 0 && month < 13, "Mese impossibile");
|
||||||
set_firm(firm);
|
set_firm(firm);
|
||||||
|
|
||||||
const char * const fieldname = giornale ? MOV_STAMPATO : MOV_REGST;
|
const char * const fieldname = giornale ? MOV_STAMPATO : MOV_REGST;
|
||||||
TRelation rel(LF_MOV);
|
TRelation rel(LF_MOV);
|
||||||
TLocalisamfile & mov = rel.lfile();
|
TLocalisamfile & mov = rel.lfile();
|
||||||
TTable reg("REG");
|
TTable reg("REG");
|
||||||
TString16 s;
|
TString16 s;
|
||||||
|
|
||||||
s.format("%-4s%s", year, regist);
|
s.format("%-4s%s", year, regist);
|
||||||
|
|
||||||
reg.zero();
|
reg.zero();
|
||||||
reg.put("CODTAB", s);
|
reg.put("CODTAB", s);
|
||||||
if (reg.read(_isequal, _lock) == NOERR)
|
if (reg.read(_isequal, _lock) == NOERR)
|
||||||
{
|
{
|
||||||
TDate dlast(reg.get_date("D3"));
|
TDate dlast(reg.get_date("D3"));
|
||||||
int wyear = atoi(year);
|
int wyear = atoi(year);
|
||||||
|
|
||||||
if (giornale)
|
if (giornale)
|
||||||
{
|
{
|
||||||
TTable esc("ESC");
|
TTable esc("ESC");
|
||||||
esc.zero();
|
esc.zero();
|
||||||
esc.put("CODTAB", year);
|
esc.put("CODTAB", year);
|
||||||
if (esc.read() != NOERR)
|
if (esc.read() != NOERR)
|
||||||
{
|
{
|
||||||
set_firm(_default_firm);
|
set_firm(_default_firm);
|
||||||
return error_box("Esercizio %s assente", year);
|
return error_box("Esercizio %s assente", year);
|
||||||
}
|
}
|
||||||
|
|
||||||
TDate wd(esc.get_date("D0"));
|
TDate wd(esc.get_date("D0"));
|
||||||
|
|
||||||
wyear = wd.year();
|
wyear = wd.year();
|
||||||
if (wd.month() > month)
|
if (wd.month() > month)
|
||||||
wyear++;
|
wyear++;
|
||||||
}
|
}
|
||||||
TDate d(1, month, wyear);
|
TDate d(1, month, wyear);
|
||||||
|
|
||||||
TRectype from(mov.curr()); from.zero();
|
TRectype from(mov.curr()); from.zero();
|
||||||
TRectype to(from);
|
TRectype to(from);
|
||||||
TString16 filter;
|
TString16 filter;
|
||||||
|
|
||||||
from.put(MOV_DATAREG, d);
|
from.put(MOV_DATAREG, d);
|
||||||
to.put(MOV_DATAREG, dlast);
|
to.put(MOV_DATAREG, dlast);
|
||||||
if (!giornale)
|
if (!giornale)
|
||||||
filter.format("%s==\"%s\"", MOV_REG, regist);
|
filter.format("%s==\"%s\"", MOV_REG, regist);
|
||||||
|
|
||||||
TCursor cursor(&rel, filter, 2, &from, &to);
|
TCursor cursor(&rel, filter, 2, &from, &to);
|
||||||
long last_num = 0L;
|
long last_num = 0L;
|
||||||
|
|
||||||
cursor = 0L;
|
cursor = 0L;
|
||||||
const long nitems = cursor.items();
|
const long nitems = cursor.items();
|
||||||
|
|
||||||
TProgind p(nitems ? nitems : 1, format("Ripristino stampa del registro %s", (const char *) regist) , TRUE, TRUE, 70);
|
TProgind p(nitems ? nitems : 1, format("Ripristino stampa del registro %s", (const char *) regist) , TRUE, TRUE, 70);
|
||||||
|
|
||||||
if (giornale)
|
if (giornale)
|
||||||
{
|
{
|
||||||
last_num = mov.get_long(MOV_NUMGIO);
|
last_num = mov.get_long(MOV_NUMGIO);
|
||||||
if (last_num > 0) last_num--;
|
if (last_num > 0) last_num--;
|
||||||
CHECK(last_num >= 0, "Ultimo numero stampato impossibile");
|
CHECK(last_num >= 0, "Ultimo numero stampato impossibile");
|
||||||
}
|
}
|
||||||
for (; ok && cursor.pos() < cursor.items(); ++cursor)
|
for (; ok && cursor.pos() < cursor.items(); ++cursor)
|
||||||
{
|
{
|
||||||
p.addstatus(1);
|
p.addstatus(1);
|
||||||
mov.read(_isequal, _lock);
|
mov.read(_isequal, _lock);
|
||||||
mov.zero(fieldname);
|
mov.zero(fieldname);
|
||||||
ok = (mov.rewrite() == NOERR);
|
ok = (mov.rewrite() == NOERR);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
error_box("Errore nell' aggiornamento del movimento %ld.\n Errore n. %d",
|
error_box("Errore nell' aggiornamento del movimento %ld.\n Errore n. %d",
|
||||||
mov.get_long(MOV_NUMREG), mov.status());
|
mov.get_long(MOV_NUMREG), mov.status());
|
||||||
}
|
}
|
||||||
d--;
|
--d;
|
||||||
reg.put("D3", d);
|
reg.put("D3", d);
|
||||||
if (giornale)
|
if (giornale)
|
||||||
reg.put("I6", last_num);
|
reg.put("I6", last_num);
|
||||||
ok = (reg.rewrite() == NOERR);
|
ok = (reg.rewrite() == NOERR);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
error_box("Errore nell' aggiornamento del registro %s.\n Errore n. %d",
|
error_box("Errore nell' aggiornamento del registro %s.\n Errore n. %d",
|
||||||
(const char * ) regist, mov.status());
|
(const char * ) regist, mov.status());
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ok = error_box("Non riesco a leggere il registro %s anno %s", (const char *) regist, (const char *) year);
|
ok = error_box("Non riesco a leggere il registro %s anno %s", (const char *) regist, (const char *) year);
|
||||||
|
|
||||||
set_firm(_default_firm);
|
set_firm(_default_firm);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TRipristina_stampa::create()
|
bool TRipristina_stampa::create()
|
||||||
{
|
{
|
||||||
_msk = new TMask("cg5400a") ;
|
_msk = new TMask("cg5400a") ;
|
||||||
_msk->set_handler(F_FIRM, firm_handler);
|
_msk->set_handler(F_FIRM, firm_handler);
|
||||||
_default_firm = get_firm();
|
_default_firm = get_firm();
|
||||||
dispatch_e_menu(BAR_ITEM(1));
|
dispatch_e_menu(BAR_ITEM(1));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TRipristina_stampa::destroy()
|
bool TRipristina_stampa::destroy()
|
||||||
{
|
{
|
||||||
if (_msk != NULL) delete _msk;
|
if (_msk != NULL) delete _msk;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TRipristina_stampa::menu(MENU_TAG)
|
bool TRipristina_stampa::menu(MENU_TAG)
|
||||||
{
|
{
|
||||||
while (_msk->run() == K_ENTER)
|
while (_msk->run() == K_ENTER)
|
||||||
{
|
{
|
||||||
const long firm = _msk->get_long(F_FIRM);
|
const long firm = _msk->get_long(F_FIRM);
|
||||||
const TString16 reg = _msk->get(F_REG);
|
const TString16 reg = _msk->get(F_REG);
|
||||||
const bool giornale = _msk->get_int(F_TIPO) == 5;
|
const bool giornale = _msk->get_int(F_TIPO) == 5;
|
||||||
const TString16 year = _msk->get(giornale ? F_ESER : F_YEAR);
|
const TString16 year = _msk->get(giornale ? F_ESER : F_YEAR);
|
||||||
int month = _msk->get_int(F_MESE);
|
int month = _msk->get_int(F_MESE);
|
||||||
|
|
||||||
if (prefhndl->exist(firm))
|
if (prefhndl->exist(firm))
|
||||||
{
|
{
|
||||||
TString mess;
|
TString mess;
|
||||||
|
|
||||||
mess.format("Attenzione sara' ripristinata la stampa\n del registro %s %s %s della ditta %ld dal mese di %s. Devo continuare",
|
mess.format("Attenzione sara' ripristinata la stampa\n del registro %s %s %s della ditta %ld dal mese di %s. Devo continuare",
|
||||||
(const char *) reg, giornale ? "esercizio" : "anno",
|
(const char *) reg, giornale ? "esercizio" : "anno",
|
||||||
(const char *) year, (const char *) firm, itom(month));
|
(const char *) year, (const char *) firm, itom(month));
|
||||||
if (yesno_box((const char *) mess))
|
if (yesno_box((const char *) mess))
|
||||||
{
|
{
|
||||||
mess.rtrim(16); mess << " Devo veramente continuare";
|
mess.rtrim(16); mess << " Devo veramente continuare";
|
||||||
if (yesno_box((const char *) mess))
|
if (yesno_box((const char *) mess))
|
||||||
do_restore(firm, reg, year, month, giornale);
|
do_restore(firm, reg, year, month, giornale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else error_box("Gli archivi della ditta %d non sono stati ancora generati",firm);
|
else error_box("Gli archivi della ditta %d non sono stati ancora generati",firm);
|
||||||
_msk->reset();
|
_msk->reset();
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cg5400(int argc, char* argv[])
|
int cg5400(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TRipristina_stampa a ;
|
TRipristina_stampa a ;
|
||||||
a.run(argc, argv, "Ripristino stampa registri");
|
a.run(argc, argv, "Ripristino stampa registri");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user