Patch level : xx.282

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Riportata la versione 01.05 patch 282


git-svn-id: svn://10.65.10.50/trunk@8076 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1999-04-22 14:23:18 +00:00
parent fbd1ada076
commit a6bbb2800e
25 changed files with 2732 additions and 148 deletions

View File

@ -1,3 +1,3 @@
134
0
$rintra|0|0|110|0|Righe movimenti intra|||
$rintra|0|0|112|0|Righe movimenti intra|||

View File

@ -5,13 +5,13 @@ NUMRIG|2|3|0|Numero di riga
AMMLIRE|4|18|2|Ammontare in lire
AMMVALUTA|4|18|2|Ammontare in valuta
NATURA|2|1|0|Natura della transazione
CONSEGNA|1|3|0|Condizioni di consegna
TRASPORTO|6|1|0|Tipo di trasporto
NOMENCL|1|8|0|Nomenclatura
MASSAKG|4|13|5|Massa in Kilogrammi
MASSAUMS|4|13|6|Massa nell'unita' di misura specificata
UMS|1|2|0|Unita' di misura
VALSTAT|4|18|2|Valore statistico
REGIME|2|1|0|Regime
PAESE|1|2|0|Paese di destinazione/provenineza
PAESEORIG|1|2|0|Paese d'origine
PROV|1|2|0|Provincia d'origine/destinazione

View File

@ -1,3 +1,3 @@
135
0
$rieprett|0|0|154|0|Riepiloghi e rettifiche INTRA|||
$rieprett|0|0|156|0|Riepiloghi e rettifiche INTRA|||

View File

@ -8,7 +8,7 @@ STATO|1|2|0|Codice ISO dello Stato CEE
PIVA|1|13|0|Partita IVA Cliente/Fornitore
NATURA|7|1|0|Natura della transazione
NOMENCL|3|8|0|Nomenclatura combinata
REGIME|6|1|0|Regime [1,6]
CONSEGNA|1|3|0|Condizioni di consegna
TRASPORTO|2|1|0|Tipo di trasporto [1,9]
PAESE|1|2|0|Paese di destinazione/provenienza
PAESEORIG|1|2|0|Paese d'origine (solo Acquisti)

View File

@ -7,9 +7,11 @@ int main(int argc, char** argv)
const int n = (argc > 1) ? (argv[1][1]-'0') : 0;
switch (n)
{
case 5 : is0600(argc, argv); break; // riepiloghi
case 6 : is0700(argc, argv); break; // rettifiche
default: is0500(argc, argv); break; // movimenti
case 0 : in0100(argc, argv); break; // stampa
case 1 : in0200(argc, argv); break; // dischetti
case 5 : in0600(argc, argv); break; // riepiloghi
case 6 : in0700(argc, argv); break; // rettifiche
default: in0500(argc, argv); break; // movimenti
}
exit(0);
return 0;

View File

@ -1,4 +1,6 @@
int is0500(int argc, char* argv[]);
int is0600(int argc, char* argv[]);
int is0700(int argc, char* argv[]);
int in0100(int argc, char* argv[]);
int in0200(int argc, char* argv[]);
int in0500(int argc, char* argv[]);
int in0600(int argc, char* argv[]);
int in0700(int argc, char* argv[]);

335
in/in0100.cpp Executable file
View File

@ -0,0 +1,335 @@
// Programma di stampa riepiloghi INTRA comunitari
//
// A fundament of righteous men, a barrow of ideals, the carriage
// of misjustice crushes all beneath its weels
//
#include <applicat.h>
#include <prefix.h>
#include <printer.h>
#include <recarray.h>
#include <form.h>
#include <nditte.h>
#include "in0.h"
#include "in0100a.h"
#include "inlib01.h"
///////////////////////////////////////////////////////////
// TStampaIntra_form
///////////////////////////////////////////////////////////
class TStampaIntra_form : public TForm
{
TRecord_array *_riepiloghi;
TRecord_array *_rettifiche;
TString16 _tipo, _frequenza, _periodo, _anno;
int _totrow1, _totrow2, _totpag1, _totpag2; // Righe e pagine totali per sezioni...
int _pageno1, _pageno2, _index1, _index2; // Numero di pagina corrente ed indice di accesso ai TRecord_array
real _tot1, _tot2; // Totale ammontare sezione 1 e 2
real _riportoprec1, _riportoprec2; // Riporto pagina prec. per sezioni 1 e 2
real _totaleprog1, _totaleprog2; // Totale progressivo per pagina, sezioni 1 e 2
protected:
void print_page(const pagetype p);
const bool good() const;
public:
void print();
TStampaIntra_form (const char* name, char t, char f, int p, int a);
virtual ~TStampaIntra_form ();
};
TStampaIntra_form::TStampaIntra_form(const char* name, char t, char f, int p, int a) : TForm(name)
{
_tipo << t;
_frequenza << f;
_periodo << p;
_anno << a;
TRectype dep(cursor()->file(LF_RIEPRETT).curr());
dep.zero();
dep.put("TIPO", t); dep.put("ANNO", a);
dep.put("PERIODO", p);
_riepiloghi = new TRecord_array(dep, "NUMRIG");
t++;
dep.put("TIPO", t);
_rettifiche = new TRecord_array(dep, "NUMRIG");
}
TStampaIntra_form::~TStampaIntra_form()
{
if (_riepiloghi)
delete _riepiloghi;
if (_rettifiche)
delete _rettifiche;
}
const bool TStampaIntra_form::good() const
{
return _index1 <= _riepiloghi->rows() || _index2 <= _rettifiche->rows();
}
void TStampaIntra_form::print_page(const pagetype p)
{
TString16 ws;
char secs[] = { "HBF" };
TPrint_section* ps;
TPrinter& pr = printer();
for (int sc = 0; sc < 3; sc++)
if ((ps = exist(secs[sc], p, FALSE)) != NULL)
{
const word r = ps->height();
int iterations = 1;
if (secs[sc] == 'B')
switch(p)
{
case odd_page:
iterations = 10;
break;
case even_page:
iterations = 7;
break;
default:
break;
}
const bool is_odd_page = p == odd_page;
const bool not_first = p != first_page;
int& index = is_odd_page ? _index1 : _index2;
int& max = is_odd_page ? _totrow1 : _totrow2;
// Per le testate ed i footers 1 singola iterazione, per i Body (solo ODD ed EVEN)
// esegue tante iterazioni quante sono le righe per riepiloghi o rettifiche
for (int k = 0; k < iterations; k++)
{
ps->reset();
switch (secs[sc])
{
case 'H': // Testate...
{
if (p == first_page || (not_first && index <= max))
{
ps->find_field(_frequenza == "M" ? 1 : 2).set(_periodo);
ps->find_field(3).set(_anno);
if (p == first_page)
ps->find_field(4).set(_frequenza);
ps->update();
}
}
break;
case 'F': // Footers...
if (p == first_page)
{
ws.format("%d", _totpag1);
ps->find_field(1).set(ws);
ws.format("%d", _totrow1);
ps->find_field(2).set(ws);
ps->find_field(3).set(_tot1.string());
ws.format("%d", _totpag2);
ps->find_field(4).set(ws);
ws.format("%d", _totrow2);
ps->find_field(5).set(ws);
ps->find_field(6).set(_tot2.string());
ps->update();
}
else // Footers ODD/EVEN
{
real & rrip = is_odd_page ? _riportoprec1 : _riportoprec2;
real & rtot = is_odd_page ? _totaleprog1 : _totaleprog2;
int& pgn = is_odd_page ? _pageno1 : _pageno2;
int& totpgn = is_odd_page ? _totpag1 : _totpag2;
if (pgn <= totpgn)
{
ws.format("%d", pgn);
ps->find_field(1).set(rrip.string());
ps->find_field(2).set(rtot.string());
ps->find_field(3).set(ws);
pgn++;
ps->update();
}
rrip = rtot;
}
break;
case 'B': // Body! CDB Infame donato per compiacer alle virtu' delle giovani signore/signorine
{ // Spezza il Totem: riunisce la piu' probabile delle ipotesi in un inutile compendio di
// miserabili ed incomode tentazioni.
if (not_first)
{
TRecord_array* ra = is_odd_page ? _riepiloghi : _rettifiche;
if (index <= max)
{
const TRectype& rec = ra->row(index);
relation()->lfile(LF_RIEPRETT).curr() = rec;
real & rtot = is_odd_page ? _totaleprog1 : _totaleprog2;
rtot += rec.get_real("AMMLIRE");
index++;
ps->update();
}
}
else
ps->update();
}
break;
default:
break;
}
for (word j = 0; j < r; j++)
{
TPrintrow& row = ps->row(j);
pr.print(row);
}
}
}
// No formfeed is needed since Header + n * Body + Footer = 72;
// Where n is the total body size for first_page, 10 for odd_page and 7 for even_page
}
void TStampaIntra_form::print()
{
TPrinter& pr = printer();
// Calcolo degli ammontare complessivi, totale pagine e righe di dettaglio
// per sezione
_totrow1 = _riepiloghi->rows();
_totrow2 = _rettifiche->rows();
_totpag1 = _totrow1 % 10 != 0 ? _totrow1 / 10 + 1 : _totrow1 / 10;
_totpag2 = _totrow2 % 7 != 0 ? _totrow2 / 7 + 1 : _totrow2 / 7;
_pageno1 = _pageno2 = 1;
_index1 = _index2 = 1;
if (_totrow1 + _totrow2 == 0)
{
error_box("Non esistono righe di riepilogo o rettifiche da stampare per il periodo selezionato");
return;
}
for (int i = 1; i <= _totrow1; i++)
_tot1 += _riepiloghi->row(i).get_real("AMMLIRE");
for (i = 1; i <= _totrow2; i++)
{
const TRectype& rec = _rettifiche->row(i);
if (rec.get_char("SEGNORETT") == '-')
_tot2 -= rec.get_real("AMMLIRE");
else
_tot2 += rec.get_real("AMMLIRE");
}
//Posiziona la relazione principale (ditta corrente)
TLocalisamfile& nditte = relation()->lfile(LF_NDITTE);
nditte.put(NDT_CODDITTA, prefix().get_codditta());
if (relation()->read(_isequal) != NOERR && !yesno_box("Errore nel posizionamento sulla ditta corrente. Continuare?"))
return;
pr.formlen(height(1));
pr.open(); // Apriti Sesamo! Granello di nulla... ma assai importante nell'antichita'.
//Posizionamento
if (pr.printtype() == winprinter && pr.is_generic())
arrange_form();
// Ed ecco qui... il Lievito Svi$$ero (sempre per rimanere in tema di Ali' Baba' ed i 40 Kazzoni)
while (good())
{
for (int pagina = 1; pagina <= 4; pagina++)
{
switch (pagina)
{
case 1:
print_page(first_page);
break;
case 2:
case 3:
print_page(odd_page);
break;
case 4:
print_page(even_page);
break;
default:
break;
}
}
}
// Exhausting all the rest:
// I will get, you dear enemy;
// ..See that people are underhand when asking: "how are you?"
// And so the printer was CLOSED!
pr.close(); // Chiuditi Sesamo
}
///////////////////////////////////////////////////////////
// TStampaIntra_mask
///////////////////////////////////////////////////////////
class TStampaIntra_mask : public TIntra_mask
{
protected:
virtual short type_field() const { return R_TIPO; }
virtual short period_field() const { return R_PERIODO_M; }
public:
void print();
TStampaIntra_mask();
virtual ~TStampaIntra_mask() { }
};
TStampaIntra_mask::TStampaIntra_mask()
: TIntra_mask("in0100a")
{ }
void TStampaIntra_mask::print()
{
TStampaIntra_form form(tipo() == 'A' ? "in0100a" : "in0100b", tipo(), frequenza(), periodo(), get_int(R_ANNO));
form.print();
}
///////////////////////////////////////////////////////////
// Applicazione di stampa
///////////////////////////////////////////////////////////
class TStampa_intra : public TSkeleton_application
{
TStampaIntra_mask* _msk;
protected:
virtual bool create();
virtual bool destroy();
virtual void main_loop();
public:
TStampa_intra() {};
virtual ~TStampa_intra() {};
};
bool TStampa_intra::create()
{
open_files(LF_TABCOM, LF_TAB, LF_CLIFO, LF_MOV,
LF_INTRA, LF_RINTRA, 0);
_msk = new TStampaIntra_mask;
return TSkeleton_application::create();
}
bool TStampa_intra::destroy()
{
delete _msk;
return TSkeleton_application::destroy();
}
void TStampa_intra::main_loop()
{
while (_msk->run()!=K_QUIT)
_msk->print();
}
int in0100(int argc, char* argv[])
{
TStampa_intra a;
a.run(argc, argv, "Stampa Riepiloghi");
return 0;
}

