Aggiunta box riepilogativa del test di velocita'.

Spostato all'inizio il codice Altro per la lista del Tipo IVA.


git-svn-id: svn://10.65.10.50/trunk@39 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1994-08-19 10:42:50 +00:00
parent 5e5176d3c8
commit 617fd7e074
6 changed files with 143 additions and 165 deletions

View File

@ -595,16 +595,11 @@ void TPrimanota_application::mask2rel(const TMask& m)
r.put("ANNOES", annoes);
r.put("NUMREG", numreg);
r.put("NUMRIG", cur);
const char* imponibile = row.get(0);
r.put("IMPONIBILE", imponibile);
r.put("IMPONIBILE", row.get(0));
r.put("CODIVA", row.get());
const char* imposta = row.get();
r.put("IMPOSTA", imposta);
r.put("TIPOCR", row.get());
r.put("TIPODET", row.get());
r.put("IMPOSTA", row.get());
r.put("TIPOCR", row.get());
const TConto c(row, -1, 0x1);
const int rimp = bill2pos(c, 'I')+1;

View File

@ -182,6 +182,7 @@ DISPLAY "Descrizione@50" DESCR
DISPLAY "Codice" CODCAUS
COPY OUTPUT F_CODCAUS
MESSAGE COPY,H_DESCRCAUS
CHECKTYPE REQUIRED
ADD RUN cg0 -4
END
@ -291,6 +292,7 @@ NUM_EXPR (#F_RIEPILOGO==0)||(#F_RIEPILOGO>=#F_PROTIVA)
DISPLAY "Partita IVA@12" PAIV
DISPLAY "Codice" CODCF
COPY OUTPUT F_FORNITORE
CHECKTYPE REQUIRED
ADD RUN cg0 -1
END
@ -305,6 +307,7 @@ NUM_EXPR (#F_RIEPILOGO==0)||(#F_RIEPILOGO>=#F_PROTIVA)
DISPLAY "Partita IVA@12" PAIV
DISPLAY "Codice" CODCF
COPY OUTPUT F_CLIENTE
CHECKTYPE REQUIRED
ADD RUN cg0 -1
END
@ -320,6 +323,7 @@ NUM_EXPR (#F_RIEPILOGO==0)||(#F_RIEPILOGO>=#F_PROTIVA)
DISPLAY "Ragione Sociale@50" RAGSOC
DISPLAY "Codice" CODCF
COPY OUTPUT F_CLIENTE
CHECKTYPE NORMAL
ADD RUN cg0 -1
END
@ -333,6 +337,7 @@ NUM_EXPR (#F_RIEPILOGO==0)||(#F_RIEPILOGO>=#F_PROTIVA)
INPUT PAIV F_PIVAFORNITORE
COPY DISPLAY F_PIVACLIENTE
COPY OUTPUT F_FORNITORE
CHECKTYPE NORMAL
ADD RUN cg0 -1
END

View File

@ -14,6 +14,7 @@ const char* iva2name(TipoIVA iva)
case nessuna_iva : i = "Nessuna IVA"; break;
case iva_acquisti: i = "IVA Acquisti"; break;
case iva_vendite : i = "IVA Vendite"; break;
case iva_generica: i = "IVA Generica"; break;
default : i = "IVA ERRATA!"; break;
}
@ -73,7 +74,7 @@ TRegistro& TRegistro::operator =(const TRegistro& r)
int TRegistro::tipo() const
{
const int t = _rec.ok() ? _rec.get_int("I0") : 0;
const int t = ok() ? _rec.get_int("I0") : 0;
return t;
}
@ -238,15 +239,12 @@ bool TCausale::read(const char* cod, int year)
for (int riga = 1; riga < size(); riga++) // Fill gaps
if (objptr(riga) == NULL) add(rcaus.curr(), riga);
if (year > 0)
{
TString16 codreg(caus.get("REG"));
const bool ok = _reg.read(codreg, year); // Read register
if (!ok && codreg.not_empty())
return error_box("Non esiste il registro '%s' per l'anno %d",
(const char*)codreg, year);
}
}
else
{
_iva = nessuna_iva; // Clear IVA data
@ -318,7 +316,7 @@ TipoIVA TCausale::iva() const
if (tpd.read() == NOERR)
{
i = (TipoIVA)tpd.get_int("I0"); // IVA acquisti, vendite, generica
if (i != iva_vendite && i != iva_acquisti)
if (i == iva_generica)
i = _reg.iva();
}
}

View File

@ -39,7 +39,7 @@ USE LF_PCON SELECT (CONTO!="") && (SOTTOCONTO="")
OUTPUT 107 GRUPPO
OUTPUT 108 CONTO
OUTPUT 110 DESCR
OUTPUT 104 TIPOSPRIC
OUTPUT 105 TIPOSPRIC
ADD RUN cg0 -0
CHECKTYPE NORMAL
WARNING "Conto inesistente nella riga IVA"
@ -58,7 +58,7 @@ USE LF_PCON SELECT (CONTO!="") && (SOTTOCONTO="")
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT 104 TIPOSPRIC
OUTPUT 105 TIPOSPRIC
OUTPUT 107 GRUPPO
OUTPUT 108 CONTO
OUTPUT 109 SOTTOCONTO
@ -84,7 +84,7 @@ USE LF_PCON SELECT (CONTO!="") && (SOTTOCONTO="")
CHECKTYPE NORMAL
ADD RUN cg0 -1
FLAGS "G"
MESSAGE COPY,109|RESET,104
MESSAGE COPY,109|RESET,105
END
NUMBER 309 6
@ -102,7 +102,7 @@ USE LF_PCON SELECT (CONTO!="") && (SOTTOCONTO="")
CHECKTYPE NORMAL
ADD RUN cg0 -1
FLAGS "G"
MESSAGE COPY,109|RESET,104
MESSAGE COPY,109|RESET,105
END
STRING 110 50

View File

@ -5,6 +5,6 @@
//int cg4300(int argc, char* argv[]);
int cg4400(int argc, char* argv[]);
int cg4500(int argc, char* argv[]);
//int cg4600(int argc, char* argv[]);
int cg4600(int argc, char* argv[]);
#endif // __CG4_H

View File

@ -1,20 +1,18 @@
// Chiusura/Apertura Conti
#include <config.h>
#include <mask.h>
#include <printapp.h>
#include <relation.h>
#include <tabutil.h>
#include <printapp.h>
#include <mask.h>
#include <date.h>
#include <scanner.h>
#include <utility.h>
#include <prefix.h>
#include <config.h>
#include <urldefid.h>
#include <utility.h>
#include "cg4.h"
#include "cg4600.h"
#include "cg2101.h"
#include "cglib.h"
#include <cglib.h>
#include <cg4.h>
#include <cg4600.h>
#include <cg2101.h>
#include <pconti.h>
#include <mov.h>
#include <saldi.h>
@ -41,7 +39,8 @@ class CG4600_application : public TApplication
TSaldo_agg* _sld;
Saldo _sale;
long _annoes_msk, _sproper, _numreg;
int _annoes_msk;
long _sproper, _numreg;
TDate _datareg;
TString _codcaus, _annoeseprec;
int _gproper, _cproper;
@ -132,14 +131,14 @@ bool mask_datac (TMask_field& f, KEY k)
bool mask_dataap (TMask_field& f, KEY k)
{
TTable TabEs ("ESC");
TTable TabReg("REG");
int anno = 0;
TString annos (4);
bool ok = TRUE;
if ( (k == K_ENTER) && f.to_check(k) )
{
TTable TabEs ("ESC");
TTable TabReg("REG");
int anno = 0;
TabEs.last();
TDate inizio = TabEs.get_date("D0");
TDate fine = TabEs.get_date("D1");
@ -148,20 +147,11 @@ bool mask_dataap (TMask_field& f, KEY k)
TDate iniziop = TabEs.get_date("D0");
TDate finep = TabEs.get_date("D1");
if (f.get() < inizio)
{
f.warning_box ("La data di apertura non puo' essere inferiore alla data di inizio esercizio in corso");
return FALSE;
}
return f.error_box ("La data di apertura non puo' essere inferiore alla data di inizio esercizio in corso");
if (f.get() > fine)
{
f.warning_box ("La data di apertura non puo' essere superiore alla data di fine esercizio in corso");
return FALSE;
}
return f.error_box ("La data di apertura non puo' essere superiore alla data di fine esercizio in corso");
if ( scarico.ok() && (f.get() <= scarico) )
{
f.warning_box ("La data di apertura non puo' essere inferiore o uguale alla data di scarico");
return FALSE;
}
return f.error_box ("La data di apertura non puo' essere inferiore o uguale alla data di scarico");
if ( (f.get() >= inizio) && (f.get() <= fine) ) //la data di apertura e' cioe' relativa all'esercizio in corso
anno = fine.year();
@ -169,7 +159,7 @@ bool mask_dataap (TMask_field& f, KEY k)
anno = finep.year();
TabReg.zero();
annos = format ("%04d", anno);
TString16 annos(format ("%04d", anno));
TabReg.put ("CODTAB", annos);
TRectype r (TabReg.curr());
TabReg.read(_isgteq);
@ -189,10 +179,7 @@ bool mask_dataap (TMask_field& f, KEY k)
}
}
if (!ok)
{
f.warning_box("La data di apertura non puo' essere inferiore alla data ultima stampa bollato");
return FALSE;
}
return f.error_box("La data di apertura non puo' essere inferiore alla data ultima stampa bollato");
}
return TRUE;
}
@ -237,7 +224,6 @@ bool mask_distinti (TMask_field& f, KEY k)
idg = idg + 3;
idc = idc + 3;
ids = ids + 3;
}
}
return TRUE;
@ -262,9 +248,7 @@ bool CG4600_application::create()
TApplication::create();
_rel = new TRelation (LF_PCON);
_cur = new TCursor(_rel,"((GRUPPO!=\"\")&&(CONTO!=\"\")&&(SOTTOCONTO==\"\"))",1);
_pn = new TMovimentoPN();
_saldi = new TLocalisamfile (LF_SALDI);
_mov = new TLocalisamfile (LF_MOV);
@ -294,18 +278,17 @@ bool CG4600_application::destroy()
void CG4600_application::anno_ese_precedente()
{
TTable tabesc ("ESC");
TString16 chiave;
int err = "NOERR";
TString16 chiave; chiave << _annoes_msk;
tabesc.zero();
chiave << _annoes_msk;
tabesc.put("CODTAB", chiave);
err = tabesc.read();
const int err = tabesc.read();
if (err == NOERR)
{
tabesc.prev();
_annoeseprec = tabesc.get("CODTAB");
}
else
_annoeseprec = 0;
}
void CG4600_application::ultima_registrazione()
@ -370,7 +353,7 @@ bool CG4600_application::set()
if (tasto == K_ENTER)
{
_annoes_msk = m.get_long(F_ANNO);
_annoes_msk = m.get_int (F_ANNO);
_datareg = m.get (F_DATAC);
_codcaus = m.get (F_CHIUSURA);
_gproper = m.get_int (F_PROPERG);
@ -413,7 +396,7 @@ void CG4600_application::record_rmov_proper(long numrig,TRectype& rmov,real& tot
if (tot_saldo.sign() < 0)
{
sez_rmov = 'D';
tot_saldo = tot_saldo * (-1.00);
tot_saldo = -tot_saldo;
}
rmov.put(RMV_SEZIONE, sez_rmov);
@ -619,7 +602,7 @@ void CG4600_application::ricavi()
if (j >= 1)
{
record_rmov_proper (numrig, rmov);
record_rmov_proper (numrig, rmov, tot_saldo);
if (tot_saldo.sign() > 0)
sez_rmov = 'A';
@ -662,7 +645,7 @@ void CG4600_application::ricavi()
// di tutti i saldi aventi lo stesso sottoconto, indicandola
// con una sezione opposta al risultato (della somma).
record_rmov_proper (numrig, rmov);
record_rmov_proper (numrig, rmov, tot_saldo);
if (tot_saldo.sign() > 0)
sez_rmov = 'A';
@ -719,17 +702,14 @@ bool CG4600_application::menu(MENU_TAG m)
return FALSE;
}
int main /* cg4600 */(int argc, char* argv[])
int cg4600 (int argc, char* argv[])
{
CG4600_application main_app;
main_app.run(argc, argv, "Chiusura Apertura Conti");
main_app.run(argc, argv, "Chiusura/Apertura Conti");
return TRUE;
}