789
in/in0100a.frm Executable file
View File

@ -0,0 +1,789 @@
// Form per la stampa riepiloghi INTRA (Acquisti)
USE 9
JOIN 6 TO 9 ALIAS 106 INTO TIPOA=TIPOA CODANAGR=CODANAGR
JOIN 8 TO 106@ ALIAS 118 INTO CODANAGR=CODANAGR
JOIN 13 TO 118@ ALIAS 213 INTO STATO=="" COM==COMNASC
JOIN 13 TO 106@ ALIAS 313 INTO STATO==STATORES COM==COMRES
JOIN 13 TO 106@ ALIAS 413 INTO STATO=="" COM==COMRF
JOIN 6 TO 9 ALIAS 206 INTO TIPOA==TIPOSOGDEL CODANAGR==CODSOGDEL
JOIN 13 TO 206@ ALIAS 513 INTO STATO==STATORES COM==COMRES
JOIN 13 TO 206@ ALIAS 613 INTO STATO=="" COM==COMRF
JOIN 135 TO 9 INTO ANNO=CODDITTA
END
DESCRIPTION
BEGIN
END
GENERAL
BEGIN
OFFSET 0 0
CARATTERE "X"
INIZIO_POS 2 4
FINE_POS 76
END
SECTION HEADER FIRST 16
NUMERO 1 4
BEGIN
KEY "Mese"
PROMPT 43 14 ""
PICTURE "@ #"
END
NUMERO 2 1
BEGIN
KEY "Trimestre"
PROMPT 55 14 ""
END
NUMERO 3 5
BEGIN
KEY "Anno"
PROMPT 64 14 ""
PICTURE "^^# #"
END
STRINGA 4 1
BEGIN
KEY "Tipo riepilogo"
PROMPT 39 16 ""
END
END
SECTION BODY FIRST 33
LISTA 99
BEGIN
KEY "Tipo anagrafica"
PROMPT 1 1 ""
FIELD TIPOA
ITEM "F| " MESSAGE SHOW,1@|HIDE,2@
ITEM "G| " MESSAGE SHOW,2@|HIDE,1@
END
STRINGA 1
BEGIN
KEY "Codice Fiscale"
PROMPT 3 7 ""
FIELD 106@->COFI
END
STRINGA 2
BEGIN
KEY "Partita IVA"
PROMPT 53 7 ""
FIELD 106@->PAIV
END
STRINGA 3
BEGIN
KEY "Cognome"
PROMPT 3 10 ""
FIELD 106@->RAGSOC[1,30]
GROUP 1
END
STRINGA 4
BEGIN
KEY "Nome"
PROMPT 43 10 ""
FIELD 106@->RAGSOC[31,50]
GROUP 1
END
DATA 5
BEGIN
KEY "Data di nascita"
PROMPT 4 13 ""
FIELD 118@->DATANASC
FORMAT "1442-"
PICTURE "# #^# #^# #"
GROUP 1
END
LISTA 6
BEGIN
KEY "Sesso"
PROMPT 19 13 ""
FIELD 118@->SESSO
ITEM "M|X"
ITEM "F| X"
GROUP 1
END
STRINGA 7 32
BEGIN
KEY "Comune di nascita"
PROMPT 23 13 ""
FIELD 213@->DENCOM
GROUP 1
END
STRINGA 8 2
BEGIN
KEY "Provincia di nascita"
PROMPT 59 13 ""
FIELD 213@->PROVCOM
GROUP 1
END
STRINGA 9 4
BEGIN
KEY "Prefisso telefonico"
PROMPT 64 13 ""
FIELD 106@->PTELRF
GROUP 1
END
STRINGA 10 9
BEGIN
KEY "Numero telefonico"
PROMPT 69 13 ""
FIELD 106@->TELRF
GROUP 1
END
STRINGA 11
BEGIN
KEY "Denominazione o ragione sociale"
PROMPT 3 17 ""
FIELD 106@->RAGSOC
GROUP 2
END
STRINGA 12 4
BEGIN
KEY "Prefisso telefonico"
PROMPT 64 17 ""
FIELD 106@->PTELRF
GROUP 2
END
STRINGA 13 9
BEGIN
KEY "Numero telefonico"
PROMPT 69 17 ""
FIELD 106@->TELRF
GROUP 2
END
STRINGA 14 20
BEGIN
KEY "Comune di residenza fiscale"
PROMPT 52 20 ""
FIELD 413@->DENCOM
MESSAGE EMPTY SHOW,3@|HIDE,4@
MESSAGE SHOW,4@|HIDE,3@
END
STRINGA 15 20
BEGIN
KEY "Comune di residenza"
PROMPT 52 20 ""
FIELD 313@->DENCOM
GROUP 3
END
STRINGA 16
BEGIN
KEY "Provincia di residenza fiscale"
PROMPT 74 20 ""
FIELD 413@->PROVCOM
GROUP 4
END
STRINGA 17
BEGIN
KEY "Provincia di residenza"
PROMPT 74 20 ""
FIELD 313@->PROVCOM
GROUP 3
END
STRINGA 18
BEGIN
KEY "Indirizzo residenza fiscale"
PROMPT 1 20 ""
FIELD 106@->INDRF[1,35]
FLAGS "H"
MESSAGE COPY,20
END
STRINGA 19
BEGIN
KEY "Nr. civico di residenza fiscale"
PROMPT 1 20 ""
FIELD 106@->CIVRF
FLAGS "H"
MESSAGE APPEND,20
END
STRINGA 20 38
BEGIN
KEY "Indirizzo residenza fiscale+nr. civico"
PROMPT 3 20 ""
GROUP 4
END
STRINGA 21
BEGIN
KEY "Indirizzo residenza"
PROMPT 1 20 ""
FIELD 106@->INDRES[1,35]
FLAGS "H"
MESSAGE COPY,23
END
STRINGA 22
BEGIN
KEY "Nr. civico di residenza"
PROMPT 1 20 ""
FIELD 106@->CIVRES
FLAGS "H"
MESSAGE APPEND,23
END
STRINGA 23 38
BEGIN
KEY "Indirizzo residenza+nr. civico"
PROMPT 3 20 ""
GROUP 3
END
STRINGA 24
BEGIN
KEY "CAP residenza fiscale"
PROMPT 42 20 ""
FIELD 106@->CAPRF
GROUP 4
END
STRINGA 25
BEGIN
KEY "CAP residenza"
PROMPT 42 20 ""
FIELD 106@->CAPRES
GROUP 3
END
LISTA 26 1
BEGIN
KEY "Elenchi presentati in precedenza"
PROMPT 7 23 ""
ITEM " | "
ITEM "X|X"
FIELD PRESELEN
END
LISTA 26 1
BEGIN
KEY "Cessazione attivita'"
PROMPT 40 23 ""
ITEM " | "
ITEM "X|X"
FIELD CESSIVA
END
STRINGA 27
BEGIN
KEY "Partita IVA delegato"
PROMPT 11 27 ""
FIELD 206@->PAIV
END
STRINGA 28 50
BEGIN
KEY "Nome e Cognome o Ragione sociale delegato"
PROMPT 3 30 ""
FIELD 206@->RAGSOC
END
STRINGA 29 4
BEGIN
KEY "Prefisso telefonico delegato"
PROMPT 64 30 ""
FIELD 206@->PTELRF
END
STRINGA 30 9
BEGIN
KEY "Numero telefonico delegato"
PROMPT 69 30 ""
FIELD 206@->TELRF
END
STRINGA 31 20
BEGIN
KEY "Comune di residenza fiscale delegato"
PROMPT 52 33 ""
FIELD 613@->DENCOM
MESSAGE EMPTY SHOW,5@|HIDE,6@
MESSAGE SHOW,6@|HIDE,5@
END
STRINGA 32 20
BEGIN
KEY "Comune di residenza delegato"
PROMPT 52 33 ""
FIELD 513@->DENCOM
GROUP 5
END
STRINGA 33
BEGIN
KEY "Provincia di residenza fiscale delegato"
PROMPT 74 33 ""
FIELD 613@->PROVCOM
GROUP 6
END
STRINGA 34
BEGIN
KEY "Provincia di residenza delegato"
PROMPT 74 33 ""
FIELD 513@->PROVCOM
GROUP 5
END
STRINGA 35
BEGIN
KEY "Indirizzo residenza fiscale delegato"
PROMPT 1 33 ""
FIELD 206@->INDRF[1,35]
FLAGS "H"
MESSAGE COPY,37
END
STRINGA 36
BEGIN
KEY "Nr. civico di residenza fiscale delegato"
PROMPT 1 33 ""
FIELD 206@->CIVRF
FLAGS "H"
MESSAGE APPEND,37
END
STRINGA 37 38
BEGIN
KEY "Indirizzo residenza fiscale+nr. civico delegato"
PROMPT 3 33 ""
GROUP 6
END
STRINGA 38
BEGIN
KEY "Indirizzo residenza delegato"
PROMPT 1 33 ""
FIELD 206@->INDRES[1,35]
FLAGS "H"
MESSAGE COPY,40
END
STRINGA 39
BEGIN
KEY "Nr. civico di residenza delegato"
PROMPT 1 33 ""
FIELD 206@->CIVRES
FLAGS "H"
MESSAGE APPEND,40
END
STRINGA 40 38
BEGIN
KEY "Indirizzo residenza+nr. civico delegato"
PROMPT 3 33 ""
GROUP 5
END
STRINGA 41
BEGIN
KEY "CAP residenza fiscale delegato"
PROMPT 42 33 ""
FIELD 206@->CAPRF
GROUP 6
END
STRINGA 42
BEGIN
KEY "CAP residenza delegato"
PROMPT 42 33 ""
FIELD 206@->CAPRES
GROUP 5
END
END
SECTION FOOTER FIRST 23
NUMERO 1 3
BEGIN
KEY "Totale pagine sezione 1"
PROMPT 11 6 ""
END
NUMERO 2 5
BEGIN
KEY "Totale righe dettaglio sezione 1"
PROMPT 18 6 ""
END
NUMERO 3 15
BEGIN
KEY "Ammontare complessivo sezione 1"
PROMPT 25 6 ""
PICTURE "###.###.###.^^^"
END
NUMERO 4 3
BEGIN
KEY "Totale pagine sezione 2"
PROMPT 49 6 ""
END
NUMERO 5 5
BEGIN
KEY "Totale righe dettaglio sezione 2"
PROMPT 56 6 ""
END
NUMERO 6 15
BEGIN
KEY "Ammontare complessivo sezione 2"
PROMPT 64 6 ""
PICTURE "###.###.###.^^^"
END
DATA 7 10
BEGIN
KEY "Data di stampa"
PROMPT 6 10 ""
MESSAGE _TODAY
END
END
SECTION HEADER ODD 21
NUMERO 1 4
BEGIN
KEY "Mese"
PROMPT 16 15 ""
PICTURE "@ #"
END
NUMERO 2 1
BEGIN
KEY "Trimestre"
PROMPT 29 15 ""
END
NUMERO 3 5
BEGIN
KEY "Anno"
PROMPT 37 15 ""
PICTURE "^^# #"
END
STRINGA 4
BEGIN
KEY "Partita IVA"
PROMPT 53 15 ""
FIELD 106@->PAIV
END
END
SECTION BODY ODD 2
NUMERO 1 3
BEGIN
KEY "Progressivo riga"
PROMPT 3 1 ""
FIELD 135->NUMRIG
END
STRINGA 2 2
BEGIN
KEY "Stato"
PROMPT 7 1 ""
FIELD 135->STATO
END
STRINGA 3 11
BEGIN
KEY "Partita IVA"
PROMPT 11 1 ""
FIELD 135->PIVA
END
NUMERO 4 12
BEGIN
KEY "Ammontare operazioni in lire"
PROMPT 25 1 ""
FIELD 135->AMMLIRE
PICTURE "####.###.^^^"
END
NUMERO 5 12
BEGIN
KEY "Ammontare operazioni in valuta"
PROMPT 37 1 ""
FIELD 135->AMMVALUTA
PICTURE "#.###.###,@@"
END
STRINGA 6 1
BEGIN
KEY "Natura della transazione"
PROMPT 50 1 ""
FIELD 135->NATURA
END
STRINGA 7 8
BEGIN
KEY "Nomenclatura combinata"
PROMPT 53 1 ""
FIELD 135->NOMENCL
PICTURE "@@@@@@@@"
END
NUMERO 8 10
BEGIN
KEY "Massa netta in kilogrammi"
PROMPT 62 1 ""
FIELD 135->MASSAKG
PICTURE "######,@@@"
END
NUMERO 9 10
BEGIN
KEY "Massa in unita' supplementare"
PROMPT 73 1 ""
FIELD 135->MASSAUMS
PICTURE "######,@@@"
END
NUMERO 10 12
BEGIN
KEY "Valore statistico"
PROMPT 84 1 ""
FIELD 135->VALSTAT
PICTURE "####.###.^^^"
END
STRINGA 11 1
BEGIN
KEY "Codice consegna"
PROMPT 97 1 ""
FIELD 135->CONSEGNA[1,1]
END
STRINGA 12 1
BEGIN
KEY "Modo di trasporto"
PROMPT 100 1 ""
FIELD 135->TRASPORTO
END
STRINGA 13 2
BEGIN
KEY "Paese destinazione/provenienza"
PROMPT 103 1 ""
FIELD 135->PAESE
END
STRINGA 14 2
BEGIN
KEY "Paese di origine"
PROMPT 107 1 ""
FIELD 135->PAESEORIG
END
STRINGA 15 2
BEGIN
KEY "Provincia di destinazione"
PROMPT 111 1 ""
FIELD 135->PROV
END
END
SECTION FOOTER ODD 31
NUMERO 1 12
BEGIN
KEY "Riporto dalla pagina precedente"
PROMPT 25 1 ""
PICTURE "####.###.^^^"
END
NUMERO 2 12
BEGIN
KEY "Totale"
PROMPT 25 3 ""
PICTURE "####.###.^^^"
END
NUMERO 3 3
BEGIN
KEY "Numero di pagina"
PROMPT 111 3 ""
END
END
SECTION HEADER EVEN 22
NUMERO 1 4
BEGIN
KEY "Mese"
PROMPT 16 15 ""
PICTURE "@ #"
END
NUMERO 2 1
BEGIN
KEY "Trimestre"
PROMPT 29 15 ""
END
NUMERO 3 6
BEGIN
KEY "Anno"
PROMPT 37 15 ""
PICTURE "^^# #"
END
STRINGA 4
BEGIN
KEY "Partita IVA"
PROMPT 53 15 ""
FIELD 106@->PAIV
END
END
// Sezione di stampa rettifiche
SECTION BODY EVEN 2
NUMERO 1 3
BEGIN
KEY "Progressivo riga"
PROMPT 3 1 ""
FIELD 135->NUMRIG
END
NUMERO 2 2
BEGIN
KEY "Mese del periodo di riferimento"
PROMPT 7 1 ""
FIELD 135->PERETT
END
NUMERO 3 2
BEGIN
KEY "Trimestre del periodo di riferimento"
PROMPT 11 1 ""
FIELD 135->PERETT
END
NUMERO 4 4
BEGIN
KEY "Anno del periodo di riferimento"
PROMPT 14 1 ""
FIELD 135->ANNORETT
END
STRINGA 5 2
BEGIN
KEY "Stato"
PROMPT 19 1 ""
FIELD 135->STATO
END
STRINGA 6 11
BEGIN
KEY "Partita IVA"
PROMPT 23 1 ""
FIELD 135->PIVA
END
STRINGA 7 1
BEGIN
KEY "Segno"
PROMPT 37 1 ""
FIELD 135->SEGNORETT
END
NUMERO 8 12
BEGIN
KEY "Ammontare operazioni in lire"
PROMPT 41 1 ""
FIELD 135->AMMLIRE
PICTURE "####.###.^^^"
END
NUMERO 9 12
BEGIN
KEY "Ammontare operazioni in valuta"
PROMPT 52 1 ""
FIELD 135->AMMVALUTA
PICTURE "#.###.###,@@"
END
STRINGA 10 1
BEGIN
KEY "Natura della transazione"
PROMPT 66 1 ""
FIELD 135->NATURA
END
STRINGA 11 8
BEGIN
KEY "Nomenclatura combinata"
PROMPT 69 1 ""
FIELD 135->NOMENCL
PICTURE "@@@@@@@@"
END
NUMERO 12 12
BEGIN
KEY "Valore statistico"
PROMPT 80 1 ""
FIELD 135->VALSTAT
PICTURE "####.###.^^^"
END
END
SECTION FOOTER EVEN 36
NUMERO 1 12
BEGIN
KEY "Riporto dala pagina precedente"
PROMPT 41 1 ""
PICTURE "####.###.^^^"
END
NUMERO 2 12
BEGIN
KEY "Totale"
PROMPT 41 3 ""
PICTURE "####.###.^^^"
END
NUMERO 3 3
BEGIN
KEY "Numero di pagina"
PROMPT 89 4 ""
END
END

6
in/in0100a.h Executable file
View File

@ -0,0 +1,6 @@
#define R_RIEPILOGHI 100
#define R_TIPO 101
#define R_ANNO 102
#define R_PERIODO_M 103
#define R_PERIODO_T 104
#define R_PERIODO_A 105

57
in/in0100a.uml Executable file
View File

@ -0,0 +1,57 @@
#include "in0100a.h"
PAGE "Stampa Riepiloghi" -1 -1 32 6
LIST R_TIPO 1 10
BEGIN
PROMPT 1 1 "Tipo riepilogo "
ITEM "C|Cessioni"
ITEM "A|Acquisti"
END
NUMBER R_ANNO 4
BEGIN
PROMPT 1 2 "Anno "
FLAGS "AU"
END
LIST R_PERIODO_M 2 17
BEGIN
PROMPT 1 3 "Periodo "
FLAGS "AM"
FIELD PERIODO
END
LIST R_PERIODO_T 2 17
BEGIN
PROMPT 1 3 "Periodo "
ITEM "01|Gennaio-Marzo"
MESSAGE COPY,R_PERIODO_M
ITEM "02|Aprile-Giugno"
MESSAGE COPY,R_PERIODO_M
ITEM "03|Luglio-Settembre"
MESSAGE COPY,R_PERIODO_M
ITEM "04|Ottobre-Dicembre"
MESSAGE COPY,R_PERIODO_M
END
LIST R_PERIODO_A 2 17
BEGIN
PROMPT 1 3 "Periodo "
ITEM "01|Annuale"
MESSAGE COPY,R_PERIODO_M
END
BUTTON DLG_PRINT 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

766
in/in0100b.frm Executable file
View File

@ -0,0 +1,766 @@
// Form per la stampa riepiloghi INTRA (Cessioni)
USE 9
JOIN 6 TO 9 ALIAS 106 INTO TIPOA=TIPOA CODANAGR=CODANAGR
JOIN 8 TO 106@ ALIAS 118 INTO CODANAGR=CODANAGR
JOIN 13 TO 118@ ALIAS 213 INTO STATO=="" COM==COMNASC
JOIN 13 TO 106@ ALIAS 313 INTO STATO==STATORES COM==COMRES
JOIN 13 TO 106@ ALIAS 413 INTO STATO=="" COM==COMRF
JOIN 6 TO 9 ALIAS 206 INTO TIPOA==TIPOSOGDEL CODANAGR==CODSOGDEL
JOIN 13 TO 206@ ALIAS 513 INTO STATO==STATORES COM==COMRES
JOIN 13 TO 206@ ALIAS 613 INTO STATO=="" COM==COMRF
JOIN 135 TO 9 INTO ANNO=CODDITTA
END
DESCRIPTION
BEGIN
END
GENERAL
BEGIN
OFFSET 0 0
CARATTERE "X"
INIZIO_POS 2 4
FINE_POS 76
END
SECTION HEADER FIRST 16
NUMERO 1 4
BEGIN
KEY "Mese"
PROMPT 43 14 ""
PICTURE "@ #"
END
NUMERO 2 1
BEGIN
KEY "Trimestre"
PROMPT 55 14 ""
END
NUMERO 3 5
BEGIN
KEY "Anno"
PROMPT 64 14 ""
PICTURE "^^# #"
END
STRINGA 4 1
BEGIN
KEY "Tipo riepilogo"
PROMPT 39 16 ""
END
END
SECTION BODY FIRST 33
LISTA 99
BEGIN
KEY "Tipo anagrafica"
PROMPT 1 1 ""
FIELD TIPOA
ITEM "F| " MESSAGE SHOW,1@|HIDE,2@
ITEM "G| " MESSAGE SHOW,2@|HIDE,1@
END
STRINGA 1
BEGIN
KEY "Codice Fiscale"
PROMPT 3 7 ""
FIELD 106@->COFI
END
STRINGA 2
BEGIN
KEY "Partita IVA"
PROMPT 53 7 ""
FIELD 106@->PAIV
END
STRINGA 3
BEGIN
KEY "Cognome"
PROMPT 3 10 ""
FIELD 106@->RAGSOC[1,30]
GROUP 1
END
STRINGA 4
BEGIN
KEY "Nome"
PROMPT 43 10 ""
FIELD 106@->RAGSOC[31,50]
GROUP 1
END
DATA 5
BEGIN
KEY "Data di nascita"
PROMPT 4 13 ""
FIELD 118@->DATANASC
FORMAT "1442-"
PICTURE "# #^# #^# #"
GROUP 1
END
LISTA 6
BEGIN
KEY "Sesso"
PROMPT 19 13 ""
FIELD 118@->SESSO
ITEM "M|X"
ITEM "F| X"
GROUP 1
END
STRINGA 7 32
BEGIN
KEY "Comune di nascita"
PROMPT 23 13 ""
FIELD 213@->DENCOM
GROUP 1
END
STRINGA 8 2
BEGIN
KEY "Provincia di nascita"
PROMPT 59 13 ""
FIELD 213@->PROVCOM
GROUP 1
END
STRINGA 9 4
BEGIN
KEY "Prefisso telefonico"
PROMPT 64 13 ""
FIELD 106@->PTELRF
GROUP 1
END
STRINGA 10 9
BEGIN
KEY "Numero telefonico"
PROMPT 69 13 ""
FIELD 106@->TELRF
GROUP 1
END
STRINGA 11
BEGIN
KEY "Denominazione o ragione sociale"
PROMPT 3 17 ""
FIELD 106@->RAGSOC
GROUP 2
END
STRINGA 12 4
BEGIN
KEY "Prefisso telefonico"
PROMPT 64 17 ""
FIELD 106@->PTELRF
GROUP 2
END
STRINGA 13 9
BEGIN
KEY "Numero telefonico"
PROMPT 69 17 ""
FIELD 106@->TELRF
GROUP 2
END
STRINGA 14 20
BEGIN
KEY "Comune di residenza fiscale"
PROMPT 52 20 ""
FIELD 413@->DENCOM
MESSAGE EMPTY SHOW,3@|HIDE,4@
MESSAGE SHOW,4@|HIDE,3@
END
STRINGA 15 20
BEGIN
KEY "Comune di residenza"
PROMPT 52 20 ""
FIELD 313@->DENCOM
GROUP 3
END
STRINGA 16
BEGIN
KEY "Provincia di residenza fiscale"
PROMPT 74 20 ""
FIELD 413@->PROVCOM
GROUP 4
END
STRINGA 17
BEGIN
KEY "Provincia di residenza"
PROMPT 74 20 ""
FIELD 313@->PROVCOM
GROUP 3
END
STRINGA 18
BEGIN
KEY "Indirizzo residenza fiscale"
PROMPT 1 20 ""
FIELD 106@->INDRF[1,35]
FLAGS "H"
MESSAGE COPY,20
END
STRINGA 19
BEGIN
KEY "Nr. civico di residenza fiscale"
PROMPT 1 20 ""
FIELD 106@->CIVRF
FLAGS "H"
MESSAGE APPEND,20
END
STRINGA 20 38
BEGIN
KEY "Indirizzo residenza fiscale+nr. civico"
PROMPT 3 20 ""
GROUP 4
END
STRINGA 21
BEGIN
KEY "Indirizzo residenza"
PROMPT 1 20 ""
FIELD 106@->INDRES[1,35]
FLAGS "H"
MESSAGE COPY,23
END
STRINGA 22
BEGIN
KEY "Nr. civico di residenza"
PROMPT 1 20 ""
FIELD 106@->CIVRES
FLAGS "H"
MESSAGE APPEND,23
END
STRINGA 23 38
BEGIN
KEY "Indirizzo residenza+nr. civico"
PROMPT 3 20 ""
GROUP 3
END
STRINGA 24
BEGIN
KEY "CAP residenza fiscale"
PROMPT 42 20 ""
FIELD 106@->CAPRF
GROUP 4
END
STRINGA 25
BEGIN
KEY "CAP residenza"
PROMPT 42 20 ""
FIELD 106@->CAPRES
GROUP 3
END
LISTA 26 1
BEGIN
KEY "Elenchi presentati in precedenza"
PROMPT 7 23 ""
ITEM " | "
ITEM "X|X"
FIELD PRESELEN
END
LISTA 26 1
BEGIN
KEY "Cessazione attivita'"
PROMPT 40 23 ""
ITEM " | "
ITEM "X|X"
FIELD CESSIVA
END
STRINGA 27
BEGIN
KEY "Partita IVA delegato"
PROMPT 11 27 ""
FIELD 206@->PAIV
END
STRINGA 28 50
BEGIN
KEY "Nome e Cognome o Ragione sociale delegato"
PROMPT 3 30 ""
FIELD 206@->RAGSOC
END
STRINGA 29 4
BEGIN
KEY "Prefisso telefonico delegato"
PROMPT 64 30 ""
FIELD 206@->PTELRF
END
STRINGA 30 9
BEGIN
KEY "Numero telefonico delegato"
PROMPT 69 30 ""
FIELD 206@->TELRF
END
STRINGA 31 20
BEGIN
KEY "Comune di residenza fiscale delegato"
PROMPT 52 33 ""
FIELD 613@->DENCOM
MESSAGE EMPTY SHOW,5@|HIDE,6@
MESSAGE SHOW,6@|HIDE,5@
END
STRINGA 32 20
BEGIN
KEY "Comune di residenza delegato"
PROMPT 52 33 ""
FIELD 513@->DENCOM
GROUP 5
END
STRINGA 33
BEGIN
KEY "Provincia di residenza fiscale delegato"
PROMPT 74 33 ""
FIELD 613@->PROVCOM
GROUP 6
END
STRINGA 34
BEGIN
KEY "Provincia di residenza delegato"
PROMPT 74 33 ""
FIELD 513@->PROVCOM
GROUP 5
END
STRINGA 35
BEGIN
KEY "Indirizzo residenza fiscale delegato"
PROMPT 1 33 ""
FIELD 206@->INDRF[1,35]
FLAGS "H"
MESSAGE COPY,37
END
STRINGA 36
BEGIN
KEY "Nr. civico di residenza fiscale delegato"
PROMPT 1 33 ""
FIELD 206@->CIVRF
FLAGS "H"
MESSAGE APPEND,37
END
STRINGA 37 38
BEGIN
KEY "Indirizzo residenza fiscale+nr. civico delegato"
PROMPT 3 33 ""
GROUP 6
END
STRINGA 38
BEGIN
KEY "Indirizzo residenza delegato"
PROMPT 1 33 ""
FIELD 206@->INDRES[1,35]
FLAGS "H"
MESSAGE COPY,40
END
STRINGA 39
BEGIN
KEY "Nr. civico di residenza delegato"
PROMPT 1 33 ""
FIELD 206@->CIVRES
FLAGS "H"
MESSAGE APPEND,40
END
STRINGA 40 38
BEGIN
KEY "Indirizzo residenza+nr. civico delegato"
PROMPT 3 33 ""
GROUP 5
END
STRINGA 41
BEGIN
KEY "CAP residenza fiscale delegato"
PROMPT 42 33 ""
FIELD 206@->CAPRF
GROUP 6
END
STRINGA 42
BEGIN
KEY "CAP residenza delegato"
PROMPT 42 33 ""
FIELD 206@->CAPRES
GROUP 5
END
END
SECTION FOOTER FIRST 23
NUMERO 1 3
BEGIN
KEY "Totale pagine sezione 1"
PROMPT 11 6 ""
END
NUMERO 2 5
BEGIN
KEY "Totale righe dettaglio sezione 1"
PROMPT 18 6 ""
END
NUMERO 3 15
BEGIN
KEY "Ammontare complessivo sezione 1"
PROMPT 25 6 ""
PICTURE "###.###.###.^^^"
END
NUMERO 4 3
BEGIN
KEY "Totale pagine sezione 2"
PROMPT 49 6 ""
END
NUMERO 5 5
BEGIN
KEY "Totale righe dettaglio sezione 2"
PROMPT 56 6 ""
END
NUMERO 6 15
BEGIN
KEY "Ammontare complessivo sezione 2"
PROMPT 64 6 ""
PICTURE "###.###.###.^^^"
END
DATA 7 10
BEGIN
KEY "Data di stampa"
PROMPT 6 10 ""
MESSAGE _TODAY
END
END
SECTION HEADER ODD 21
NUMERO 1 4
BEGIN
KEY "Mese"
PROMPT 16 15 ""
PICTURE "@ #"
END
NUMERO 2 1
BEGIN
KEY "Trimestre"
PROMPT 29 15 ""
END
NUMERO 3 5
BEGIN
KEY "Anno"
PROMPT 37 15 ""
PICTURE "^^# #"
END
STRINGA 4
BEGIN
KEY "Partita IVA"
PROMPT 53 15 ""
FIELD 106@->PAIV
END
END
SECTION BODY ODD 2
NUMERO 1 3
BEGIN
KEY "Progressivo riga"
PROMPT 3 1 ""
FIELD 135->NUMRIG
END
STRINGA 2 2
BEGIN
KEY "Stato"
PROMPT 7 1 ""
FIELD 135->STATO
END
STRINGA 3 11
BEGIN
KEY "Partita IVA"
PROMPT 11 1 ""
FIELD 135->PIVA
END
NUMERO 4 12
BEGIN
KEY "Ammontare operazioni in lire"
PROMPT 25 1 ""
FIELD 135->AMMLIRE
PICTURE "####.###.^^^"
END
STRINGA 6 1
BEGIN
KEY "Natura della transazione"
PROMPT 37 1 ""
FIELD 135->NATURA
END
STRINGA 7 8
BEGIN
KEY "Nomenclatura combinata"
PROMPT 39 1 ""
FIELD 135->NOMENCL
PICTURE "@@@@@@@@"
END
NUMERO 8 10
BEGIN
KEY "Massa netta in kilogrammi"
PROMPT 49 1 ""
FIELD 135->MASSAKG
PICTURE "######,@@@"
END
NUMERO 9 10
BEGIN
KEY "Massa in unita' supplementare"
PROMPT 60 1 ""
FIELD 135->MASSAUMS
PICTURE "######,@@@"
END
NUMERO 10 12
BEGIN
KEY "Valore statistico"
PROMPT 71 1 ""
FIELD 135->VALSTAT
PICTURE "####.###.^^^"
END
STRINGA 11 1
BEGIN
KEY "Codice consegna"
PROMPT 84 1 ""
FIELD 135->CONSEGNA[1,1]
END
STRINGA 12 1
BEGIN
KEY "Modo di trasporto"
PROMPT 87 1 ""
FIELD 135->TRASPORTO
END
STRINGA 13 2
BEGIN
KEY "Paese destinazione"
PROMPT 90 1 ""
FIELD 135->PAESE
END
STRINGA 14 2
BEGIN
KEY "Provincia Origine"
PROMPT 94 1 ""
FIELD 135->PROV
END
END
SECTION FOOTER ODD 31
NUMERO 1 12
BEGIN
KEY "Riporto dalla pagina precedente"
PROMPT 25 1 ""
PICTURE "####.###.^^^"
END
NUMERO 2 12
BEGIN
KEY "Totale"
PROMPT 25 3 ""
PICTURE "####.###.^^^"
END
NUMERO 3 3
BEGIN
KEY "Numero di pagina"
PROMPT 95 3 ""
END
END
SECTION HEADER EVEN 22
NUMERO 1 4
BEGIN
KEY "Mese"
PROMPT 16 15 ""
PICTURE "@ #"
END
NUMERO 2 1
BEGIN
KEY "Trimestre"
PROMPT 29 15 ""
END
NUMERO 3 6
BEGIN
KEY "Anno"
PROMPT 37 15 ""
PICTURE "^^# #"
END
STRINGA 4
BEGIN
KEY "Partita IVA"
PROMPT 53 15 ""
FIELD 106@->PAIV
END
END
// Sezione di stampa rettifiche
SECTION BODY EVEN 2
NUMERO 1 3
BEGIN
KEY "Progressivo riga"
PROMPT 3 1 ""
FIELD 135->NUMRIG
END
NUMERO 2 2
BEGIN
KEY "Mese del periodo di riferimento"
PROMPT 7 1 ""
FIELD 135->PERETT
END
NUMERO 3 2
BEGIN
KEY "Trimestre del periodo di riferimento"
PROMPT 11 1 ""
FIELD 135->PERETT
END
NUMERO 4 4
BEGIN
KEY "Anno del periodo di riferimento"
PROMPT 14 1 ""
FIELD 135->ANNORETT
END
STRINGA 5 2
BEGIN
KEY "Stato"
PROMPT 19 1 ""
FIELD 135->STATO
END
STRINGA 6 11
BEGIN
KEY "Partita IVA"
PROMPT 23 1 ""
FIELD 135->PIVA
END
STRINGA 7 1
BEGIN
KEY "Segno"
PROMPT 37 1 ""
FIELD 135->SEGNORETT
END
NUMERO 8 12
BEGIN
KEY "Ammontare operazioni in lire"
PROMPT 41 1 ""
FIELD 135->AMMLIRE
PICTURE "####.###.^^^"
END
STRINGA 10 1
BEGIN
KEY "Natura della transazione"
PROMPT 53 1 ""
FIELD 135->NATURA
END
STRINGA 11 8
BEGIN
KEY "Nomenclatura combinata"
PROMPT 56 1 ""
FIELD 135->NOMENCL
PICTURE "@@@@@@@@"
END
NUMERO 12 12
BEGIN
KEY "Valore statistico"
PROMPT 67 1 ""
FIELD 135->VALSTAT
PICTURE "####.###.^^^"
END
END
SECTION FOOTER EVEN 36
NUMERO 1 12
BEGIN
KEY "Riporto dala pagina precedente"
PROMPT 41 1 ""
PICTURE "####.###.^^^"
END
NUMERO 2 12
BEGIN
KEY "Totale"
PROMPT 41 3 ""
PICTURE "####.###.^^^"
END
NUMERO 3 3
BEGIN
KEY "Numero di pagina"
PROMPT 75 4 ""
END
END

479
in/in0200.cpp Executable file
View File

@ -0,0 +1,479 @@
#include <applicat.h>
#include <os_dep.h>
#include <progind.h>
#include <recarray.h>
#include <relation.h>
#include "in0.h"
#include "in0200a.h"
#include "inlib01.h"
#include <nditte.h>
#include <anagr.h>
///////////////////////////////////////////////////////////
// TRecord_intra
///////////////////////////////////////////////////////////
struct TIntra_context
{
char _tipo;
long _progr;
char _freq;
int _anno;
int _periodo;
long _righe_riep;
real _totale_riep;
long _righe_rett;
real _totale_rett;
unsigned long _written;
unsigned long _disksize;
TIntra_context();
};
TIntra_context::TIntra_context()
{
_tipo = 'C'; _freq = 'T'; _anno = 1999; _periodo = 1;
_progr = _righe_riep = _righe_rett = 0L;
_written = _disksize = 0L;
}
class TRecord_intra : public TString
{
protected:
virtual void print_on(ostream& o) const;
public:
void reset(const TIntra_context& ic);
void reset_data();
void put(const char* str, int pos, int dim, const char* flags = "");
void put(real num, int pos, int dim, int dec = 0);
void put(long num, int pos, int dim);
void put(char chr, int pos);
void genera_testata(const TIntra_context& ic);
void put(const TRectype& rec, TIntra_context& ic);
TRecord_intra();
virtual ~TRecord_intra() { }
};
// Scrive un campo generico sul record di invio
void TRecord_intra::put(const char* str, int pos, int dim, const char* flags)
{
CHECKD(pos > 0 && pos < size(), "Invalid field position:", pos);
CHECKD(dim > 0 && dim <= 50, "Invalid field dimension:", dim);
TString256 val(str);
if (val.len() < dim)
{
const bool rj = strchr(flags, 'R') != NULL;
const bool zf = strchr(flags, 'Z') != NULL;
if (rj)
val.right_just(dim, zf ? '0' : ' ');
else
val.left_just(dim, zf ? '0' : ' ');
}
else
val.cut(dim);
overwrite(val, pos-1);
}
// Scrive un campo numerico sul record di invio
void TRecord_intra::put(real num, int pos, int dim, int dec)
{
TString80 str;
if (!num.is_zero())
{
num.round(dec);
const bool negativo = num < ZERO;
if (negativo) num *= -1.0;
if (dec < 0)
{
str = num.string(dim-dec, 0, '0');
str.rtrim(-dec);
}
else
{
str = num.string(dim, dec, '0');
}
if (negativo)
str[dim-1] += 64;
}
put(str, pos, dim, "RZ");
}
// Scrive un campo intero sul record di invio
void TRecord_intra::put(long num, int pos, int dim)
{
TString16 str;
str.format("%0*ld", dim, num);
put(str, pos, dim, "RZ");
}
// Scrive un campo carattere sul record di invio
void TRecord_intra::put(char chr, int pos)
{
const char str[2] = { chr, '\0' };
put(str, pos, 1);
}
// Azzera il record
void TRecord_intra::reset(const TIntra_context& ic)
{
spaces();
put("INTRA", 1, 5);
const TRectype& ditta = cache().get(LF_NDITTE, main_app().get_firm());
TString16 cod;
cod << ditta.get_char(NDT_TIPOA) << '|';
cod << ditta.get(NDT_CODANAGR);
const TRectype& anagr = cache().get(LF_ANAG, cod);
put(anagr.get(ANA_PAIV), 6, 11);
put(ic._progr, 17, 6);
}
void TRecord_intra::reset_data()
{
const TString80 key = left(22);
spaces();
overwrite(key, 0);
}
// Scrive la testata con le informazioni della ditta
void TRecord_intra::genera_testata(const TIntra_context& ic)
{
reset(ic);
put('0', 23); // Tipo record frontespizio
put("", 24, 5, "RZ"); // Numero riga (0 per frontespizio)
put(ic._tipo, 29); // Tipo riepilogo
put(ic._anno % 100, 30, 2);
put(ic._freq, 32);
put(ic._periodo, 33, 2);
TString16 cod = mid(5, 11); // Ricopia la parita iva della ditta
put(cod, 35, 11);
const TRectype& ditta = cache().get(LF_NDITTE, main_app().get_firm());
put(ditta.get_bool("PRESELEN") ? '1' : '0', 46);
put(ditta.get_bool("CESSIVA") ? '1' : '0', 47);
cod.cut(0);
cod << ditta.get_char("TIPOSOGDEL") << '|';
cod << ditta.get("CODSOGDEL");
if (cod.len() > 8)
{
const TRectype& sogdel = cache().get(LF_ANAG, cod);
put(sogdel.get(ANA_PAIV), 48, 11);
}
else
put("", 48, 11, "Z");
put(ic._righe_riep, 59, 5);
put(ic._totale_riep, 64, 13, -3);
put(ic._righe_rett, 77, 5);
put(ic._totale_rett, 82, 13, -3);
}
// Scrive un intero record del file riepiloghi/rettifiche
void TRecord_intra::put(const TRectype& rec, TIntra_context& ic)
{
reset_data();
put(rec.get_long("NUMRIG"), 24, 5);
const char tipo = rec.get_char("TIPO");
switch (tipo)
{
case 'A':
put('1', 23);
put(rec.get("STATO"), 29, 2);
put(rec.get("PIVA"), 31, 12);
put(rec.get_real("AMMLIRE"), 43, 13, -3);
put(rec.get_real("AMMVALUTA"), 56, 13);
put(rec.get_char("NATURA"), 69);
put(rec.get("NOMENCL"), 70, 8, "RZ");
if (ic._freq == 'M')
{
put(rec.get_real("MASSAKG"), 78, 10, 0);
put(rec.get_real("MASSAUMS"), 88, 10, 0);
put(rec.get_real("VALSTAT"), 98, 13, -3);
put(rec.get_char("CONSEGNA"), 111);
put(rec.get_char("TRASPORTO"), 112);
put(rec.get("PAESE"), 113, 2);
put(rec.get("PAESEORIG"), 115, 2);
put(rec.get("PROV"), 117, 2);
}
else
put("", 78, 100);
break;
case 'B':
{
put('2', 23);
if (ic._freq == 'M')
put(rec.get("PERETT"), 29, 2, "RZ");
else
put("", 29, 2, "RZ");
if (ic._freq == 'T')
put(rec.get("PERETT")[1], 31);
else
put('0', 31);
put(rec.get("ANNORETT").right(2), 32, 2, "RZ");
put(rec.get("STATO"), 34, 2);
put(rec.get("PIVA"), 36, 12);
put(rec.get("SEGNORETT"), 48, 1);
put(rec.get_real("AMMLIRE"), 49, 13, -3);
put(rec.get_real("AMMVALUTA"), 62, 13);
put(rec.get_char("NATURA"), 75);
put(rec.get("NOMENCL"), 76, 8, "RZ");
if (ic._freq == 'M')
put(rec.get_real("VALSTAT"), 84, 13, -3);
else
put("", 84, 13);
}
break;
case 'C':
put('1', 23);
put(rec.get("STATO"), 29, 2);
put(rec.get("PIVA"), 31, 12);
put(rec.get_real("AMMLIRE"), 43, 13, -3);
put(rec.get_char("NATURA"), 56);
put(rec.get("NOMENCL"), 57, 8, "RZ");
if (ic._freq == 'M')
{
put(rec.get_real("MASSAKG"), 65, 10);
put(rec.get_real("MASSAUMS"), 75, 10);
put(rec.get_real("VALSTAT"), 85, 13, -3);
put(rec.get_char("CONSEGNA"), 98);
put(rec.get_char("TRASPORTO"), 99);
put(rec.get("PAESE"), 100, 2);
put(rec.get("PROV"), 102, 2);
}
else
put("", 65, 100);
break;
case 'D':
{
put('2', 23);
if (ic._freq == 'M')
put(rec.get("PERETT"), 29, 2, "RZ");
else
put("", 29, 2, "RZ");
if (ic._freq == 'T')
put(rec.get("PERETT")[1], 31);
else
put('0', 31);
put(rec.get("ANNORETT").right(2), 32, 2, "RZ");
put(rec.get("STATO"), 34, 2);
put(rec.get("PIVA"), 36, 12);
put(rec.get("SEGNORETT"), 48, 1);
put(rec.get_real("AMMLIRE"), 49, 13, -3);
put(rec.get("NATURA"), 62, 1);
put(rec.get("NOMENCL"), 63, 8, "RZ");
if (ic._freq == 'M')
put(rec.get_real("VALSTAT"), 71, 13, -3);
else
put("", 71, 13);
}
break;
default:
NFCHECK("Record di tipo sconosciuto: %c", tipo);
break;
}
}
// Scrive su file il record
void TRecord_intra::print_on(ostream& o) const
{
((TRecord_intra*)this)->rtrim();
TString::print_on(o);
o << endl;
}
TRecord_intra::TRecord_intra() : TString(132)
{ }
///////////////////////////////////////////////////////////
// TDischetto_mask
///////////////////////////////////////////////////////////
class TDischetto_mask : public TIntra_mask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
virtual short type_field() const { return F_TIPO; }
virtual short period_field() const { return F_PERIODO_M; }
long calcola_totale(TCursor& cur, real& tot) const;
bool write_record(ofstream& out, const TRecord_intra& rec, TIntra_context& ic);
public:
void genera_dischetto();
TDischetto_mask();
};
bool TDischetto_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
{
case F_RIEPILOGHI:
if (e == fe_button)
::genera_riepiloghi(tipo(), get_int(F_ANNO), periodo());
break;
default:break;
}
return TIntra_mask::on_field_event(o, e, jolly);
}
long TDischetto_mask::calcola_totale(TCursor& cur, real& tot) const
{
TWait_cursor arrow;
const long items = cur.items();
cur.freeze();
tot = ZERO;
const TRectype& rec = cur.curr();
for (cur = 0L; cur.pos() < items; ++cur)
{
const char tipo = rec.get_char("TIPO");
const real val = rec.get_real("AMMLIRE");
// Da chiarire: come sommare le rettifiche negative!
if ((tipo == 'B' || tipo == 'D') && rec.get_char("SEGNORETT") == '-')
tot -= val; // Rettifiche negative
else
tot += val;
}
return items;
}
bool TDischetto_mask::write_record(ofstream& out, const TRecord_intra& rec, TIntra_context& ic)
{
out << rec;
bool good = out.good() != 0;
if (good)
ic._written += rec.len()+2;
if (ic._written >= ic._disksize)
{
out.close();
TFilename name;
name = get(F_DISCO); name.add("scambi.cee");
message_box("Inserire un nuovo dischetto prima di continuare.");
out.open(name);
if (out)
{
ic._written = 0;
good = TRUE;
}
}
if (!good)
error_box("Errore di scrittura su disco: ripetere l'operazione.");
return good;
}
void TDischetto_mask::genera_dischetto()
{
TIntra_context ic;
ic._tipo = tipo();
ic._freq = frequenza();
ic._anno = get_int(F_ANNO);
ic._periodo = periodo();
ic._progr = get_long(F_NUMERO);
TRelation rel(LF_RIEPRETT);
TRectype filter(LF_RIEPRETT);
filter.put("TIPO", ic._tipo);
filter.put("ANNO", ic._anno);
filter.put("PERIODO", periodo_str());
TCursor riep(&rel, "", 1, &filter, &filter);
ic._righe_riep = calcola_totale(riep, ic._totale_riep);
filter.put("TIPO", char(ic._tipo+1));
TCursor rett(&rel, "", 1, &filter, &filter);
ic._righe_rett = calcola_totale(rett, ic._totale_rett);
TFilename name;
name = get(F_DISCO); name.add("scambi.cee");
if (name.exist())
{
if (yesno_box("Il file %s, esiste gia': si desiderla eliminarlo?",
(const char*)name))
::remove(name);
}
ofstream out(name, ios::out | ios::app);
if (!out)
{
error_box("Impossibile creare il file %s\n"
"Assicurarsi di avere inserito un dischetto\n"
"formattato e ripetere nuovamente l'operazione.",
(const char*)name);
return;
}
ic._disksize = os_get_disk_size(name) - (64L*1024L);
ic._written = 0;
const long total = ic._righe_riep + ic._righe_rett;
TProgind pi(total, "Generazione scambi.cee", FALSE, TRUE);
TRecord_intra rec;
rec.genera_testata(ic);
out << rec;
rec.reset_data();
for (riep = 0L; riep.pos() < ic._righe_riep; ++riep)
{
pi.addstatus(1);
rec.put(riep.curr(), ic);
if (!write_record(out, rec, ic))
return;
}
rec.reset_data();
for (rett = 0L; rett.pos() < ic._righe_rett; ++rett)
{
pi.addstatus(1);
rec.put(riep.curr(), ic);
if (!write_record(out, rec, ic))
return;
}
}
TDischetto_mask::TDischetto_mask()
: TIntra_mask("in0200a")
{ }
///////////////////////////////////////////////////////////
// TDischetto_app
///////////////////////////////////////////////////////////
class TDischetto_app : public TSkeleton_application
{
protected:
virtual void main_loop();
};
void TDischetto_app::main_loop()
{
TDischetto_mask m;
while (m.run() == K_ENTER)
m.genera_dischetto();
}
int in0200(int argc, char* argv[])
{
TDischetto_app a;
a.run(argc, argv, "Generazione dischetti INTRA");
return 0;
}

9
in/in0200a.h Executable file
View File

@ -0,0 +1,9 @@
#define F_RIEPILOGHI 100
#define F_TIPO 101
#define F_ANNO 102
#define F_PERIODO_M 103
#define F_PERIODO_T 104
#define F_PERIODO_A 105
#define F_DISCO 106
#define F_NUMERO 107

76
in/in0200a.uml Executable file
View File

@ -0,0 +1,76 @@
#include "in0200a.h"
PAGE "Generazione Dischetti INTRA" -1 -1 30 8
LIST F_TIPO 1 10
BEGIN
PROMPT 1 1 "Tipo riepilogo "
ITEM "C|Cessioni"
ITEM "A|Acquisti"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 1 2 "Anno "
FLAGS "AU"
END
NUMBER F_NUMERO 6
BEGIN
PROMPT 15 2 "Numero "
CHECKTYPE REQUIRED
END
LIST F_PERIODO_M 2 17
BEGIN
PROMPT 1 3 "Periodo "
FLAGS "AM"
FIELD PERIODO
END
LIST F_PERIODO_T 2 17
BEGIN
PROMPT 1 3 "Periodo "
ITEM "01|Gennaio-Marzo"
MESSAGE COPY,F_PERIODO_M
ITEM "02|Aprile-Giugno"
MESSAGE COPY,F_PERIODO_M
ITEM "03|Luglio-Settembre"
MESSAGE COPY,F_PERIODO_M
ITEM "04|Ottobre-Dicembre"
MESSAGE COPY,F_PERIODO_M
END
LIST F_PERIODO_A 2 17
BEGIN
PROMPT 1 3 "Periodo "
ITEM "01|Annuale"
MESSAGE COPY,F_PERIODO_M
END
LIST F_DISCO 2
BEGIN
PROMPT 1 4 "Disco destinazione "
ITEM "A:|A:"
ITEM "B:|B:"
ITEM "C:|C:"
END
BUTTON F_RIEPILOGHI 26 1
BEGIN
PROMPT -11 -3 "~Generazione Riepiloghi"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -53,7 +53,7 @@ bool TImmissione_mask::on_field_event(TOperable_field& o, TField_event e, long j
const bool acq = tipo() == 'A';
m.show(-GR_ACQUISTI, acq); // Mostra i gruppi di campi
m.show(-GR_CESSIONI, !acq); // consoni al tipo movimento
/*
const bool req = frequenza() == 'M';
for (int i = m.fields()-1; i >= 0; i--)
{
@ -63,17 +63,24 @@ bool TImmissione_mask::on_field_event(TOperable_field& o, TField_event e, long j
if (f.is_edit())
f.check_type(req ? CHECK_REQUIRED : CHECK_NORMAL);
}
*/
}
break;
break;
case F_VALUTA:
if (e == fe_modify)
{
TEdit_field& cambio = efield(F_CAMBIO);
if (cambio.empty())
{
TCursor* cur = efield(F_VALUTA).browse()->cursor();
cambio.set(cur->curr().get("S4"));
const TRectype& curr = efield(F_VALUTA).browse()->cursor()->curr();
const TString& s = curr.get("S4");
if (s.not_empty())
cambio.set(s);
else
{
const TString& r = curr.get("R0");
cambio.set(r);
}
}
}
break;
@ -105,7 +112,7 @@ bool TImmissione_mask::on_field_event(TOperable_field& o, TField_event e, long j
return on_sheet_event((TSheet_field&)o, e, int(jolly));
case R_RIEPILOGHI:
if (e == fe_button)
genera_riepiloghi();
::genera_riepiloghi(tipo());
break;
default:
if (id < F_DITTA && jolly == 1)
@ -195,7 +202,7 @@ bool TImmissione_intra::user_destroy()
return TRUE;
}
int is0500(int argc, char* argv[])
int in0500(int argc, char* argv[])
{
TImmissione_intra a;
a.run(argc, argv, "Movimenti INTRA");

View File

@ -32,8 +32,7 @@
#define F_MASSA_UMS 106
#define F_UMS 107
#define F_VALORE_STAT 108
#define F_REGIME_C 109
#define F_REGIME_A 209
#define F_CONSEGNA 109
#define F_TRASPORTO 110
#define F_PAESE 111
#define F_PAESE_ORIG 112

View File

@ -126,6 +126,7 @@ LIST F_STATO 2 14
BEGIN
PROMPT 1 6 "Stato CEE "
ITEM " |"
ITEM "AT|Austria"
ITEM "BE|Belgio"
ITEM "DE|Germania"
ITEM "DK|Danimarca"
@ -138,6 +139,7 @@ BEGIN
ITEM "LU|Lussemburgo"
ITEM "NL|Olanda"
ITEM "PT|Portogallo"
ITEM "SE|Svezia"
FLAGS "D"
END
@ -201,8 +203,8 @@ BEGIN
ITEM "Massa Ums@13"
ITEM "U.M."
ITEM "Valore\nStatistico@15"
ITEM "Reg.@3"
ITEM "Modo\nTrasp.@5"
ITEM "Condiz.\nCons.@6"
ITEM "Paese@6"
ITEM "Paese\nOrig.@6"
ITEM "Provincia"
@ -298,29 +300,31 @@ BEGIN
FIELD VALSTAT
END
LIST F_REGIME_C 1 24
STRING F_CONSEGNA 3
BEGIN
PROMPT 36 5 "Regime "
ITEM "1|Spedizione definitiva"
ITEM "2|Spedizione temporanea"
ITEM "3|Rispedizione"
FIELD REGIME
GROUP GR_CESSIONI
END
LIST F_REGIME_A 1 24
BEGIN
PROMPT 36 5 "Regime "
ITEM "4|Introduzione definitiva"
ITEM "5|Introduzione temporanea"
ITEM "6|Reintroduzione"
FIELD REGIME
GROUP GR_ACQUISTI
PROMPT 43 5 "Condizioni consegna "
SHEET "Codice|Descrizione@45"
INPUT F_CONSEGNA
ITEM "EXW|Franco fabbrica"
ITEM "FCA|Franco vettore"
ITEM "FAS|Franco sotto bordo"
ITEM "FOB|Franco a bordo"
ITEM "CFR|Costo e nolo"
ITEM "CIF|Costo, assicurazione, nolo"
ITEM "CPT|Nolo/porto pagato fino a ..."
ITEM "CIP|Nolo/porto e assicurazione pagati fino a ..."
ITEM "DAF|Reso frontiera"
ITEM "DES|Reso franco bordo nave a destino"
ITEM "DEQ|Reso franco banchina"
ITEM "DDU|Reso non sdoganato"
ITEM "DDP|Reso sdoganato"
OUTPUT F_CONSEGNA
FIELD CONSEGNA
END
LIST F_TRASPORTO 1 20
BEGIN
PROMPT 1 6 "Modo di trasporto "
PROMPT 1 6 "Modo di trasporto "
ITEM "1|Marittimo"
ITEM "2|Ferroviario"
ITEM "3|Stradale"
@ -334,20 +338,21 @@ END
TEXT DLG_NULL
BEGIN
PROMPT 1 7 "Pase di destinazione"
PROMPT 1 7 "Pase destinazione"
GROUP GR_CESSIONI
END
TEXT DLG_NULL
BEGIN
PROMPT 1 7 "Pase di provenienza"
PROMPT 1 7 "Pase provenienza"
GROUP GR_ACQUISTI
END
LIST F_PAESE 2 20
BEGIN
PROMPT 22 7 ""
PROMPT 19 7 ""
ITEM " |"
ITEM "AT|Austria"
ITEM "BE|Belgio"
ITEM "DE|Germania"
ITEM "DK|Danimarca"
@ -360,25 +365,13 @@ BEGIN
ITEM "LU|Lussemburgo"
ITEM "NL|Olanda"
ITEM "PT|Portogallo"
ITEM "SE|Svezia"
FIELD PAESE
END
LIST F_PAESE_ORIG 2 20
STRING F_PAESE_ORIG 2
BEGIN
PROMPT 1 8 "Pase di origine "
ITEM " |"
ITEM "BE|Belgio"
ITEM "DE|Germania"
ITEM "DK|Danimarca"
ITEM "EL|Grecia"
ITEM "ES|Spagna"
ITEM "FR|Francia"
ITEM "GB|Gran Bretagna"
ITEM "IE|Irlanda"
ITEM "IT|Italia"
ITEM "LU|Lussemburgo"
ITEM "NL|Olanda"
ITEM "PT|Portogallo"
PROMPT 1 8 "Pase di origine "
FIELD PAESEORIG
GROUP GR_ACQUISTI
END
@ -386,25 +379,25 @@ END
STRING F_PAESE_DUMMY 2
BEGIN
PROMPT 81 8 "Pase anti NFCHECK "
GROUP GR_CESSIONI
FLAGS "D"
END
TEXT DLG_NULL
BEGIN
PROMPT 46 7 "Provincia d'origine "
GROUP GR_CESSIONI
END
TEXT DLG_NULL
BEGIN
PROMPT 46 7 "Prov. destinazione "
PROMPT 43 7 "Provincia d'origine"
GROUP GR_CESSIONI
END
TEXT DLG_NULL
BEGIN
PROMPT 43 7 "Prov. destinazione"
GROUP GR_ACQUISTI
END
STRING F_PROV 2
BEGIN
PROMPT 66 7 ""
PROMPT 64 7 ""
FLAGS "U"
FIELD PROV
END

View File

@ -35,7 +35,7 @@ bool TRiepiloghi_mask::on_field_event(TOperable_field& o, TField_event e, long j
break;
case F_RIEPILOGHI:
if (e == fe_button)
genera_riepiloghi();
::genera_riepiloghi(tipo(), get_int(F_ANNO));
break;
default:
break;
@ -112,7 +112,8 @@ void TRiepiloghi_intra::init_query_mode(TMask& m)
{
TEdit_field& numrig = m.efield(F_NUM_RIG);
TCursor& cur = *numrig.browse()->cursor();
cur.last_item();
if (cur.items() > 0L)
cur.last_item();
const TRectype& curr = cur.curr();
m.set(F_ANNO, curr.get("ANNO"));
m.set(F_TIPO, curr.get("TIPO"), TRUE);
@ -120,7 +121,7 @@ void TRiepiloghi_intra::init_query_mode(TMask& m)
m.set(F_PERIODO_T, curr.get("PERIODO"));
}
int is0600(int argc, char* argv[])
int in0600(int argc, char* argv[])
{
TRiepiloghi_intra a;
a.run(argc, argv, "Riepiloghi INTRA");

View File

@ -1,34 +1,34 @@
#define F_DITTA 301
#define F_DITTA_DESCR 302
#define F_DITTA 301
#define F_DITTA_DESCR 302
#define F_TIPO 303
#define F_ANNO 304
#define F_PERIODO_M 305
#define F_PERIODO_T 306
#define F_PERIODO_A 307
#define F_STATO 308
#define F_TIPO_CF 309
#define F_PARTITA_IVA 310
#define F_PARTITA_DESC 311
#define F_NUM_RIG 312
#define F_RIEPILOGHI 313
#define F_TIPO 303
#define F_ANNO 304
#define F_PERIODO_M 305
#define F_PERIODO_T 306
#define F_PERIODO_A 307
#define F_STATO 308
#define F_TIPO_CF 309
#define F_PARTITA_IVA 310
#define F_PARTITA_DESC 311
#define F_NUM_RIG 312
#define F_RIEPILOGHI 313
#define F_NATURA_TRANS 321
#define F_NATURA_DESCR 322
#define F_NOMENCLATURA 323
#define F_NOMENCL_DESC 324
#define F_REGIME_C 325
#define F_REGIME_A 326
#define F_TRASPORTO 327
#define F_PAESE 328
#define F_PAESE_ORIG 329
#define F_PROV 330
#define F_AMM_LIRE 331
#define F_AMM_VALUTA 332
#define F_VALUTA 333
#define F_VALORE_STAT 334
#define F_MASSA_KG 335
#define F_MASSA_UMS 336
#define F_NATURA_TRANS 321
#define F_NATURA_DESCR 322
#define F_NOMENCLATURA 323
#define F_NOMENCL_DESC 324
#define F_CONSEGNA 325
#define F_CONSEGNA_DESC 326
#define F_TRASPORTO 327
#define F_PAESE 340
#define F_PAESE_ORIG 341
#define F_PROV 342
#define F_AMM_LIRE 350
#define F_AMM_VALUTA 351
#define F_VALUTA 352
#define F_VALORE_STAT 353
#define F_MASSA_KG 354
#define F_MASSA_UMS 355
#define GR_CESSIONI 1
#define GR_ACQUISTI 2

View File

@ -101,7 +101,7 @@ BEGIN
DISPLAY "Partita IVA" PIVA
DISPLAY "Natura" NATURA
DISPLAY "Nomenclatura" NOMENCL
DISPLAY "Regime" REGIME
DISPLAY "Consegna" CONSEGNA
DISPLAY "Trasporto" TRASPORTO
DISPLAY "Paese" PAESE
OUTPUT F_PERIODO_M PERIODO
@ -115,6 +115,7 @@ END
LIST F_STATO 2 16
BEGIN
PROMPT 1 5 "Stato CEE "
ITEM "AT|Austria"
ITEM "BE|Belgio"
ITEM "DE|Germania"
ITEM "DK|Danimarca"
@ -127,6 +128,7 @@ BEGIN
ITEM "LU|Lussemburgo"
ITEM "NL|Olanda"
ITEM "PT|Portogallo"
ITEM "SE|Svezia"
FIELD STATO
END
@ -215,29 +217,38 @@ BEGIN
FLAGS "D"
END
LIST F_REGIME_C 1 24
STRING F_CONSEGNA 3
BEGIN
PROMPT 1 11 "Regime "
ITEM "1|Spedizione definitiva"
ITEM "2|Spedizione temporanea"
ITEM "3|Rispedizione"
GROUP GR_CESSIONI
FIELD REGIME
PROMPT 1 11 "Condiz. consegna "
SHEET "Codice|Descrizione@45"
INPUT F_CONSEGNA
ITEM "EXW|Franco fabbrica"
ITEM "FCA|Franco vettore"
ITEM "FAS|Franco sotto bordo"
ITEM "FOB|Franco a bordo"
ITEM "CFR|Costo e nolo"
ITEM "CIF|Costo, assicurazione, nolo"
ITEM "CPT|Nolo/porto pagato fino a ..."
ITEM "CIP|Nolo/porto e assicurazione pagati fino a ..."
ITEM "DAF|Reso frontiera"
ITEM "DES|Reso franco bordo nave a destino"
ITEM "DEQ|Reso franco banchina"
ITEM "DDU|Reso non sdoganato"
ITEM "DDP|Reso sdoganato"
OUTPUT F_CONSEGNA
OUTPUT F_CONSEGNA_DESC
FIELD CONSEGNA
END
LIST F_REGIME_A 1 24
STRING F_CONSEGNA_DESC 50
BEGIN
PROMPT 1 11 "Regime "
ITEM "4|Introduzione definitiva"
ITEM "5|Introduzione temporanea"
ITEM "6|Reintroduzione"
GROUP GR_ACQUISTI
FIELD REGIME
PROMPT 26 11 ""
FLAGS "D"
END
LIST F_TRASPORTO 1 20
BEGIN
PROMPT 44 11 "Trasporto "
PROMPT 1 12 "Modo di trasporto "
ITEM "1|Marittimo"
ITEM "2|Ferroviario"
ITEM "3|Stradale"
@ -252,20 +263,21 @@ END
TEXT DLG_NULL
BEGIN
PROMPT 1 12 "Pase di destinazione"
PROMPT 1 13 "Pase di destinazione"
GROUP GR_CESSIONI
END
TEXT DLG_NULL
BEGIN
PROMPT 1 12 "Pase di provenienza"
PROMPT 1 13 "Pase di provenienza"
GROUP GR_ACQUISTI
END
LIST F_PAESE 2 20
BEGIN
PROMPT 22 12 ""
PROMPT 22 13 ""
ITEM " |"
ITEM "AT|Austria"
ITEM "BE|Belgio"
ITEM "DE|Germania"
ITEM "DK|Danimarca"
@ -278,44 +290,32 @@ BEGIN
ITEM "LU|Lussemburgo"
ITEM "NL|Olanda"
ITEM "PT|Portogallo"
ITEM "SE|Svezia"
FIELD PAESE
END
LIST F_PAESE_ORIG 2 20
STRING F_PAESE_ORIG 2
BEGIN
PROMPT 1 13 "Pase di origine "
ITEM " |"
ITEM "BE|Belgio"
ITEM "DE|Germania"
ITEM "DK|Danimarca"
ITEM "EL|Grecia"
ITEM "ES|Spagna"
ITEM "FR|Francia"
ITEM "GB|Gran Bretagna"
ITEM "IE|Irlanda"
ITEM "IT|Italia"
ITEM "LU|Lussemburgo"
ITEM "NL|Olanda"
ITEM "PT|Portogallo"
PROMPT 1 14 "Pase di origine "
GROUP GR_ACQUISTI
FIELD PAESEORIG
END
TEXT DLG_NULL
BEGIN
PROMPT 46 12 "Provincia d'origine "
PROMPT 46 13 "Provincia d'origine "
GROUP GR_CESSIONI
END
TEXT DLG_NULL
BEGIN
PROMPT 46 12 "Prov. destinazione "
PROMPT 46 13 "Prov. destinazione "
GROUP GR_ACQUISTI
END
STRING F_PROV 2
BEGIN
PROMPT 66 12 ""
PROMPT 66 13 ""
FLAGS "U"
FIELD PROV
END

View File

@ -101,7 +101,7 @@ bool TRettifiche_intra::user_destroy()
return TRUE;
}
int is0700(int argc, char* argv[])
int in0700(int argc, char* argv[])
{
TRettifiche_intra a;
a.run(argc, argv, "Rettifiche INTRA");

View File

@ -102,7 +102,7 @@ BEGIN
DISPLAY "Partita IVA" PIVA
DISPLAY "Natura" NATURA
DISPLAY "Nomenclatura" NOMENCL
DISPLAY "Regime" REGIME
DISPLAY "Consegna" CONSEGNA
DISPLAY "Trasporto" TRASPORTO
DISPLAY "Paese" PAESE
OUTPUT O_PERIODO_M PERIODO
@ -124,6 +124,7 @@ END
LIST O_STATO 2 16
BEGIN
PROMPT 2 5 "Stato CEE "
ITEM "AT|Austria"
ITEM "BE|Belgio"
ITEM "DE|Germania"
ITEM "DK|Danimarca"
@ -136,6 +137,7 @@ BEGIN
ITEM "LU|Lussemburgo"
ITEM "NL|Olanda"
ITEM "PT|Portogallo"
ITEM "SE|Svezia"
GROUP GR_ORIGINAL
END
@ -312,6 +314,7 @@ END
LIST F_STATO 2 16
BEGIN
PROMPT 2 13 "Stato CEE "
ITEM "AT|Austria"
ITEM "BE|Belgio"
ITEM "DE|Germania"
ITEM "DK|Danimarca"
@ -324,6 +327,7 @@ BEGIN
ITEM "LU|Lussemburgo"
ITEM "NL|Olanda"
ITEM "PT|Portogallo"
ITEM "SE|Svezia"
FIELD STATO
END

View File

@ -47,17 +47,17 @@ char TIntra_mask::frequenza() const
return (t == 'A' || t == 'B') ? _freq_acq : _freq_ces;
}
int TIntra_mask::periodo() const
const char* TIntra_mask::periodo_str() const
{
const short id = period_field();
int pe = 1;
const char* pe = "01";
if (id != DLG_NULL)
{
switch(frequenza())
{
case 'T': pe = get_int(id+1); break;
case 'A': pe = 1; break;
default : pe = get_int(id); break;
case 'M': pe = get(id); break;
case 'T': pe = get(id+1); break;
default : break;
}
}
else
@ -65,6 +65,11 @@ int TIntra_mask::periodo() const
return pe;
}
int TIntra_mask::periodo() const
{
return atoi(periodo_str());
}
bool TIntra_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
if (jolly == 0 && o.dlg() == type_field())
@ -96,7 +101,7 @@ TIntra_mask::TIntra_mask(const char* name)
class TDati_riepilogo : public TSortable
{
TString _key;
TToken_string _key;
TCurrency _ammlire, _ammvaluta;
real _valstat, _massakg, _massaums;
@ -108,8 +113,18 @@ public:
TDati_riepilogo& operator +=(const TDati_riepilogo& r);
void write(TRectype& rec) const;
const TString& stato(TString& c) const { _key.get(0, c); return c; }
const TString& partita_iva(TString& c) const { _key.get(1, c); return c; }
const TString& natura(TString& c) const { _key.get(3, c); return c; }
const TString& nomenclatura(TString& c) const { _key.get(4, c); return c; }
const TString& consegna(TString& c) const { _key.get(5, c); return c; }
const TString& trasporto(TString& c) const { _key.get(6, c); return c; }
const TString& paese(TString& c) const { _key.get(7, c); return c; }
const TString& paese_orig(TString& c) const { _key.get(8, c); return c; }
const TString& provincia(TString& c) const { _key.get(9, c); return c; }
TDati_riepilogo(const TDati_riepilogo& r);
TDati_riepilogo(const TString& key, const TRectype& rec, const TString& codval);
TDati_riepilogo(const TToken_string& key, const TRectype& rec, const TString& codval);
virtual ~TDati_riepilogo() { }
};
@ -131,12 +146,24 @@ TDati_riepilogo& TDati_riepilogo::operator +=(const TDati_riepilogo& r)
void TDati_riepilogo::write(TRectype& rec) const
{
TString str;
rec.put("STATO", stato(str));
rec.put("PIVA", partita_iva(str));
rec.put("NATURA", natura(str));
rec.put("NOMENCL", nomenclatura(str));
rec.put("CONSEGNA", consegna(str));
rec.put("TRASPORTO", trasporto(str));
rec.put("PAESE", paese(str));
rec.put("PAESEORIG", paese_orig(str));
rec.put("PROV", provincia(str));
rec.put("AMMLIRE", _ammlire.get_num());
rec.put("AMMVALUTA", _ammvaluta.get_num());
rec.put("CODVAL", _ammvaluta.get_value());
rec.put("VALSTAT", _valstat);
rec.put("MASSAKG", _massakg);
rec.put("MASSAUMS", _massaums);
}
TDati_riepilogo::TDati_riepilogo(const TDati_riepilogo& r)
@ -145,7 +172,7 @@ TDati_riepilogo::TDati_riepilogo(const TDati_riepilogo& r)
_massakg(r._massakg), _massaums(r._massaums)
{ }
TDati_riepilogo::TDati_riepilogo(const TString& key,
TDati_riepilogo::TDati_riepilogo(const TToken_string& key,
const TRectype& rec,
const TString& codval)
: _key(key), _ammlire(rec.get_real("AMMLIRE"), "_FIRM"),
@ -178,7 +205,8 @@ public:
void TRiepiloghi::add(const TRectype& rec, const TRectype& mov)
{
TString16 cod;
cod << mov.get_char("TIPOCF") << '|' << mov.get_long("CODCF");
const char tipocf = mov.get_char("TIPOCF");
cod << tipocf << '|' << mov.get_long("CODCF");
const TRectype& clifo = cache().get(LF_CLIFO, cod);
cod = mov.get("CODVAL");
@ -189,10 +217,10 @@ void TRiepiloghi::add(const TRectype& rec, const TRectype& mov)
key.add(cod); // Non e' chiaro se raggruppare per valuta!
key.add(rec.get("NATURA"));
key.add(rec.get("NOMENCL"));
key.add(rec.get("REGIME"));
key.add(rec.get("CONSEGNA"));
key.add(rec.get("TRASPORTO"));
key.add(rec.get("PAESE"));
key.add(rec.get("PAESEORIG"));
key.add(rec.get("PAESEORIG")); // Campo solo per Acquisti
key.add(rec.get("PROV"));
TDati_riepilogo* data = (TDati_riepilogo*)_ass.objptr(key);
@ -331,9 +359,28 @@ TGenerazione_mask::TGenerazione_mask()
// Generazione riepiloghi
///////////////////////////////////////////////////////////
void genera_riepiloghi()
void genera_riepiloghi(char tipo, int anno, int periodo)
{
TGenerazione_mask m;
if (m.run() == K_ENTER)
int num_fields = 0;
if (tipo > ' ' )
{
m.set(R_TIPO, tipo);
num_fields++;
}
if (anno > 0)
{
m.set(R_ANNO, anno);
num_fields++;
}
if (periodo > 0)
{
m.set(R_PERIODO_M, periodo);
m.set(R_PERIODO_T, periodo);
num_fields++;
}
if (num_fields == 3 || m.run() == K_ENTER)
m.genera_riepiloghi();
}

View File

@ -20,11 +20,12 @@ public:
char tipo() const;
char frequenza() const;
int periodo() const;
const char* periodo_str() const;
TIntra_mask(const char* name);
virtual ~TIntra_mask() { }
};
void genera_riepiloghi();
void genera_riepiloghi(char tipo = ' ', int anno = 0, int periodo = 0);
#endif

11
in/inprassi.men Executable file
View File

@ -0,0 +1,11 @@
[PRASSIEF_001]
Caption = "Elenchi INTRA comunitari"
Picture = <ba00.bmp>
Module = 34
Flags = ""
Item_01 = "Stampa riepiloghi", "in0 -0", "F"
Item_02 = "Generazione dischetti", "in0 -1", "F"
Item_03 = "Gestione movimenti", "in0 -4", "F"
Item_04 = "Gestione riepiloghi", "in0 -5", "F"
Item_05 = "Gestione rettifiche", "in0 -6", "F"