Patch level : 2.2 399
Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 2.1 598 git-svn-id: svn://10.65.10.50/trunk@13909 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d47d7a30fa
commit
21699c002e
@ -490,6 +490,7 @@ bool TStampaIscritti::user_create()
|
|||||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPDOM);
|
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPDOM);
|
||||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMDOM);
|
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMDOM);
|
||||||
|
|
||||||
|
|
||||||
add_cursor(new TCursor(_rel, "", 3));
|
add_cursor(new TCursor(_rel, "", 3));
|
||||||
_msk = new TMask("at2600a");
|
_msk = new TMask("at2600a");
|
||||||
TConfig config(CONFIG_STUDIO);
|
TConfig config(CONFIG_STUDIO);
|
||||||
@ -502,7 +503,8 @@ bool TStampaIscritti::user_create()
|
|||||||
TFilename iscrtrr = "iscritti";
|
TFilename iscrtrr = "iscritti";
|
||||||
iscrtrr.ext("trr");
|
iscrtrr.ext("trr");
|
||||||
if (iscrtrr.exist())
|
if (iscrtrr.exist())
|
||||||
_fileiscr = new TExternisamfile(iscrname, iscrtrr);
|
_fileiscr = new TExternisamfile(iscrname, iscrtrr, false);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -521,4 +523,4 @@ int at2600(int argc, char* argv[])
|
|||||||
TStampaIscritti a;
|
TStampaIscritti a;
|
||||||
a.run(argc, argv, "Iscritti/dimessi");
|
a.run(argc, argv, "Iscritti/dimessi");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -1252,7 +1252,12 @@ bool TStampaPerCategorie::user_create()
|
|||||||
_sfamiglia = new TRecord_array(LF_FAMIGLIE,FAM_PROGFAM);
|
_sfamiglia = new TRecord_array(LF_FAMIGLIE,FAM_PROGFAM);
|
||||||
add_cursor(new TSorted_cursor(_rel,"SOG_CODSEZ|SOG_CODSOT","",3));
|
add_cursor(new TSorted_cursor(_rel,"SOG_CODSEZ|SOG_CODSOT","",3));
|
||||||
_msk = new TMask("at2700a");
|
_msk = new TMask("at2700a");
|
||||||
_file = new TExternisamfile("$file");
|
TFilename filename = "file";
|
||||||
|
filename.ext("dbf");
|
||||||
|
TFilename filetrr = "file";
|
||||||
|
filetrr.ext("trr");
|
||||||
|
filetrr.custom_path();
|
||||||
|
_file = new TExternisamfile(filename, filetrr, FALSE);
|
||||||
TFilename namepers("filepers");
|
TFilename namepers("filepers");
|
||||||
namepers.ext("dbf");
|
namepers.ext("dbf");
|
||||||
if (namepers.exist())
|
if (namepers.exist())
|
||||||
@ -1294,7 +1299,7 @@ bool TStampaPerCategorie::user_destroy()
|
|||||||
delete _msk;
|
delete _msk;
|
||||||
if (_filepers != NULL)
|
if (_filepers != NULL)
|
||||||
delete _filepers;
|
delete _filepers;
|
||||||
delete _file;
|
delete _file;
|
||||||
delete _sfamiglia;
|
delete _sfamiglia;
|
||||||
delete _sbenemerenze;
|
delete _sbenemerenze;
|
||||||
delete _famiglie;
|
delete _famiglie;
|
||||||
|
@ -237,7 +237,7 @@ bool TFrequenza::filter_func_freq(const TRelation* rel)
|
|||||||
filtrato = (numdon == app()._numdon);
|
filtrato = (numdon == app()._numdon);
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
filtrato = (numdon > 1 && numdon <= app()._numdon);
|
filtrato = (numdon >= 1 && numdon <= app()._numdon);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -585,7 +585,6 @@ bool TFrequenza::user_create()
|
|||||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||||
add_cursor(new TSorted_cursor(_rel, "", "", 3));
|
add_cursor(new TSorted_cursor(_rel, "", "", 3));
|
||||||
_msk = new TMask("at2900a");
|
_msk = new TMask("at2900a");
|
||||||
_file = new TExternisamfile("$file");
|
|
||||||
_donaz = new TLocalisamfile(LF_DONAZ);
|
_donaz = new TLocalisamfile(LF_DONAZ);
|
||||||
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
|
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
|
||||||
TConfig config(CONFIG_STUDIO);
|
TConfig config(CONFIG_STUDIO);
|
||||||
@ -595,6 +594,13 @@ bool TFrequenza::user_create()
|
|||||||
_form_eti = new TEti_freq_form(etformato);
|
_form_eti = new TEti_freq_form(etformato);
|
||||||
_stampa80 = config.get_bool("Stampa80");
|
_stampa80 = config.get_bool("Stampa80");
|
||||||
_form_let = new TEti_freq_form("ATLETTER");
|
_form_let = new TEti_freq_form("ATLETTER");
|
||||||
|
TFilename freqname = "file";
|
||||||
|
freqname.ext("dbf");
|
||||||
|
TFilename freqtrr = "file";
|
||||||
|
freqtrr.ext("trr");
|
||||||
|
freqtrr.custom_path();
|
||||||
|
_file = new TExternisamfile(freqname, freqtrr, FALSE);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
at/file.trr
Executable file
12
at/file.trr
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
1001
|
||||||
|
8
|
||||||
|
CODICE|3|8|0|Codice
|
||||||
|
COGNOME|1|25|0|Cognome
|
||||||
|
NOME|1|25|0|Nome
|
||||||
|
SPOSATA|1|25|0|Cognome da sposata
|
||||||
|
INDIRIZZO|1|30|0|Indirizzo
|
||||||
|
STRADARIO|1|5|0|Stradario
|
||||||
|
PRESSO|1|30|0|Presso
|
||||||
|
LOCALITA|1|80|0|CAP, Localita, Prov.
|
||||||
|
1
|
||||||
|
CODICE|X
|
@ -51,7 +51,7 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
SPREADSHEET F_FIELDS 0 10
|
SPREADSHEET F_FIELDS 0 13
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 0 2 "Fields"
|
PROMPT 0 2 "Fields"
|
||||||
ITEM "Nome@10"
|
ITEM "Nome@10"
|
||||||
@ -63,7 +63,7 @@ END
|
|||||||
|
|
||||||
SPREADSHEET F_KEYS
|
SPREADSHEET F_KEYS
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 0 13 "Keys"
|
PROMPT 0 16 "Keys"
|
||||||
ITEM "Espressione@65"
|
ITEM "Espressione@65"
|
||||||
ITEM "Chiavi duplicate"
|
ITEM "Chiavi duplicate"
|
||||||
END
|
END
|
||||||
|
@ -1401,9 +1401,13 @@ bool TAttivazione_moduli::create()
|
|||||||
{
|
{
|
||||||
bool ok = ::dongle().login(TRUE);
|
bool ok = ::dongle().login(TRUE);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
ok = TApplication::test_assistance_year();
|
ok = TApplication::test_assistance_year();
|
||||||
|
#ifdef DBG
|
||||||
|
if (ok && argc() > 2 && strcmp(argv(2), "-dninst") == 0)
|
||||||
|
ok = false;
|
||||||
|
#endif
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
ok = update_assistance_year();
|
ok = update_assistance_year();
|
||||||
|
@ -35,14 +35,14 @@ HIDDEN void encode_string(char* dninst_key, char* data)
|
|||||||
strcpy(data, tmp);
|
strcpy(data, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN bool build_dninst(const TFilename& name)
|
HIDDEN bool build_dninst()
|
||||||
{
|
{
|
||||||
ifstream inf("dninst.txt", ios::in | ios::nocreate);
|
ifstream inf("dninst.txt", ios::in | ios::nocreate);
|
||||||
if (inf.good())
|
if (inf.good())
|
||||||
{
|
{
|
||||||
char dninst_key[8] = "";
|
char dninst_key[8] = "";
|
||||||
|
|
||||||
ofstream ouf(name, ios::out | ios::binary);
|
ofstream ouf("dninst.zip", ios::out | ios::binary);
|
||||||
char line[256];
|
char line[256];
|
||||||
int year = 0;
|
int year = 0;
|
||||||
while (!inf.eof())
|
while (!inf.eof())
|
||||||
@ -52,9 +52,8 @@ HIDDEN bool build_dninst(const TFilename& name)
|
|||||||
{
|
{
|
||||||
srand(883);
|
srand(883);
|
||||||
year = atoi(line);
|
year = atoi(line);
|
||||||
CHECKD(year >= 2001 && year <= 3001, "Anno errato:", year);
|
CHECKD(year >= 2005 && year <= 3000, "Anno errato:", year);
|
||||||
}
|
}
|
||||||
|
|
||||||
encode_string(dninst_key, line);
|
encode_string(dninst_key, line);
|
||||||
ouf << line << '\n';
|
ouf << line << '\n';
|
||||||
|
|
||||||
@ -111,6 +110,14 @@ HIDDEN int module2number(const TString& mod)
|
|||||||
|
|
||||||
bool update_dninst(bool force)
|
bool update_dninst(bool force)
|
||||||
{
|
{
|
||||||
|
#ifdef DBG
|
||||||
|
if (force && main_app().argc() > 2 && strcmp(main_app().argv(2), "-dninst") == 0)
|
||||||
|
{
|
||||||
|
build_dninst();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const TFilename keys_name = "dninst.zip";
|
const TFilename keys_name = "dninst.zip";
|
||||||
if (force || !keys_name.exist())
|
if (force || !keys_name.exist())
|
||||||
{
|
{
|
||||||
@ -121,17 +128,13 @@ bool update_dninst(bool force)
|
|||||||
remote_name.add(keys_name);
|
remote_name.add(keys_name);
|
||||||
if (remote_name.exist())
|
if (remote_name.exist())
|
||||||
fcopy(remote_name, keys_name);
|
fcopy(remote_name, keys_name);
|
||||||
#ifdef DBG
|
|
||||||
else
|
|
||||||
build_dninst(remote_name); // La cifrature del file avviene solo in DEBUG!
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool update_assistance_year()
|
bool update_assistance_year()
|
||||||
{
|
{
|
||||||
update_dninst(TRUE);
|
update_dninst(true);
|
||||||
|
|
||||||
const TFilename dninst = "dninst.zip";
|
const TFilename dninst = "dninst.zip";
|
||||||
if (dninst.exist())
|
if (dninst.exist())
|
||||||
|
@ -323,6 +323,7 @@ void TReport_properties_mask::set_report(const TReport& r)
|
|||||||
set(F_POSTSCRIPT, r.postscript());
|
set(F_POSTSCRIPT, r.postscript());
|
||||||
|
|
||||||
sfield(F_PARAMS).rows_array() = r.params();
|
sfield(F_PARAMS).rows_array() = r.params();
|
||||||
|
sfield(F_LINK).rows_array() = r.allegates();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TReport_properties_mask::get_report(TReport& r) const
|
void TReport_properties_mask::get_report(TReport& r) const
|
||||||
@ -351,6 +352,7 @@ void TReport_properties_mask::get_report(TReport& r) const
|
|||||||
r.set_postscript(get(F_POSTSCRIPT));
|
r.set_postscript(get(F_POSTSCRIPT));
|
||||||
|
|
||||||
r.set_params(sfield(F_PARAMS).rows_array());
|
r.set_params(sfield(F_PARAMS).rows_array());
|
||||||
|
r.set_allegates(sfield(F_LINK).rows_array());
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -966,8 +968,12 @@ bool TReport_mask::on_field_event(TOperable_field& o, TField_event e, long jolly
|
|||||||
sht.run();
|
sht.run();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
warning_box(TR("Nessuna riga risultato"));
|
{
|
||||||
|
if (sql.find("SELECT ") >= 0)
|
||||||
|
warning_box(TR("Nessuna riga risultato"));
|
||||||
|
}
|
||||||
delete rex;
|
delete rex;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1031,15 +1037,17 @@ TReport_mask::TReport_mask() : _tree(_report), _is_dirty(false)
|
|||||||
|
|
||||||
switch (s)
|
switch (s)
|
||||||
{
|
{
|
||||||
case 1 : rd.set_report_section(_report.section('H', 0)); break;
|
case 1 :
|
||||||
default:
|
rd.set_report_section(_report.section('H', 0));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
_curr_section = &_report.section('B', 1);
|
_curr_section = &_report.section('B', 1);
|
||||||
rd.set_report_section(*_curr_section);
|
rd.set_report_section(*_curr_section);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_tree.goto_node('B',1);
|
_tree.goto_node('B', 1);
|
||||||
const int ih = _tree.image_height();
|
const int ih = _tree.image_height();
|
||||||
if (ih > CHARY)
|
if (ih > CHARY)
|
||||||
albero.set_row_height(ih);
|
albero.set_row_height(ih);
|
||||||
@ -1104,4 +1112,4 @@ int ba8300(int argc, char* argv[])
|
|||||||
TReporter_app app;
|
TReporter_app app;
|
||||||
app.run(argc, argv, TR("Report Generator"));
|
app.run(argc, argv, TR("Report Generator"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -108,9 +108,29 @@ END
|
|||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Allegati" -1 -1 60 16
|
||||||
|
|
||||||
|
SPREADSHEET F_LINK 0 -3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
ITEM "Allegato@50"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
|
||||||
PAGE "Parametri" -1 -1 60 5
|
PAGE "Parametro" -1 -1 60 5
|
||||||
|
|
||||||
STRING 101 15
|
STRING 101 15
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -137,6 +157,32 @@ BEGIN
|
|||||||
PROMPT -33 -1 ""
|
PROMPT -33 -1 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
||||||
|
|
||||||
|
PAGE "Allegato" -1 -1 70 5
|
||||||
|
|
||||||
|
STRING 101 256 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Allegato "
|
||||||
|
FSELECT ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -13 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_DELREC 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -23 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -33 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
|
@ -122,4 +122,3 @@ Caption = "Preferiti"
|
|||||||
Picture = <ba00>
|
Picture = <ba00>
|
||||||
Module = 0
|
Module = 0
|
||||||
Flags = ""
|
Flags = ""
|
||||||
|
|
||||||
|
16
ba/batbdet.h
Executable file
16
ba/batbdet.h
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#define F_CODICE 101
|
||||||
|
#define F_DESC 102
|
||||||
|
#define F_TIPO 103
|
||||||
|
#define F_DESCTIPO 104
|
||||||
|
#define F_PERC 105
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
82
ba/batbdet.uml
Executable file
82
ba/batbdet.uml
Executable file
@ -0,0 +1,82 @@
|
|||||||
|
#include "batbdet.h"
|
||||||
|
|
||||||
|
TOOLBAR "" 0 -3 0 3
|
||||||
|
|
||||||
|
#include <toolbar.h>
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "@bCodici Indetrabilita'" -1 -1 78 15
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 78 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Codice Indetrabilita'"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CODICE 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 2 ""
|
||||||
|
FIELD CODTAB
|
||||||
|
USE %DET
|
||||||
|
INPUT CODTAB F_CODICE
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Percentuale" R0
|
||||||
|
DISPLAY "Descrizione@50" S0
|
||||||
|
OUTPUT F_CODICE CODTAB
|
||||||
|
OUTPUT F_DESC S0
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
KEY 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 10 2 "Descrizione "
|
||||||
|
FIELD S0
|
||||||
|
USE %DET KEY 2
|
||||||
|
INPUT CODTAB F_CODICE
|
||||||
|
DISPLAY "Descrizione@50" S0
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Percentuale" R0
|
||||||
|
COPY OUTPUT F_CODICE
|
||||||
|
KEY 2
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 78 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 5 "@bPercentuale"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_TIPO 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 6 "Tipo "
|
||||||
|
SHEET "Codice|Tipo indetraibilita'@75"
|
||||||
|
INPUT F_TIPO
|
||||||
|
ITEM "1|IVA indetraibile su acquisti riferiti a ricavi esenti"
|
||||||
|
ITEM "3|IVA indicata per passaggi interni al solo fine del calcolo di ventilazione"
|
||||||
|
ITEM "9|IVA non detraibile per l'articolo 19"
|
||||||
|
OUTPUT F_TIPO
|
||||||
|
OUTPUT F_DESCTIPO
|
||||||
|
FIELD I0
|
||||||
|
CHEKCTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCTIPO 75 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 6 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_PERC 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 7 "Indetraibilita' "
|
||||||
|
NUM_EXPR #F_PERC<=100
|
||||||
|
WARNING "Percentuale non valida"
|
||||||
|
FLAGS "U"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
FIELD R0
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
3
ba/f155.dir
Executable file
3
ba/f155.dir
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
155
|
||||||
|
0
|
||||||
|
$multirel|0|0|96|0|Relazione molti a molti|||
|
9
ba/f155.trr
Executable file
9
ba/f155.trr
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
155
|
||||||
|
4
|
||||||
|
COD|1|5|0|Codice relazione
|
||||||
|
FIRST|1|20|0|Primo elemento
|
||||||
|
SECOND|1|20|0|Secondo elemento
|
||||||
|
DATA|1|50|0|Dati
|
||||||
|
2
|
||||||
|
COD+FIRST+SECOND|
|
||||||
|
COD+SECOND+FIRST|
|
@ -14,6 +14,7 @@ int main(int argc,char** argv)
|
|||||||
case 5: ce3600(argc,argv) ; break; // Stampa lista movimenti cespiti
|
case 5: ce3600(argc,argv) ; break; // Stampa lista movimenti cespiti
|
||||||
case 6: ce3700(argc,argv) ; break; // Stampa elenco cespiti promisqui :-)
|
case 6: ce3700(argc,argv) ; break; // Stampa elenco cespiti promisqui :-)
|
||||||
case 7: ce3800(argc,argv) ; break; // Stampa elenco cespiti etero :-)
|
case 7: ce3800(argc,argv) ; break; // Stampa elenco cespiti etero :-)
|
||||||
|
case 8: ce3900(argc,argv) ; break; // Stampa sintetica cespiti (sintetica = leggibile) :-)
|
||||||
default: ce3100(argc,argv) ; break; // Stampa registro cespiti
|
default: ce3100(argc,argv) ; break; // Stampa registro cespiti
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
1
ce/ce3.h
1
ce/ce3.h
@ -9,6 +9,7 @@ int ce3500(int argc, char* argv[]);
|
|||||||
int ce3600(int argc, char* argv[]);
|
int ce3600(int argc, char* argv[]);
|
||||||
int ce3700(int argc, char* argv[]);
|
int ce3700(int argc, char* argv[]);
|
||||||
int ce3800(int argc, char* argv[]);
|
int ce3800(int argc, char* argv[]);
|
||||||
|
int ce3900(int argc, char* argv[]);
|
||||||
|
|
||||||
#endif // __CE3_H
|
#endif // __CE3_H
|
||||||
|
|
||||||
|
255
ce/ce3900.cpp
Executable file
255
ce/ce3900.cpp
Executable file
@ -0,0 +1,255 @@
|
|||||||
|
#include <applicat.h>
|
||||||
|
#include <automask.h>
|
||||||
|
#include <execp.h>
|
||||||
|
#include <progind.h>
|
||||||
|
#include <recarray.h>
|
||||||
|
#include <recset.h>
|
||||||
|
#include <reprint.h>
|
||||||
|
|
||||||
|
#include "../cg/cglib01.h"
|
||||||
|
|
||||||
|
#include "ammce.h"
|
||||||
|
#include "movce.h"
|
||||||
|
#include "salce.h"
|
||||||
|
#include "celib.h"
|
||||||
|
|
||||||
|
#include "ce3.h"
|
||||||
|
#include "ce3900.h"
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
// MASCHERA
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
class TStampa_sintetica_mask : public TAutomask
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
|
|
||||||
|
public:
|
||||||
|
TStampa_sintetica_mask();
|
||||||
|
virtual ~TStampa_sintetica_mask() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
bool TStampa_sintetica_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
switch (o.dlg())
|
||||||
|
{
|
||||||
|
case F_FROM_CAT:
|
||||||
|
case F_D_FROM_CAT:
|
||||||
|
case F_TO_CAT:
|
||||||
|
case F_D_TO_CAT:
|
||||||
|
{
|
||||||
|
TDitta_cespiti& dc = ditta_cespiti();
|
||||||
|
ok = dc.on_category_event(o, e, jolly);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case F_ESERCIZIO:
|
||||||
|
case F_GRUPPO:
|
||||||
|
case F_SPECIE:
|
||||||
|
if (e == fe_init || e == fe_modify)
|
||||||
|
{
|
||||||
|
const TString& esercizio = get(F_ESERCIZIO);
|
||||||
|
const TString& gruppo = get(F_GRUPPO);
|
||||||
|
const TString& specie = get(F_SPECIE);
|
||||||
|
TString16 key; key << esercizio << gruppo << specie;
|
||||||
|
TRelation ccb("CCB");
|
||||||
|
ccb.curr().put("CODTAB", key);
|
||||||
|
if (ccb.read() == NOERR)
|
||||||
|
autoload(ccb);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TStampa_sintetica_mask::TStampa_sintetica_mask()
|
||||||
|
:TAutomask("ce3900")
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
// RECORDSET
|
||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TStampa_sintetica_recordset : public TISAM_recordset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void set_filter(const TStampa_sintetica_mask& msk);
|
||||||
|
TStampa_sintetica_recordset(const TString& sql) : TISAM_recordset(sql) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const TStampa_sintetica_recordset* myself = NULL;
|
||||||
|
|
||||||
|
//metodo per caricare i valori nel recordset dalla maschera...fighissimo!!
|
||||||
|
void TStampa_sintetica_recordset::set_filter(const TStampa_sintetica_mask& msk)
|
||||||
|
{
|
||||||
|
const TString& dacat = msk.get(F_FROM_CAT);
|
||||||
|
const TString& acat = msk.get(F_TO_CAT);
|
||||||
|
TString query = "USE CESPI";
|
||||||
|
if (dacat.full() || acat.full())
|
||||||
|
{
|
||||||
|
query << " SELECT ";
|
||||||
|
if (dacat == acat)
|
||||||
|
{
|
||||||
|
query << "CODCAT==" << dacat;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (dacat.full())
|
||||||
|
query << "(CODCAT>=" << dacat << ")";
|
||||||
|
if (acat.full())
|
||||||
|
{
|
||||||
|
if (dacat.full())
|
||||||
|
query << "&&";
|
||||||
|
query << "(CODCAT<=" << acat << ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
query << "\nBY CODCAT|IDCESPITE";
|
||||||
|
set(query); //setta la nuova query nel report (che avrebbe solo USE CESPI)
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
// REPORT
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
class TStampa_sintetica_rep : public TReport
|
||||||
|
{
|
||||||
|
int _anno;
|
||||||
|
protected:
|
||||||
|
virtual bool get_usr_val(const TString& name, TVariant& var) const;
|
||||||
|
public:
|
||||||
|
void set_filter(const TStampa_sintetica_mask& msk);
|
||||||
|
};
|
||||||
|
|
||||||
|
void TStampa_sintetica_rep::set_filter(const TStampa_sintetica_mask& msk)
|
||||||
|
{
|
||||||
|
_anno = msk.get_int(F_ESERCIZIO);
|
||||||
|
((TStampa_sintetica_recordset*) recordset())->set_filter(msk);
|
||||||
|
}
|
||||||
|
|
||||||
|
//metodo per il calcolo dei campi da calcolare (ma va'!) nel report
|
||||||
|
bool TStampa_sintetica_rep::get_usr_val(const TString& name, TVariant& var) const
|
||||||
|
{
|
||||||
|
const TRecordset& recset = *recordset();
|
||||||
|
const TString& idcespite = recset.get("IDCESPITE").as_string();
|
||||||
|
if (name == "#DESCAT") //categoria (descrizione della categoria corrente)
|
||||||
|
{
|
||||||
|
const int gruppo = recset.get("CODCGRA").as_int();
|
||||||
|
const TString& specie = recset.get("CODSPA").as_string();
|
||||||
|
const int categoria = recset.get("CODCAT").as_int();
|
||||||
|
const TRectype& rec_cac = ditta_cespiti().categoria(gruppo, specie, categoria);
|
||||||
|
var = rec_cac.get("S0");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (name == "#ALIENAZ") //movimenti di vendita
|
||||||
|
{
|
||||||
|
//cerca tutti i movimenti di vendita relativi al cespite corrente all'interno dell'esercizio..
|
||||||
|
//..selezionato sulla maschera;somma i loro importi in modo da ricavare l'importo complessivo..
|
||||||
|
//..di tutti
|
||||||
|
TString query;
|
||||||
|
|
||||||
|
TEsercizi_contabili esc;
|
||||||
|
const TDate& dataini = esc[_anno].inizio();
|
||||||
|
const TDate& datafine = esc[_anno].fine();
|
||||||
|
|
||||||
|
query.format("USE MOVCE KEY 2 SELECT NUM(ANSI(DTMOV)>=%ld)&&NUM(ANSI(DTMOV)<=%ld)\nFROM IDCESPITE=%s\nTO IDCESPITE=%s",
|
||||||
|
dataini.date2ansi(), datafine.date2ansi(), (const char*)idcespite, (const char*)idcespite);
|
||||||
|
TISAM_recordset isam(query);
|
||||||
|
real somma_vendite;
|
||||||
|
for (TRecnotype i = 0; isam.move_to(i); i++)
|
||||||
|
{
|
||||||
|
const real vendita = isam.get(MOVCE_IMPVEN).as_real();
|
||||||
|
somma_vendite += vendita;
|
||||||
|
}
|
||||||
|
var = somma_vendite;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (name == "#COSTO") //costo
|
||||||
|
{
|
||||||
|
TToken_string key;
|
||||||
|
key = idcespite; //cespite
|
||||||
|
key.add(_anno); //esercizio
|
||||||
|
key.add(1); //tiposaldo finale
|
||||||
|
const TRectype& rec_salce = cache().get(LF_SALCE, key);
|
||||||
|
const real costo = rec_salce.get_real(SALCE_CSTO);
|
||||||
|
var = costo;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (name == "#PERCAMM") //percentuale ammortamento
|
||||||
|
{
|
||||||
|
TToken_string key;
|
||||||
|
key = idcespite;
|
||||||
|
key.add(_anno);
|
||||||
|
key.add(2); //tiposaldo finale
|
||||||
|
key.add(1); //tipoamm fiscale
|
||||||
|
const TRectype& rec_ammce = cache().get(LF_AMMCE, key);
|
||||||
|
const real percamm = rec_ammce.get_real(AMMCE_PNOR) + rec_ammce.get_real(AMMCE_PACC) + rec_ammce.get_real(AMMCE_PANT);
|
||||||
|
var = percamm;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (name == "#QAMM") //fondo ammortamento esercizio corrente
|
||||||
|
{
|
||||||
|
TToken_string key;
|
||||||
|
key = idcespite;
|
||||||
|
key.add(_anno);
|
||||||
|
key.add(2); //tiposaldo finale
|
||||||
|
key.add(1); //tipoamm fiscale
|
||||||
|
const TRectype& rec_ammce = cache().get(LF_AMMCE, key);
|
||||||
|
const real quotamm = rec_ammce.get_real(AMMCE_QNOR) + rec_ammce.get_real(AMMCE_QACC) + rec_ammce.get_real(AMMCE_QANT);
|
||||||
|
var = quotamm;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (name == "#FAMM") //fondo ammortamento alla fine dell'esercizio precedente
|
||||||
|
{
|
||||||
|
TToken_string key;
|
||||||
|
key = idcespite;
|
||||||
|
key.add(_anno);
|
||||||
|
key.add(1); //tiposaldo iniziale
|
||||||
|
key.add(1); //tipoamm fiscale
|
||||||
|
const TRectype& rec_ammce = cache().get(LF_AMMCE, key);
|
||||||
|
const real quotamm = rec_ammce.get_real(AMMCE_QNOR) + rec_ammce.get_real(AMMCE_QACC) + rec_ammce.get_real(AMMCE_QANT);
|
||||||
|
var = quotamm;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TReport::get_usr_val(name, var);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
// APPLICAZIONE
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
class TStampa_sintetica : public TSkeleton_application
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual void main_loop();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void TStampa_sintetica::main_loop()
|
||||||
|
{
|
||||||
|
TStampa_sintetica_mask mask;
|
||||||
|
while (mask.run() == K_ENTER)
|
||||||
|
{
|
||||||
|
//report e book dei report
|
||||||
|
TReport_book book;
|
||||||
|
TStampa_sintetica_rep rep;
|
||||||
|
rep.load("ce3900a");
|
||||||
|
|
||||||
|
rep.set_filter(mask);
|
||||||
|
book.add(rep);
|
||||||
|
|
||||||
|
book.print_or_preview(); //stampa il book dei report
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int ce3900(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
TStampa_sintetica a;
|
||||||
|
a.run(argc, argv, TR("Stampa sintetica cespiti"));
|
||||||
|
return 0;
|
||||||
|
}
|
19
ce/ce3900.h
Executable file
19
ce/ce3900.h
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
//campi maschera ce3900.uml
|
||||||
|
#define F_CODDITTA 101
|
||||||
|
#define F_RAGSOC 102
|
||||||
|
#define F_ESERCIZIO 103
|
||||||
|
#define F_DATAINIZIO 104
|
||||||
|
#define F_DATAFINE 105
|
||||||
|
#define F_GRUPPO 106
|
||||||
|
#define F_SPECIE 107
|
||||||
|
#define F_D_GRUPPO 108
|
||||||
|
#define F_D_SPECIE 109
|
||||||
|
#define F_CODTAB 110
|
||||||
|
#define F_D_CODTAB 111
|
||||||
|
|
||||||
|
#define F_FROM_CAT 112
|
||||||
|
#define F_D_FROM_CAT 113
|
||||||
|
#define F_TO_CAT 114
|
||||||
|
#define F_D_TO_CAT 115
|
||||||
|
|
||||||
|
#define F_REPORT 116
|
151
ce/ce3900.uml
Executable file
151
ce/ce3900.uml
Executable file
@ -0,0 +1,151 @@
|
|||||||
|
#include "ce3900.h"
|
||||||
|
|
||||||
|
TOOLBAR "" 0 -3 0 3
|
||||||
|
|
||||||
|
BUTTON DLG_PRINT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -11 "~Stampa"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -11 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Lista sintetica cespiti" -1 -1 78 6
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 78 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 0 ""
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_CODDITTA 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 1 "Ditta "
|
||||||
|
FLAGS "DF"
|
||||||
|
USE LF_NDITTE
|
||||||
|
INPUT CODDITTA F_CODDITTA
|
||||||
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOC 55
|
||||||
|
BEGIN
|
||||||
|
PROMPT 20 1 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_ESERCIZIO 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 2 "Esercizio "
|
||||||
|
FLAGS "Z"
|
||||||
|
USE CCE
|
||||||
|
JOIN ESC ALIAS 105 INTO CODTAB==CODTAB
|
||||||
|
INPUT CODTAB F_ESERCIZIO
|
||||||
|
DISPLAY "Codice esercizio" CODTAB
|
||||||
|
DISPLAY "Data inizio@15" 105@->D0
|
||||||
|
DISPLAY "Data fine@15" 105@->D1
|
||||||
|
OUTPUT F_ESERCIZIO CODTAB
|
||||||
|
OUTPUT F_DATAINIZIO 105@->D0
|
||||||
|
OUTPUT F_DATAFINE 105@->D1
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
FIELD CODTAB[1,4]
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAINIZIO
|
||||||
|
BEGIN
|
||||||
|
PROMPT 20 2 "Data inizio "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAFINE
|
||||||
|
BEGIN
|
||||||
|
PROMPT 45 2 "Data fine "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_GRUPPO 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 3 "Gruppo "
|
||||||
|
FLAGS "Z"
|
||||||
|
USE CCB KEY 1
|
||||||
|
JOIN %CGR ALIAS 106 INTO CODTAB==CODTAB[5,6]
|
||||||
|
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||||
|
INPUT CODTAB[5,6] F_GRUPPO
|
||||||
|
INPUT CODTAB[7,10] F_SPECIE
|
||||||
|
DISPLAY "Codice" CODTAB[5,6]
|
||||||
|
DISPLAY "Descrizione@60" 106@->S0
|
||||||
|
OUTPUT F_GRUPPO CODTAB[5,6]
|
||||||
|
OUTPUT F_D_GRUPPO 106@->S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
FIELD CODTAB[5,6]
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_SPECIE 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "Specie "
|
||||||
|
FLAGS "_"
|
||||||
|
USE CCB KEY 1
|
||||||
|
JOIN %CAT ALIAS 107 INTO CODTAB[1,2]==CODTAB[5,6] CODTAB[3,6]==CODTAB[7,10]
|
||||||
|
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||||
|
INPUT CODTAB[5,6] F_GRUPPO SELECT
|
||||||
|
INPUT CODTAB[7,10] F_SPECIE
|
||||||
|
DISPLAY "Gruppo" CODTAB[5,6]
|
||||||
|
DISPLAY "Specie" CODTAB[7,10]
|
||||||
|
DISPLAY "Descrizione@60" 107@->S0
|
||||||
|
OUTPUT F_SPECIE CODTAB[7,10]
|
||||||
|
OUTPUT F_D_SPECIE 107@->S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
FIELD CODTAB[7,10]
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_GRUPPO 60 55
|
||||||
|
BEGIN
|
||||||
|
PROMPT 20 3 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_SPECIE 60 55
|
||||||
|
BEGIN
|
||||||
|
PROMPT 20 4 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 78 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 6 "@bSelezione categoria"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_FROM_CAT 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 7 "Dalla "
|
||||||
|
FLAGS "BZ"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_FROM_CAT 60 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 25 7 ""
|
||||||
|
FLAGS "B"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_TO_CAT 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 8 "Alla "
|
||||||
|
FLAGS "BZ"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_TO_CAT 60 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 25 8 ""
|
||||||
|
FLAGS "B"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
104
ce/ce3900a.rep
Executable file
104
ce/ce3900a.rep
Executable file
@ -0,0 +1,104 @@
|
|||||||
|
|
||||||
|
<report name="ce3900a" lpi="6">
|
||||||
|
<description>Lista sintetica cespiti</description>
|
||||||
|
<font face="Courier New" size="8" />
|
||||||
|
<section type="Head">
|
||||||
|
<font face="Courier New" bold="1" size="8" />
|
||||||
|
</section>
|
||||||
|
<section type="Head" level="1" height="6">
|
||||||
|
<field border="1" radius="100" x="18" y="0.5" type="Testo" valign="center" align="center" shade_offset="25" width="130" height="2.5" text="LISTA SINTETICA CESPITI">
|
||||||
|
<font face="Courier New" bold="1" size="16" />
|
||||||
|
</field>
|
||||||
|
<field border="2" y="4" type="Linea" width="176" height="0" pattern="1" />
|
||||||
|
<field x="1" y="4.5" type="Stringa" width="50" pattern="1">
|
||||||
|
<font italic="1" face="Courier New" bold="1" size="9" />
|
||||||
|
<source>#SYSTEM.RAGSOC</source>
|
||||||
|
</field>
|
||||||
|
<field x="79" y="4.5" type="Data" width="10" pattern="1">
|
||||||
|
<source>#SYSTEM.DATE</source>
|
||||||
|
</field>
|
||||||
|
<field x="157" y="4.5" type="Numero" align="right" width="3" pattern="1">
|
||||||
|
<source>#REPORT.PAGE</source>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section repeat="1" type="Head" level="2">
|
||||||
|
<groupby>CODCAT</groupby>
|
||||||
|
<font face="Courier New" bold="1" size="8" />
|
||||||
|
<field x="1" type="Testo" width="12" pattern="1" text="Categoria:">
|
||||||
|
<font face="Courier New" bold="1" size="9" />
|
||||||
|
</field>
|
||||||
|
<field x="16" type="Stringa" width="70" pattern="1">
|
||||||
|
<font face="Courier New" bold="1" size="9" />
|
||||||
|
<source>#DESCAT</source>
|
||||||
|
</field>
|
||||||
|
<field x="157" y="0.75" type="Testo" align="justify" width="12" height="3" pattern="1" text="Valore residuo da ammortizzare" />
|
||||||
|
<field x="24" y="1" type="Testo" align="center" width="10" pattern="1" text="Date" />
|
||||||
|
<field x="89.5" y="1" type="Testo" width="8" pattern="1" text="Valori" />
|
||||||
|
<field x="126.5" y="1" type="Testo" width="20" pattern="1" text="Fondo Ammortamento" />
|
||||||
|
<field x="1" y="2" type="Testo" width="10" pattern="1" text="Codice" />
|
||||||
|
<field x="11" y="2" type="Testo" width="11" pattern="1" text="Alienazione" />
|
||||||
|
<field x="24" y="2" type="Testo" width="10" pattern="1" text="Acquisto" />
|
||||||
|
<field x="34.5" y="2" type="Testo" width="10" pattern="1" text="Entr. Funz." />
|
||||||
|
<field x="46" y="2" type="Testo" width="30" pattern="1" text="Descrizione" />
|
||||||
|
<field x="72" y="2" type="Testo" align="right" width="12" pattern="1" text="Acquisizione" />
|
||||||
|
<field x="85" y="2" type="Testo" align="right" width="12" pattern="1" text="Alienazioni" />
|
||||||
|
<field x="98" y="2" type="Testo" align="right" width="12" pattern="1" text="Aggiornato" />
|
||||||
|
<field x="112" y="2" type="Testo" align="right" width="4" pattern="1" text="%Amm" />
|
||||||
|
<field x="118" y="2" type="Testo" align="right" width="12" pattern="1" text="Es. corrente" />
|
||||||
|
<field x="131" y="2" type="Testo" align="right" width="12" pattern="1" text="Fine es.prec" />
|
||||||
|
<field x="143" y="2" type="Testo" align="right" width="12" pattern="1" text="Totale" />
|
||||||
|
<field border="1" x="1" y="3" type="Linea" width="172" height="0" pattern="1" />
|
||||||
|
<field x="13" type="Numero" align="right" width="2" id="101" pattern="1">
|
||||||
|
<font face="Courier New" bold="1" size="9" />
|
||||||
|
<source>CODCAT</source>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section type="Body" />
|
||||||
|
<section type="Body" level="1">
|
||||||
|
<field type="Stringa" width="10" pattern="1">
|
||||||
|
<source>IDCESPITE</source>
|
||||||
|
</field>
|
||||||
|
<field x="11.5" type="Data" width="10" pattern="1">
|
||||||
|
<source>DTALIEN</source>
|
||||||
|
</field>
|
||||||
|
<field x="23" type="Data" width="10" pattern="1">
|
||||||
|
<source>DTCOMP</source>
|
||||||
|
</field>
|
||||||
|
<field x="34.5" type="Data" width="10" pattern="1">
|
||||||
|
<source>DTFUNZ</source>
|
||||||
|
</field>
|
||||||
|
<field x="46" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
|
||||||
|
<source>DESC</source>
|
||||||
|
</field>
|
||||||
|
<field x="112" type="Numero" align="right" width="4" pattern="1">
|
||||||
|
<source>#PERCAMM</source>
|
||||||
|
</field>
|
||||||
|
<field x="98" type="Valuta" align="right" width="12" id="101" pattern="1" text="#########,@@">
|
||||||
|
<source>#COSTO</source>
|
||||||
|
</field>
|
||||||
|
<field x="85" type="Valuta" align="right" width="12" id="102" pattern="1" text="#########,@@">
|
||||||
|
<source>#ALIENAZ</source>
|
||||||
|
</field>
|
||||||
|
<field x="72" type="Valuta" align="right" width="12" id="103" pattern="1" text="###.###.###,@@">
|
||||||
|
<source>#101-#102</source>
|
||||||
|
</field>
|
||||||
|
<field x="118" type="Numero" align="right" width="12" id="104" pattern="1">
|
||||||
|
<source>#QAMM</source>
|
||||||
|
</field>
|
||||||
|
<field x="131" type="Numero" align="right" width="12" id="105" pattern="1">
|
||||||
|
<source>#FAMM</source>
|
||||||
|
</field>
|
||||||
|
<field x="144" type="Numero" align="right" width="12" id="106" pattern="1">
|
||||||
|
<source>#104+#105</source>
|
||||||
|
</field>
|
||||||
|
<field x="157" type="Numero" align="right" width="12" id="107" pattern="1">
|
||||||
|
<source>#101-#106</source>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section type="Foot" />
|
||||||
|
<section type="Foot" level="1" />
|
||||||
|
<section type="Foot" level="2" height="1">
|
||||||
|
<field border="1" x="1" y="0.5" type="Linea" width="196" height="0" pattern="1" />
|
||||||
|
</section>
|
||||||
|
<sql>USE CESPI KEY 2</sql>
|
||||||
|
</report>
|
@ -105,9 +105,10 @@ Picture = <ce00>
|
|||||||
Module = 11
|
Module = 11
|
||||||
Flags = ""
|
Flags = ""
|
||||||
Item_01 = "Lista cespiti", "ce3 -4", "F"
|
Item_01 = "Lista cespiti", "ce3 -4", "F"
|
||||||
Item_02 = "Lista movimenti", "ce3 -5", "F"
|
Item_02 = "Lista cespiti sintetica", "ce3 -8", "F"
|
||||||
Item_03 = "Lista cespiti ad uso promiscuo", "ce3 -6", "F"
|
Item_03 = "Lista movimenti", "ce3 -5", "F"
|
||||||
Item_04 = "Lista cespiti a fine esercizio", "ce3 -7", "F"
|
Item_04 = "Lista cespiti ad uso promiscuo", "ce3 -6", "F"
|
||||||
|
Item_05 = "Lista cespiti a fine esercizio", "ce3 -7", "F"
|
||||||
|
|
||||||
[CEMENU_011]
|
[CEMENU_011]
|
||||||
Caption = "Stampe di fine esercizio"
|
Caption = "Stampe di fine esercizio"
|
||||||
@ -118,6 +119,7 @@ Item_01 = "Scheda storico cespite", "ce3 -1", "F"
|
|||||||
Item_02 = "Prospetto cespiti", "ce3 -2", "F"
|
Item_02 = "Prospetto cespiti", "ce3 -2", "F"
|
||||||
Item_03 = "Prospetto rivalutazioni", "ce3 -3", "F"
|
Item_03 = "Prospetto rivalutazioni", "ce3 -3", "F"
|
||||||
Item_04 = "Registro cespiti", "ce3 -0", "F"
|
Item_04 = "Registro cespiti", "ce3 -0", "F"
|
||||||
|
Item_05 = "Registro cespiti sintetico", "ce3 -8", "F"
|
||||||
|
|
||||||
[CEMENU_012]
|
[CEMENU_012]
|
||||||
Caption = "Servizi"
|
Caption = "Servizi"
|
||||||
|
@ -450,7 +450,7 @@ bool TPrimanota_application::force_mask_swap(const TCausale& old_caus, const TCa
|
|||||||
// Salvo la maschera corrente in un apposito file temporaneo "cg2100.ini"
|
// Salvo la maschera corrente in un apposito file temporaneo "cg2100.ini"
|
||||||
TFilename tmp; get_mask_swap_file(tmp);
|
TFilename tmp; get_mask_swap_file(tmp);
|
||||||
TConfig ini(tmp);
|
TConfig ini(tmp);
|
||||||
mask2ini(old, ini);
|
TRelation_application::mask2ini(old, ini); // Non devo salvare le righe degli sheet
|
||||||
|
|
||||||
ini.set_paragraph("23");
|
ini.set_paragraph("23");
|
||||||
ini.remove(MOV_NUMREG); // Tolgo numero di registrazione provvisorio
|
ini.remove(MOV_NUMREG); // Tolgo numero di registrazione provvisorio
|
||||||
@ -1699,13 +1699,8 @@ void TPrimanota_application::mask2ini(const TMask& msk, TConfig& ini)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
for ( ; ; i++)
|
for ( ; ini.set_paragraph(format("%d,%d", LF_RMOV, i+1)); i++)
|
||||||
{
|
ini.remove_all();
|
||||||
if (ini.set_paragraph(format("%d,%d", LF_RMOV, i+1)))
|
|
||||||
ini.remove_all();
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < _rel->iva_items(); i++)
|
for (i = 0; i < _rel->iva_items(); i++)
|
||||||
{
|
{
|
||||||
@ -1717,13 +1712,8 @@ void TPrimanota_application::mask2ini(const TMask& msk, TConfig& ini)
|
|||||||
ini.set(name, rec.get(name));
|
ini.set(name, rec.get(name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ( ; ; i++)
|
for ( ; ini.set_paragraph(format("%d,%d", LF_RMOVIVA, i+1)); i++)
|
||||||
{
|
ini.remove_all();
|
||||||
if (ini.set_paragraph(format("%d,%d", LF_RMOVIVA, i+1)))
|
|
||||||
ini.remove_all();
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_fattura())
|
if (is_fattura())
|
||||||
{
|
{
|
||||||
|
@ -1984,8 +1984,9 @@ bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
if (f.to_check(key))
|
if (f.to_check(key))
|
||||||
{
|
{
|
||||||
bool ok = suspended_handler(f, key);
|
if (!suspended_handler(f, key))
|
||||||
if (!ok) return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
const TMask& m = f.mask();
|
const TMask& m = f.mask();
|
||||||
const int ann = m.get_int(F_ANNOIVA);
|
const int ann = m.get_int(F_ANNOIVA);
|
||||||
|
@ -393,7 +393,7 @@ END
|
|||||||
|
|
||||||
VALUTA FFR_REGIMP(13) 18
|
VALUTA FFR_REGIMP(13) 18
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 38 ""
|
PROMPT 29 38 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
VALUTA FFR_REGIVA(13) 18
|
VALUTA FFR_REGIVA(13) 18
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<font face="Courier New" bold="1" size="12" />
|
<font face="Courier New" bold="1" size="12" />
|
||||||
<source>"Lista clienti privati per quadro IVA VT anno " + #ANNO</source>
|
<source>"Lista clienti privati per quadro IVA VT anno " + #ANNO</source>
|
||||||
</field>
|
</field>
|
||||||
<field border="3" y="2" type="Linea" width="68" height="0" pattern="1" />
|
<field border="3" y="2" type="Linea" width="70" height="0" pattern="1" />
|
||||||
</section>
|
</section>
|
||||||
<section type="Head" level="1" />
|
<section type="Head" level="1" />
|
||||||
<section type="Head" level="2" height="3">
|
<section type="Head" level="2" height="3">
|
||||||
@ -43,7 +43,7 @@
|
|||||||
<font face="Courier New" bold="1" size="12" />
|
<font face="Courier New" bold="1" size="12" />
|
||||||
<source>20.RAGSOC</source>
|
<source>20.RAGSOC</source>
|
||||||
</field>
|
</field>
|
||||||
<field border="1" y="2" type="Linea" width="68" height="0" pattern="1" />
|
<field border="1" y="2" type="Linea" width="70" height="0" pattern="1" />
|
||||||
<field x="1" y="2.25" type="Testo" width="16" pattern="1" text="N.Operazione" />
|
<field x="1" y="2.25" type="Testo" width="16" pattern="1" text="N.Operazione" />
|
||||||
<field x="19" y="2.25" type="Testo" align="right" width="18" pattern="1" text="Imponibile" />
|
<field x="19" y="2.25" type="Testo" align="right" width="18" pattern="1" text="Imponibile" />
|
||||||
<field x="41" y="2.25" type="Testo" width="6" pattern="1" text="Cod." />
|
<field x="41" y="2.25" type="Testo" width="6" pattern="1" text="Cod." />
|
||||||
@ -61,20 +61,18 @@
|
|||||||
<field x="41" type="Stringa" width="4" pattern="1">
|
<field x="41" type="Stringa" width="4" pattern="1">
|
||||||
<source>RMOVIVA.CODIVA</source>
|
<source>RMOVIVA.CODIVA</source>
|
||||||
</field>
|
</field>
|
||||||
<field x="49" type="Valuta" align="right" width="18" pattern="1" text="###.###.###,@@">
|
<field x="50" type="Valuta" align="right" width="18" pattern="1" text="###.###.###,@@">
|
||||||
<source>RMOVIVA.IMPOSTA</source>
|
<source>RMOVIVA.IMPOSTA</source>
|
||||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F3.102</prescript>
|
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,F3.102</prescript>
|
||||||
</field>
|
</field>
|
||||||
</section>
|
</section>
|
||||||
<section type="Foot" />
|
<section type="Foot" />
|
||||||
<section type="Foot" level="1">
|
<section type="Foot" level="1">
|
||||||
<field border="2" x="-0.38" y="0.5" type="Linea" width="68" height="0" pattern="1" />
|
<field border="2" y="0.5" type="Linea" width="70" height="0" pattern="1" />
|
||||||
<field border="2" x="-0.5" y="0.75" type="Linea" width="68" height="0" pattern="1" />
|
<field border="2" y="0.75" type="Linea" width="70" height="0" pattern="1" />
|
||||||
<field x="2" y="1" type="Testo" width="15" pattern="1" text="Totale generale" />
|
<field x="2" y="1" type="Testo" width="15" pattern="1" text="Totale generale" />
|
||||||
<field x="18" y="1" type="Valuta" align="right" width="18" id="301" pattern="1" text="###.###.###,@@" />
|
<field x="18" y="1" type="Valuta" align="right" width="18" id="301" pattern="1" text="###.###.###,@@" />
|
||||||
<field x="50" y="1" type="Valuta" align="right" width="18" id="302" pattern="1" text="###.###.###,@@">
|
<field x="50" y="1" type="Valuta" align="right" width="18" id="302" pattern="1" text="###.###.###,@@" />
|
||||||
<prescript description="F1.302 PRESCRIPT">MESSAGE ADD,F1.302</prescript>
|
|
||||||
</field>
|
|
||||||
</section>
|
</section>
|
||||||
<section type="Foot" level="2">
|
<section type="Foot" level="2">
|
||||||
<field x="2" y="1" type="Testo" width="14" pattern="1" text="Totale regione" />
|
<field x="2" y="1" type="Testo" width="14" pattern="1" text="Totale regione" />
|
||||||
|
@ -214,15 +214,16 @@ void TInv_cont::main_loop()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
floppy = mask->get(F_FLOPPY);
|
floppy = mask->get(F_FLOPPY);
|
||||||
|
floppy << ':';
|
||||||
num_disk = calcola_numero_dischi(*mask,floppy);
|
num_disk = calcola_numero_dischi(*mask,floppy);
|
||||||
percorso = mask->get(F_PATH);
|
percorso = mask->get(F_PATH);
|
||||||
if (percorso.not_empty())
|
if (percorso.not_empty())
|
||||||
{
|
{
|
||||||
floppy << ":/" << percorso;
|
floppy.add(percorso);
|
||||||
if (floppy.exist())
|
if (floppy.exist())
|
||||||
ok = TRUE;
|
ok = TRUE;
|
||||||
else
|
else
|
||||||
message_box("Il percorso indicato non e' corretto");
|
error_box("Il percorso indicato non e' corretto");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ok = TRUE; // Se scelgo il dischetto non eseguo il controllo sulla correttezza del path
|
ok = TRUE; // Se scelgo il dischetto non eseguo il controllo sulla correttezza del path
|
||||||
@ -236,11 +237,8 @@ void TInv_cont::main_loop()
|
|||||||
|
|
||||||
const TFilename from(_trasf); // File da splittare
|
const TFilename from(_trasf); // File da splittare
|
||||||
|
|
||||||
TFilename work;
|
TFilename work = floppy;
|
||||||
if (percorso.not_empty())
|
work.add(from.name());
|
||||||
work << floppy << "/" << from.name();
|
|
||||||
else
|
|
||||||
work << floppy << ":/" << from.name(); // File su dischetto
|
|
||||||
|
|
||||||
FILE* i = fopen(from, "rb");
|
FILE* i = fopen(from, "rb");
|
||||||
|
|
||||||
@ -250,11 +248,7 @@ void TInv_cont::main_loop()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* message;
|
const char* message = "Trasferimento in corso... Prego attendere";
|
||||||
if (floppy == "A" || floppy == "B")
|
|
||||||
message = "Trasferimento su dischetti in corso... Prego attendere";
|
|
||||||
else
|
|
||||||
message = "Trasferimento in corso... Prego attendere";
|
|
||||||
|
|
||||||
TProgind w(_dim_tot, message, TRUE, TRUE, 60);
|
TProgind w(_dim_tot, message, TRUE, TRUE, 60);
|
||||||
|
|
||||||
@ -292,7 +286,6 @@ void TInv_cont::main_loop()
|
|||||||
else
|
else
|
||||||
if (_scelta == 'P')
|
if (_scelta == 'P')
|
||||||
{
|
{
|
||||||
_trasf = "";
|
|
||||||
_trasf = firm2dir(0);
|
_trasf = firm2dir(0);
|
||||||
_trasf << "\\trasfer";
|
_trasf << "\\trasfer";
|
||||||
::remove(_trasf);
|
::remove(_trasf);
|
||||||
@ -327,7 +320,7 @@ void TInv_cont::main_loop()
|
|||||||
if (floppy.exist())
|
if (floppy.exist())
|
||||||
ok = TRUE;
|
ok = TRUE;
|
||||||
else
|
else
|
||||||
message_box("Il percorso indicato non e' corretto");
|
error_box("Il percorso indicato non e' corretto");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ok = TRUE; // Se scelgo il dischetto non eseguo il controllo sulla correttezza del path
|
ok = TRUE; // Se scelgo il dischetto non eseguo il controllo sulla correttezza del path
|
||||||
@ -351,11 +344,7 @@ void TInv_cont::main_loop()
|
|||||||
error_box("Impossibile aprire il file '%s'", from);
|
error_box("Impossibile aprire il file '%s'", from);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char* message;
|
const char* message= "Trasferimento in corso... Prego attendere";
|
||||||
if (floppy == "A" || floppy == "B")
|
|
||||||
message = "Trasferimento su dischetti in corso... Prego attendere";
|
|
||||||
else
|
|
||||||
message = "Trasferimento in corso... Prego attendere";
|
|
||||||
|
|
||||||
TProgind w(_dim_tot, message, TRUE, TRUE, 60);
|
TProgind w(_dim_tot, message, TRUE, TRUE, 60);
|
||||||
|
|
||||||
|
@ -52,19 +52,9 @@ bool TInv_cont::scrivi_disco(TString& floppy, int disk, const char* work,
|
|||||||
else
|
else
|
||||||
aggiorna_marker(str,34);
|
aggiorna_marker(str,34);
|
||||||
|
|
||||||
TString path_m;
|
TFilename path_m = floppy; path_m.add("marker");
|
||||||
TString path_t;
|
TFilename path_t = floppy; path_t.add("trasfer");
|
||||||
|
|
||||||
if (floppy[0] == 'A' || floppy[0] == 'B')
|
|
||||||
{
|
|
||||||
path_m << floppy << ":\\marker";
|
|
||||||
path_t << floppy << ":\\trasfer";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
path_m << floppy << "\\marker";
|
|
||||||
path_t << floppy << "\\trasfer";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fcopy(_marker,path_m)) // Copia il marker su disco
|
if (!fcopy(_marker,path_m)) // Copia il marker su disco
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -2054,4 +2044,3 @@ void TInv_cont::write_AS_imp(const real& importo, TString& record, int pos, int
|
|||||||
numero.right_just(len, '0');
|
numero.right_just(len, '0');
|
||||||
record.overwrite(numero, pos);
|
record.overwrite(numero, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
|
|
||||||
|
#include "comuni.h"
|
||||||
#include "cglib01.h"
|
#include "cglib01.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -219,6 +220,11 @@ bool TEsercizi_contabili::code2range(int codice, TDate& dal, TDate& al) const
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////
|
||||||
|
// Simpatici metodi jolly
|
||||||
|
/////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
const char* iva2name(TipoIVA iva)
|
const char* iva2name(TipoIVA iva)
|
||||||
{
|
{
|
||||||
const char* i;
|
const char* i;
|
||||||
@ -238,6 +244,36 @@ const char* iva2name(TipoIVA iva)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TString& cap2comune(const TString& cap, const TString& denom)
|
||||||
|
{
|
||||||
|
TString8 cappone = cap;
|
||||||
|
if (cappone[2] == '1') //e' un capoluogo di provincia
|
||||||
|
cappone.overwrite("00", 3, 2);
|
||||||
|
|
||||||
|
TRelation relcom(LF_COMUNI);
|
||||||
|
TRectype& comrec = relcom.curr();
|
||||||
|
comrec.put(COM_CAPCOM, cappone);
|
||||||
|
|
||||||
|
TCursor comuni (&relcom, "", 3, &comrec, &comrec);
|
||||||
|
const TRecnotype items = comuni.items();
|
||||||
|
|
||||||
|
comuni.freeze();
|
||||||
|
TString& codcom = get_tmp_string();
|
||||||
|
double cmp = 0.69;
|
||||||
|
|
||||||
|
for (comuni = 0L; comuni.pos() < items; ++comuni)
|
||||||
|
{
|
||||||
|
const TString& denominazione = comrec.get(COM_DENCOM);
|
||||||
|
const double fc = xvt_str_fuzzy_compare (denom, denominazione);
|
||||||
|
if (fc > cmp)
|
||||||
|
{
|
||||||
|
codcom = comrec.get(COM_COM);
|
||||||
|
cmp = fc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return codcom;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Registro
|
// Registro
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -1045,4 +1081,4 @@ bool TBill::is_analitico() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
@ -77,7 +77,8 @@ enum TipoIVA
|
|||||||
iva_generica = 9
|
iva_generica = 9
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* iva2name(TipoIVA i);
|
const char* iva2name(TipoIVA i);
|
||||||
|
const TString& cap2comune(const TString& cap, const TString& denom);
|
||||||
|
|
||||||
class TMask_field;
|
class TMask_field;
|
||||||
bool handler_data_cambio(TMask_field& f, KEY k);
|
bool handler_data_cambio(TMask_field& f, KEY k);
|
||||||
|
@ -33,15 +33,15 @@ const word P_TOOMANY = 0x0400; // troppe rate (piu' di 999)
|
|||||||
const word P_TOTNCVAL= 0x0800; // totale importi in valuta != totale pagamento
|
const word P_TOTNCVAL= 0x0800; // totale importi in valuta != totale pagamento
|
||||||
const word P_ZEROVAL = 0x1000; // importo di una rata in valuta uguale a zero
|
const word P_ZEROVAL = 0x1000; // importo di una rata in valuta uguale a zero
|
||||||
|
|
||||||
enum TTipo_pag{_rim_dir = 1, _tratta, _ric_ban, _cessione, _paghero, _let_cred, _tratta_acc, _rid, _bonfico, _nessun_pag};
|
enum TTipo_pag { _rim_dir = 1, _tratta, _ric_ban, _cessione, _paghero, _let_cred, _tratta_acc, _rid, _bonfico, _nessun_pag };
|
||||||
|
|
||||||
class TPagamento : public TObject
|
class TPagamento : public TObject
|
||||||
{
|
{
|
||||||
TString _code; // codice
|
TString4 _code; // codice
|
||||||
TString _name; // descrizione
|
TString _name; // descrizione
|
||||||
real _imponval; // imponibile da affettare
|
real _imponval; // imponibile da affettare
|
||||||
real _imposval; // imposta da affettare
|
real _imposval; // imposta da affettare
|
||||||
real _speseval; // spese da affettare
|
real _speseval; // spese da affettare
|
||||||
real _imponlit; // imponibile da affettare in lire (se imp. in valuta)
|
real _imponlit; // imponibile da affettare in lire (se imp. in valuta)
|
||||||
real _imposlit; // imposta da affettare in lire
|
real _imposlit; // imposta da affettare in lire
|
||||||
real _speselit; // spese da affettare in lire
|
real _speselit; // spese da affettare in lire
|
||||||
@ -130,7 +130,7 @@ public:
|
|||||||
|
|
||||||
int scad_rata(int n) const { return _rata_ifield(n,0);}
|
int scad_rata(int n) const { return _rata_ifield(n,0);}
|
||||||
real perc_rata(int n) const { return _rata_rfield(n,1);}
|
real perc_rata(int n) const { return _rata_rfield(n,1);}
|
||||||
int tipo_rata(int n) const { return _rata_ifield(n,2);}
|
TTipo_pag tipo_rata(int n) const { return (TTipo_pag)_rata_ifield(n,2);}
|
||||||
TDate data_rata(int n) const { return _rata_dfield(n,3);}
|
TDate data_rata(int n) const { return _rata_dfield(n,3);}
|
||||||
real importo_rata(int n, bool v = FALSE) const
|
real importo_rata(int n, bool v = FALSE) const
|
||||||
{ return v ? tval_rata(n) : tlit_rata(n); }
|
{ return v ? tval_rata(n) : tlit_rata(n); }
|
||||||
@ -169,10 +169,10 @@ public:
|
|||||||
const TDate& get_inizio() const { return _inizio; }
|
const TDate& get_inizio() const { return _inizio; }
|
||||||
const TDate& get_datadoc() const { return _datadoc; }
|
const TDate& get_datadoc() const { return _datadoc; }
|
||||||
|
|
||||||
void set_datadoc(const TDate & d) { _datadoc = d;}
|
void set_datadoc(const TDate & d) { _datadoc = d;}
|
||||||
void set_inizio_scadenza(char v) { _inscad = v; }
|
void set_inizio_scadenza(char v) { _inscad = v; }
|
||||||
void set_code(const char* c) { _code = c; }
|
void set_code(const char* c) { _code = c; }
|
||||||
void set_roundval(int n) { _roundval = n; }
|
void set_roundval(int n) { _roundval = n; }
|
||||||
|
|
||||||
bool in_valuta() const { return _in_valuta; }
|
bool in_valuta() const { return _in_valuta; }
|
||||||
// const real& cambio() const { return _cambio; }
|
// const real& cambio() const { return _cambio; }
|
||||||
|
@ -518,12 +518,6 @@ TYPE(17) = DATA
|
|||||||
POSITION(17) = 72
|
POSITION(17) = 72
|
||||||
LENGTH(17) = 8
|
LENGTH(17) = 8
|
||||||
|
|
||||||
NAME(18) = CODICE PAGAMENTO
|
|
||||||
TYPE(18) = NUMERO
|
|
||||||
POSITION(18) = 80
|
|
||||||
LENGTH(18) = 3
|
|
||||||
FIELD(18)=23->CODPAG[1,3]
|
|
||||||
|
|
||||||
NAME(19) = TIPO PAGAMENTO
|
NAME(19) = TIPO PAGAMENTO
|
||||||
TYPE(19) = STRINGA
|
TYPE(19) = STRINGA
|
||||||
POSITION(19) = 83
|
POSITION(19) = 83
|
||||||
|
@ -166,7 +166,19 @@ public:
|
|||||||
TCache(size_t size = 0); // 883 assigned by default
|
TCache(size_t size = 0); // 883 assigned by default
|
||||||
virtual ~TCache();
|
virtual ~TCache();
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
|
__ass = TAssoc_array da scandire
|
||||||
|
__obj = variabile del cazzo che serve internamente al ciclo; va nominata e dimenticata
|
||||||
|
__key = nome della variabile del record corrente dell'Assoc (primo campo)
|
||||||
|
__str = valore del record corrente dell'Assoc (secondo campo)
|
||||||
|
Es:
|
||||||
|
TAssoc_array ass;
|
||||||
|
TString str;
|
||||||
|
FOR_EACH_ASSOC_STRING(ass, ho, k, str)
|
||||||
|
{
|
||||||
|
usa in qualche modo k e str presi da ass;
|
||||||
|
}
|
||||||
|
*/
|
||||||
#define FOR_EACH_ASSOC_STRING(__ass, __obj, __key, __str) \
|
#define FOR_EACH_ASSOC_STRING(__ass, __obj, __key, __str) \
|
||||||
const char *__key, *__str; __ass.restart(); \
|
const char *__key, *__str; __ass.restart(); \
|
||||||
for (THash_object* __obj = __ass.get_hashobj(); \
|
for (THash_object* __obj = __ass.get_hashobj(); \
|
||||||
|
@ -37,27 +37,33 @@
|
|||||||
#define CLI_MAIL "MAIL"
|
#define CLI_MAIL "MAIL"
|
||||||
#define CLI_DATANASC "DATANASC"
|
#define CLI_DATANASC "DATANASC"
|
||||||
#define CLI_STATONASC "STATONASC"
|
#define CLI_STATONASC "STATONASC"
|
||||||
#define CLI_COMNASC "COMNASC"
|
#define CLI_COMNASC "COMNASC"
|
||||||
#define CLI_CODSTAT "CODSTAT"
|
|
||||||
#define CLI_CODABI "CODABI"
|
|
||||||
#define CLI_CODCAB "CODCAB"
|
|
||||||
#define CLI_IBAN "IBAN"
|
|
||||||
#define CLI_SCONTO "SCONTO"
|
#define CLI_SCONTO "SCONTO"
|
||||||
#define CLI_CODVAL "CODVAL"
|
|
||||||
#define CLI_RAGGRB "RAGGRB"
|
#define CLI_RAGGRB "RAGGRB"
|
||||||
#define CLI_RAGGFT "RAGGFT"
|
#define CLI_RAGGFT "RAGGFT"
|
||||||
#define CLI_FIDO "FIDO"
|
|
||||||
#define CLI_CODVETT1 "CODVETT1"
|
#define CLI_CODVETT1 "CODVETT1"
|
||||||
#define CLI_CODVETT2 "CODVETT2"
|
#define CLI_CODVETT2 "CODVETT2"
|
||||||
#define CLI_CODVETT3 "CODVETT3"
|
#define CLI_CODVETT3 "CODVETT3"
|
||||||
#define CLI_CODCFATT "CODCFATT"
|
#define CLI_CODCFATT "CODCFATT"
|
||||||
#define CLI_DESTIN "DESTIN"
|
#define CLI_DESTIN "DESTIN"
|
||||||
#define CLI_CODAG "CODAG"
|
#define CLI_CODAG "CODAG"
|
||||||
#define CLI_CODPAG "CODPAG"
|
#define CLI_CODZONA "CODZONA"
|
||||||
#define CLI_SOSPESO "SOSPESO"
|
#define CLI_CODSTAT "CODSTAT"
|
||||||
#define CLI_OCCAS "OCCAS"
|
#define CLI_CODABI "CODABI"
|
||||||
|
#define CLI_CODCAB "CODCAB"
|
||||||
|
#define CLI_NUMCC "NUMCC"
|
||||||
|
#define CLI_IBAN "IBAN"
|
||||||
|
#define CLI_OCCAS "OCCAS"
|
||||||
|
#define CLI_STATO "STATO"
|
||||||
|
#define CLI_CODVAL "CODVAL"
|
||||||
#define CLI_CODLIN "CODLIN"
|
#define CLI_CODLIN "CODLIN"
|
||||||
#define CLI_CODZONA "CODZONA"
|
#define CLI_FIDO "FIDO"
|
||||||
|
#define CLI_CODPAG "CODPAG"
|
||||||
|
#define CLI_RICALT "RICALT"
|
||||||
|
#define CLI_OGGETTI "OGGETTI"
|
||||||
|
#define CLI_SOSPESO "SOSPESO"
|
||||||
|
#define CLI_DIRTY "DIRTY"
|
||||||
|
#define CLI_REFERENTE "REFERENTE"
|
||||||
#define CLI_VALINTRA "VALINTRA"
|
#define CLI_VALINTRA "VALINTRA"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -191,7 +191,14 @@ void TFile_text::set_gen_parm(TConfig& config, const TString& section)
|
|||||||
{
|
{
|
||||||
_decsep = config.get_char("DECSEP",section);
|
_decsep = config.get_char("DECSEP",section);
|
||||||
_recordsize = config.get_int("RECORDSIZE",section); // solo se a lung. fissa
|
_recordsize = config.get_int("RECORDSIZE",section); // solo se a lung. fissa
|
||||||
_fieldsep = config.get_char("FIELDSEP",section); // solo se a lung. variabile
|
TString tmpstring = config.get("FIELDSEP",section); // solo se a lung. variabile
|
||||||
|
if (tmpstring[0] == '\\')
|
||||||
|
{
|
||||||
|
if (tmpstring = "\t")
|
||||||
|
_fieldsep = '\t';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_fieldsep = tmpstring[0]; // solo se a lung. variabile
|
||||||
_recordsep = config.get("RECORDSEP",section); // solo se a lung. variabile
|
_recordsep = config.get("RECORDSEP",section); // solo se a lung. variabile
|
||||||
if (_recordsize <= 0 && _recordsep.empty()) // separatore di record standard
|
if (_recordsize <= 0 && _recordsep.empty()) // separatore di record standard
|
||||||
_recordsep = "\r\n";
|
_recordsep = "\r\n";
|
||||||
@ -522,7 +529,7 @@ int TFile_text::read(TRecord_text& rec)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_fieldsep > ' ')
|
if (_fieldsep != ' ')
|
||||||
{
|
{
|
||||||
buffer.separator(_fieldsep);
|
buffer.separator(_fieldsep);
|
||||||
|
|
||||||
|
@ -666,7 +666,7 @@ void TGolem_window::handler(WINDOW win, EVENT* ep)
|
|||||||
TFilename fname; // File corrente
|
TFilename fname; // File corrente
|
||||||
for (int i = 0; i < num_files; i++)
|
for (int i = 0; i < num_files; i++)
|
||||||
{
|
{
|
||||||
DragQueryFile(hdrop, i, (char*)(const char*)fname, fname.size());
|
::DragQueryFile(hdrop, i, (char*)(const char*)fname, fname.size());
|
||||||
fname << '|' << fname.name() << "|X";
|
fname << '|' << fname.name() << "|X";
|
||||||
if (driver()->roman())
|
if (driver()->roman())
|
||||||
{
|
{
|
||||||
@ -678,7 +678,7 @@ void TGolem_window::handler(WINDOW win, EVENT* ep)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DragFinish(hdrop);
|
::DragFinish(hdrop);
|
||||||
driver()->set(file_list);
|
driver()->set(file_list);
|
||||||
#endif
|
#endif
|
||||||
on_key(K_SPACE);
|
on_key(K_SPACE);
|
||||||
@ -704,7 +704,7 @@ TGolem_window::TGolem_window(int x, int y, int dx, int dy, WINDOW parent, TGolem
|
|||||||
|
|
||||||
#ifdef WIN32 // verificare
|
#ifdef WIN32 // verificare
|
||||||
HWND nat = (HWND)xvt_vobj_get_attr(win(), ATTR_NATIVE_WINDOW);
|
HWND nat = (HWND)xvt_vobj_get_attr(win(), ATTR_NATIVE_WINDOW);
|
||||||
DragAcceptFiles(nat, TRUE);
|
::DragAcceptFiles(nat, TRUE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -712,9 +712,9 @@ TGolem_window::~TGolem_window()
|
|||||||
{
|
{
|
||||||
#ifdef WIN32 // verificare
|
#ifdef WIN32 // verificare
|
||||||
if (_last_handle)
|
if (_last_handle)
|
||||||
PostMessage(HWND(_last_handle), WM_CLOSE, 0, 0);
|
::PostMessage(HWND(_last_handle), WM_CLOSE, 0, 0);
|
||||||
HWND nat = (HWND)xvt_vobj_get_attr(win(), ATTR_NATIVE_WINDOW);
|
HWND nat = (HWND)xvt_vobj_get_attr(win(), ATTR_NATIVE_WINDOW);
|
||||||
DragAcceptFiles(nat, FALSE);
|
::DragAcceptFiles(nat, FALSE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,6 +166,7 @@
|
|||||||
#define LF_RRILPROD 153
|
#define LF_RRILPROD 153
|
||||||
|
|
||||||
#define LF_LETINT 154
|
#define LF_LETINT 154
|
||||||
|
#define LF_MULTIREL 155
|
||||||
|
|
||||||
#define LF_PANAPDC 155
|
#define LF_PANAPDC 155
|
||||||
|
|
||||||
|
@ -4617,11 +4617,6 @@ void TList_field::add_list()
|
|||||||
csafe = _codes; _codes = "";
|
csafe = _codes; _codes = "";
|
||||||
vsafe = _values; _values = "";
|
vsafe = _values; _values = "";
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
_codes.add("01|02|03|04|05|06|07|08|09|10|11|12");
|
|
||||||
_values.add("Gennaio|Febbraio|Marzo|Aprile|Maggio|Giugno|"
|
|
||||||
"Luglio|Agosto|Settembre|Ottobre|Novembre|Dicembre");
|
|
||||||
*/
|
|
||||||
for (int i = 1; i <= 12; i++)
|
for (int i = 1; i <= 12; i++)
|
||||||
{
|
{
|
||||||
char num[4]; sprintf(num, "%02d", i);
|
char num[4]; sprintf(num, "%02d", i);
|
||||||
|
@ -130,7 +130,7 @@ class TSpreadsheet : public TControl
|
|||||||
|
|
||||||
// @access:(INTERNAL) Private Member
|
// @access:(INTERNAL) Private Member
|
||||||
// @cmember:(INTERNAL) costanti
|
// @cmember:(INTERNAL) costanti
|
||||||
enum {MAX_COL=64};
|
enum {MAX_COL=96};
|
||||||
static int NUMBER_WIDTH;
|
static int NUMBER_WIDTH;
|
||||||
|
|
||||||
// @cmember:(INTERNAL) Array di TToken_strings contenenti le righe
|
// @cmember:(INTERNAL) Array di TToken_strings contenenti le righe
|
||||||
@ -613,7 +613,7 @@ TSpreadsheet::TSpreadsheet(
|
|||||||
memset(_default_width, 0, sizeof(_default_width));
|
memset(_default_width, 0, sizeof(_default_width));
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
RCT rct; xi_get_rect(column[i], (XinRect *) &rct);
|
XI_RCT rct; xi_get_rect(column[i], &rct);
|
||||||
_default_width[i] = rct.right - rct.left;
|
_default_width[i] = rct.right - rct.left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1768,6 +1768,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
|||||||
if (next_rec >= 0)
|
if (next_rec >= 0)
|
||||||
{
|
{
|
||||||
dispatch_e_char(parent(), k == K_ENTER ? K_DOWN : K_UP);
|
dispatch_e_char(parent(), k == K_ENTER ? K_DOWN : K_UP);
|
||||||
|
refused = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -343,14 +343,14 @@ TMultiple_rectype & TMultiple_rectype::copy(const TMultiple_rectype& r)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @mfunc Copia il multiple rectype r su quello corrente
|
// @mfunc Ritorna il numero di righe caricate
|
||||||
int TMultiple_rectype::loaded_rows(int logicnum) const
|
int TMultiple_rectype::loaded_rows(int logicnum) const
|
||||||
{
|
{
|
||||||
const int index = log2ind(logicnum);
|
const int index = log2ind(logicnum);
|
||||||
TRecord_array* r = (TRecord_array*) ((TMultiple_rectype *) this)->_files.objptr(index);
|
TRecord_array* r = (TRecord_array*) ((TMultiple_rectype *) this)->_files.objptr(index);
|
||||||
|
if (_changed[index] || r == NULL)
|
||||||
if (_changed[index] || r == NULL)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return r->rows();
|
return r->rows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,8 +455,8 @@ TRectype & TMultiple_rectype::insert_row(int row, int logicnum)
|
|||||||
|
|
||||||
TRectype & TMultiple_rectype::new_row(int logicnum)
|
TRectype & TMultiple_rectype::new_row(int logicnum)
|
||||||
{
|
{
|
||||||
TRecord_array & b = body(logicnum);
|
TRecord_array& b = body(logicnum);
|
||||||
TRectype & r = b.row(-1, TRUE);
|
TRectype& r = b.row(-1, true);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
10
include/multirel.h
Executable file
10
include/multirel.h
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#ifndef __MULTIREL_H
|
||||||
|
#define __MULTIREL_H
|
||||||
|
|
||||||
|
#define MULTI_COD "COD"
|
||||||
|
#define MULTI_FIRST "FIRST"
|
||||||
|
#define MULTI_SECOND "SECOND"
|
||||||
|
#define MULTI_DATA "DATA"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -1,7 +1,27 @@
|
|||||||
#include <odbcrset.h>
|
#include <odbcrset.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
void TODBC_recordset::close()
|
///////////////////////////////////////////////////////////
|
||||||
|
// TODBC_connections
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TODBC_connections
|
||||||
|
{
|
||||||
|
TString _dsn, _usr;
|
||||||
|
XVT_ODBC _odbc;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void close();
|
||||||
|
|
||||||
|
public:
|
||||||
|
XVT_ODBC get(const char* dsn, const char* usr, const char* pwd, const char* dir);
|
||||||
|
TODBC_connections();
|
||||||
|
~TODBC_connections();
|
||||||
|
};
|
||||||
|
|
||||||
|
TODBC_connections _connections;
|
||||||
|
|
||||||
|
void TODBC_connections::close()
|
||||||
{
|
{
|
||||||
if (_odbc != NULL)
|
if (_odbc != NULL)
|
||||||
{
|
{
|
||||||
@ -10,18 +30,38 @@ void TODBC_recordset::close()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TODBC_recordset::connect(const char* dsn, const char* usr, const char* pwd, const char* dir)
|
XVT_ODBC TODBC_connections::get(const char* dsn, const char* usr, const char* pwd, const char* dir)
|
||||||
|
{
|
||||||
|
if (_odbc == NULL || _dsn != dsn || _usr != usr)
|
||||||
|
{
|
||||||
|
close();
|
||||||
|
if (dsn && *dsn)
|
||||||
|
_odbc = xvt_odbc_get_connection(_dsn = dsn, _usr = usr, pwd, dir);
|
||||||
|
}
|
||||||
|
return _odbc;
|
||||||
|
}
|
||||||
|
|
||||||
|
TODBC_connections::TODBC_connections() : _odbc(NULL)
|
||||||
|
{}
|
||||||
|
|
||||||
|
TODBC_connections::~TODBC_connections()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
_odbc = xvt_odbc_get_connection(dsn, usr, pwd, dir);
|
|
||||||
return _odbc != NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TODBC_recordset
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
XVT_ODBC TODBC_recordset::connection() const
|
XVT_ODBC TODBC_recordset::connection() const
|
||||||
{
|
{
|
||||||
if (_odbc == NULL)
|
return _connections.get(_dsn, _usr, _pwd, _dir);
|
||||||
((TODBC_recordset*)this)->connect("");
|
}
|
||||||
return _odbc;
|
|
||||||
|
bool TODBC_recordset::connect(const char* dsn, const char* usr, const char* pwd, const char* dir)
|
||||||
|
{
|
||||||
|
_dsn = dsn; _usr = usr; _pwd = pwd; _dir = dir;
|
||||||
|
return connection() != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TString& TODBC_recordset::query_text() const
|
const TString& TODBC_recordset::query_text() const
|
||||||
@ -136,9 +176,11 @@ TRecnotype TODBC_recordset::items() const
|
|||||||
TRecnotype& i = (TRecnotype&)_items;
|
TRecnotype& i = (TRecnotype&)_items;
|
||||||
if (!_columns_loaded)
|
if (!_columns_loaded)
|
||||||
{
|
{
|
||||||
((TArray&)_page).destroy();
|
TODBC_recordset* myself = (TODBC_recordset*)this;
|
||||||
|
myself->_page.destroy();
|
||||||
|
myself->_cursor_pos = 0;
|
||||||
i = xvt_odbc_execute(connection(), sql, query_get_items, (void*)this);
|
i = xvt_odbc_execute(connection(), sql, query_get_items, (void*)this);
|
||||||
(bool&)_columns_loaded = true;
|
myself->_columns_loaded = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
i = xvt_odbc_execute(connection(), sql, NULL, NULL);
|
i = xvt_odbc_execute(connection(), sql, NULL, NULL);
|
||||||
@ -150,10 +192,12 @@ unsigned int TODBC_recordset::columns() const
|
|||||||
{
|
{
|
||||||
if (!_columns_loaded && _column.items() == 0)
|
if (!_columns_loaded && _column.items() == 0)
|
||||||
{
|
{
|
||||||
|
TODBC_recordset* myself = (TODBC_recordset*)this;
|
||||||
TString sql; parsed_text(sql);
|
TString sql; parsed_text(sql);
|
||||||
TPerformance_profiler prof("ODBC info");
|
TPerformance_profiler prof("ODBC info");
|
||||||
|
myself->_cursor_pos = 0;
|
||||||
xvt_odbc_execute(connection(), sql, query_get_columns, (void*)this);
|
xvt_odbc_execute(connection(), sql, query_get_columns, (void*)this);
|
||||||
(bool&)_columns_loaded = true;
|
myself->_columns_loaded = true;
|
||||||
}
|
}
|
||||||
return _column.items();
|
return _column.items();
|
||||||
}
|
}
|
||||||
@ -173,6 +217,9 @@ int TODBC_recordset::on_get_rows(int argc, char** values, char** columns)
|
|||||||
|
|
||||||
if (_page.items() >= _pagesize)
|
if (_page.items() >= _pagesize)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (_cursor_pos++ < _first_row)
|
||||||
|
return 0; // Ignora le righe prima del LIMIT
|
||||||
|
|
||||||
TArray* a = new TArray;
|
TArray* a = new TArray;
|
||||||
for (int c = 0; c < argc; c++)
|
for (int c = 0; c < argc; c++)
|
||||||
@ -232,15 +279,12 @@ bool TODBC_recordset::move_to(TRecnotype n)
|
|||||||
sql.trim();
|
sql.trim();
|
||||||
_page.destroy();
|
_page.destroy();
|
||||||
if (n >= _pagesize)
|
if (n >= _pagesize)
|
||||||
_first_row = n-_pagesize/8; // Prendo qualche riga dalla pagina precedente, per velocizzare il pagina su
|
_first_row = n-32; // Prendo qualche riga dalla pagina precedente, per velocizzare il pagina su
|
||||||
else
|
else
|
||||||
_first_row = n;
|
_first_row = n;
|
||||||
sql << "\nLIMIT ";
|
|
||||||
if (_first_row > 0)
|
|
||||||
sql << _first_row << ',';
|
|
||||||
sql << _pagesize << ';';
|
|
||||||
}
|
}
|
||||||
TPerformance_profiler prof("ODBC query");
|
TPerformance_profiler prof("ODBC query");
|
||||||
|
_cursor_pos = 0;
|
||||||
xvt_odbc_execute(connection(), sql, query_get_rows, this);
|
xvt_odbc_execute(connection(), sql, query_get_rows, this);
|
||||||
if (!_columns_loaded)
|
if (!_columns_loaded)
|
||||||
_columns_loaded = true; // Brutto posto ma necessario
|
_columns_loaded = true; // Brutto posto ma necessario
|
||||||
@ -315,15 +359,13 @@ void TODBC_recordset::set(const char* sql)
|
|||||||
find_and_reset_vars();
|
find_and_reset_vars();
|
||||||
}
|
}
|
||||||
|
|
||||||
TODBC_recordset::TODBC_recordset(const char* sql) : _odbc(NULL)
|
TODBC_recordset::TODBC_recordset(const char* sql)
|
||||||
{
|
{
|
||||||
set(sql);
|
set(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
TODBC_recordset::~TODBC_recordset()
|
TODBC_recordset::~TODBC_recordset()
|
||||||
{
|
{ }
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Creazione "intelligente" del recordset appropriato in base alla query
|
// Creazione "intelligente" del recordset appropriato in base alla query
|
||||||
@ -332,7 +374,7 @@ TODBC_recordset::~TODBC_recordset()
|
|||||||
TRecordset* create_recordset(const TString& sql)
|
TRecordset* create_recordset(const TString& sql)
|
||||||
{
|
{
|
||||||
TRecordset* rex = NULL;
|
TRecordset* rex = NULL;
|
||||||
if (!sql.blank())
|
if (sql.full())
|
||||||
{
|
{
|
||||||
if (sql.starts_with("US", true))
|
if (sql.starts_with("US", true))
|
||||||
rex = new TISAM_recordset(sql);
|
rex = new TISAM_recordset(sql);
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
class TODBC_recordset : public TRecordset
|
class TODBC_recordset : public TRecordset
|
||||||
{
|
{
|
||||||
|
TString _dsn, _usr, _pwd, _dir;
|
||||||
TString _sql;
|
TString _sql;
|
||||||
XVT_ODBC _odbc;
|
|
||||||
|
|
||||||
TRecnotype _first_row, _pagesize, _items, _current_row;
|
TRecnotype _first_row, _pagesize, _items, _current_row, _cursor_pos;
|
||||||
TArray _page;
|
TArray _page;
|
||||||
|
|
||||||
TArray _column;
|
TArray _column;
|
||||||
@ -18,10 +18,7 @@ class TODBC_recordset : public TRecordset
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
XVT_ODBC connection() const;
|
XVT_ODBC connection() const;
|
||||||
void close();
|
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
const TArray* row(TRecnotype n);
|
const TArray* row(TRecnotype n);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
#include <printapp.h>
|
|
||||||
#include <iostream.h>
|
|
||||||
#include <lffiles.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
class MyApp : public TPrintapp
|
|
||||||
{
|
|
||||||
int counter;
|
|
||||||
public:
|
|
||||||
virtual void preprocess_page();
|
|
||||||
virtual bool create();
|
|
||||||
MyApp() : TPrintapp()
|
|
||||||
{ counter = 0; }
|
|
||||||
};
|
|
||||||
|
|
||||||
void MyApp::preprocess_page()
|
|
||||||
{
|
|
||||||
reset_row(1);
|
|
||||||
set_row(1,"%d: Ragsoc: @10S", ++counter, FLD(LF_ANAG,"RAGSOC"));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MyApp::create()
|
|
||||||
{
|
|
||||||
TPrintapp::create();
|
|
||||||
disable_sorting_menu();
|
|
||||||
disable_selection_menu();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
main(int argc, char* argv[])
|
|
||||||
{
|
|
||||||
MyApp app;
|
|
||||||
int dummy;
|
|
||||||
|
|
||||||
cout << "process is: " << getpid();
|
|
||||||
fscanf(stdin,"%d",&dummy);
|
|
||||||
|
|
||||||
TRelation tr_giu(LF_ANAG);
|
|
||||||
TCursor ttr(&tr_giu);
|
|
||||||
|
|
||||||
app.cursor(&ttr);
|
|
||||||
app.set_config_file("pr2.stp");
|
|
||||||
app.set_row(2,"-------- riga statica con codanagr: @pn --------",
|
|
||||||
FLD(LF_ANAG,"CODANAGR","@@@@@@@@@"));
|
|
||||||
app.run(argc, argv, "Trial Print Application");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1119,38 +1119,37 @@ bool TPrint_application::print_tree (link_item * head)
|
|||||||
{
|
{
|
||||||
head->_cnt = 0;
|
head->_cnt = 0;
|
||||||
if (_cur->is_first_match (head->_logicnum))
|
if (_cur->is_first_match (head->_logicnum))
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
if (!preprocess_print (head->_logicnum, head->_cnt))
|
|
||||||
break;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
// set print rows according to current file
|
|
||||||
if (_force_setpage || _cur_file != head->_logicnum
|
|
||||||
|| !_print_defined)
|
|
||||||
{
|
|
||||||
reset_print ();
|
|
||||||
set_page(head->_logicnum, head->_cnt);
|
|
||||||
_cur_file = head->_logicnum;
|
|
||||||
}
|
|
||||||
int cnt2 = 0;
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (!preprocess_page (head->_logicnum, cnt2))
|
if (!preprocess_print (head->_logicnum, head->_cnt))
|
||||||
break;
|
break;
|
||||||
go = print_one (head->_logicnum);
|
do
|
||||||
if (go && head->_son)
|
{
|
||||||
go = print_tree (head->_son);
|
// set print rows according to current file
|
||||||
|
if (_force_setpage || _cur_file != head->_logicnum
|
||||||
|
|| !_print_defined)
|
||||||
|
{
|
||||||
|
reset_print ();
|
||||||
|
set_page(head->_logicnum, head->_cnt);
|
||||||
|
_cur_file = head->_logicnum;
|
||||||
|
}
|
||||||
|
int cnt2 = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (!preprocess_page (head->_logicnum, cnt2))
|
||||||
|
break;
|
||||||
|
go = print_one (head->_logicnum);
|
||||||
|
if (go && head->_son)
|
||||||
|
go = print_tree (head->_son);
|
||||||
|
}
|
||||||
|
while (go && postprocess_page (head->_logicnum, cnt2++) ==
|
||||||
|
REPEAT_PAGE);
|
||||||
|
}
|
||||||
|
while (go && _cur->next_match (head->_logicnum));
|
||||||
}
|
}
|
||||||
while (go && postprocess_page (head->_logicnum, cnt2++) ==
|
while (go && postprocess_print (head->_logicnum, head->_cnt++) == REPEAT_PAGE);
|
||||||
REPEAT_PAGE);
|
|
||||||
}
|
}
|
||||||
while (go && _cur->next_match (head->_logicnum));
|
|
||||||
}
|
|
||||||
while (go && postprocess_print (head->_logicnum, head->_cnt++)
|
|
||||||
== REPEAT_PAGE);
|
|
||||||
}
|
|
||||||
if (!go)
|
if (!go)
|
||||||
break;
|
break;
|
||||||
go = TRUE;
|
go = TRUE;
|
||||||
@ -1568,7 +1567,7 @@ bool TPrint_application::create()
|
|||||||
dispatch_e_menu (_last_choice);
|
dispatch_e_menu (_last_choice);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrint_application::destroy ()
|
bool TPrint_application::destroy ()
|
||||||
|
@ -1149,6 +1149,7 @@ void TPrinter::init_formlen(
|
|||||||
_formlen = int(ph * _lines_per_inch / pvr); // Total number of lines per page
|
_formlen = int(ph * _lines_per_inch / pvr); // Total number of lines per page
|
||||||
_dots_per_line = int(pvr / _lines_per_inch); // Number of point per line
|
_dots_per_line = int(pvr / _lines_per_inch); // Number of point per line
|
||||||
_vert_offset = (int)(ph - ((long)_formlen * _dots_per_line)) >> 1;
|
_vert_offset = (int)(ph - ((long)_formlen * _dots_per_line)) >> 1;
|
||||||
|
_formwidth = int ((pw * 120) / (_ch_size * phr)); // nice guess
|
||||||
|
|
||||||
if (prwin != NULL_WIN)
|
if (prwin != NULL_WIN)
|
||||||
{
|
{
|
||||||
@ -1157,7 +1158,7 @@ void TPrinter::init_formlen(
|
|||||||
TString256 spc; spc.fill('m', maxcol);
|
TString256 spc; spc.fill('m', maxcol);
|
||||||
|
|
||||||
_formwidth = maxcol;
|
_formwidth = maxcol;
|
||||||
int w = 0;
|
int w = 0;
|
||||||
while (mincol < maxcol )
|
while (mincol < maxcol )
|
||||||
{
|
{
|
||||||
w = xvt_dwin_get_text_width(prwin, (char*)(const char*)spc, _formwidth);
|
w = xvt_dwin_get_text_width(prwin, (char*)(const char*)spc, _formwidth);
|
||||||
@ -1174,7 +1175,7 @@ void TPrinter::init_formlen(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_formwidth = int (pw * (_ch_size * 10 / 12) / phr);
|
// _formwidth = int (pw * (_ch_size * 10 / 12) / phr); / ca$$ata
|
||||||
_horz_offset = 0;
|
_horz_offset = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2014,12 +2015,14 @@ HIDDEN BOOLEAN calc_font_callback(long data)
|
|||||||
font_data& fd = *(font_data*)data;
|
font_data& fd = *(font_data*)data;
|
||||||
|
|
||||||
// Create print window
|
// Create print window
|
||||||
WINDOW win = xvt_print_create_win(printer().get_printrcd(), "Calcolo font");
|
TPrinter& pr = printer();
|
||||||
|
WINDOW win = xvt_print_create_win(pr.get_printrcd(), "Calcolo font");
|
||||||
|
|
||||||
if (win != NULL_WIN)
|
if (win != NULL_WIN)
|
||||||
{
|
{
|
||||||
long pw, ph, phr, pvr; // Printer width, height, horizontal and vertical resolution
|
long pw, ph, phr, pvr; // Printer width, height, horizontal and vertical resolution
|
||||||
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, printer().get_printrcd(), &ph, &pw, &pvr, &phr);
|
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, printer().get_printrcd(), &ph, &pw, &pvr, &phr);
|
||||||
|
xvt_set_font(win, pr.fontname(), XVT_FS_NONE, pr.get_char_size());
|
||||||
|
|
||||||
TString test(fd._columns);
|
TString test(fd._columns);
|
||||||
test.fill('M', fd._columns);
|
test.fill('M', fd._columns);
|
||||||
@ -2061,26 +2064,26 @@ int TPrinter::calc_font_size(int columns) const
|
|||||||
HIDDEN BOOLEAN calc_cols_callback(long data)
|
HIDDEN BOOLEAN calc_cols_callback(long data)
|
||||||
{
|
{
|
||||||
int &numcols=*(int *)data;
|
int &numcols=*(int *)data;
|
||||||
|
|
||||||
// Create print window
|
// Create print window
|
||||||
WINDOW win = xvt_print_create_win(printer().get_printrcd(), "Calcolo numero colonne");
|
TPrinter& pr = printer();
|
||||||
|
WINDOW win = xvt_print_create_win(pr.get_printrcd(), "Calcolo numero colonne");
|
||||||
if (win != NULL_WIN)
|
if (win != NULL_WIN)
|
||||||
{
|
{
|
||||||
long pw, ph, phr, pvr; // Printer width, height, horizontal and vertical resolution
|
long pw, ph, phr, pvr; // Printer width, height, horizontal and vertical resolution
|
||||||
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, printer().get_printrcd(), &ph, &pw, &pvr, &phr);
|
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, pr.get_printrcd(), &ph, &pw, &pvr, &phr);
|
||||||
xvtil_set_font(win, printer().fontname(), XVT_FS_NONE, printer().get_char_size());
|
xvtil_set_font(win, printer().fontname(), XVT_FS_NONE, pr.get_char_size());
|
||||||
|
|
||||||
|
|
||||||
// Compute maximum number of chars per line
|
// Compute maximum number of chars per line
|
||||||
int mincol = 0,maxcol=MAX_PR_WIDTH;
|
int mincol = 1, maxcol=MAX_PR_WIDTH;
|
||||||
TString spc(maxcol,'M' );
|
const TString spc(maxcol,'M');
|
||||||
|
|
||||||
numcols = maxcol;
|
numcols = (pw * 120) / (pr.get_char_size() * phr); // Primo guess
|
||||||
int w;
|
|
||||||
while (mincol < maxcol )
|
while (mincol < maxcol )
|
||||||
{
|
{
|
||||||
w = xvt_dwin_get_text_width(win, (char*)(const char*)spc, numcols);
|
const int w = xvt_dwin_get_text_width(win, spc, numcols);
|
||||||
|
|
||||||
if (w < pw)
|
if (w < pw)
|
||||||
mincol = numcols+1;
|
mincol = numcols+1;
|
||||||
else
|
else
|
||||||
@ -2097,10 +2100,10 @@ HIDDEN BOOLEAN calc_cols_callback(long data)
|
|||||||
// Funzione chiamata solo da sv1200, ma non si capisce perche' non usi la formwidth()
|
// Funzione chiamata solo da sv1200, ma non si capisce perche' non usi la formwidth()
|
||||||
int TPrinter::calc_num_cols() const
|
int TPrinter::calc_num_cols() const
|
||||||
{
|
{
|
||||||
int numcols;
|
int numcols = 80; // Default sensato
|
||||||
xvt_print_open();
|
xvt_print_open();
|
||||||
xvt_print_start_thread(calc_cols_callback, (long)&numcols);
|
xvt_print_start_thread(calc_cols_callback, (long)&numcols);
|
||||||
xvt_print_close();
|
xvt_print_close();
|
||||||
|
|
||||||
return numcols;
|
return numcols;
|
||||||
}
|
}
|
@ -59,6 +59,7 @@
|
|||||||
#define RDOC_CODCMS "CODCMS"
|
#define RDOC_CODCMS "CODCMS"
|
||||||
#define RDOC_FASCMS "FASCMS"
|
#define RDOC_FASCMS "FASCMS"
|
||||||
#define RDOC_CODCOSTO "CODCOSTO"
|
#define RDOC_CODCOSTO "CODCOSTO"
|
||||||
|
#define RDOC_CODAGG1 "CODAGG1"
|
||||||
|
#define RDOC_CODAGG2 "CODAGG2"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@ void TRecord_array::set_key(TRectype* r)
|
|||||||
{
|
{
|
||||||
const RecDes* recd = r->rec_des(); // Descrizione del record della testata
|
const RecDes* recd = r->rec_des(); // Descrizione del record della testata
|
||||||
const KeyDes& kd = recd->Ky[0]; // Elenco dei campi della chiave 1
|
const KeyDes& kd = recd->Ky[0]; // Elenco dei campi della chiave 1
|
||||||
|
|
||||||
// Copia tutti i campi chiave, tranne l'ultimo, in tutti i records
|
// Copia tutti i campi chiave, tranne l'ultimo, in tutti i records
|
||||||
TString val;
|
TString val;
|
||||||
for (int i = kd.NkFields-2; i >= 0; i--)
|
for (int i = kd.NkFields-2; i >= 0; i--)
|
||||||
@ -77,14 +78,15 @@ void TRecord_array::set_key(TRectype* r)
|
|||||||
const RecFieldDes& rf = recd->Fd[nf];
|
const RecFieldDes& rf = recd->Fd[nf];
|
||||||
val = r->get(rf.Name);
|
val = r->get(rf.Name);
|
||||||
renum_key(rf.Name, val);
|
renum_key(rf.Name, val);
|
||||||
|
CHECKS(i > 0 || val.full(), "First key field can't be empty: ", rf.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const TRectype& TRecord_array::key() const
|
const TRectype& TRecord_array::key() const
|
||||||
{
|
{
|
||||||
TRectype* r = (TRectype*)_data.objptr(0);
|
const TRectype* r = (const TRectype*)_data.objptr(0);
|
||||||
CHECK(r, "TRecord_array lost its key");
|
CHECK(r && !r->empty(), "TRecord_array lost its key");
|
||||||
return *r;
|
return *r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +118,7 @@ TRectype& TRecord_array::row(
|
|||||||
if (r == NULL && create)
|
if (r == NULL && create)
|
||||||
{
|
{
|
||||||
r = (TRectype*)key().dup(); // Crea nuovo record copiando la chiave
|
r = (TRectype*)key().dup(); // Crea nuovo record copiando la chiave
|
||||||
n = _data.add(r, i) + _offset; // Riassegna n se era negativo!
|
n = _data.add(r, i) + _offset; // Riassegna n se era negativo!
|
||||||
char str[16]; sprintf(str, "%d", n);
|
char str[16]; sprintf(str, "%d", n);
|
||||||
r->renum_key(_num, str); // Aggiorna campo numero riga
|
r->renum_key(_num, str); // Aggiorna campo numero riga
|
||||||
}
|
}
|
||||||
|
@ -174,9 +174,14 @@ bool TRecordset::save_as_html(const char* path)
|
|||||||
ofstream out(path);
|
ofstream out(path);
|
||||||
out << "<html>" << endl;
|
out << "<html>" << endl;
|
||||||
out << "<body>" << endl;
|
out << "<body>" << endl;
|
||||||
out << "<table border=\"1\">" << endl;
|
|
||||||
out << " <caption><h1>" << path << "</h1></caption>" << endl;
|
|
||||||
|
|
||||||
|
TString qry; parsed_text(qry);
|
||||||
|
for (int i = qry.find('\n'); i > 0; i = qry.find('\n', i+1))
|
||||||
|
qry.insert("<br/>", i+1);
|
||||||
|
|
||||||
|
out << "<p><b>" << qry << "</b></p>" << endl;
|
||||||
|
|
||||||
|
out << "<table border=\"1\">" << endl;
|
||||||
out << " <thead>";
|
out << " <thead>";
|
||||||
for (unsigned int c = 0; c < columns(); c++)
|
for (unsigned int c = 0; c < columns(); c++)
|
||||||
{
|
{
|
||||||
@ -664,17 +669,22 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
|
|||||||
TString_array lista;
|
TString_array lista;
|
||||||
TFilename path;
|
TFilename path;
|
||||||
|
|
||||||
// Leggo i files in custom
|
|
||||||
if (main_app().has_module(RSAUT))
|
|
||||||
{
|
|
||||||
TFilename custom = firm2dir(-1);
|
|
||||||
custom.add("custom");
|
|
||||||
if (!custom.exist())
|
|
||||||
xvt_fsys_mkdir(custom);
|
|
||||||
|
|
||||||
path = custom;
|
{
|
||||||
path.add("*");
|
TWait_cursor hourglass;
|
||||||
path.ext(ext);
|
|
||||||
|
TString_array files;
|
||||||
|
// Leggo i files in custom
|
||||||
|
if (main_app().has_module(RSAUT))
|
||||||
|
{
|
||||||
|
TFilename custom = firm2dir(-1);
|
||||||
|
custom.add("custom");
|
||||||
|
if (!custom.exist())
|
||||||
|
xvt_fsys_mkdir(custom);
|
||||||
|
|
||||||
|
path = custom;
|
||||||
|
path.add("*");
|
||||||
|
path.ext(ext);
|
||||||
|
|
||||||
list_files(path, lista);
|
list_files(path, lista);
|
||||||
}
|
}
|
||||||
@ -682,6 +692,7 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
|
|||||||
list_files(path, lista);
|
list_files(path, lista);
|
||||||
sort_files(lista); // Ordino i files e rimuovo i doppioni
|
sort_files(lista); // Ordino i files e rimuovo i doppioni
|
||||||
|
|
||||||
|
|
||||||
TString8 acqua;
|
TString8 acqua;
|
||||||
TString stringona, desc;
|
TString stringona, desc;
|
||||||
|
|
||||||
@ -699,6 +710,7 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
|
|||||||
get_xml_attr(stringona, "class", acqua);
|
get_xml_attr(stringona, "class", acqua);
|
||||||
if (classe && *classe)
|
if (classe && *classe)
|
||||||
ok = acqua == classe;
|
ok = acqua == classe;
|
||||||
|
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
@ -708,6 +720,7 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
|
|||||||
riga->add(acqua);
|
riga->add(acqua);
|
||||||
riga->add(desc);
|
riga->add(desc);
|
||||||
files.add(riga);
|
files.add(riga);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -721,6 +734,7 @@ bool select_custom_file(TFilename& path, const char* ext, const char* library)
|
|||||||
TString_array& files = sheet.rows_array();
|
TString_array& files = sheet.rows_array();
|
||||||
|
|
||||||
bool ok = list_custom_files(ext, library, files);
|
bool ok = list_custom_files(ext, library, files);
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
TFilename name;
|
TFilename name;
|
||||||
@ -1436,7 +1450,7 @@ bool TSQL_recordset::move_to(TRecnotype n)
|
|||||||
sql.trim();
|
sql.trim();
|
||||||
_page.destroy();
|
_page.destroy();
|
||||||
if (n >= _pagesize)
|
if (n >= _pagesize)
|
||||||
_first_row = n-_pagesize/8; // Prendo qualche riga dalla pagina precedente, per velocizzare il pagina su
|
_first_row = n-32; // Prendo qualche riga dalla pagina precedente, per velocizzare il pagina su
|
||||||
else
|
else
|
||||||
_first_row = n;
|
_first_row = n;
|
||||||
sql << "\nLIMIT " << _pagesize << " OFFSET " << _first_row << ';';
|
sql << "\nLIMIT " << _pagesize << " OFFSET " << _first_row << ';';
|
||||||
@ -2196,7 +2210,7 @@ unsigned int TISAM_recordset::columns() const
|
|||||||
bool TISAM_recordset::move_to(TRecnotype pos)
|
bool TISAM_recordset::move_to(TRecnotype pos)
|
||||||
{
|
{
|
||||||
TCursor* c = cursor();
|
TCursor* c = cursor();
|
||||||
bool ok = c != NULL;
|
bool ok = c != NULL && pos >= 0;
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
*c = pos;
|
*c = pos;
|
||||||
@ -2275,4 +2289,3 @@ TRecordset_sheet::TRecordset_sheet(TRecordset& query)
|
|||||||
: TSheet(-1, -1, -2, -4, "Query", query.sheet_head()), _query(query)
|
: TSheet(-1, -1, -2, -4, "Query", query.sheet_head()), _query(query)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2124,6 +2124,17 @@ bool TReport::load(const char* fname)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_allegati.destroy();
|
||||||
|
const TXmlItem* all = xml.FindFirstChild("allegates");
|
||||||
|
if (all != NULL)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < all->GetChildren(); i++)
|
||||||
|
{
|
||||||
|
const TXmlItem* item = all->GetChild(i);
|
||||||
|
_allegati.add(item->GetAttr("name"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -2177,6 +2188,15 @@ bool TReport::save(const char* fname) const
|
|||||||
item << str->get();
|
item << str->get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (_allegati.items() > 0) // Salva lista dei parametri se necessario
|
||||||
|
{
|
||||||
|
TXmlItem& all = xml.AddChild("allegates");
|
||||||
|
FOR_EACH_ARRAY_ROW(_allegati, i, str) if (str->full())
|
||||||
|
{
|
||||||
|
TXmlItem& item = all.AddChild("item");
|
||||||
|
item.SetAttr("name", *str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
xml.Save(fname);
|
xml.Save(fname);
|
||||||
}
|
}
|
||||||
@ -2290,6 +2310,14 @@ bool TReport::get_report_field(const TString& name, TVariant& var) const
|
|||||||
var = long(_book_page);
|
var = long(_book_page);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (strncmp(str, "ALLEGATE", 8) == 0)
|
||||||
|
{
|
||||||
|
const int index = atoi(str + 9);
|
||||||
|
if (index >= 0 && index < _allegati.items())
|
||||||
|
var = _allegati.row(index);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
@ -2973,4 +3001,4 @@ TReport::TReport()
|
|||||||
TReport::~TReport()
|
TReport::~TReport()
|
||||||
{
|
{
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
@ -464,6 +464,7 @@ class TReport : public TAlex_virtual_machine
|
|||||||
word _rep_page, _book_page;
|
word _rep_page, _book_page;
|
||||||
bool _use_printer_font;
|
bool _use_printer_font;
|
||||||
int _orientation;
|
int _orientation;
|
||||||
|
TString_array _allegati;
|
||||||
TReport_field* _curr_field;
|
TReport_field* _curr_field;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -539,8 +540,8 @@ public:
|
|||||||
virtual bool execute_prescript();
|
virtual bool execute_prescript();
|
||||||
virtual bool execute_postscript();
|
virtual bool execute_postscript();
|
||||||
|
|
||||||
const TString_array& params() const { return _params; }
|
|
||||||
void set_params(const TString_array& p) { _params = p; }
|
void set_params(const TString_array& p) { _params = p; }
|
||||||
|
const TString_array& params() const { return _params; }
|
||||||
|
|
||||||
void set_libraries(const char* inc) { _include = inc; }
|
void set_libraries(const char* inc) { _include = inc; }
|
||||||
TToken_string& get_libraries() { return _include; }
|
TToken_string& get_libraries() { return _include; }
|
||||||
@ -549,6 +550,9 @@ public:
|
|||||||
void set_description(const char* d) { _description = d; }
|
void set_description(const char* d) { _description = d; }
|
||||||
const TString& description() const { return _description; }
|
const TString& description() const { return _description; }
|
||||||
|
|
||||||
|
void set_allegates(const TString_array& all) { _allegati = all; }
|
||||||
|
const TString_array& allegates() const { return _allegati; }
|
||||||
|
|
||||||
const TFilename& filename() const { return _path; }
|
const TFilename& filename() const { return _path; }
|
||||||
bool save(const char* fname) const;
|
bool save(const char* fname) const;
|
||||||
bool load(const char* fname);
|
bool load(const char* fname);
|
||||||
@ -567,6 +571,7 @@ public:
|
|||||||
void report2mask(TMask & m) const;
|
void report2mask(TMask & m) const;
|
||||||
void mask2report(const TMask & m);
|
void mask2report(const TMask & m);
|
||||||
|
|
||||||
|
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
TReport();
|
TReport();
|
||||||
|
@ -92,6 +92,7 @@ void advanced_draw_text_line(TWindow& win, const char* text, const RCT& r, char
|
|||||||
RCT clipper;
|
RCT clipper;
|
||||||
xvt_rect_intersect(&clipper, &orig, (RCT*)&r);
|
xvt_rect_intersect(&clipper, &orig, (RCT*)&r);
|
||||||
xvt_dwin_set_clip(w, (RCT*)&clipper);
|
xvt_dwin_set_clip(w, (RCT*)&clipper);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
xvt_dwin_set_clip(w, (RCT*)&r);
|
xvt_dwin_set_clip(w, (RCT*)&r);
|
||||||
@ -734,21 +735,42 @@ TPreview_mask::TPreview_mask(TBook* book) : _book(book)
|
|||||||
|
|
||||||
class TWindow_printer : public TWindow
|
class TWindow_printer : public TWindow
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
bool is_ok() const { return win() != NULL_WIN; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool print_doc(const TFilename& name);
|
||||||
|
|
||||||
TWindow_printer(PRINT_RCD* rcd);
|
TWindow_printer(PRINT_RCD* rcd);
|
||||||
~TWindow_printer();
|
~TWindow_printer();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool TWindow_printer::print_doc(const TFilename& name)
|
||||||
|
{
|
||||||
|
bool ok = name.exist();
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
const bool printing = is_ok();
|
||||||
|
if (printing)
|
||||||
|
xvt_print_suspend_thread();
|
||||||
|
ok = xvt_sys_goto_url(name, "print") != 0;
|
||||||
|
if (printing)
|
||||||
|
xvt_print_restart_thread();
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
TWindow_printer::TWindow_printer(PRINT_RCD* rcd)
|
TWindow_printer::TWindow_printer(PRINT_RCD* rcd)
|
||||||
{
|
{
|
||||||
WINDOW prwin = xvt_print_create_win(rcd, "Stampa");
|
WINDOW prwin = xvt_print_create_win(rcd, "Stampa");
|
||||||
|
|
||||||
set_win(prwin);
|
set_win(prwin);
|
||||||
_pixmap = true;
|
_pixmap = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
TWindow_printer::~TWindow_printer()
|
TWindow_printer::~TWindow_printer()
|
||||||
{
|
{
|
||||||
if (win() != NULL_WIN)
|
if (is_ok())
|
||||||
{
|
{
|
||||||
xvt_vobj_destroy(win());
|
xvt_vobj_destroy(win());
|
||||||
set_win(NULL_WIN);
|
set_win(NULL_WIN);
|
||||||
@ -837,12 +859,20 @@ int TBook::compute_text_frame(const TString& tmp, const TReport_font& font, TRec
|
|||||||
|
|
||||||
TPoint TBook::page_size() const
|
TPoint TBook::page_size() const
|
||||||
{
|
{
|
||||||
|
if (_pw <= 0 || _ph <= 0) // Valori nulli: mi invento un A4
|
||||||
|
{
|
||||||
|
TPoint pag = page_res();
|
||||||
|
pag.x *= 8; pag.y *= 11;
|
||||||
|
return pag;
|
||||||
|
}
|
||||||
return TPoint(_pw, _ph);
|
return TPoint(_pw, _ph);
|
||||||
}
|
}
|
||||||
|
|
||||||
TPoint TBook::page_res() const
|
TPoint TBook::page_res() const
|
||||||
{
|
{
|
||||||
return TPoint(_phr, _pvr);
|
const int resx = _phr > 0 ? _phr : 96;
|
||||||
|
const int resy = _pvr > 0 ? _pvr : 96;
|
||||||
|
return TPoint(resx, resy);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TBook::open_page()
|
bool TBook::open_page()
|
||||||
@ -874,8 +904,8 @@ bool TBook::close_page()
|
|||||||
*_out << "</page number=" << page() << '>' << endl;
|
*_out << "</page number=" << page() << '>' << endl;
|
||||||
|
|
||||||
_pages++;
|
_pages++;
|
||||||
|
|
||||||
_page_is_open = false;
|
_page_is_open = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1029,6 +1059,13 @@ void TBook::draw_image(const TRectangle& rect, const char* name)
|
|||||||
*_out << "<image src=\"" << name << "\" />" << endl;
|
*_out << "<image src=\"" << name << "\" />" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TBook::add_doc(const TString& name)
|
||||||
|
{
|
||||||
|
TBook::open_page();
|
||||||
|
*_out << "<doc url=\"" << name << "\" />"<< endl;
|
||||||
|
TBook::close_page();
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Reading a page
|
// Reading a page
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -1070,6 +1107,46 @@ int get_xml_int(const TString& line, const char* attr, int def)
|
|||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TBook::print_doc(TWindow& win, const TFilename& name)
|
||||||
|
{
|
||||||
|
const bool print = win.win() == 883;
|
||||||
|
|
||||||
|
if (print)
|
||||||
|
{
|
||||||
|
TWindow_printer& wp = (TWindow_printer&)win;
|
||||||
|
wp.print_doc(name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TPoint ps = page_size();
|
||||||
|
TRectangle rect(TPoint(0,0), ps);
|
||||||
|
RCT page; win.log2dev(rect, page);
|
||||||
|
advanced_draw_text(win, name, page, 'C', 'T');
|
||||||
|
|
||||||
|
const TPoint pr = page_res();
|
||||||
|
rect.deflate(pr.x/2, pr.y/2);
|
||||||
|
win.log2dev(rect, page);
|
||||||
|
|
||||||
|
TString4 ext = name.right(3); ext.lower();
|
||||||
|
if (ext == "bmp" || ext == "gif" || ext == "jpg" || ext == "peg")
|
||||||
|
{
|
||||||
|
const TImage* img = _images.image(name);
|
||||||
|
if (img != NULL)
|
||||||
|
{
|
||||||
|
const double sx = double(page.right) / double(img->width());
|
||||||
|
const double sy = double(page.bottom) / double(img->height());
|
||||||
|
const double s = sx < sy ? sx : sy;
|
||||||
|
const int w = int(s * img->width());
|
||||||
|
const int h = int(s * img->height());
|
||||||
|
RCT rct;
|
||||||
|
rct.left = (page.right+page.left-w)/2; rct.right = rct.left + w;
|
||||||
|
rct.top = (page.bottom+page.top-h)/2; rct.bottom = rct.top + h;
|
||||||
|
img->draw(win.win(), rct);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool TBook::print_page(TWindow& win, size_t page)
|
bool TBook::print_page(TWindow& win, size_t page)
|
||||||
{
|
{
|
||||||
if (page <= 0 || page > pages())
|
if (page <= 0 || page > pages())
|
||||||
@ -1105,6 +1182,8 @@ bool TBook::print_page(TWindow& win, size_t page)
|
|||||||
|
|
||||||
_horizontal_alignment = 'L'; // Reset text alignment
|
_horizontal_alignment = 'L'; // Reset text alignment
|
||||||
_vertical_alignment = 'T';
|
_vertical_alignment = 'T';
|
||||||
|
|
||||||
|
bool page_is_open = false; // Stato attuale della pagina della stampante
|
||||||
|
|
||||||
while (!ifs.eof())
|
while (!ifs.eof())
|
||||||
{
|
{
|
||||||
@ -1112,6 +1191,27 @@ bool TBook::print_page(TWindow& win, size_t page)
|
|||||||
if (str.starts_with("</page"))
|
if (str.starts_with("</page"))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (str.starts_with("<page "))
|
||||||
|
{
|
||||||
|
// Non apro ora la pagina sulla stampante perche' potrei incontrare un allegato
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str.starts_with("<doc")) // Stampa il documento allegato senza aprire la pagina su carta
|
||||||
|
{
|
||||||
|
TFilename name; get_xml_string(str, "url", name);
|
||||||
|
print_doc(win, name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Per i comandi successivi serve una pagina aperta!
|
||||||
|
if (!page_is_open && !preview)
|
||||||
|
{
|
||||||
|
page_is_open = xvt_print_open_page(_rcd) != 0;
|
||||||
|
if (!page_is_open)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (str.starts_with("<a "))
|
if (str.starts_with("<a "))
|
||||||
{
|
{
|
||||||
if (preview && rct.bottom >= visible.top && rct.top <= visible.bottom)
|
if (preview && rct.bottom >= visible.top && rct.top <= visible.bottom)
|
||||||
@ -1140,7 +1240,7 @@ bool TBook::print_page(TWindow& win, size_t page)
|
|||||||
rl->set(field, stringona);
|
rl->set(field, stringona);
|
||||||
rl->add_rect(rct);
|
rl->add_rect(rct);
|
||||||
|
|
||||||
if (!stringona.blank() && rct.right > rct.left) // Possono esserci campi chiave nascosti
|
if (stringona.full() && rct.right > rct.left) // Possono esserci campi chiave nascosti
|
||||||
{
|
{
|
||||||
DRAW_CTOOLS dct;
|
DRAW_CTOOLS dct;
|
||||||
xvt_dwin_get_draw_ctools(w, &dct);
|
xvt_dwin_get_draw_ctools(w, &dct);
|
||||||
@ -1153,7 +1253,8 @@ bool TBook::print_page(TWindow& win, size_t page)
|
|||||||
win.set_color(COLOR_BLUE, dct.back_color);
|
win.set_color(COLOR_BLUE, dct.back_color);
|
||||||
advanced_draw_text_line(win, stringona, rct, _horizontal_alignment, _vertical_alignment);
|
advanced_draw_text_line(win, stringona, rct, _horizontal_alignment, _vertical_alignment);
|
||||||
win.set_color(dct.fore_color, dct.back_color);
|
win.set_color(dct.fore_color, dct.back_color);
|
||||||
xvt_dwin_set_font(w, oldfont);
|
xvt_dwin_set_font(w, oldfont);
|
||||||
|
xvt_font_destroy(newfont);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1174,10 +1275,12 @@ bool TBook::print_page(TWindow& win, size_t page)
|
|||||||
{
|
{
|
||||||
xvt_dwin_set_clip(w, &rct);
|
xvt_dwin_set_clip(w, &rct);
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (str.starts_with("</clip"))
|
if (str.starts_with("</clip"))
|
||||||
{
|
{
|
||||||
xvt_dwin_set_clip(w, NULL);
|
xvt_dwin_set_clip(w, NULL);
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (str == "<ellipse/>")
|
if (str == "<ellipse/>")
|
||||||
{
|
{
|
||||||
xvt_dwin_draw_oval(w, &rct);
|
xvt_dwin_draw_oval(w, &rct);
|
||||||
@ -1201,6 +1304,7 @@ bool TBook::print_page(TWindow& win, size_t page)
|
|||||||
xvt_dwin_set_font(w, font.get_preview_font(win, page_res()));
|
xvt_dwin_set_font(w, font.get_preview_font(win, page_res()));
|
||||||
else
|
else
|
||||||
xvt_dwin_set_font(w, font.get_xvt_font(win));
|
xvt_dwin_set_font(w, font.get_xvt_font(win));
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (str.starts_with("<image "))
|
if (str.starts_with("<image "))
|
||||||
@ -1217,6 +1321,7 @@ bool TBook::print_page(TWindow& win, size_t page)
|
|||||||
const PNT to = { rct.bottom, rct.right };
|
const PNT to = { rct.bottom, rct.right };
|
||||||
xvt_dwin_draw_set_pos(w, fr);
|
xvt_dwin_draw_set_pos(w, fr);
|
||||||
xvt_dwin_draw_line(w, to);
|
xvt_dwin_draw_line(w, to);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (str == "<pages/>")
|
if (str == "<pages/>")
|
||||||
@ -1302,6 +1407,11 @@ bool TBook::print_page(TWindow& win, size_t page)
|
|||||||
plinks.sort();
|
plinks.sort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (page_is_open)
|
||||||
|
xvt_print_close_page(_rcd);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1482,18 +1592,10 @@ bool TBook::main_loop()
|
|||||||
_print_aborted = false;
|
_print_aborted = false;
|
||||||
for (size_t c = 0; c < _copies && !_print_aborted; c++)
|
for (size_t c = 0; c < _copies && !_print_aborted; c++)
|
||||||
{
|
{
|
||||||
for (size_t page = _pagefrom; page <= _pageto; page++)
|
for (size_t page = _pagefrom; page <= _pageto && !_print_aborted; page++)
|
||||||
{
|
{
|
||||||
if (xvt_print_open_page(_rcd))
|
if (!print_page(win, page))
|
||||||
{
|
|
||||||
print_page(*_printwin, page);
|
|
||||||
xvt_print_close_page(_rcd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_print_aborted = true;
|
_print_aborted = true;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1574,7 +1676,8 @@ bool TBook::print_or_preview()
|
|||||||
TBook::TBook(const char* name)
|
TBook::TBook(const char* name)
|
||||||
: _out(NULL), _is_temporary(false),
|
: _out(NULL), _is_temporary(false),
|
||||||
_pw(0), _ph(0), _pvr(0), _phr(0),
|
_pw(0), _ph(0), _pvr(0), _phr(0),
|
||||||
_pages(0), _page(0), _rcd(NULL), _printwin(NULL)
|
_pages(0), _page(0), _rcd(NULL), _printwin(NULL), _page_is_open(false)
|
||||||
|
|
||||||
{
|
{
|
||||||
_file = name;
|
_file = name;
|
||||||
if (_file.blank())
|
if (_file.blank())
|
||||||
@ -1853,8 +1956,8 @@ long TReport_book::print_section(TReport_section& rs)
|
|||||||
rs.print(*this);
|
rs.print(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rs.level() > 0) // Ho stampato qualcosa che non sia lo sfondo!
|
if (rs.level() > 0 && (rs.type() != 'H' || rs.level() > 1)) // Ho stampato qualcosa che non sia lo sfondo!
|
||||||
_page_break_allowed = true;
|
_page_break_allowed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rs.execute_postscript())
|
if (!rs.execute_postscript())
|
||||||
@ -2111,6 +2214,22 @@ bool TReport_book::add(TReport& rep, bool progind)
|
|||||||
close_page();
|
close_page();
|
||||||
|
|
||||||
_report->execute_postscript();
|
_report->execute_postscript();
|
||||||
|
|
||||||
|
if (!_print_aborted)
|
||||||
|
{
|
||||||
|
const TString_array& all = _report->allegates();
|
||||||
|
for (int a = 0; a < all.items(); a++)
|
||||||
|
{
|
||||||
|
TFilename name = all.row(a);
|
||||||
|
if (name.find('#') >= 0) // Se puo' essere un'espressione
|
||||||
|
{
|
||||||
|
TVariant var;
|
||||||
|
if (_report->evaluate(name, var, _alfafld))
|
||||||
|
name = var.as_string();
|
||||||
|
}
|
||||||
|
add_doc(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pi != NULL)
|
if (pi != NULL)
|
||||||
@ -2176,6 +2295,4 @@ bool TReport_book::on_link(const TReport_link& lnk)
|
|||||||
|
|
||||||
TReport_book::TReport_book(const char* name)
|
TReport_book::TReport_book(const char* name)
|
||||||
: TBook(name), _report(NULL)
|
: TBook(name), _report(NULL)
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ protected:
|
|||||||
virtual bool init();
|
virtual bool init();
|
||||||
TPoint log2dev(const TPoint& ptlog) const;
|
TPoint log2dev(const TPoint& ptlog) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool open_page();
|
virtual bool open_page();
|
||||||
virtual bool close_page();
|
virtual bool close_page();
|
||||||
@ -53,7 +54,8 @@ public:
|
|||||||
virtual void draw_book_pages(const TRectangle& r);
|
virtual void draw_book_pages(const TRectangle& r);
|
||||||
virtual void set_clip(long top, long bottom);
|
virtual void set_clip(long top, long bottom);
|
||||||
virtual int compute_text_frame(const TString& txt, const TReport_font& font, TRectangle& rect, TString_array& para) const;
|
virtual int compute_text_frame(const TString& txt, const TReport_font& font, TRectangle& rect, TString_array& para) const;
|
||||||
|
virtual void add_doc(const TString& name);
|
||||||
|
|
||||||
TPoint page_size() const;
|
TPoint page_size() const;
|
||||||
TPoint page_res() const;
|
TPoint page_res() const;
|
||||||
size_t page() const { return _page; }
|
size_t page() const { return _page; }
|
||||||
@ -115,4 +117,4 @@ void advanced_draw_text_line(TWindow& win, const char* text, const RCT& r, char
|
|||||||
void advanced_draw_paragraph(TWindow& win, const TString_array& text, const RCT& r,
|
void advanced_draw_paragraph(TWindow& win, const TString_array& text, const RCT& r,
|
||||||
char halign, char valign, int default_row_height);
|
char halign, char valign, int default_row_height);
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -213,7 +213,6 @@ TString& TString::operator <<(const TObject& obj)
|
|||||||
return operator <<(spark);
|
return operator <<(spark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TString& TString::operator <<(const TString& str)
|
TString& TString::operator <<(const TString& str)
|
||||||
{ return operator <<(str._str); }
|
{ return operator <<(str._str); }
|
||||||
|
|
||||||
@ -230,11 +229,11 @@ TString& TString::strip(
|
|||||||
const char& c = *s;
|
const char& c = *s;
|
||||||
if (strchr(k, c) == NULL)
|
if (strchr(k, c) == NULL)
|
||||||
_str[j++] = c;
|
_str[j++] = c;
|
||||||
|
|
||||||
}
|
}
|
||||||
return cut(j);
|
return cut(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TString::blank() const
|
bool TString::blank() const
|
||||||
{
|
{
|
||||||
for (const char* s = _str; *s; s++)
|
for (const char* s = _str; *s; s++)
|
||||||
@ -243,6 +242,16 @@ bool TString::blank() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TString::full() const
|
||||||
|
{
|
||||||
|
for (const char* s = _str; *s; s++)
|
||||||
|
if (!is_space(*s))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TString& TString::strip_spaces()
|
TString& TString::strip_spaces()
|
||||||
{
|
{
|
||||||
char instring = '\0';
|
char instring = '\0';
|
||||||
@ -307,8 +316,7 @@ TObject* TString::dup() const
|
|||||||
//
|
//
|
||||||
// @rdesc Ritorna il puntatore alla stringa duplicata
|
// @rdesc Ritorna il puntatore alla stringa duplicata
|
||||||
{
|
{
|
||||||
TString* s = new TString(_str);
|
return new TString(_str);
|
||||||
return s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TString::read_from(istream& in)
|
void TString::read_from(istream& in)
|
||||||
@ -352,11 +360,13 @@ int TString::find(
|
|||||||
// Nel caso <p from> sia maggiore della lunghezza della stringa manda
|
// Nel caso <p from> sia maggiore della lunghezza della stringa manda
|
||||||
// un messaggio di errore
|
// un messaggio di errore
|
||||||
{
|
{
|
||||||
|
CHECKD(from >= 0, "bad string index", from);
|
||||||
|
CHECK(c, "bad character to find");
|
||||||
int pos = -1;
|
int pos = -1;
|
||||||
if (from == 0 || from < len())
|
if (from == 0 || from < len())
|
||||||
{
|
{
|
||||||
const char* p = strchr(_str + from, c);
|
const char* p = strchr(_str + from, c);
|
||||||
if (p)
|
if (p != NULL)
|
||||||
pos = int(p - _str);
|
pos = int(p - _str);
|
||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
@ -390,6 +400,8 @@ HIDDEN const char* strstr(const char* string1, const char* string2)
|
|||||||
// Certified 100%
|
// Certified 100%
|
||||||
int TString::find(const char* s, int from) const
|
int TString::find(const char* s, int from) const
|
||||||
{
|
{
|
||||||
|
CHECKD(from >= 0, "bad string index", from);
|
||||||
|
CHECK(s && *s, "bad string to find");
|
||||||
int pos = -1;
|
int pos = -1;
|
||||||
if (from == 0 || from < len())
|
if (from == 0 || from < len())
|
||||||
{
|
{
|
||||||
@ -405,6 +417,7 @@ bool TString::match(const char* pat, bool ignore_case) const
|
|||||||
if (pat == NULL || *pat =='\0')
|
if (pat == NULL || *pat =='\0')
|
||||||
return empty();
|
return empty();
|
||||||
return xvt_str_match(_str, pat, !ignore_case) != 0;
|
return xvt_str_match(_str, pat, !ignore_case) != 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int TString::replace(char find_char, char replace_char)
|
int TString::replace(char find_char, char replace_char)
|
||||||
@ -2073,4 +2086,4 @@ TToken_string& get_tmp_string(int len)
|
|||||||
if (++next >= ararar.size())
|
if (++next >= ararar.size())
|
||||||
next = 0;
|
next = 0;
|
||||||
return *str;
|
return *str;
|
||||||
}
|
}
|
@ -99,7 +99,8 @@ public:
|
|||||||
// @cmember Controlla se la stringa e' vuota o contiene solo whitespace (true se vuota)
|
// @cmember Controlla se la stringa e' vuota o contiene solo whitespace (true se vuota)
|
||||||
bool blank() const;
|
bool blank() const;
|
||||||
// @cmember Controlla se la stringa NON e' vuota o contiene solo whitespace (true se vuota)
|
// @cmember Controlla se la stringa NON e' vuota o contiene solo whitespace (true se vuota)
|
||||||
bool full() const { return !blank(); }
|
bool full() const;
|
||||||
|
|
||||||
|
|
||||||
// @cmember Ritorna la posizione della prima occorrenza carattere char nell'oggetto TString
|
// @cmember Ritorna la posizione della prima occorrenza carattere char nell'oggetto TString
|
||||||
int find(char, int from = 0) const;
|
int find(char, int from = 0) const;
|
||||||
@ -760,4 +761,3 @@ const char SLASH =
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
6
include/user.h
Executable file
6
include/user.h
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#define USR_USERNAME "USERNAME"
|
||||||
|
#define USR_USERDESC "USERDESC"
|
||||||
|
#define USR_PASSWORD "PASSWORD"
|
||||||
|
#define USR_DATAPWD "DATAPWD"
|
||||||
|
#define USR_ISGROUP "ISGROUP"
|
||||||
|
#define USR_AUTSTR "AUTSTR"
|
@ -243,7 +243,12 @@ TVariant& TVariant::sub(const TVariant& var)
|
|||||||
{
|
{
|
||||||
switch (_type)
|
switch (_type)
|
||||||
{
|
{
|
||||||
case _datefld: set(as_date() - var.as_int()); break;
|
case _datefld:
|
||||||
|
if (var.type() == _datefld)
|
||||||
|
set(as_date() - var.as_date());
|
||||||
|
else
|
||||||
|
set(as_date() - var.as_int());
|
||||||
|
break;
|
||||||
case _longfld:
|
case _longfld:
|
||||||
if (var.type() == _longfld)
|
if (var.type() == _longfld)
|
||||||
{
|
{
|
||||||
|
@ -85,6 +85,19 @@ void TRectangle::merge(const TRectangle& rct)
|
|||||||
set_bounds(l, t, r, b);
|
set_bounds(l, t, r, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TRectangle::inflate(int dx, int dy)
|
||||||
|
{
|
||||||
|
x -= dx; y -= dy;
|
||||||
|
_size.x += 2*dx;
|
||||||
|
_size.y += 2*dy;
|
||||||
|
normalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRectangle::deflate(int dx, int dy)
|
||||||
|
{
|
||||||
|
inflate(-dx, -dy);
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Utilities
|
// Utilities
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -130,7 +143,7 @@ HIDDEN bool remove_menu_item(MENU_ITEM* menu, MENU_TAG id, bool ismbar)
|
|||||||
HIDDEN void set_menu_item(MENU_ITEM& m, TToken_string& tt)
|
HIDDEN void set_menu_item(MENU_ITEM& m, TToken_string& tt)
|
||||||
{
|
{
|
||||||
MENU_TAG tag = tt.get_int(0);
|
MENU_TAG tag = tt.get_int(0);
|
||||||
TString flag = tt.items() <= 2 ? "": tt.get(2);
|
TString flag = tt.items() <= 2 ? "": tt.get(2);
|
||||||
char* text = NULL;
|
char* text = NULL;
|
||||||
if (strlen(tt.get(1)) > 0)
|
if (strlen(tt.get(1)) > 0)
|
||||||
{
|
{
|
||||||
|
@ -68,6 +68,8 @@ public:
|
|||||||
bool contains(const TRectangle& r) const;
|
bool contains(const TRectangle& r) const;
|
||||||
bool intersects(const TRectangle& r) const;
|
bool intersects(const TRectangle& r) const;
|
||||||
void merge(const TRectangle& r);
|
void merge(const TRectangle& r);
|
||||||
|
void inflate(int dx, int dy);
|
||||||
|
void deflate(int dx, int dy);
|
||||||
bool is_empty() const { return _size.x == 0 || _size.y == 0; }
|
bool is_empty() const { return _size.x == 0 || _size.y == 0; }
|
||||||
|
|
||||||
// @cmember Confronta se due rettangoli sono uguali (TRUE se uguali)
|
// @cmember Confronta se due rettangoli sono uguali (TRUE se uguali)
|
||||||
|
@ -59,12 +59,13 @@
|
|||||||
#define ANAMAG_USER8 "USER8"
|
#define ANAMAG_USER8 "USER8"
|
||||||
#define ANAMAG_USER9 "USER9"
|
#define ANAMAG_USER9 "USER9"
|
||||||
#define ANAMAG_USER10 "USER10"
|
#define ANAMAG_USER10 "USER10"
|
||||||
#define ANAMAG_NUMREG1 "NUMREG1"
|
#define ANAMAG_NUMREG1 "NUMREG1"
|
||||||
#define ANAMAG_NUMREG2 "NUMREG2"
|
#define ANAMAG_NUMREG2 "NUMREG2"
|
||||||
#define ANAMAG_CONTOINDA "CONTOINDA"
|
#define ANAMAG_CONTOINDA "CONTOINDA"
|
||||||
#define ANAMAG_CONTOINDV "CONTOINDV"
|
#define ANAMAG_CONTOINDV "CONTOINDV"
|
||||||
#define ANAMAG_DATAVDIST "DATAVDIST"
|
#define ANAMAG_DATAVDIST "DATAVDIST"
|
||||||
#define ANAMAG_VALDIST "VALDIST"
|
#define ANAMAG_VALDIST "VALDIST"
|
||||||
|
#define ANAMAG_GOLEM "GOLEM"
|
||||||
|
|
||||||
#define NULL_CODART "_****_"
|
#define NULL_CODART "_****_"
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ class TMask_movmag : public TMask
|
|||||||
static void sheetrighe_get(TSheet_field &fld_righe, int item);
|
static void sheetrighe_get(TSheet_field &fld_righe, int item);
|
||||||
public:
|
public:
|
||||||
TArticolo_giacenza& curr_art();
|
TArticolo_giacenza& curr_art();
|
||||||
|
void update_tot();
|
||||||
const TMagazzini & magazzini() const
|
const TMagazzini & magazzini() const
|
||||||
{return _magazzini;}
|
{return _magazzini;}
|
||||||
TMask_movmag(TMov_mag * m_m);
|
TMask_movmag(TMov_mag * m_m);
|
||||||
@ -179,6 +180,22 @@ bool TMask_movmag::handle_righe(TMask_field &f, KEY k)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TMask_movmag::update_tot()
|
||||||
|
{
|
||||||
|
TSheet_field & ss = sfield(F_RIGHE);
|
||||||
|
const int rows = ss.items();
|
||||||
|
real tot;
|
||||||
|
|
||||||
|
for (int i = 0 ; i < rows; i++)
|
||||||
|
{
|
||||||
|
TToken_string & r = ss.row(i);
|
||||||
|
real valore = r.get(ss.cid2index(F_VALORE));
|
||||||
|
|
||||||
|
tot += valore;
|
||||||
|
}
|
||||||
|
set(F_VALORE_TOT, tot);
|
||||||
|
}
|
||||||
|
|
||||||
bool TMask_movmag::notify_righe(TSheet_field & ss, int r, KEY key)
|
bool TMask_movmag::notify_righe(TSheet_field & ss, int r, KEY key)
|
||||||
{
|
{
|
||||||
TMask_movmag &m=(TMask_movmag &)ss.mask();
|
TMask_movmag &m=(TMask_movmag &)ss.mask();
|
||||||
@ -195,7 +212,10 @@ bool TMask_movmag::notify_righe(TSheet_field & ss, int r, KEY key)
|
|||||||
ss.destroy(r+1);
|
ss.destroy(r+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (key == K_INS) { // Inserimento
|
} else if ( key == K_CTRL + K_DEL ) // Cancellazione
|
||||||
|
{
|
||||||
|
m.update_tot();
|
||||||
|
} else if (key == K_INS) { // Inserimento
|
||||||
if (r < ss.items() && *ss.cell(r,ss.cid2index( F_AUTOMATICA))==riga_automatica)
|
if (r < ss.items() && *ss.cell(r,ss.cid2index( F_AUTOMATICA))==riga_automatica)
|
||||||
return FALSE; // cannot insert between a row and its generated one
|
return FALSE; // cannot insert between a row and its generated one
|
||||||
|
|
||||||
@ -259,6 +279,8 @@ bool TMask_movmag::notify_righe(TSheet_field & ss, int r, KEY key)
|
|||||||
}
|
}
|
||||||
if (m.update_rigamov(r,old_codcaus,old_codart,old_quant))
|
if (m.update_rigamov(r,old_codcaus,old_codart,old_quant))
|
||||||
ss.select(r);
|
ss.select(r);
|
||||||
|
|
||||||
|
m.update_tot();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -763,7 +785,10 @@ int TApp_movmag::read(TMask& m)
|
|||||||
TArticolo_giacenza & art = _msk->curr_art();
|
TArticolo_giacenza & art = _msk->curr_art();
|
||||||
|
|
||||||
art.read("");
|
art.read("");
|
||||||
return TRelation_application::read(m);
|
const int err = TRelation_application::read(m);
|
||||||
|
if (err == NOERR)
|
||||||
|
((TMask_movmag &)m).update_tot();
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TApp_movmag::init_query_mode(TMask& m)
|
void TApp_movmag::init_query_mode(TMask& m)
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#define F_EXANNODOC 127
|
#define F_EXANNODOC 127
|
||||||
#define F_INVENTORYMODE 128
|
#define F_INVENTORYMODE 128
|
||||||
#define F_INVENTORYMODE2 129
|
#define F_INVENTORYMODE2 129
|
||||||
|
#define F_VALORE_TOT 130
|
||||||
|
|
||||||
#define H_NUMREG 131
|
#define H_NUMREG 131
|
||||||
#define H_DATAREG 132
|
#define H_DATAREG 132
|
||||||
|
@ -330,7 +330,13 @@ END
|
|||||||
|
|
||||||
TEXT F_INVENTORYMODE2
|
TEXT F_INVENTORYMODE2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "@BModalita' di inserimento come movimento di differenza inventariale"
|
PROMPT 2 4 "@BModalita' di inserimento come movimento di differenza inventariale"
|
||||||
|
FLAGS "UD"
|
||||||
|
END
|
||||||
|
|
||||||
|
CURRENCY F_VALORE_TOT
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "Valore totale "
|
||||||
FLAGS "UD"
|
FLAGS "UD"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -356,6 +362,7 @@ BEGIN
|
|||||||
ITEM "Giacenza"
|
ITEM "Giacenza"
|
||||||
ITEM "Impianto"
|
ITEM "Impianto"
|
||||||
ITEM "Linea"
|
ITEM "Linea"
|
||||||
|
ITEM "Valore@15"
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
#define F_GIAC 114
|
#define F_GIAC 114
|
||||||
#define F_IMPIANTO 115
|
#define F_IMPIANTO 115
|
||||||
#define F_LINEA 116
|
#define F_LINEA 116
|
||||||
#define F_ESPLOSA 117 // lasciare questo campo come ultimo in sheet non visualizzatpo
|
#define F_VALORE 117
|
||||||
|
#define F_ESPLOSA 118 // lasciare questo campo come ultimo in sheet non visualizzato
|
||||||
#define F_UMFC 121
|
#define F_UMFC 121
|
||||||
|
|
||||||
// colonne non visibili dello Sheet
|
// colonne non visibili dello Sheet
|
||||||
@ -24,7 +25,7 @@
|
|||||||
#define H_DESMAG 152
|
#define H_DESMAG 152
|
||||||
#define H_GESTGIA 153
|
#define H_GESTGIA 153
|
||||||
#define F_UBICAZD 154
|
#define F_UBICAZD 154
|
||||||
#define F_VALORE 156
|
// #define F_VALORE 156
|
||||||
#define F_DESCAUSRIG 157
|
#define F_DESCAUSRIG 157
|
||||||
|
|
||||||
#define G_NOAUTO 1
|
#define G_NOAUTO 1
|
||||||
|
@ -65,25 +65,25 @@ bool TMask_openclose::handle_close(TMask_field &fld, KEY k)
|
|||||||
TMask_openclose& mask = (TMask_openclose&)fld.mask();
|
TMask_openclose& mask = (TMask_openclose&)fld.mask();
|
||||||
if (k == K_ENTER || fld.to_check(k))
|
if (k == K_ENTER || fld.to_check(k))
|
||||||
{
|
{
|
||||||
TEsercizi_contabili& ex = mask.exercise();
|
const TEsercizi_contabili& ex = mask.exercise();
|
||||||
TDate d(fld.get());
|
const TDate d(fld.get());
|
||||||
|
|
||||||
const int es_close = ex.date2esc(d);
|
const int es_close = ex.date2esc(d);
|
||||||
mask.set(F_ESTOCLOSE, es_close);
|
mask.set(F_ESTOCLOSE, es_close);
|
||||||
if (es_close == 0)
|
if (es_close == 0)
|
||||||
return fld.error_box(TR("La data indicata non appartiene a nessun esercizio."));
|
return fld.error_box(TR("La data indicata non appartiene a nessun esercizio."));
|
||||||
|
|
||||||
if (k == K_ENTER && ex.esercizio(es_close).chiusura_mag() != TDate(NULLDATE))
|
if (k == K_ENTER)
|
||||||
return fld.error_box(FR("L'esercizio %d risulta gia' chiuso. Selezionare"
|
|
||||||
" un altro esercizio o togliere la data di chiusura."), es_close);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
int pred = ex.pred(es_close);
|
if (ex.esercizio(es_close).chiusura_mag().ok())
|
||||||
if (k == K_ENTER && pred != 0 && ex.esercizio(pred).chiusura_mag() == TDate(NULLDATE))
|
return fld.error_box(FR("L'esercizio %04d risulta gia' chiuso. Selezionare"
|
||||||
return fld.error_box(TR("L'esercizio precedente a quello indicato non e' ancora stato chiuso."));
|
" un altro esercizio o togliere la data di chiusura."), es_close);
|
||||||
|
const int pred = ex.pred(es_close);
|
||||||
|
if (pred != 0 && !ex.esercizio(pred).chiusura_mag().ok())
|
||||||
|
return fld.error_box(FR("L'esercizio %04d non e' ancora stato chiuso."), pred);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMask_openclose::handle_open(TMask_field &fld, KEY k)
|
bool TMask_openclose::handle_open(TMask_field &fld, KEY k)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "mg3100.h"
|
#include "mg3100.h"
|
||||||
PAGE "Stampa dati storici" -1 -1 78 20
|
PAGE "Stampa dati storici" -1 -1 80 20
|
||||||
|
|
||||||
LIST F_PREZZIVALORI 18
|
LIST F_PREZZIVALORI 18
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -58,7 +58,7 @@ BEGIN
|
|||||||
MESSAGE " ", F_FILTRO|SHOW,F_ORDINEART|ENABLE,F_ORDINEART|HIDE,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
|
MESSAGE " ", F_FILTRO|SHOW,F_ORDINEART|ENABLE,F_ORDINEART|HIDE,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
|
||||||
MESSAGE SHOW,F_TOTALIMAGAZZINI|SHOW,F_DETTAGLIOMAG
|
MESSAGE SHOW,F_TOTALIMAGAZZINI|SHOW,F_DETTAGLIOMAG
|
||||||
ITEM "M|magazzini"
|
ITEM "M|magazzini"
|
||||||
MESSAGE " ", F_FILTRO|"C",F_ORDINEART|K_SPACE,F_ORDINEART|SHOW,F_ORDINEART|DISABLE,F_ORDINEART|HIDE,F_ORDINEMAG|SHOW,G_CODART@|HIDE,G_DESART@
|
MESSAGE " ", F_FILTRO|"C",F_ORDINEART|K_SPACE,F_ORDINEART|SHOW,F_ORDINEART|DISABLE,F_ORDINEART|HIDE,F_ORDINEMAG|SHOW,G_CODART@
|
||||||
MESSAGE SHOW,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
|
MESSAGE SHOW,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
|
||||||
MESSAGE HIDE,F_TOTALIMAGAZZINI|HIDE,F_DETTAGLIOMAG
|
MESSAGE HIDE,F_TOTALIMAGAZZINI|HIDE,F_DETTAGLIOMAG
|
||||||
END
|
END
|
||||||
@ -68,13 +68,13 @@ BEGIN
|
|||||||
FLAGS "G"
|
FLAGS "G"
|
||||||
PROMPT 34 2 "Sotto-ordinamento "
|
PROMPT 34 2 "Sotto-ordinamento "
|
||||||
ITEM "C|codice"
|
ITEM "C|codice"
|
||||||
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|HIDE,F_SALTOPAG
|
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|HIDE,F_SALTOPAG
|
||||||
ITEM "D|descrizione"
|
ITEM "D|descrizione"
|
||||||
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|DISABLE,G_CODART@|SHOW,G_DESART@|HIDE,F_SALTOPAG
|
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|DISABLE,G_CODART@|HIDE,F_SALTOPAG
|
||||||
ITEM "M|gruppo merc./codice"
|
ITEM "M|gruppo merc./codice"
|
||||||
MESSAGE SHOW,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|SHOW,F_SALTOPAG
|
MESSAGE SHOW,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG
|
||||||
ITEM "S|Sottogr.merc./codice"
|
ITEM "S|Sottogr.merc./codice"
|
||||||
MESSAGE HIDE,G_CATMER@|SHOW,G_SCATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|SHOW,F_SALTOPAG
|
MESSAGE HIDE,G_CATMER@|SHOW,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG
|
||||||
END
|
END
|
||||||
|
|
||||||
LISTBOX F_ORDINEMAG 20
|
LISTBOX F_ORDINEMAG 20
|
||||||
@ -82,11 +82,11 @@ BEGIN
|
|||||||
FLAGS "G"
|
FLAGS "G"
|
||||||
PROMPT 34 2 "Sotto-ordinamento "
|
PROMPT 34 2 "Sotto-ordinamento "
|
||||||
ITEM "C|codice"
|
ITEM "C|codice"
|
||||||
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|HIDE,F_SALTOPAG
|
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|HIDE,F_SALTOPAG
|
||||||
ITEM "M|gruppo merc./codice"
|
ITEM "M|gruppo merc./codice"
|
||||||
MESSAGE SHOW,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|SHOW,F_SALTOPAG
|
MESSAGE SHOW,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG
|
||||||
ITEM "S|Sottogr.merc./codice"
|
ITEM "S|Sottogr.merc./codice"
|
||||||
MESSAGE HIDE,G_CATMER@|SHOW,G_SCATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|SHOW,F_SALTOPAG
|
MESSAGE HIDE,G_CATMER@|SHOW,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_SALTOPAG
|
BOOLEAN F_SALTOPAG
|
||||||
@ -120,9 +120,19 @@ BEGIN
|
|||||||
ITEM "T|tutto"
|
ITEM "T|tutto"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DAART 20
|
TEXT DLG_NULL
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Dall'articolo "
|
PROMPT 2 5 "Dall'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 6 " all'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DAART 20
|
||||||
|
BEGIN
|
||||||
|
PROMPT 16 5 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_ANAMAG
|
USE LF_ANAMAG
|
||||||
INPUT CODART F_DAART
|
INPUT CODART F_DAART
|
||||||
@ -132,9 +142,22 @@ BEGIN
|
|||||||
OUTPUT F_DADES DESCR
|
OUTPUT F_DADES DESCR
|
||||||
GROUP G_CODART
|
GROUP G_CODART
|
||||||
END
|
END
|
||||||
|
|
||||||
|
STRING F_DADES 50 36
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 5 ""
|
||||||
|
FLAGS "U"
|
||||||
|
USE LF_ANAMAG KEY 2
|
||||||
|
INPUT DESCR F_DADES
|
||||||
|
DISPLAY "Descr@50" DESCR
|
||||||
|
DISPLAY "Codice@20" CODART
|
||||||
|
OUTPUT F_DAART CODART
|
||||||
|
OUTPUT F_DADES DESCR
|
||||||
|
END
|
||||||
|
|
||||||
STRING F_AART 20
|
STRING F_AART 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 6 " all'articolo "
|
PROMPT 16 6 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
COPY USE F_DAART
|
COPY USE F_DAART
|
||||||
INPUT CODART F_AART
|
INPUT CODART F_AART
|
||||||
@ -144,31 +167,17 @@ BEGIN
|
|||||||
GROUP G_CODART
|
GROUP G_CODART
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DADES 50
|
STRING F_ADES 50 36
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Dall'articolo "
|
PROMPT 40 6 ""
|
||||||
FLAGS "U"
|
|
||||||
USE LF_ANAMAG KEY 2
|
|
||||||
INPUT DESCR F_DADES
|
|
||||||
DISPLAY "Descr@50" DESCR
|
|
||||||
DISPLAY "Codice@20" CODART
|
|
||||||
OUTPUT F_DAART CODART
|
|
||||||
OUTPUT F_DADES DESCR
|
|
||||||
GROUP G_DESART
|
|
||||||
END
|
|
||||||
STRING F_ADES 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 2 6 " all'articolo "
|
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
COPY USE F_DADES
|
COPY USE F_DADES
|
||||||
INPUT DESCR F_ADES
|
INPUT DESCR F_ADES
|
||||||
COPY DISPLAY F_DADES
|
COPY DISPLAY F_DADES
|
||||||
OUTPUT F_ADES DESCR
|
OUTPUT F_ADES DESCR
|
||||||
OUTPUT F_AART CODART
|
OUTPUT F_AART CODART
|
||||||
GROUP G_DESART
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
STRING F_DAMAG 3
|
STRING F_DAMAG 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 8 "Dal magazzino "
|
PROMPT 2 8 "Dal magazzino "
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "mg3200.h"
|
#include "mg3200.h"
|
||||||
PAGE "Stampa disponibilità" -1 -1 78 20
|
PAGE "Stampa disponibilità" -1 -1 80 20
|
||||||
|
|
||||||
LISTBOX F_ORDINE 10
|
LISTBOX F_ORDINE 10
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -8,7 +8,7 @@ BEGIN
|
|||||||
MESSAGE ENABLE,F_ORDINEART|HIDE,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
|
MESSAGE ENABLE,F_ORDINEART|HIDE,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
|
||||||
MESSAGE SHOW,F_TOTALIMAGAZZINI|SHOW,F_DETTAGLIOMAG
|
MESSAGE SHOW,F_TOTALIMAGAZZINI|SHOW,F_DETTAGLIOMAG
|
||||||
ITEM "M|magazzini"
|
ITEM "M|magazzini"
|
||||||
MESSAGE "C",F_ORDINEART|K_SPACE,F_ORDINEART|DISABLE,F_ORDINEART|SHOW,G_CODART@|HIDE,G_DESART@
|
MESSAGE "C",F_ORDINEART|K_SPACE,F_ORDINEART|DISABLE,F_ORDINEART|SHOW,G_CODART@
|
||||||
MESSAGE SHOW,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
|
MESSAGE SHOW,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
|
||||||
MESSAGE HIDE,F_TOTALIMAGAZZINI|HIDE,F_DETTAGLIOMAG
|
MESSAGE HIDE,F_TOTALIMAGAZZINI|HIDE,F_DETTAGLIOMAG
|
||||||
END
|
END
|
||||||
@ -19,11 +19,11 @@ BEGIN
|
|||||||
FLAGS "G"
|
FLAGS "G"
|
||||||
PROMPT 34 1 "sotto-ordinamento "
|
PROMPT 34 1 "sotto-ordinamento "
|
||||||
ITEM "C|codice"
|
ITEM "C|codice"
|
||||||
MESSAGE HIDE,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|ENABLE,F_RAGGCODICE
|
MESSAGE HIDE,G_CATMER@|ENABLE,G_CODART@|ENABLE,F_RAGGCODICE
|
||||||
ITEM "D|descrizione"
|
ITEM "D|descrizione"
|
||||||
MESSAGE HIDE,G_CATMER@|DISABLE,G_CODART@|SHOW,G_DESART@|DISABLE,F_RAGGCODICE
|
MESSAGE HIDE,G_CATMER@|DISABLE,G_CODART@|DISABLE,F_RAGGCODICE
|
||||||
ITEM "M|gruppo merc./codice"
|
ITEM "M|gruppo merc./codice"
|
||||||
MESSAGE SHOW,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|DISABLE,F_RAGGCODICE
|
MESSAGE SHOW,G_CATMER@|ENABLE,G_CODART@|DISABLE,F_RAGGCODICE
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_ANNOES 4
|
NUMBER F_ANNOES 4
|
||||||
@ -40,9 +40,19 @@ BEGIN
|
|||||||
ADD NONE
|
ADD NONE
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DAART 20
|
TEXT DLG_NULL
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Dall'articolo "
|
PROMPT 2 4 "Dall'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 " all'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DAART 20
|
||||||
|
BEGIN
|
||||||
|
PROMPT 16 4 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_ANAMAG
|
USE LF_ANAMAG
|
||||||
INPUT CODART F_DAART
|
INPUT CODART F_DAART
|
||||||
@ -53,9 +63,20 @@ BEGIN
|
|||||||
GROUP G_CODART
|
GROUP G_CODART
|
||||||
END
|
END
|
||||||
|
|
||||||
|
STRING F_DADES 50 36
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 4 ""
|
||||||
|
FLAGS "U"
|
||||||
|
USE LF_ANAMAG KEY 2
|
||||||
|
INPUT DESCR F_DADES
|
||||||
|
DISPLAY "Descr@50" DESCR
|
||||||
|
DISPLAY "Codice@20" CODART
|
||||||
|
COPY OUTPUT F_DAART
|
||||||
|
END
|
||||||
|
|
||||||
STRING F_AART 20
|
STRING F_AART 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 " all'articolo "
|
PROMPT 16 5 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
COPY USE F_DAART
|
COPY USE F_DAART
|
||||||
INPUT CODART F_AART
|
INPUT CODART F_AART
|
||||||
@ -65,29 +86,14 @@ BEGIN
|
|||||||
GROUP G_CODART
|
GROUP G_CODART
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DADES 50
|
STRING F_ADES 50 36
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Dall'articolo "
|
PROMPT 40 5 ""
|
||||||
FLAGS "U"
|
|
||||||
USE LF_ANAMAG KEY 2
|
|
||||||
INPUT DESCR F_DADES
|
|
||||||
DISPLAY "Descr@50" DESCR
|
|
||||||
DISPLAY "Codice@20" CODART
|
|
||||||
OUTPUT F_DADES DESCR
|
|
||||||
OUTPUT F_DAART CODART
|
|
||||||
GROUP G_DESART
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_ADES 50
|
|
||||||
BEGIN
|
|
||||||
PROMPT 2 5 " all'articolo "
|
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
COPY USE F_DADES
|
COPY USE F_DADES
|
||||||
INPUT DESCR F_ADES
|
INPUT DESCR F_ADES
|
||||||
COPY DISPLAY F_DADES
|
COPY DISPLAY F_DADES
|
||||||
OUTPUT F_ADES DESCR
|
COPY OUTPUT F_AART
|
||||||
OUTPUT F_AART CODART
|
|
||||||
GROUP G_DESART
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "mg3300.h"
|
#include "mg3300.h"
|
||||||
PAGE "Stampa Schede di magazzino" -1 -1 78 21
|
PAGE "Stampa Schede di magazzino" -1 -1 80 21
|
||||||
|
|
||||||
LISTBOX F_SCHEDA 30
|
LISTBOX F_SCHEDA 30
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -21,7 +21,7 @@ BEGIN
|
|||||||
MESSAGE HIDE,F_DETTAGLIOMAG|"X",F_DETTAGLIODEP
|
MESSAGE HIDE,F_DETTAGLIOMAG|"X",F_DETTAGLIODEP
|
||||||
MESSAGE SHOW,F_SUDDIV_MAGAZZINI|SHOW,F_SUDDIV_DEPOSITI
|
MESSAGE SHOW,F_SUDDIV_MAGAZZINI|SHOW,F_SUDDIV_DEPOSITI
|
||||||
ITEM "M|magazzini"
|
ITEM "M|magazzini"
|
||||||
MESSAGE "C",F_ORDINEART|K_SPACE,F_ORDINEART|DISABLE,F_ORDINEART|SHOW,G_CODART@|HIDE,G_DESART@
|
MESSAGE "C",F_ORDINEART|K_SPACE,F_ORDINEART|DISABLE,F_ORDINEART|SHOW,G_CODART@|
|
||||||
MESSAGE SHOW,F_DETTAGLIOMAG|"X",F_DETTAGLIODEP
|
MESSAGE SHOW,F_DETTAGLIOMAG|"X",F_DETTAGLIODEP
|
||||||
MESSAGE HIDE,F_SUDDIV_MAGAZZINI|HIDE,F_SUDDIV_DEPOSITI
|
MESSAGE HIDE,F_SUDDIV_MAGAZZINI|HIDE,F_SUDDIV_DEPOSITI
|
||||||
|
|
||||||
@ -33,11 +33,11 @@ BEGIN
|
|||||||
FLAGS "G"
|
FLAGS "G"
|
||||||
PROMPT 42 2 "sotto-ordinamento "
|
PROMPT 42 2 "sotto-ordinamento "
|
||||||
ITEM "C|codice"
|
ITEM "C|codice"
|
||||||
MESSAGE HIDE,G_CATMER@|SHOW,G_CODART@|HIDE,G_DESART@|ENABLE,G_LIVELLI@
|
MESSAGE HIDE,G_CATMER@|ENABLE,G_CODART@|ENABLE,G_LIVELLI@
|
||||||
ITEM "D|descrizione"
|
ITEM "D|descrizione"
|
||||||
MESSAGE HIDE,G_CATMER@|HIDE,G_CODART@|SHOW,G_DESART@|"AC",F_ENABLER|"0",F_TOLIVELLOART|DISABLE,G_LIVELLI@
|
MESSAGE HIDE,G_CATMER@|DISABLE,G_CODART@|"AC",F_ENABLER|"0",F_TOLIVELLOART|DISABLE,G_LIVELLI@
|
||||||
ITEM "M|gruppo merc."
|
ITEM "M|gruppo merc."
|
||||||
MESSAGE SHOW,G_CATMER@|SHOW,G_CODART@|HIDE,G_DESART@|ENABLE,G_LIVELLI@
|
MESSAGE SHOW,G_CATMER@|ENABLE,G_CODART@|ENABLE,G_LIVELLI@
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_ANNOES 4
|
NUMBER F_ANNOES 4
|
||||||
@ -64,60 +64,72 @@ END
|
|||||||
|
|
||||||
DATE F_DADATA
|
DATE F_DADATA
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Dalla data "
|
PROMPT 2 4 "Dalla data "
|
||||||
END
|
END
|
||||||
|
|
||||||
DATE F_ADATA
|
DATE F_ADATA
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 6 " alla data "
|
PROMPT 29 4 " alla data "
|
||||||
STR_EXPR ANSI(#F_ADATA)>=ANSI(#F_DADATA)||(#F_ADATA=="")
|
STR_EXPR ANSI(#F_ADATA)>=ANSI(#F_DADATA)||(#F_ADATA=="")
|
||||||
WARNING "Il secondo estremo deve essere superiore al primo"
|
WARNING "Il secondo estremo deve essere superiore al primo"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "Dall'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 6 " all'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
STRING F_DAART 20
|
STRING F_DAART 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 28 5 "Dall'articolo "
|
PROMPT 16 5 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_ANAMAG
|
USE LF_ANAMAG
|
||||||
INPUT CODART F_DAART
|
INPUT CODART F_DAART
|
||||||
DISPLAY "Codice@20" CODART
|
DISPLAY "Codice@20" CODART
|
||||||
DISPLAY "Descr@50" DESCR
|
DISPLAY "Descr@50" DESCR
|
||||||
OUTPUT F_DAART CODART
|
OUTPUT F_DAART CODART
|
||||||
|
OUTPUT F_DADES DESCR
|
||||||
GROUP G_CODART
|
GROUP G_CODART
|
||||||
END
|
END
|
||||||
STRING F_AART 20
|
|
||||||
BEGIN
|
|
||||||
PROMPT 28 6 " all'articolo "
|
|
||||||
FLAGS "U"
|
|
||||||
COPY USE F_DAART
|
|
||||||
INPUT CODART F_AART
|
|
||||||
COPY DISPLAY F_DAART
|
|
||||||
OUTPUT F_AART CODART
|
|
||||||
GROUP G_CODART
|
|
||||||
STR_EXPR (#F_AART>=#F_DAART)||(#F_AART=="")
|
|
||||||
WARNING "Il secondo estremo deve essere superiore al primo"
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_DADES 50 30
|
STRING F_DADES 50 36
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 28 5 "Dall'articolo "
|
PROMPT 40 5 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_ANAMAG KEY 2
|
USE LF_ANAMAG KEY 2
|
||||||
INPUT DESCR F_DADES
|
INPUT DESCR F_DADES
|
||||||
DISPLAY "Descr@50" DESCR
|
DISPLAY "Descr@50" DESCR
|
||||||
DISPLAY "Codice@20" CODART
|
DISPLAY "Codice@20" CODART
|
||||||
OUTPUT F_DADES DESCR
|
COPY OUTPUT F_DAART
|
||||||
GROUP G_DESART
|
|
||||||
END
|
END
|
||||||
STRING F_ADES 50 30
|
|
||||||
|
STRING F_AART 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 28 6 " all'articolo "
|
PROMPT 16 6 ""
|
||||||
|
FLAGS "U"
|
||||||
|
COPY USE F_DAART
|
||||||
|
INPUT CODART F_AART
|
||||||
|
COPY DISPLAY F_DAART
|
||||||
|
OUTPUT F_AART CODART
|
||||||
|
OUTPUT F_ADES DESCR
|
||||||
|
GROUP G_CODART
|
||||||
|
STR_EXPR (#F_AART>=#F_DAART)||(#F_AART=="")
|
||||||
|
WARNING "Il secondo estremo deve essere superiore al primo"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_ADES 50 36
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 6 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
COPY USE F_DADES
|
COPY USE F_DADES
|
||||||
INPUT DESCR F_ADES
|
INPUT DESCR F_ADES
|
||||||
COPY DISPLAY F_DADES
|
COPY DISPLAY F_DADES
|
||||||
OUTPUT F_ADES DESCR
|
COPY OUTPUT F_AART
|
||||||
GROUP G_DESART
|
|
||||||
STR_EXPR (#F_ADES>=#F_DADES)||(#F_ADES=="")
|
STR_EXPR (#F_ADES>=#F_DADES)||(#F_ADES=="")
|
||||||
WARNING "Il secondo estremo deve essere superiore al primo"
|
WARNING "Il secondo estremo deve essere superiore al primo"
|
||||||
END
|
END
|
||||||
|
@ -1,7 +1,37 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
int mg3400(int argc, char* argv[])
|
#include <report.h>
|
||||||
|
|
||||||
|
#include "../ba/ba8500.h"
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TReport_mag
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TReport_mag : public TReport
|
||||||
{
|
{
|
||||||
TApplication a;
|
public:
|
||||||
a.run(argc,argv,"?????????");
|
};
|
||||||
return 0;
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TStampa_mag
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TStampa_mag : public TKlarkKent_app
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual TReport* create_report(const char* name) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
TReport* TStampa_mag::create_report(const char* name) const
|
||||||
|
{
|
||||||
|
TReport_mag* rep = new TReport_mag;
|
||||||
|
rep->load(name);
|
||||||
|
return rep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mg3400(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
TStampa_mag app;
|
||||||
|
app.run(argc, argv, TR("Stampa Report Magazzino"));
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1,20 +1,20 @@
|
|||||||
#include "mg3500.h"
|
#include "mg3500.h"
|
||||||
PAGE "Stampa storico rimanenze" -1 -1 70 12
|
PAGE "Stampa storico rimanenze" -1 -1 80 12
|
||||||
|
|
||||||
LISTBOX F_ORDINE 25
|
LISTBOX F_ORDINE 25
|
||||||
BEGIN
|
BEGIN
|
||||||
FLAGS "G"
|
FLAGS "G"
|
||||||
PROMPT 2 1 "Ordinamento "
|
PROMPT 2 1 "Ordinamento "
|
||||||
ITEM "C|codice"
|
ITEM "C|codice"
|
||||||
MESSAGE SHOW,G_CODART@|HIDE,G_DESART@|HIDE,G_GRMERC@|HIDE,G_SGRMERC@|HIDE,G_RAGGFIS@
|
MESSAGE ENABLE,G_CODART@|HIDE,G_GRMERC@|HIDE,G_SGRMERC@|HIDE,G_RAGGFIS@
|
||||||
ITEM "D|descrizione"
|
ITEM "D|descrizione"
|
||||||
MESSAGE SHOW,G_DESART@|HIDE,G_CODART@|HIDE,G_GRMERC@|HIDE,G_SGRMERC@|HIDE,G_RAGGFIS@
|
MESSAGE DISABLE,G_CODART@|HIDE,G_GRMERC@|HIDE,G_SGRMERC@|HIDE,G_RAGGFIS@
|
||||||
ITEM "M|Gruppo merceologico"
|
ITEM "M|Gruppo merceologico"
|
||||||
MESSAGE SHOW,G_CODART@|HIDE,G_DESART@|SHOW,G_GRMERC@|HIDE,G_SGRMERC@|HIDE,G_RAGGFIS@
|
MESSAGE ENABLE,G_CODART@|SHOW,G_GRMERC@|HIDE,G_SGRMERC@|HIDE,G_RAGGFIS@
|
||||||
ITEM "S|Sottogruppo merceologico"
|
ITEM "S|Sottogruppo merceologico"
|
||||||
MESSAGE SHOW,G_CODART@|HIDE,G_DESART@|SHOW,G_GRMERC@|SHOW,G_SGRMERC@|HIDE,G_RAGGFIS@
|
MESSAGE ENABLE,G_CODART@|SHOW,G_GRMERC@|SHOW,G_SGRMERC@|HIDE,G_RAGGFIS@
|
||||||
ITEM "R|Raggruppamento fiscale"
|
ITEM "R|Raggruppamento fiscale"
|
||||||
MESSAGE SHOW,G_CODART@|HIDE,G_DESART@|SHOW,G_RAGGFIS@|HIDE,G_GRMERC@|HIDE,G_SGRMERC@
|
MESSAGE ENABLE,G_CODART@|SHOW,G_RAGGFIS@|HIDE,G_GRMERC@|HIDE,G_SGRMERC@
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_ANNOES 4
|
NUMBER F_ANNOES 4
|
||||||
@ -31,53 +31,64 @@ BEGIN
|
|||||||
ADD NONE
|
ADD NONE
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DAART 20
|
TEXT DLG_NULL
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Dall'articolo "
|
PROMPT 2 4 "Dall'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 " all'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DAART 20
|
||||||
|
BEGIN
|
||||||
|
PROMPT 16 4 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_ANAMAG
|
USE LF_ANAMAG
|
||||||
INPUT CODART F_DAART
|
INPUT CODART F_DAART
|
||||||
DISPLAY "Codice@20" CODART
|
DISPLAY "Codice@20" CODART
|
||||||
DISPLAY "Descr@50" DESCR
|
DISPLAY "Descr@50" DESCR
|
||||||
OUTPUT F_DAART CODART
|
OUTPUT F_DAART CODART
|
||||||
CHECKTYPE NORMAL
|
OUTPUT F_DADES DESCR
|
||||||
GROUP G_CODART
|
|
||||||
END
|
|
||||||
STRING F_AART 20
|
|
||||||
BEGIN
|
|
||||||
PROMPT 2 5 "all'articolo "
|
|
||||||
FLAGS "U"
|
|
||||||
COPY USE F_DAART
|
|
||||||
INPUT CODART F_AART
|
|
||||||
COPY DISPLAY F_DAART
|
|
||||||
OUTPUT F_AART CODART
|
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
GROUP G_CODART
|
GROUP G_CODART
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DADES 50
|
STRING F_DADES 50 36
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Dall'articolo "
|
PROMPT 40 4 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_ANAMAG KEY 2
|
USE LF_ANAMAG KEY 2
|
||||||
INPUT DESCR F_DADES
|
INPUT DESCR F_DADES
|
||||||
DISPLAY "Descr@50" DESCR
|
DISPLAY "Descr@50" DESCR
|
||||||
DISPLAY "Codice@20" CODART
|
DISPLAY "Codice@20" CODART
|
||||||
OUTPUT F_DADES DESCR
|
COPY OUTPUT F_DAART
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
GROUP G_DESART
|
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_ADES 50
|
STRING F_AART 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "all'articolo "
|
PROMPT 16 5 ""
|
||||||
|
FLAGS "U"
|
||||||
|
COPY USE F_DAART
|
||||||
|
INPUT CODART F_AART
|
||||||
|
COPY DISPLAY F_DAART
|
||||||
|
OUTPUT F_AART CODART
|
||||||
|
OUTPUT F_ADES DESCR
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
GROUP G_CODART
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_ADES 50 36
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 5 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
COPY USE F_DADES
|
COPY USE F_DADES
|
||||||
INPUT DESCR F_ADES
|
INPUT DESCR F_ADES
|
||||||
COPY DISPLAY F_DADES
|
COPY DISPLAY F_DADES
|
||||||
OUTPUT F_ADES DESCR
|
COPY OUTPUT F_AART
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
GROUP G_DESART
|
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DAGRMERC 3
|
STRING F_DAGRMERC 3
|
||||||
|
@ -18,3 +18,5 @@
|
|||||||
#define F_CODCLI 123
|
#define F_CODCLI 123
|
||||||
#define F_CODFOR 124
|
#define F_CODFOR 124
|
||||||
#define F_RAGSOC 125
|
#define F_RAGSOC 125
|
||||||
|
#define F_DADES 126
|
||||||
|
#define F_ADES 127
|
||||||
|
@ -84,18 +84,42 @@ BEGIN
|
|||||||
DISPLAY "Codice@20" CODART
|
DISPLAY "Codice@20" CODART
|
||||||
DISPLAY "Descrizione@50" DESCR
|
DISPLAY "Descrizione@50" DESCR
|
||||||
OUTPUT F_DAARTICOLO CODART
|
OUTPUT F_DAARTICOLO CODART
|
||||||
|
OUTPUT F_DADES DESCR
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DADES 50 36
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 7 ""
|
||||||
|
FLAGS "U"
|
||||||
|
USE LF_ANAMAG KEY 2
|
||||||
|
INPUT DESCR F_DADES
|
||||||
|
DISPLAY "Descr@50" DESCR
|
||||||
|
DISPLAY "Codice@20" CODART
|
||||||
|
COPY OUTPUT F_DAARTICOLO
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_AARTICOLO 20
|
STRING F_AARTICOLO 20
|
||||||
BEGIN
|
BEGIN
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
PROMPT 42 7 "All'articolo "
|
PROMPT 2 8 "All'articolo "
|
||||||
COPY USE F_DAARTICOLO
|
COPY USE F_DAARTICOLO
|
||||||
INPUT CODART F_AARTICOLO
|
INPUT CODART F_AARTICOLO
|
||||||
COPY DISPLAY F_DAARTICOLO
|
COPY DISPLAY F_DAARTICOLO
|
||||||
OUTPUT F_AARTICOLO CODART
|
OUTPUT F_AARTICOLO CODART
|
||||||
|
OUTPUT F_ADES DESCR
|
||||||
END
|
END
|
||||||
|
|
||||||
|
STRING F_ADES 50 36
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 8 ""
|
||||||
|
FLAGS "U"
|
||||||
|
COPY USE F_DADES
|
||||||
|
INPUT DESCR F_ADES
|
||||||
|
COPY DISPLAY F_DADES
|
||||||
|
COPY OUTPUT F_AARTICOLO
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
LISTBOX F_TIPOCF 9
|
LISTBOX F_TIPOCF 9
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 9 ""
|
PROMPT 2 9 ""
|
||||||
|
124
mg/mg4200.uml
124
mg/mg4200.uml
@ -30,15 +30,15 @@ BEGIN
|
|||||||
FLAGS "G"
|
FLAGS "G"
|
||||||
PROMPT 36 1 "sotto-ordinamento "
|
PROMPT 36 1 "sotto-ordinamento "
|
||||||
ITEM "C|codice"
|
ITEM "C|codice"
|
||||||
MESSAGE HIDE,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|ENABLE,F_RAGGCODICE
|
MESSAGE HIDE,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|ENABLE,G_CODART@|ENABLE,F_RAGGCODICE
|
||||||
ITEM "D|descrizione"
|
ITEM "D|descrizione"
|
||||||
MESSAGE SHOW,G_DESART@|HIDE,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|DISABLE,G_CODART@|CLEAR,F_RAGGCODICE|K_SPACE,F_RAGGCODICE
|
MESSAGE HIDE,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|DISABLE,G_CODART@|CLEAR,F_RAGGCODICE|K_SPACE,F_RAGGCODICE
|
||||||
ITEM "M|gruppo merc./codice"
|
ITEM "M|gruppo merc./codice"
|
||||||
MESSAGE HIDE,G_RAGFIS@|HIDE,G_SCATMER@|SHOW,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|ENABLE,F_RAGGCODICE
|
MESSAGE HIDE,G_RAGFIS@|HIDE,G_SCATMER@|SHOW,G_CATMER@|ENABLE,G_CODART@|ENABLE,F_RAGGCODICE
|
||||||
ITEM "S|sottogr. merc/codice"
|
ITEM "S|sottogr. merc/codice"
|
||||||
MESSAGE HIDE,G_RAGFIS@|SHOW,G_SCATMER@|SHOW,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|ENABLE,F_RAGGCODICE
|
MESSAGE HIDE,G_RAGFIS@|SHOW,G_SCATMER@|SHOW,G_CATMER@|ENABLE,G_CODART@|ENABLE,F_RAGGCODICE
|
||||||
ITEM "R|raggr. fisc./codice"
|
ITEM "R|raggr. fisc./codice"
|
||||||
MESSAGE SHOW,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|ENABLE,F_RAGGCODICE
|
MESSAGE SHOW,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|ENABLE,G_CODART@|ENABLE,F_RAGGCODICE
|
||||||
END
|
END
|
||||||
|
|
||||||
LISTBOX F_ORDINEMAG 20
|
LISTBOX F_ORDINEMAG 20
|
||||||
@ -46,13 +46,13 @@ BEGIN
|
|||||||
FLAGS "G"
|
FLAGS "G"
|
||||||
PROMPT 36 1 "sotto-ordinamento "
|
PROMPT 36 1 "sotto-ordinamento "
|
||||||
ITEM "C|codice"
|
ITEM "C|codice"
|
||||||
MESSAGE HIDE,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|ENABLE,F_RAGGCODICE
|
MESSAGE HIDE,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|ENABLE,G_CODART@|ENABLE,F_RAGGCODICE
|
||||||
ITEM "M|gruppo merc./codice"
|
ITEM "M|gruppo merc./codice"
|
||||||
MESSAGE HIDE,G_RAGFIS@|HIDE,G_SCATMER@|SHOW,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|ENABLE,F_RAGGCODICE
|
MESSAGE HIDE,G_RAGFIS@|HIDE,G_SCATMER@|SHOW,G_CATMER@|ENABLE,G_CODART@|ENABLE,F_RAGGCODICE
|
||||||
ITEM "S|sottogr. merc/codice"
|
ITEM "S|sottogr. merc/codice"
|
||||||
MESSAGE HIDE,G_RAGFIS@|SHOW,G_SCATMER@|SHOW,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|ENABLE,F_RAGGCODICE
|
MESSAGE HIDE,G_RAGFIS@|SHOW,G_SCATMER@|SHOW,G_CATMER@|ENABLE,G_CODART@|ENABLE,F_RAGGCODICE
|
||||||
ITEM "R|raggr. fisc./codice"
|
ITEM "R|raggr. fisc./codice"
|
||||||
MESSAGE SHOW,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|ENABLE,G_CODART@|HIDE,G_DESART@|ENABLE,F_RAGGCODICE
|
MESSAGE SHOW,G_RAGFIS@|HIDE,G_SCATMER@|HIDE,G_CATMER@|ENABLE,G_CODART@|ENABLE,F_RAGGCODICE
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST F_REALE_GIAC 12
|
LIST F_REALE_GIAC 12
|
||||||
@ -95,61 +95,71 @@ BEGIN
|
|||||||
ITEM "T|tutti gli articoli"
|
ITEM "T|tutti gli articoli"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "Dall'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 " all'articolo "
|
||||||
|
END
|
||||||
|
|
||||||
STRING F_DAART 20
|
STRING F_DAART 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Dall'articolo "
|
PROMPT 16 4 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_ANAMAG
|
USE LF_ANAMAG
|
||||||
INPUT CODART F_DAART
|
INPUT CODART F_DAART
|
||||||
DISPLAY "Codice@25" CODART
|
DISPLAY "Codice@25" CODART
|
||||||
DISPLAY "Descr@50" DESCR
|
DISPLAY "Descr@50" DESCR
|
||||||
OUTPUT F_DAART CODART
|
OUTPUT F_DAART CODART
|
||||||
CHECKTYPE NORMAL
|
OUTPUT F_DADES DESCR
|
||||||
GROUP G_CODART
|
|
||||||
ADD RUN ve2 -3
|
|
||||||
END
|
|
||||||
STRING F_AART 20
|
|
||||||
BEGIN
|
|
||||||
PROMPT 42 4 " a "
|
|
||||||
FLAGS "U"
|
|
||||||
COPY USE F_DAART
|
|
||||||
INPUT CODART F_AART
|
|
||||||
COPY DISPLAY F_DAART
|
|
||||||
OUTPUT F_AART CODART
|
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
GROUP G_CODART
|
GROUP G_CODART
|
||||||
ADD RUN ve2 -3
|
ADD RUN ve2 -3
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DADES 50 20
|
STRING F_DADES 50 36
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Dall'articolo "
|
PROMPT 40 4 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_ANAMAG KEY 2
|
USE LF_ANAMAG KEY 2
|
||||||
INPUT DESCR F_DADES
|
INPUT DESCR F_DADES
|
||||||
DISPLAY "Descr@50" DESCR
|
DISPLAY "Descr@50" DESCR
|
||||||
DISPLAY "Codice@20" CODART
|
DISPLAY "Codice@20" CODART
|
||||||
OUTPUT F_DADES DESCR
|
COPY OUTPUT F_DAART
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
GROUP G_DESART
|
|
||||||
END
|
END
|
||||||
STRING F_ADES 50 20
|
|
||||||
|
STRING F_AART 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 4 " a "
|
PROMPT 16 5 ""
|
||||||
|
FLAGS "U"
|
||||||
|
COPY USE F_DAART
|
||||||
|
INPUT CODART F_AART
|
||||||
|
COPY DISPLAY F_DAART
|
||||||
|
OUTPUT F_AART CODART
|
||||||
|
OUTPUT F_ADES DESCR
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
GROUP G_CODART
|
||||||
|
ADD RUN ve2 -3
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_ADES 50 36
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 5 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
COPY USE F_DADES
|
COPY USE F_DADES
|
||||||
INPUT DESCR F_ADES
|
INPUT DESCR F_ADES
|
||||||
COPY DISPLAY F_DADES
|
COPY DISPLAY F_DADES
|
||||||
OUTPUT F_ADES DESCR
|
COPY OUTPUT F_AART
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
GROUP G_DESART
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
STRING F_DAMAG 3
|
STRING F_DAMAG 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Dal magazzino "
|
PROMPT 2 6 "Dal magazzino "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE MAG SELECT CODTAB[4,5]==""
|
USE MAG SELECT CODTAB[4,5]==""
|
||||||
INPUT CODTAB F_DAMAG
|
INPUT CODTAB F_DAMAG
|
||||||
@ -161,7 +171,7 @@ END
|
|||||||
|
|
||||||
STRING F_AMAG 3
|
STRING F_AMAG 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 5 " a "
|
PROMPT 42 6 " a "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
COPY USE F_DAMAG
|
COPY USE F_DAMAG
|
||||||
INPUT CODTAB F_AMAG
|
INPUT CODTAB F_AMAG
|
||||||
@ -172,7 +182,7 @@ END
|
|||||||
|
|
||||||
STRING F_DACATMER 3
|
STRING F_DACATMER 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 6 "Dal gruppo "
|
PROMPT 2 7 "Dal gruppo "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE GMC SELECT CODTAB[4,5]==""
|
USE GMC SELECT CODTAB[4,5]==""
|
||||||
INPUT CODTAB F_DACATMER
|
INPUT CODTAB F_DACATMER
|
||||||
@ -185,7 +195,7 @@ END
|
|||||||
|
|
||||||
STRING F_DASCATMER 2
|
STRING F_DASCATMER 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 6 ""
|
PROMPT 23 7 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE GMC SELECT CODTAB[4,5]!=""
|
USE GMC SELECT CODTAB[4,5]!=""
|
||||||
INPUT CODTAB[1,3] F_DACATMER
|
INPUT CODTAB[1,3] F_DACATMER
|
||||||
@ -200,7 +210,7 @@ END
|
|||||||
|
|
||||||
STRING F_ACATMER 3
|
STRING F_ACATMER 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 6 " a "
|
PROMPT 42 7 " a "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
COPY USE F_DACATMER
|
COPY USE F_DACATMER
|
||||||
INPUT CODTAB F_ACATMER
|
INPUT CODTAB F_ACATMER
|
||||||
@ -212,7 +222,7 @@ END
|
|||||||
|
|
||||||
STRING F_ASCATMER 2
|
STRING F_ASCATMER 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 51 6 ""
|
PROMPT 51 7 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE GMC
|
USE GMC
|
||||||
INPUT CODTAB[1,3] F_ACATMER
|
INPUT CODTAB[1,3] F_ACATMER
|
||||||
@ -227,7 +237,7 @@ END
|
|||||||
|
|
||||||
STRING F_DARAGFIS 5
|
STRING F_DARAGFIS 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 6 "Dal grup. fis. "
|
PROMPT 2 7 "Dal grup. fis. "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE RFA
|
USE RFA
|
||||||
INPUT CODTAB F_DARAGFIS
|
INPUT CODTAB F_DARAGFIS
|
||||||
@ -240,7 +250,7 @@ END
|
|||||||
|
|
||||||
STRING F_ARAGFIS 5
|
STRING F_ARAGFIS 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 6 " a "
|
PROMPT 42 7 " a "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE RFA
|
USE RFA
|
||||||
INPUT CODTAB F_ARAGFIS
|
INPUT CODTAB F_ARAGFIS
|
||||||
@ -253,7 +263,7 @@ END
|
|||||||
|
|
||||||
BOOL F_TOTALIDEPOSITI
|
BOOL F_TOTALIDEPOSITI
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 7 "Suddivido per depositi"
|
PROMPT 2 8 "Suddivido per depositi"
|
||||||
// MESSAGE TRUE ENABLE,F_DETTAGLIODEP
|
// MESSAGE TRUE ENABLE,F_DETTAGLIODEP
|
||||||
// MESSAGE FALSE CLEAR,F_DETTAGLIODEP|K_SPACE,F_DETTAGLIODEP
|
// MESSAGE FALSE CLEAR,F_DETTAGLIODEP|K_SPACE,F_DETTAGLIODEP
|
||||||
END
|
END
|
||||||
@ -261,14 +271,14 @@ END
|
|||||||
BOOL F_DETTAGLIODEP
|
BOOL F_DETTAGLIODEP
|
||||||
BEGIN
|
BEGIN
|
||||||
FLAGS "DH"
|
FLAGS "DH"
|
||||||
PROMPT 42 7 "Dettaglia i depositi"
|
PROMPT 42 8 "Dettaglia i depositi"
|
||||||
MESSAGE TRUE ENABLE,F_RAGGCODICE|ENABLE,F_RAGGLIVGIAC
|
MESSAGE TRUE ENABLE,F_RAGGCODICE|ENABLE,F_RAGGLIVGIAC
|
||||||
MESSAGE FALSE CLEAR,F_RAGGCODICE|K_SPACE,F_RAGGCODICE|CLEAR,F_RAGGLIVGIAC|K_SPACE,F_RAGGLIVGIAC
|
MESSAGE FALSE CLEAR,F_RAGGCODICE|K_SPACE,F_RAGGCODICE|CLEAR,F_RAGGLIVGIAC|K_SPACE,F_RAGGLIVGIAC
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_RAGGCODICE
|
BOOLEAN F_RAGGCODICE
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 8 "Stampa totali livelli di codice"
|
PROMPT 2 9 "Stampa totali livelli di codice"
|
||||||
MESSAGE FALSE CLEAR,F_FROMLIVELLOART|CLEAR,F_TOLIVELLOART|CHECK,F_TOLIVELLOART
|
MESSAGE FALSE CLEAR,F_FROMLIVELLOART|CLEAR,F_TOLIVELLOART|CHECK,F_TOLIVELLOART
|
||||||
MESSAGE TRUE ENABLE,F_FROMLIVELLOART|ENABLE,F_TOLIVELLOART|CHECK,F_TOLIVELLOART
|
MESSAGE TRUE ENABLE,F_FROMLIVELLOART|ENABLE,F_TOLIVELLOART|CHECK,F_TOLIVELLOART
|
||||||
END
|
END
|
||||||
@ -276,7 +286,7 @@ END
|
|||||||
NUMBER F_FROMLIVELLOART 1
|
NUMBER F_FROMLIVELLOART 1
|
||||||
BEGIN
|
BEGIN
|
||||||
FLAGS "G"
|
FLAGS "G"
|
||||||
PROMPT 42 8 "da "
|
PROMPT 42 9 "da "
|
||||||
USE FCA
|
USE FCA
|
||||||
INPUT CODTAB F_FROMLIVELLOART
|
INPUT CODTAB F_FROMLIVELLOART
|
||||||
DISPLAY "Num." CODTAB
|
DISPLAY "Num." CODTAB
|
||||||
@ -289,7 +299,7 @@ END
|
|||||||
|
|
||||||
NUMBER F_TOLIVELLOART 1
|
NUMBER F_TOLIVELLOART 1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 52 8 "a "
|
PROMPT 52 9 "a "
|
||||||
USE FCA
|
USE FCA
|
||||||
INPUT CODTAB F_TOLIVELLOART
|
INPUT CODTAB F_TOLIVELLOART
|
||||||
DISPLAY "Num." CODTAB
|
DISPLAY "Num." CODTAB
|
||||||
@ -302,7 +312,7 @@ END
|
|||||||
|
|
||||||
BOOL F_RAGGLIVGIAC
|
BOOL F_RAGGLIVGIAC
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 9 "Stampa totali livelli di giacenza"
|
PROMPT 2 10 "Stampa totali livelli di giacenza"
|
||||||
MESSAGE FALSE CLEAR,F_FROMLIVELLOGIAC|CLEAR,F_TOLIVELLOGIAC|CHECK,F_TOLIVELLOGIAC
|
MESSAGE FALSE CLEAR,F_FROMLIVELLOGIAC|CLEAR,F_TOLIVELLOGIAC|CHECK,F_TOLIVELLOGIAC
|
||||||
MESSAGE TRUE ENABLE,F_FROMLIVELLOGIAC|ENABLE,F_TOLIVELLOGIAC
|
MESSAGE TRUE ENABLE,F_FROMLIVELLOGIAC|ENABLE,F_TOLIVELLOGIAC
|
||||||
END
|
END
|
||||||
@ -310,7 +320,7 @@ END
|
|||||||
NUMBER F_FROMLIVELLOGIAC 1
|
NUMBER F_FROMLIVELLOGIAC 1
|
||||||
BEGIN
|
BEGIN
|
||||||
FLAG "D"
|
FLAG "D"
|
||||||
PROMPT 42 9 "da "
|
PROMPT 42 10 "da "
|
||||||
USE FCG
|
USE FCG
|
||||||
INPUT CODTAB F_FROMLIVELLOGIAC
|
INPUT CODTAB F_FROMLIVELLOGIAC
|
||||||
DISPLAY "Num." CODTAB
|
DISPLAY "Num." CODTAB
|
||||||
@ -325,7 +335,7 @@ END
|
|||||||
NUMBER F_TOLIVELLOGIAC 1
|
NUMBER F_TOLIVELLOGIAC 1
|
||||||
BEGIN
|
BEGIN
|
||||||
FLAG "D"
|
FLAG "D"
|
||||||
PROMPT 52 9 "a "
|
PROMPT 52 10 "a "
|
||||||
USE FCG
|
USE FCG
|
||||||
INPUT CODTAB F_TOLIVELLOGIAC
|
INPUT CODTAB F_TOLIVELLOGIAC
|
||||||
DISPLAY "Num." CODTAB
|
DISPLAY "Num." CODTAB
|
||||||
@ -338,33 +348,33 @@ END
|
|||||||
|
|
||||||
BOOL F_ALLADATA
|
BOOL F_ALLADATA
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 10 "Calcola inventario alla data"
|
PROMPT 2 11 "Calcola inventario alla data"
|
||||||
MESSAGE TRUE ENABLE,F_DATALIM
|
MESSAGE TRUE ENABLE,F_DATALIM
|
||||||
MESSAGE CLEAR, F_DATALIM
|
MESSAGE CLEAR, F_DATALIM
|
||||||
END
|
END
|
||||||
|
|
||||||
DATE F_DATALIM
|
DATE F_DATALIM
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 10 "Data inventario "
|
PROMPT 42 11 "Data inventario "
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOL F_TOTALIMAGAZZINI
|
BOOL F_TOTALIMAGAZZINI
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 11 "Stampa i totali di magazzino"
|
PROMPT 2 12 "Stampa i totali di magazzino"
|
||||||
MESSAGE TRUE ENABLE,F_DETTAGLIOMAG
|
MESSAGE TRUE ENABLE,F_DETTAGLIOMAG
|
||||||
MESSAGE FALSE CLEAR,F_DETTAGLIOMAG
|
MESSAGE FALSE CLEAR,F_DETTAGLIOMAG
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOL F_DETTAGLIOMAG
|
BOOL F_DETTAGLIOMAG
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 11 "Stampa i totali di deposito"
|
PROMPT 42 12 "Stampa i totali di deposito"
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST F_VAL1 20
|
LIST F_VAL1 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 12 "Valorizz. 1 "
|
PROMPT 2 13 "Valorizz. 1 "
|
||||||
ITEM "6|Costo medio ponder."
|
ITEM "6|Costo medio ponder."
|
||||||
ITEM "1|Ultimo costo"
|
ITEM "1|Ultimo costo"
|
||||||
ITEM "2|Media ultimi costi"
|
ITEM "2|Media ultimi costi"
|
||||||
@ -378,7 +388,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
LIST F_VAL2 20
|
LIST F_VAL2 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 13 "Valorizz. 2 "
|
PROMPT 2 14 "Valorizz. 2 "
|
||||||
ITEM "|"
|
ITEM "|"
|
||||||
ITEM "6|Costo medio ponder."
|
ITEM "6|Costo medio ponder."
|
||||||
ITEM "1|Ultimo costo"
|
ITEM "1|Ultimo costo"
|
||||||
@ -393,7 +403,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
LIST F_VAL3 20
|
LIST F_VAL3 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 14 "Valorizz. 3 "
|
PROMPT 2 15 "Valorizz. 3 "
|
||||||
ITEM "|"
|
ITEM "|"
|
||||||
ITEM "6|Costo medio ponder."
|
ITEM "6|Costo medio ponder."
|
||||||
ITEM "1|Ultimo costo"
|
ITEM "1|Ultimo costo"
|
||||||
@ -408,7 +418,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
LIST F_VAL4 20
|
LIST F_VAL4 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 12 "Valorizz. 4 "
|
PROMPT 42 13 "Valorizz. 4 "
|
||||||
ITEM "|"
|
ITEM "|"
|
||||||
ITEM "6|Costo medio ponder."
|
ITEM "6|Costo medio ponder."
|
||||||
ITEM "1|Ultimo costo"
|
ITEM "1|Ultimo costo"
|
||||||
@ -423,7 +433,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
LIST F_VAL5 20
|
LIST F_VAL5 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 13 "Valorizz. 5 "
|
PROMPT 42 14 "Valorizz. 5 "
|
||||||
ITEM "|"
|
ITEM "|"
|
||||||
ITEM "6|Costo medio ponder."
|
ITEM "6|Costo medio ponder."
|
||||||
ITEM "1|Ultimo costo"
|
ITEM "1|Ultimo costo"
|
||||||
@ -438,7 +448,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
LIST F_VAL6 20
|
LIST F_VAL6 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 14 "Valorizz. 6 "
|
PROMPT 42 15 "Valorizz. 6 "
|
||||||
ITEM "|"
|
ITEM "|"
|
||||||
ITEM "6|Costo medio ponder."
|
ITEM "6|Costo medio ponder."
|
||||||
ITEM "1|Ultimo costo"
|
ITEM "1|Ultimo costo"
|
||||||
|
@ -103,7 +103,7 @@ protected:
|
|||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void load_prod_file(const char * nomefile, bool savefile, bool only_errors);
|
void load_prod_file(const char * nomefile, bool savefile, bool only_errors, TArray & warn_perc, TString_array & warning);
|
||||||
void display_error(TViswin & v, const char * msg, TTracciato_record & t, TRecord_text & r);
|
void display_error(TViswin & v, const char * msg, TTracciato_record & t, TRecord_text & r);
|
||||||
void print_record(TViswin & v, TTipo_rec t , TProduzione & r);
|
void print_record(TViswin & v, TTipo_rec t , TProduzione & r);
|
||||||
TRilprod_mask();
|
TRilprod_mask();
|
||||||
@ -219,9 +219,27 @@ bool TRilprod_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
|||||||
if (e == fe_button)
|
if (e == fe_button)
|
||||||
{
|
{
|
||||||
TLoadfile_mask m;
|
TLoadfile_mask m;
|
||||||
|
TArray warn_perc;
|
||||||
|
TString_array warning;
|
||||||
|
|
||||||
if (m.run() == K_ENTER)
|
if (m.run() == K_ENTER)
|
||||||
load_prod_file(m.get(F_FILE), m.get_bool(F_SAVE), m.get_bool(F_ONLY_ERRORS));
|
{
|
||||||
|
{
|
||||||
|
short dlg = F_PERC1;
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
const real perc(m.get(dlg++));
|
||||||
|
|
||||||
|
warn_perc.add(perc);
|
||||||
|
|
||||||
|
const TString & s = m.get(dlg++);
|
||||||
|
|
||||||
|
warning.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
load_prod_file(m.get(F_FILE), m.get_bool(F_SAVE), m.get_bool(F_ONLY_ERRORS), warn_perc, warning);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -293,7 +311,7 @@ void TRilprod_mask::print_record(TViswin & v, TTipo_rec t , TProduzione & r)
|
|||||||
v.add_line(l);
|
v.add_line(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TRilprod_mask::load_prod_file(const char * nomefile, bool savefile, bool only_errors)
|
void TRilprod_mask::load_prod_file(const char * nomefile, bool savefile, bool only_errors, TArray & warn_perc, TString_array & warning)
|
||||||
{
|
{
|
||||||
TViswin vwin(NULL, TR("Importazione produzione"), FALSE, TRUE, TRUE);
|
TViswin vwin(NULL, TR("Importazione produzione"), FALSE, TRUE, TRUE);
|
||||||
TFile_text prod(nomefile,"mr0500a.ini"); //crea un oggetto articoli di tipo TFile_text
|
TFile_text prod(nomefile,"mr0500a.ini"); //crea un oggetto articoli di tipo TFile_text
|
||||||
@ -310,7 +328,6 @@ void TRilprod_mask::load_prod_file(const char * nomefile, bool savefile, bool on
|
|||||||
TLocalisamfile fp(LF_RILPROD);
|
TLocalisamfile fp(LF_RILPROD);
|
||||||
TRectype cmp(fp.curr());
|
TRectype cmp(fp.curr());
|
||||||
const long max = fsize(nomefile);
|
const long max = fsize(nomefile);
|
||||||
|
|
||||||
TProgind p(max, format(FR("Importazione produzione : file %s"), nomefile));
|
TProgind p(max, format(FR("Importazione produzione : file %s"), nomefile));
|
||||||
|
|
||||||
for (int f = 0; f < nfields; f++)
|
for (int f = 0; f < nfields; f++)
|
||||||
@ -450,8 +467,6 @@ void TRilprod_mask::load_prod_file(const char * nomefile, bool savefile, bool on
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (nuovo)
|
if (nuovo)
|
||||||
{
|
{
|
||||||
prd.zero();
|
prd.zero();
|
||||||
@ -598,6 +613,28 @@ void TRilprod_mask::load_prod_file(const char * nomefile, bool savefile, bool on
|
|||||||
prd.put("SCARTO", scarto);
|
prd.put("SCARTO", scarto);
|
||||||
prd.rewrite();
|
prd.rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tipo > _start) // Controllo lo scarto solo dopo _start
|
||||||
|
{
|
||||||
|
const real tot(prd.get_real("QTA") + prd.get_real("SCARTO"));
|
||||||
|
if (tot > ZERO)
|
||||||
|
{
|
||||||
|
real perc = prd.get_real("SCARTO") * CENTO / tot;
|
||||||
|
|
||||||
|
perc.round(2);
|
||||||
|
for (int j = 3; j >= 0; j--)
|
||||||
|
{
|
||||||
|
if ((const real&)warn_perc[j] > ZERO && perc > (const real&)warn_perc[j])
|
||||||
|
{
|
||||||
|
TString warn;
|
||||||
|
|
||||||
|
warn.format("@b%s - percentuale %s", (const char *) warning.row(j), perc.string());
|
||||||
|
display_error(vwin, warn, trec, rec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prod.close();
|
prod.close();
|
||||||
|
@ -71,13 +71,14 @@ NUMBER F_PROG 3
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 3 "Progressivo del giorno "
|
PROMPT 42 3 "Progressivo del giorno "
|
||||||
USE LF_RILPROD KEY 6
|
USE LF_RILPROD KEY 6
|
||||||
JOIN LF_ANAMAG INTO CODART==CODART
|
JOIN LF_ANAMAG INTO CODART==CODART
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
INPUT PROVV F_PROVV
|
INPUT PROVV F_PROVV
|
||||||
INPUT ANNO F_ANNO
|
INPUT ANNO F_ANNO
|
||||||
INPUT CODNUM F_CODNUM
|
INPUT CODNUM F_CODNUM
|
||||||
INPUT NDOC F_NDOC
|
INPUT NDOC F_NDOC
|
||||||
INPUT NRIGA F_NRIGA
|
INPUT NRIGA F_NRIGA
|
||||||
|
INPUT DATA F_DATA
|
||||||
DISPLAY "Ordine@10" NDOC
|
DISPLAY "Ordine@10" NDOC
|
||||||
DISPLAY "Riga@7" NRIGA
|
DISPLAY "Riga@7" NRIGA
|
||||||
DISPLAY "Data ordine" DATA
|
DISPLAY "Data ordine" DATA
|
||||||
|
10
mr/mr0500b.h
10
mr/mr0500b.h
@ -2,4 +2,14 @@
|
|||||||
#define F_PROFILO 102
|
#define F_PROFILO 102
|
||||||
#define F_SAVE 103
|
#define F_SAVE 103
|
||||||
#define F_ONLY_ERRORS 104
|
#define F_ONLY_ERRORS 104
|
||||||
|
#define F_PERC1 105
|
||||||
|
#define F_WARN1 106
|
||||||
|
#define F_PERC2 107
|
||||||
|
#define F_WARN2 108
|
||||||
|
#define F_PERC3 109
|
||||||
|
#define F_WARN3 110
|
||||||
|
#define F_PERC4 111
|
||||||
|
#define F_WARN4 112
|
||||||
|
#define F_PERC5 113
|
||||||
|
#define F_WARN5 114
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "mr0500b.h"
|
#include "mr0500b.h"
|
||||||
|
|
||||||
PAGE "Lettura terminale portatile" -1 -1 80 8
|
PAGE "Lettura terminale portatile" -1 -1 80 18
|
||||||
|
|
||||||
STRING F_FILE 128 40
|
STRING F_FILE 128 40
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -19,6 +19,56 @@ BEGIN
|
|||||||
PROMPT 40 4 "Visualizza solo gli errori"
|
PROMPT 40 4 "Visualizza solo gli errori"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
NUMBER F_PERC1 5 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 6 "1 livello di avviso "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_WARN1 70 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 6 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_PERC2 5 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 8 "2 livello di avviso "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_WARN2 70 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 8 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_PERC3 5 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 10 "3 livello di avviso "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_WARN3 70 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 10 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_PERC4 5 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 12 "4 livello di avviso "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_WARN4 70 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 12 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_PERC5 5 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 14 "5 livello di avviso "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_WARN5 70 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 14 ""
|
||||||
|
END
|
||||||
|
|
||||||
STRING F_PROFILO 70 50
|
STRING F_PROFILO 70 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 -3 "Profilo "
|
PROMPT 1 -3 "Profilo "
|
||||||
|
@ -359,6 +359,21 @@ void TMRP_line::set_imp_lin(const char* imp, const char* lin)
|
|||||||
{
|
{
|
||||||
_codimp = imp;
|
_codimp = imp;
|
||||||
_codlin = lin;
|
_codlin = lin;
|
||||||
|
|
||||||
|
|
||||||
|
if (_codlin.full() && _codimp.full())
|
||||||
|
{
|
||||||
|
const TLinea_prod l(_codlin);
|
||||||
|
imp = l.codimp();
|
||||||
|
if (_codimp != imp)
|
||||||
|
{
|
||||||
|
#ifdef DBG
|
||||||
|
warning_box("Impianto '%s' incompatibile con la linea '%s':\nforzato a '%s'.",
|
||||||
|
(const char*)_codimp, (const char*) lin, imp);
|
||||||
|
#endif
|
||||||
|
_codimp = imp;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TMRP_line::TMRP_line(const char* art, const char* giac,
|
TMRP_line::TMRP_line(const char* art, const char* giac,
|
||||||
@ -367,9 +382,10 @@ TMRP_line::TMRP_line(const char* art, const char* giac,
|
|||||||
long codcli)
|
long codcli)
|
||||||
: _codart(art), _livgiac(giac), _explosion_depth(0),
|
: _codart(art), _livgiac(giac), _explosion_depth(0),
|
||||||
_codmag(mag), _codmag_coll(magc),
|
_codmag(mag), _codmag_coll(magc),
|
||||||
_codimp(imp), _codlin(lin), _codclifor(codcli),
|
_codclifor(codcli),
|
||||||
_final_product(FALSE)
|
_final_product(FALSE)
|
||||||
{
|
{
|
||||||
|
set_imp_lin(imp, lin);
|
||||||
if (_articolo_giac==NULL)
|
if (_articolo_giac==NULL)
|
||||||
_articolo_giac= new TArticolo_giacenza();
|
_articolo_giac= new TArticolo_giacenza();
|
||||||
}
|
}
|
||||||
@ -819,7 +835,7 @@ void TLav_finder::art2magimpline(const TCodice_articolo& art,
|
|||||||
TString& lin)
|
TString& lin)
|
||||||
{
|
{
|
||||||
TLavorazione& lav = art2lav(art);
|
TLavorazione& lav = art2lav(art);
|
||||||
if (imp.blank() && !lin.blank())
|
if (imp.blank() && lin.full())
|
||||||
imp = _lnp.decode(lin);
|
imp = _lnp.decode(lin);
|
||||||
lin.cut(0);
|
lin.cut(0);
|
||||||
const int ll = _keep_imp ? lav.linee() : lav.linee_standard();
|
const int ll = _keep_imp ? lav.linee() : lav.linee_standard();
|
||||||
@ -832,7 +848,7 @@ void TLav_finder::art2magimpline(const TCodice_articolo& art,
|
|||||||
if (goodimp)
|
if (goodimp)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (lin.not_empty())
|
if (lin.full())
|
||||||
{
|
{
|
||||||
const TLinea_prod lnp(lin) ;
|
const TLinea_prod lnp(lin) ;
|
||||||
imp = lnp.codimp();
|
imp = lnp.codimp();
|
||||||
@ -891,9 +907,9 @@ private:
|
|||||||
bool load_planned_orders();
|
bool load_planned_orders();
|
||||||
bool explode_articles();
|
bool explode_articles();
|
||||||
|
|
||||||
bool test_codnum(const TCodice_numerazione& num, TString_array& a) const;
|
bool test_codnum(const TCodice_numerazione& num, const TString_array& a) const;
|
||||||
int test_status(const TRectype& doc, TString_array& a) const;
|
int test_status(const TRectype& doc, const TString_array& a) const;
|
||||||
bool has_confirmed_status(const TRectype& doc, TToken_string & riga ) const;
|
bool has_confirmed_status(const TRectype& doc, const TToken_string& riga) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool preprocess_cycle(); // req iniziale dai docs
|
bool preprocess_cycle(); // req iniziale dai docs
|
||||||
@ -1312,7 +1328,7 @@ int TMatResMask::add_order_line(long forn, const TMRP_line& line, int bucket)
|
|||||||
{
|
{
|
||||||
// RIGA GIA' PRESENTE
|
// RIGA GIA' PRESENTE
|
||||||
TRiga_ordine& riga = (TRiga_ordine&)a[pos];
|
TRiga_ordine& riga = (TRiga_ordine&)a[pos];
|
||||||
const TString & codnum = riga.get(F_DOCCODNUM - FIRST_FIELD);
|
const TString4 codnum = riga.get(F_DOCCODNUM - FIRST_FIELD);
|
||||||
// if (!(codnum != get(F_NUM_PROD) && codnum != get(F_NUM_FORN)))
|
// if (!(codnum != get(F_NUM_PROD) && codnum != get(F_NUM_FORN)))
|
||||||
if (codnum == get(F_NUM_PROD) || codnum == get(F_NUM_FORN)) // Guy was here!
|
if (codnum == get(F_NUM_PROD) || codnum == get(F_NUM_FORN)) // Guy was here!
|
||||||
riga += *r;
|
riga += *r;
|
||||||
@ -1331,7 +1347,7 @@ int TMatResMask::add_order_line(long forn, const TMRP_line& line, int bucket)
|
|||||||
s.enable_cell(pos, F_DEPOSITO - FIRST_FIELD);
|
s.enable_cell(pos, F_DEPOSITO - FIRST_FIELD);
|
||||||
s.enable_cell(pos, F_CODIMP - FIRST_FIELD);
|
s.enable_cell(pos, F_CODIMP - FIRST_FIELD);
|
||||||
s.enable_cell(pos, F_CODLIN - FIRST_FIELD);
|
s.enable_cell(pos, F_CODLIN - FIRST_FIELD);
|
||||||
a.destroy(pos); // no null rows if not desired
|
a.destroy(pos, nref < 0); // no null rows if not desired
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1850,12 +1866,12 @@ int TRisalita_mask::add_gross_ref(const TMRP_line& line, int bucket)
|
|||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool TMatResPlanning::test_codnum(const TCodice_numerazione& num,
|
bool TMatResPlanning::test_codnum(const TCodice_numerazione& num,
|
||||||
TString_array& a) const
|
const TString_array& a) const
|
||||||
{
|
{
|
||||||
TString tmp;
|
TString tmp;
|
||||||
for (int it=0 ; it< a.items(); it++ )
|
for (int it=0 ; it< a.items(); it++ )
|
||||||
{
|
{
|
||||||
tmp = a.row(it).get(0);
|
a.row(it).get(0, tmp);
|
||||||
if (tmp == num.codice()) return TRUE;
|
if (tmp == num.codice()) return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1863,21 +1879,20 @@ bool TMatResPlanning::test_codnum(const TCodice_numerazione& num,
|
|||||||
return yes;
|
return yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMatResPlanning::has_confirmed_status(const TRectype& doc,
|
bool TMatResPlanning::has_confirmed_status(const TRectype& doc, const TToken_string& riga) const
|
||||||
TToken_string & riga ) const
|
|
||||||
{
|
{
|
||||||
const char statodoc = doc.get_char(DOC_STATO);
|
const char statodoc = doc.get_char(DOC_STATO);
|
||||||
const char state_def = riga.get_char(F_STATODEF - FIRST_FIELD);
|
const char state_def = ((TToken_string&)riga).get_char(F_STATODEF - FIRST_FIELD);
|
||||||
return (statodoc >= state_def);
|
return (statodoc >= state_def);
|
||||||
}
|
}
|
||||||
int TMatResPlanning::test_status(const TRectype& doc,
|
int TMatResPlanning::test_status(const TRectype& doc,
|
||||||
TString_array& a) const
|
const TString_array& a) const
|
||||||
{
|
{
|
||||||
const TString16 tipodoc = doc.get(DOC_TIPODOC);
|
const TString4 tipodoc = doc.get(DOC_TIPODOC);
|
||||||
const char statodoc = doc.get_char(DOC_STATO);
|
const char statodoc = doc.get_char(DOC_STATO);
|
||||||
for (int i = a.items()-1; i >= 0; i--)
|
for (int i = a.items()-1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
TToken_string& riga = a.row(i);
|
TToken_string& riga = (TToken_string&)a.row(i);
|
||||||
const char* t = riga.get(0);
|
const char* t = riga.get(0);
|
||||||
if (tipodoc == t)
|
if (tipodoc == t)
|
||||||
{
|
{
|
||||||
@ -2092,7 +2107,7 @@ bool TMatResPlanning::explode_articles()
|
|||||||
{
|
{
|
||||||
TString8 mag = line.codmagdep(), imp = line.codimp(), lin = line.codlin();
|
TString8 mag = line.codmagdep(), imp = line.codimp(), lin = line.codlin();
|
||||||
_artinfo.art2magimpline(line.articolo(), mag, imp, lin);
|
_artinfo.art2magimpline(line.articolo(), mag, imp, lin);
|
||||||
if (lin.not_empty())
|
if (lin.full())
|
||||||
line.set_imp_lin(imp, lin);
|
line.set_imp_lin(imp, lin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2173,8 +2188,8 @@ bool TMatResPlanning::load_planned_orders()
|
|||||||
const TRectype& curr = cur.curr();
|
const TRectype& curr = cur.curr();
|
||||||
TRectype filter_fr(curr), filter_to(curr);
|
TRectype filter_fr(curr), filter_to(curr);
|
||||||
|
|
||||||
TString_array& n = m.sfield(F_NUM_ORF).rows_array();
|
const TString_array& n = m.sfield(F_NUM_ORF).rows_array();
|
||||||
TString_array& a = m.sfield(F_TIPI_ORF).rows_array();
|
const TString_array& a = m.sfield(F_TIPI_ORF).rows_array();
|
||||||
|
|
||||||
TProgind pi(table_items("%NUM"), TR("Caricamento arrivi futuri..."), TRUE, TRUE);
|
TProgind pi(table_items("%NUM"), TR("Caricamento arrivi futuri..."), TRUE, TRUE);
|
||||||
|
|
||||||
@ -2239,14 +2254,19 @@ bool TMatResPlanning::load_planned_orders()
|
|||||||
if (consegna > date_to)
|
if (consegna > date_to)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (load_evasi && doc_evaso)
|
bool padre_evaso = false;
|
||||||
|
if (load_evasi)
|
||||||
{
|
{
|
||||||
const TRectype* dariga = riga.find_original_rdoc();
|
const TRectype* dariga = riga.find_original_rdoc();
|
||||||
if (dariga != NULL && dariga->get_bool(RDOC_RIGAEVASA))
|
if (dariga != NULL && dariga->get_bool(RDOC_RIGAEVASA))
|
||||||
continue;
|
{
|
||||||
|
const TRectype* dadoc = riga.find_original_doc();
|
||||||
|
if (dadoc != NULL)
|
||||||
|
padre_evaso = dadoc->get_bool(DOC_DOCEVASO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const real qta = load_evasi ? riga.quantita() : riga.qtaresidua();
|
const real qta = load_evasi && !padre_evaso ? riga.quantita() : riga.qtaresidua();
|
||||||
if (qta > ZERO)
|
if (qta > ZERO)
|
||||||
{
|
{
|
||||||
const TCodice_articolo art = riga.get(RDOC_CODARTMAG);
|
const TCodice_articolo art = riga.get(RDOC_CODARTMAG);
|
||||||
@ -2269,9 +2289,9 @@ bool TMatResPlanning::load_planned_orders()
|
|||||||
TQuantita q(art, um, qta);
|
TQuantita q(art, um, qta);
|
||||||
q.convert2umbase();
|
q.convert2umbase();
|
||||||
q.currency2umbase(prz);
|
q.currency2umbase(prz);
|
||||||
TString8 codnum = doc.get(DOC_CODNUM);
|
const TString4 codnum = doc.get(DOC_CODNUM);
|
||||||
long docnum = doc.get_long(DOC_NDOC);
|
const long docnum = doc.get_long(DOC_NDOC);
|
||||||
int numriga = riga.get_int(RDOC_NRIGA);
|
const int numriga = riga.get_int(RDOC_NRIGA);
|
||||||
TMRP_docref * docref = new TMRP_docref(doc.get_int(DOC_ANNO), codnum, docnum,
|
TMRP_docref * docref = new TMRP_docref(doc.get_int(DOC_ANNO), codnum, docnum,
|
||||||
numriga, um, q.val(), prz.get_num());
|
numriga, um, q.val(), prz.get_num());
|
||||||
const TMRP_time t(consegna, 0, imp, lin);
|
const TMRP_time t(consegna, 0, imp, lin);
|
||||||
@ -2444,6 +2464,7 @@ bool TMatResPlanning::gross2net_logic(TMRP_line &curr_article, int bucket, bool
|
|||||||
bool TMatResPlanning::net_requirement_cycle()
|
bool TMatResPlanning::net_requirement_cycle()
|
||||||
{
|
{
|
||||||
const TMatResMask& m = *_mask;
|
const TMatResMask& m = *_mask;
|
||||||
|
const bool dont_use_mag = m.get_bool(F_DONT_USE_MAG);
|
||||||
|
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
// ordina gli articoli
|
// ordina gli articoli
|
||||||
@ -2462,7 +2483,7 @@ bool TMatResPlanning::net_requirement_cycle()
|
|||||||
if (last >= 0)
|
if (last >= 0)
|
||||||
{
|
{
|
||||||
real curgiac;
|
real curgiac;
|
||||||
curr_article.set_on_hand(0, curr_article.giacenza_attuale(curgiac, m.get_date(F_DADATA)));
|
curr_article.set_on_hand(0, dont_use_mag ? ZERO : curr_article.giacenza_attuale(curgiac, m.get_date(F_DADATA)));
|
||||||
bool sc_used = false;
|
bool sc_used = false;
|
||||||
|
|
||||||
for (int bucket = 0; ok && bucket <= last; bucket = curr_article.next_bucket(bucket))
|
for (int bucket = 0; ok && bucket <= last; bucket = curr_article.next_bucket(bucket))
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
#define F_MAXLEVEL 254
|
#define F_MAXLEVEL 254
|
||||||
#define F_RIFERIMENTO_MRP 255
|
#define F_RIFERIMENTO_MRP 255
|
||||||
#define F_LOAD_EVASI 256
|
#define F_LOAD_EVASI 256
|
||||||
|
#define F_DONT_USE_MAG 257
|
||||||
|
|
||||||
// campi senza default sul profilo
|
// campi senza default sul profilo
|
||||||
#define F_YEAR 301
|
#define F_YEAR 301
|
||||||
|
@ -207,6 +207,11 @@ BEGIN
|
|||||||
PROMPT 2 20 "Non considerare l'evasione ordini"
|
PROMPT 2 20 "Non considerare l'evasione ordini"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_DONT_USE_MAG
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 20 "Non considerare la giacenza di magazzino"
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Genera" -1 -1 78 20
|
PAGE "Genera" -1 -1 78 20
|
||||||
@ -446,20 +451,20 @@ END
|
|||||||
TEXT DLG_NULL
|
TEXT DLG_NULL
|
||||||
BEGIN
|
BEGIN
|
||||||
GROUP G_PREPROCESS
|
GROUP G_PREPROCESS
|
||||||
PROMPT 32 20 "giorni lavorativi"
|
PROMPT 32 20 "gg.lavorativi"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_XTRA_PLTIME 2
|
NUMBER F_XTRA_PLTIME 2
|
||||||
BEGIN
|
BEGIN
|
||||||
GROUP G_PREPROCESS
|
GROUP G_PREPROCESS
|
||||||
PROMPT 2 21 "Anticipa le emissioni di "
|
PROMPT 42 20 "Anticipa le emissioni di "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
END
|
END
|
||||||
|
|
||||||
TEXT DLG_NULL
|
TEXT DLG_NULL
|
||||||
BEGIN
|
BEGIN
|
||||||
GROUP G_PREPROCESS
|
GROUP G_PREPROCESS
|
||||||
PROMPT 32 21 "giorni lavorativi"
|
PROMPT 72 20 "gg.lavorativi"
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -1106,7 +1111,7 @@ END
|
|||||||
STRING F_CODLIN 5
|
STRING F_CODLIN 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 11 "Linea "
|
PROMPT 1 11 "Linea "
|
||||||
FLAGS "UZ"
|
FLAGS "UZG"
|
||||||
USE LNP
|
USE LNP
|
||||||
INPUT CODTAB F_CODLIN
|
INPUT CODTAB F_CODLIN
|
||||||
DISPLAY "Codice" CODTAB
|
DISPLAY "Codice" CODTAB
|
||||||
@ -1125,7 +1130,7 @@ BEGIN
|
|||||||
DISPLAY "Descrizione@50" S0
|
DISPLAY "Descrizione@50" S0
|
||||||
DISPLAY "Codice@16" CODTAB
|
DISPLAY "Codice@16" CODTAB
|
||||||
COPY OUTPUT F_CODLIN
|
COPY OUTPUT F_CODLIN
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NONE
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_QUANTITA 18 5
|
NUMBER F_QUANTITA 18 5
|
||||||
|
112
mr/mr2200.cpp
112
mr/mr2200.cpp
@ -130,13 +130,16 @@ bool TPlann_sub_mask::on_field_event(TOperable_field& o, TField_event e, long jo
|
|||||||
{
|
{
|
||||||
switch (o.dlg())
|
switch (o.dlg())
|
||||||
{
|
{
|
||||||
case DLG_QUIT:
|
case DLG_QUIT:
|
||||||
copy_fields_to();
|
copy_fields_to();
|
||||||
save_profile();
|
save_profile();
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Maschera stampa
|
// Maschera stampa
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -361,10 +364,11 @@ int TPlanning_mask::test_codnum(const TCodice_numerazione& num) const
|
|||||||
for (int s = 2; s > 0; s--)
|
for (int s = 2; s > 0; s--)
|
||||||
{
|
{
|
||||||
const short id = s == _Doc_planning ? F_NUM_PLA : F_NUM_ORC;
|
const short id = s == _Doc_planning ? F_NUM_PLA : F_NUM_ORC;
|
||||||
TString_array& nums = sfield(id).rows_array();
|
const TString_array& nums = sfield(id).rows_array();
|
||||||
for (int i = nums.items()-1; i >= 0; i--)
|
for (int i = nums.last(); i >= 0; i--)
|
||||||
{
|
{
|
||||||
const char* t = nums.row(i).get(0);
|
TToken_string& str = (TToken_string&)nums.row(i);
|
||||||
|
const char* t = str.get(0);
|
||||||
if (num.codice() == t)
|
if (num.codice() == t)
|
||||||
{
|
{
|
||||||
r|=s; break;
|
r|=s; break;
|
||||||
@ -1340,10 +1344,10 @@ void TPlanning_mask::propose_1stJIT(TMSP_logic logic, bool check_machine, bool c
|
|||||||
{
|
{
|
||||||
_proposed_articles.destroy();
|
_proposed_articles.destroy();
|
||||||
gross2net(_stock_break, lotsizing);
|
gross2net(_stock_break, lotsizing);
|
||||||
const char * msg;
|
const char* msg = (level == 1) ? TR("Calcolo nuove proposte (articoli non Master)")
|
||||||
msg = (level == 1) ? TR("Calcolo nuove proposte (articoli non Master)") :TR("Calcolo nuove proposte");
|
: TR("Calcolo nuove proposte");
|
||||||
const int anticipomin=get_int((level == 2) ? F_ANTICIPOMIN : F_ANTICIPOMIN2);
|
const int anticipomin=get_int((level == 2) ? F_ANTICIPOMIN : F_ANTICIPOMIN2);
|
||||||
const int anticipomax=get_int((level == 2) ? F_ANTICIPOMAX : F_ANTICIPOMAX2);
|
const int anticipomax=get_int((level == 2) ? F_ANTICIPOMAX : F_ANTICIPOMAX2);
|
||||||
ok = general_review(check_machine, check_human, useextralines, useextrahours,lotsizing, no_outcapacity,anticipomin,anticipomax,_stock_break, logic, msg);
|
ok = general_review(check_machine, check_human, useextralines, useextrahours,lotsizing, no_outcapacity,anticipomin,anticipomax,_stock_break, logic, msg);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
@ -1379,6 +1383,7 @@ void TPlanning_mask::propose_1stJIT(TMSP_logic logic, bool check_machine, bool c
|
|||||||
bool TPlanning_mask::general_review(bool check_machine, bool check_human, bool useextralines, bool useextrahours,bool lotsizing, bool no_outcapacity, int anticipomin,int anticipomax, TMSP_mode mode, TMSP_logic logic, const char * msg )
|
bool TPlanning_mask::general_review(bool check_machine, bool check_human, bool useextralines, bool useextrahours,bool lotsizing, bool no_outcapacity, int anticipomin,int anticipomax, TMSP_mode mode, TMSP_logic logic, const char * msg )
|
||||||
{
|
{
|
||||||
const long max_mrp_rows=_mrp_articles.items();
|
const long max_mrp_rows=_mrp_articles.items();
|
||||||
|
const bool firstfitxbucket=get_bool(F_FFBUCKET_MSP) ;
|
||||||
if (max_mrp_rows == 0)
|
if (max_mrp_rows == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -1468,24 +1473,25 @@ bool TPlanning_mask::general_review(bool check_machine, bool check_human, bool u
|
|||||||
if (upper_buck>bucket)
|
if (upper_buck>bucket)
|
||||||
upper_buck=bucket;
|
upper_buck=bucket;
|
||||||
nbucket= (logic == _JIT_logic) ? upper_buck : lower_buck;
|
nbucket= (logic == _JIT_logic) ? upper_buck : lower_buck;
|
||||||
while (art_per_buck > ZERO // ho un sotto-stock da risolvere
|
|
||||||
&& nbucket>=lower_buck && nbucket <= upper_buck) // sono entro il range definito
|
int nlinea, numlinee;
|
||||||
{
|
|
||||||
int nlinea, numlinee;
|
|
||||||
|
|
||||||
if (ignore_lin || codlin.blank() )
|
if (ignore_lin || codlin.blank() )
|
||||||
|
{
|
||||||
|
nlinea=(attemp == 2 ? lineestd : 0 ) ;
|
||||||
|
numlinee=(attemp == 1 ? lineestd : maxlinee ) ;
|
||||||
|
} else {
|
||||||
|
nlinea= curr_labor->find_linea(codlin);
|
||||||
|
if (nlinea<0)
|
||||||
{
|
{
|
||||||
nlinea=(attemp == 2 ? lineestd : 0 ) ;
|
error_box(FR("La linea %s non e' in grado di produrre l'articolo %s"), (const char * )codlin, (const char *) _mrp_articles[mrp_row].articolo());
|
||||||
numlinee=(attemp == 1 ? lineestd : maxlinee ) ;
|
break;
|
||||||
} else {
|
}
|
||||||
nlinea= curr_labor->find_linea(codlin);
|
numlinee=nlinea+1;
|
||||||
if (nlinea<0)
|
}
|
||||||
{
|
while (art_per_buck > ZERO // ho un sotto-stock da risolvere
|
||||||
error_box(FR("La linea %s non e' in grado di produrre l'articolo %s"), (const char * )codlin, (const char *) _mrp_articles[mrp_row].articolo());
|
&& nlinea >= 0 && nlinea<numlinee && nbucket>=lower_buck && nbucket <= upper_buck) // sono entro il range definito
|
||||||
break;
|
{
|
||||||
}
|
|
||||||
numlinee=nlinea+1;
|
|
||||||
}
|
|
||||||
while (art_per_buck > ZERO && nlinea >= 0 && nlinea<numlinee && nbucket <= upper_buck)
|
while (art_per_buck > ZERO && nlinea >= 0 && nlinea<numlinee && nbucket <= upper_buck)
|
||||||
{
|
{
|
||||||
// scelgo la linea
|
// scelgo la linea
|
||||||
@ -1591,16 +1597,22 @@ bool TPlanning_mask::general_review(bool check_machine, bool check_human, bool u
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
error_box("Articolo %s: impianto %s incompatibile con la linea %s",(const char *)mrpline.articolo(), (const char *)codimp, (const char *)linea_prod.codice());
|
error_box("Articolo %s: impianto %s incompatibile con la linea %s",(const char *)mrpline.articolo(), (const char *)codimp, (const char *)linea_prod.codice());
|
||||||
if (logic == _uniform_logic)
|
if ((logic == _uniform_logic) ||
|
||||||
|
(logic == _first_fit_logic && firstfitxbucket))
|
||||||
nbucket++;
|
nbucket++;
|
||||||
else
|
else
|
||||||
nlinea++;
|
nlinea++;
|
||||||
} // ciclo sulle linee
|
} // ciclo sulle linee
|
||||||
|
if (logic == _first_fit_logic && firstfitxbucket)
|
||||||
|
nlinea++;
|
||||||
|
else
|
||||||
|
{
|
||||||
if (logic == _first_fit_logic)
|
if (logic == _first_fit_logic)
|
||||||
nbucket++;
|
nbucket++;
|
||||||
else
|
else
|
||||||
if (logic != _uniform_logic)
|
if (logic != _uniform_logic)
|
||||||
nbucket--;
|
nbucket--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
attemp++; // altro tentativo
|
attemp++; // altro tentativo
|
||||||
} // ciclo di risoluzione dei sotto-stock
|
} // ciclo di risoluzione dei sotto-stock
|
||||||
@ -1612,21 +1624,27 @@ bool TPlanning_mask::general_review(bool check_machine, bool check_human, bool u
|
|||||||
{
|
{
|
||||||
if (no_limits) // nessuna lavorazione da controllare o capacita' infinita
|
if (no_limits) // nessuna lavorazione da controllare o capacita' infinita
|
||||||
{
|
{
|
||||||
int nbucket, lower_buck, upper_buck;
|
int nbucket = 0, lower_buck = 0, upper_buck = 0;
|
||||||
if (logic == _uniform_logic)
|
switch (logic)
|
||||||
{
|
{
|
||||||
|
case _uniform_logic:
|
||||||
lower_buck = bucket - anticipomax/days_per_bucket();
|
lower_buck = bucket - anticipomax/days_per_bucket();
|
||||||
upper_buck = bucket-anticipomin/days_per_bucket();
|
upper_buck = bucket-anticipomin/days_per_bucket();
|
||||||
} else if (logic == _first_fit_logic) {
|
break;
|
||||||
|
case _first_fit_logic:
|
||||||
lower_buck = bucket - anticipomax/days_per_bucket();
|
lower_buck = bucket - anticipomax/days_per_bucket();
|
||||||
upper_buck = lower_buck;
|
upper_buck = lower_buck;
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
upper_buck = bucket - anticipomin/days_per_bucket();
|
upper_buck = bucket - anticipomin/days_per_bucket();
|
||||||
lower_buck = upper_buck;
|
lower_buck = upper_buck;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (lower_buck<1)
|
if (lower_buck < 1)
|
||||||
lower_buck=1;
|
lower_buck = 1;
|
||||||
if (upper_buck>bucket)
|
if (upper_buck < lower_buck) // Oppure bucket??????????????
|
||||||
|
upper_buck = lower_buck;
|
||||||
|
if (upper_buck > bucket)
|
||||||
upper_buck=bucket;
|
upper_buck=bucket;
|
||||||
nbucket = lower_buck;
|
nbucket = lower_buck;
|
||||||
//if (nbucket>bucket) // sono oltre il bucket attuale ?...
|
//if (nbucket>bucket) // sono oltre il bucket attuale ?...
|
||||||
@ -1661,12 +1679,9 @@ bool TPlanning_mask::general_review(bool check_machine, bool check_human, bool u
|
|||||||
}
|
}
|
||||||
if (codmagdep.empty())
|
if (codmagdep.empty())
|
||||||
{
|
{
|
||||||
if (codmagdep.empty())
|
codmagdep = _magazzini.standardmag();
|
||||||
{
|
codmagdep.left_just(3);
|
||||||
codmagdep = _magazzini.standardmag();
|
codmagdep << _magazzini.standarddep();
|
||||||
codmagdep.left_just(3);
|
|
||||||
codmagdep << _magazzini.standarddep();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
TMRP_line* new_article = find_propose(codclifor, mrpline.articolo(), mrpline.livgiac(),
|
TMRP_line* new_article = find_propose(codclifor, mrpline.articolo(), mrpline.livgiac(),
|
||||||
mrpline.codimp() , mrpline.codlin(), codmagdep, mrpline.codmagdep_coll(), true);
|
mrpline.codimp() , mrpline.codlin(), codmagdep, mrpline.codmagdep_coll(), true);
|
||||||
@ -2032,12 +2047,13 @@ const TDate & TPlanning_mask::starting_date() const
|
|||||||
|
|
||||||
int TPlanning_mask::days_per_bucket() const
|
int TPlanning_mask::days_per_bucket() const
|
||||||
{
|
{
|
||||||
return get_int(F_DAYXBUCK) * (get_int(F_BUCKETS) ? get_int(F_BUCKETS) : get_int(F_BUCKET));
|
const int cestini = get_int(F_BUCKETS);
|
||||||
|
return get_int(F_DAYXBUCK) * (cestini > 0 ? cestini : get_int(F_BUCKET));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPlanning_mask::bucket_mese() const
|
bool TPlanning_mask::bucket_mese() const
|
||||||
{
|
{
|
||||||
return *get(F_BUCKETS) == 'M';
|
return get(F_BUCKETS)[0] == 'M';
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPlanning_mask::clear_sheets()
|
void TPlanning_mask::clear_sheets()
|
||||||
@ -2307,7 +2323,7 @@ bool TPlanning_mask::pack_article_sheet(int r, int first, int last)
|
|||||||
{
|
{
|
||||||
TToken_string &curr_row=sf.row(curr);
|
TToken_string &curr_row=sf.row(curr);
|
||||||
if (art_row.get_long(F_CLIENTE-FIRST_FIELD) == curr_row.get_long(F_CLIENTE-FIRST_FIELD))
|
if (art_row.get_long(F_CLIENTE-FIRST_FIELD) == curr_row.get_long(F_CLIENTE-FIRST_FIELD))
|
||||||
if (TRiga_articolo ::order_compare(art_row, curr_row,15)==0)
|
if (TRiga_articolo::order_compare(art_row, curr_row,LAST_BUCKET)==0)
|
||||||
{
|
{
|
||||||
packed = true;
|
packed = true;
|
||||||
TToken_string work_row = curr_row;
|
TToken_string work_row = curr_row;
|
||||||
|
63
mr/mr2200a.h
63
mr/mr2200a.h
@ -25,6 +25,8 @@
|
|||||||
#define F_ADATA 207
|
#define F_ADATA 207
|
||||||
#define F_NOCLI_OUT 208
|
#define F_NOCLI_OUT 208
|
||||||
#define F_NOMAG_OUT 209
|
#define F_NOMAG_OUT 209
|
||||||
|
#define F_FFBUCKET_MSP 210
|
||||||
|
|
||||||
|
|
||||||
//#define F_NOIMP_OUT ?
|
//#define F_NOIMP_OUT ?
|
||||||
//#define F_NOLIN_OUT ?
|
//#define F_NOLIN_OUT ?
|
||||||
@ -245,25 +247,54 @@
|
|||||||
#define F_BUCKET14_V 146
|
#define F_BUCKET14_V 146
|
||||||
#define F_BUCKET15 147
|
#define F_BUCKET15 147
|
||||||
#define F_BUCKET15_V 148
|
#define F_BUCKET15_V 148
|
||||||
#define F_MASTERCODE 149
|
#define F_BUCKET16 149
|
||||||
#define F_SORTCODIMP 150
|
#define F_BUCKET16_V 150
|
||||||
#define F_SORTCODLIN 151
|
#define F_BUCKET17 151
|
||||||
|
#define F_BUCKET17_V 152
|
||||||
|
#define F_BUCKET18 153
|
||||||
|
#define F_BUCKET18_V 154
|
||||||
|
#define F_BUCKET19 155
|
||||||
|
#define F_BUCKET19_V 156
|
||||||
|
#define F_BUCKET20 157
|
||||||
|
#define F_BUCKET20_V 158
|
||||||
|
#define F_BUCKET21 159
|
||||||
|
#define F_BUCKET21_V 160
|
||||||
|
#define F_BUCKET22 161
|
||||||
|
#define F_BUCKET22_V 162
|
||||||
|
#define F_BUCKET23 163
|
||||||
|
#define F_BUCKET23_V 164
|
||||||
|
#define F_BUCKET24 165
|
||||||
|
#define F_BUCKET24_V 166
|
||||||
|
#define F_BUCKET25 167
|
||||||
|
#define F_BUCKET25_V 168
|
||||||
|
#define F_BUCKET26 169
|
||||||
|
#define F_BUCKET26_V 170
|
||||||
|
#define F_BUCKET27 171
|
||||||
|
#define F_BUCKET27_V 172
|
||||||
|
#define F_BUCKET28 173
|
||||||
|
#define F_BUCKET28_V 174
|
||||||
|
#define F_BUCKET29 175
|
||||||
|
#define F_BUCKET29_V 176
|
||||||
|
#define F_BUCKET30 177
|
||||||
|
#define F_BUCKET30_V 178
|
||||||
|
|
||||||
#define LAST_BUCKET 15
|
#define F_MASTERCODE 179
|
||||||
|
#define F_SORTCODIMP 180
|
||||||
|
#define F_SORTCODLIN 181
|
||||||
|
|
||||||
|
#define LAST_BUCKET 30
|
||||||
|
|
||||||
|
#define H_CODIMP 180
|
||||||
#define H_CODIMP 150
|
#define F_DESCCLI 181
|
||||||
#define F_DESCCLI 151
|
#define F_DESCIMP 182
|
||||||
#define F_DESCIMP 152
|
#define F_DESCLIN 183
|
||||||
#define F_DESCLIN 153
|
#define F_DESCMAG 184
|
||||||
#define F_DESCMAG 154
|
#define F_DESCMAGCOLL 185
|
||||||
#define F_DESCMAGCOLL 155
|
#define F_DOCUMENTI_IN 190
|
||||||
#define F_DOCUMENTI_IN 160
|
#define F_DOCUMENTI_OUT 191
|
||||||
#define F_DOCUMENTI_OUT 161
|
#define F_VINCOLI_IN 192
|
||||||
#define F_VINCOLI_IN 162
|
#define F_VINCOLI_OUT 193
|
||||||
#define F_VINCOLI_OUT 163
|
#define F_RECALCLINE 194
|
||||||
#define F_RECALCLINE 170
|
|
||||||
|
|
||||||
// sheet linee
|
// sheet linee
|
||||||
#define F_CODIMPCRP 101
|
#define F_CODIMPCRP 101
|
||||||
|
322
mr/mr2200a.uml
322
mr/mr2200a.uml
@ -528,6 +528,11 @@ BEGIN
|
|||||||
MESSAGE COPY,F_RECALC_TYPE2
|
MESSAGE COPY,F_RECALC_TYPE2
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOL F_FFBUCKET_MSP
|
||||||
|
BEGIN
|
||||||
|
PROMPT 60 1 "First Fit sui bucket"
|
||||||
|
END
|
||||||
|
|
||||||
STRING F_PRIORITY 60
|
STRING F_PRIORITY 60
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 2 "Priorita' "
|
PROMPT 2 2 "Priorita' "
|
||||||
@ -892,6 +897,36 @@ BEGIN
|
|||||||
ITEM "Bucket v14"
|
ITEM "Bucket v14"
|
||||||
ITEM "Bucket q15"
|
ITEM "Bucket q15"
|
||||||
ITEM "Bucket v15"
|
ITEM "Bucket v15"
|
||||||
|
ITEM "Bucket q16"
|
||||||
|
ITEM "Bucket v16"
|
||||||
|
ITEM "Bucket q17"
|
||||||
|
ITEM "Bucket v17"
|
||||||
|
ITEM "Bucket q18"
|
||||||
|
ITEM "Bucket v18"
|
||||||
|
ITEM "Bucket q19"
|
||||||
|
ITEM "Bucket v19"
|
||||||
|
ITEM "Bucket q20"
|
||||||
|
ITEM "Bucket v20"
|
||||||
|
ITEM "Bucket q21"
|
||||||
|
ITEM "Bucket v21"
|
||||||
|
ITEM "Bucket q22"
|
||||||
|
ITEM "Bucket v22"
|
||||||
|
ITEM "Bucket q23"
|
||||||
|
ITEM "Bucket v23"
|
||||||
|
ITEM "Bucket q24"
|
||||||
|
ITEM "Bucket v24"
|
||||||
|
ITEM "Bucket q25"
|
||||||
|
ITEM "Bucket v25"
|
||||||
|
ITEM "Bucket q26"
|
||||||
|
ITEM "Bucket v26"
|
||||||
|
ITEM "Bucket q27"
|
||||||
|
ITEM "Bucket v27"
|
||||||
|
ITEM "Bucket q28"
|
||||||
|
ITEM "Bucket v28"
|
||||||
|
ITEM "Bucket q29"
|
||||||
|
ITEM "Bucket v29"
|
||||||
|
ITEM "Bucket q30"
|
||||||
|
ITEM "Bucket v30"
|
||||||
ITEM "Master"
|
ITEM "Master"
|
||||||
DEFAULT NONE
|
DEFAULT NONE
|
||||||
END
|
END
|
||||||
@ -1436,7 +1471,6 @@ ENDMASK
|
|||||||
|
|
||||||
PAGE "Articoli" -1 -1 80 22
|
PAGE "Articoli" -1 -1 80 22
|
||||||
|
|
||||||
|
|
||||||
LIST F_TIPOCF_SHEET 1
|
LIST F_TIPOCF_SHEET 1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 0 ""
|
PROMPT 1 0 ""
|
||||||
@ -1692,32 +1726,16 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
TEXT DLG_NULL
|
|
||||||
BEGIN
|
|
||||||
PROMPT 3 10 " Quantita' "
|
|
||||||
END
|
|
||||||
TEXT DLG_NULL
|
|
||||||
BEGIN
|
|
||||||
PROMPT 23 10 " Prezzo"
|
|
||||||
END
|
|
||||||
TEXT DLG_NULL
|
|
||||||
BEGIN
|
|
||||||
PROMPT 42 9 " Quantita' "
|
|
||||||
END
|
|
||||||
TEXT DLG_NULL
|
|
||||||
BEGIN
|
|
||||||
PROMPT 64 9 " Prezzo"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER F_BUCKET0 17 2
|
NUMBER F_BUCKET0 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 10 "0 "
|
PROMPT 1 10 "0 "
|
||||||
FLAGS "DU"
|
FLAGS "DU"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET0_V 15 3
|
NUMBER F_BUCKET0_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 62 10 ""
|
PROMPT 1 110 ""
|
||||||
FLAGS "DU"
|
FLAGS "DU"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -1730,204 +1748,408 @@ END
|
|||||||
|
|
||||||
NUMBER F_BUCKET1_V 15 3
|
NUMBER F_BUCKET1_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 22 11 ""
|
PROMPT 1 111 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
NUMBER F_BUCKET2 17 2
|
NUMBER F_BUCKET2 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 11 "2 "
|
PROMPT 1 12 "2 "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET2_V 15 3
|
NUMBER F_BUCKET2_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 62 11 ""
|
PROMPT 1 112 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET3 17 2
|
NUMBER F_BUCKET3 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 12 "3 "
|
PROMPT 1 13 "3 "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET3_V 15 3
|
NUMBER F_BUCKET3_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 22 12 ""
|
PROMPT 1 113 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET4 17 2
|
NUMBER F_BUCKET4 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 12 "4 "
|
PROMPT 1 14 "4 "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET4_V 15 3
|
NUMBER F_BUCKET4_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 62 12 ""
|
PROMPT 1 114 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET5 17 2
|
NUMBER F_BUCKET5 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 13 "5 "
|
PROMPT 1 15 "5 "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET5_V 15 3
|
NUMBER F_BUCKET5_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 22 13 ""
|
PROMPT 1 115 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET6 17 2
|
NUMBER F_BUCKET6 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 13 "6 "
|
PROMPT 1 16 "6 "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET6_V 15 3
|
NUMBER F_BUCKET6_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 62 13 ""
|
PROMPT 1 116 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET7 17 2
|
NUMBER F_BUCKET7 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 14 "7 "
|
PROMPT 1 17 "7 "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET7_V 15 3
|
NUMBER F_BUCKET7_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 22 14 ""
|
PROMPT 1 117 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET8 17 2
|
NUMBER F_BUCKET8 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 14 "8 "
|
PROMPT 1 18 "8 "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET8_V 15 3
|
NUMBER F_BUCKET8_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 62 14 ""
|
PROMPT 1 118 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET9 17 2
|
NUMBER F_BUCKET9 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 15 "9 "
|
PROMPT 1 19 "9 "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET9_V 15 3
|
NUMBER F_BUCKET9_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 22 15 ""
|
PROMPT 1 119 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET10 17 2
|
NUMBER F_BUCKET10 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 15 "10"
|
PROMPT 22 10 "10"
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET10_V 15 3
|
NUMBER F_BUCKET10_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 62 15 ""
|
PROMPT 22 110 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET11 17 2
|
NUMBER F_BUCKET11 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 16 "11"
|
PROMPT 22 11 "11"
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET11_V 15 3
|
NUMBER F_BUCKET11_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 22 16 ""
|
PROMPT 22 111 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET12 17 2
|
NUMBER F_BUCKET12 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 16 "12"
|
PROMPT 22 12 "12"
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET12_V 15 3
|
NUMBER F_BUCKET12_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 62 16 ""
|
PROMPT 22 112 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET13 17 2
|
NUMBER F_BUCKET13 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 17 "13"
|
PROMPT 22 13 "13"
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET13_V 15 3
|
NUMBER F_BUCKET13_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 22 17 ""
|
PROMPT 22 113 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET14 17 2
|
NUMBER F_BUCKET14 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 17 "14"
|
PROMPT 22 14 "14"
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_QTA
|
GROUP G_QTA
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET14_V 15 3
|
NUMBER F_BUCKET14_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 62 17 ""
|
PROMPT 22 114 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP G_VALORI
|
GROUP G_VALORI
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET15 17 2
|
NUMBER F_BUCKET15 17 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 18 "15"
|
PROMPT 22 15 "15"
|
||||||
FLAGS "DU"
|
FLAGS "DU"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_BUCKET15_V 15 3
|
NUMBER F_BUCKET15_V 15 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 22 18 ""
|
PROMPT 22 115 ""
|
||||||
FLAGS "DU"
|
FLAGS "DU"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET16 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 16 "16"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET16_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 116 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET17 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 17 "17"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET17_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 117 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET18 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 18 "18"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET18_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 118 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET19 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 19 "19"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET19_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 119 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET20 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 10 "20"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET20_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 110 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET21 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 11 "21"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET21_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 111 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET22 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 12 "22"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET22_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 112 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET23 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 13 "23"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET23_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 113 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET24 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 14 "24"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET24_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 114 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET25 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 15 "25"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET25_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 115 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET26 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 16 "26"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET26_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 116 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET27 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 17 "27"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET27_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 117 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET28 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 18 "28"
|
||||||
|
FLAGS "U"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET28_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 118 ""
|
||||||
|
FLAGS "U"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET29 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 19 "29"
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_QTA
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET29_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 119 ""
|
||||||
|
FLAGS "U"
|
||||||
|
GROUP G_VALORI
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET30 17 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 20 "30"
|
||||||
|
FLAGS "DU"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_BUCKET30_V 15 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 43 120 ""
|
||||||
|
FLAGS "DU"
|
||||||
|
END
|
||||||
|
|
||||||
STRING F_MASTERCODE 1
|
STRING F_MASTERCODE 1
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -2164,8 +2386,6 @@ BEGIN
|
|||||||
FLAGS "DU"
|
FLAGS "DU"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BUTTON DLG_OK 10 2
|
BUTTON DLG_OK 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -12 -1 ""
|
PROMPT -12 -1 ""
|
||||||
|
@ -196,7 +196,7 @@ bool TRiga_articolo::find_block(const TSheet_field& sf, const int riga, int &fir
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TRiga_articolo::order_compare( const TToken_string &r1 , const TToken_string &r2 , int level, bool ascending)
|
int TRiga_articolo::order_compare( const TToken_string &r1, const TToken_string &r2, int level, bool ascending)
|
||||||
{
|
{
|
||||||
TString80 str0, str1;
|
TString80 str0, str1;
|
||||||
int cmp = 0;
|
int cmp = 0;
|
||||||
|
@ -229,6 +229,7 @@ public:
|
|||||||
void set_numpers_turno(int t, int pers);
|
void set_numpers_turno(int t, int pers);
|
||||||
|
|
||||||
virtual int num_turni() {return get_int("I0");}
|
virtual int num_turni() {return get_int("I0");}
|
||||||
|
virtual real tempo_minimo() {return get_real("R1");}
|
||||||
virtual int inizio_turno(int t);
|
virtual int inizio_turno(int t);
|
||||||
virtual int durata_turno(int t);
|
virtual int durata_turno(int t);
|
||||||
// **
|
// **
|
||||||
|
15
mr/mrtblnp.h
15
mr/mrtblnp.h
@ -54,17 +54,18 @@
|
|||||||
#define F_T8MDURATA 148
|
#define F_T8MDURATA 148
|
||||||
#define F_T8NUMPERS 149
|
#define F_T8NUMPERS 149
|
||||||
|
|
||||||
#define F_CODMAG 160
|
#define F_CODMAG 160
|
||||||
#define F_DESMAG 161
|
#define F_DESMAG 161
|
||||||
#define F_CODDEP 162
|
#define F_CODDEP 162
|
||||||
#define F_DESDEP 163
|
#define F_DESDEP 163
|
||||||
#define F_CODMAG_C 164
|
#define F_CODMAG_C 164
|
||||||
#define F_DESMAG_C 165
|
#define F_DESMAG_C 165
|
||||||
#define F_CODDEP_C 166
|
#define F_CODDEP_C 166
|
||||||
#define F_DESDEP_C 167
|
#define F_DESDEP_C 167
|
||||||
|
#define F_TMIN 168
|
||||||
|
|
||||||
#define F_YEAR 201
|
#define F_YEAR 201
|
||||||
#define F_TYPE 202
|
#define F_TYPE 202
|
||||||
#define F_CALENDAR 203
|
#define F_CALENDAR 203
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -129,12 +129,18 @@ END
|
|||||||
|
|
||||||
BOOL F_PERSONESPEC
|
BOOL F_PERSONESPEC
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 7 "Utilizza personale specializzato"
|
PROMPT 30 7 "Utilizza personale specializzato"
|
||||||
FIELD B0
|
FIELD B0
|
||||||
MESSAGE TRUE SHOW,GPERS@|ENABLE,F_PERSONE
|
MESSAGE TRUE SHOW,GPERS@|ENABLE,F_PERSONE
|
||||||
MESSAGE FALSE HIDE,GPERS@
|
MESSAGE FALSE HIDE,GPERS@
|
||||||
END
|
END
|
||||||
|
|
||||||
|
NUMBER F_TMIN 6 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 60 7 "Tempo minimo "
|
||||||
|
FIELD R1
|
||||||
|
END
|
||||||
|
|
||||||
NUMBER F_PERSONE 3
|
NUMBER F_PERSONE 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 26 8 "Persone su un turno "
|
PROMPT 26 8 "Persone su un turno "
|
||||||
|
@ -144,7 +144,6 @@ const int anno = rec.get_int(PROV_ANNO);
|
|||||||
const real importo_maturato = importo_rata - importo_pagato;
|
const real importo_maturato = importo_rata - importo_pagato;
|
||||||
const real provvigione_maturata = provvigione_rata - provvigione_pagata;
|
const real provvigione_maturata = provvigione_rata - provvigione_pagata;
|
||||||
|
|
||||||
rec.put(PROV_SALDATA, "X");
|
|
||||||
rec.put(PROV_PAGMAT, importo_maturato);
|
rec.put(PROV_PAGMAT, importo_maturato);
|
||||||
rec.put(PROV_PROVVMAT, provvigione_maturata);
|
rec.put(PROV_PROVVMAT, provvigione_maturata);
|
||||||
|
|
||||||
@ -171,7 +170,6 @@ const int anno = rec.get_int(PROV_ANNO);
|
|||||||
if (data_mat <= data_scad)
|
if (data_mat <= data_scad)
|
||||||
{
|
{
|
||||||
changed_record = true;
|
changed_record = true;
|
||||||
rec.put(PROV_SALDATA, "X");
|
|
||||||
rec.put(PROV_PAGMAT, importo_rata);
|
rec.put(PROV_PAGMAT, importo_rata);
|
||||||
rec.put(PROV_PROVVMAT, provvigione_rata);
|
rec.put(PROV_PROVVMAT, provvigione_rata);
|
||||||
}
|
}
|
||||||
|
617
sc/sc2600.cpp
617
sc/sc2600.cpp
@ -17,26 +17,16 @@
|
|||||||
// Stampa prospetto scadenze
|
// Stampa prospetto scadenze
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define NUMERO_FASCE 5
|
#define NUMERO_FASCE 6
|
||||||
#define LIMITI {30,60,90,120,150,30,60,90,120,150}
|
#define LIMITI {0, 30, 60, 90, 120, 150, 180}
|
||||||
|
|
||||||
enum tipo_st {clienti=0, fornitori=1};
|
enum tipo_st {clienti=0, fornitori=1};
|
||||||
|
|
||||||
class TLineTotal : public TObject //Oggetto di base per i TAssoc_array dei totali
|
class TLineTotal : public TObject //Oggetto di base per i TAssoc_array dei totali
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
real _s1;// Scaglione 1 scaduto
|
real _s[6];// Scaglioni scaduto
|
||||||
real _s2;// Scaglione 2 scaduto
|
real _ns[6];// Scaglioni a scadere
|
||||||
real _s3;// Scaglione 3 scaduto
|
|
||||||
real _s4;// Scaglione 4 scaduto
|
|
||||||
real _s5;// Scaglione 5 scaduto
|
|
||||||
real _s6;// Scaglione 6 scaduto
|
|
||||||
real _ns1;// Scaglione 1 non scaduto
|
|
||||||
real _ns2;// Scaglione 2 non scaduto
|
|
||||||
real _ns3;// Scaglione 3 non scaduto
|
|
||||||
real _ns4;// Scaglione 4 non scaduto
|
|
||||||
real _ns5;// Scaglione 5 non scaduto
|
|
||||||
real _ns6;// Scaglione 6 non scaduto
|
|
||||||
real _es; // esposto
|
real _es; // esposto
|
||||||
real _sl; // saldo
|
real _sl; // saldo
|
||||||
|
|
||||||
@ -48,18 +38,11 @@ public:
|
|||||||
|
|
||||||
TLineTotal & TLineTotal::copy(const TLineTotal & l)
|
TLineTotal & TLineTotal::copy(const TLineTotal & l)
|
||||||
{
|
{
|
||||||
_s1=l._s1;
|
for (int i = 0; i < NUMERO_FASCE; i++)
|
||||||
_s2=l._s2;
|
{
|
||||||
_s3=l._s3;
|
_s[i] = l._s[i];
|
||||||
_s4=l._s4;
|
_ns[i] = l._ns[i];
|
||||||
_s5=l._s5;
|
}
|
||||||
_s6=l._s6;
|
|
||||||
_ns1=l._ns1;
|
|
||||||
_ns2=l._ns2;
|
|
||||||
_ns3=l._ns3;
|
|
||||||
_ns4=l._ns4;
|
|
||||||
_ns5=l._ns5;
|
|
||||||
_ns6=l._ns6;
|
|
||||||
_es=l._es;
|
_es=l._es;
|
||||||
_sl=l._sl;
|
_sl=l._sl;
|
||||||
return *this;
|
return *this;
|
||||||
@ -67,18 +50,11 @@ TLineTotal & TLineTotal::copy(const TLineTotal & l)
|
|||||||
|
|
||||||
TLineTotal::TLineTotal()
|
TLineTotal::TLineTotal()
|
||||||
{
|
{
|
||||||
_s1=ZERO;
|
for (int i = 0; i < NUMERO_FASCE; i++)
|
||||||
_s2=ZERO;
|
{
|
||||||
_s3=ZERO;
|
_s[i] = ZERO;
|
||||||
_s4=ZERO;
|
_ns[i] = ZERO;
|
||||||
_s5=ZERO;
|
}
|
||||||
_s6=ZERO;
|
|
||||||
_ns1=ZERO;
|
|
||||||
_ns2=ZERO;
|
|
||||||
_ns3=ZERO;
|
|
||||||
_ns4=ZERO;
|
|
||||||
_ns5=ZERO;
|
|
||||||
_ns6=ZERO;
|
|
||||||
_es=ZERO;
|
_es=ZERO;
|
||||||
_sl=ZERO;
|
_sl=ZERO;
|
||||||
}
|
}
|
||||||
@ -117,17 +93,16 @@ public:
|
|||||||
virtual print_action postprocess_print(int file, int counter);
|
virtual print_action postprocess_print(int file, int counter);
|
||||||
virtual print_action postprocess_page(int file, int counter);
|
virtual print_action postprocess_page(int file, int counter);
|
||||||
virtual void preprocess_header() {};
|
virtual void preprocess_header() {};
|
||||||
|
virtual void preprocess_footer() ;
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
virtual bool set_print(int);
|
virtual bool set_print(int);
|
||||||
virtual void set_page (int file, int counter);
|
virtual void set_page (int file, int counter);
|
||||||
void print_totali_rows(int nriga, bool what);
|
void print_totali_rows(int nriga, bool what);
|
||||||
void print_totali(int& nriga);
|
void print_totali(int nriga);
|
||||||
void print_header();
|
void print_header();
|
||||||
int calc_last_column();
|
int calc_last_column();
|
||||||
void update_totals(bool what, real& esp,
|
void update_totals(bool what, real& esp, real s[6], real ns[6]);
|
||||||
real& s1,real& s2,real& s3,real& s4,real& s5, real& s6,
|
|
||||||
real& ns1,real& ns2,real& ns3,real& ns4,real& ns5, real& ns6);
|
|
||||||
void compute_unassigned(TPartita& p);
|
void compute_unassigned(TPartita& p);
|
||||||
void compute_all(TPartita& p, TBill& bill);
|
void compute_all(TPartita& p, TBill& bill);
|
||||||
void print_real(TString& dest, const real& num);
|
void print_real(TString& dest, const real& num);
|
||||||
@ -145,7 +120,7 @@ void TProspettoScadenze::print_real(TString& dest, const real& num)
|
|||||||
const bool stampa_in_valuta = _stvaluta && !_codval.blank();
|
const bool stampa_in_valuta = _stvaluta && !_codval.blank();
|
||||||
const TString& val = stampa_in_valuta ? _codval : EMPTY_STRING;
|
const TString& val = stampa_in_valuta ? _codval : EMPTY_STRING;
|
||||||
const TCurrency cur(num, val);
|
const TCurrency cur(num, val);
|
||||||
dest = cur.string(TRUE);
|
dest = cur.string(true);
|
||||||
dest.right_just(10);
|
dest.right_just(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,8 +141,8 @@ bool TProspettoScadenze::fil_function(const TRelation *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TProspettoScadenze::update_totals(bool what, real& esp,
|
void TProspettoScadenze::update_totals(bool what, real& esp,
|
||||||
real& s1, real& s2, real& s3, real& s4, real& s5, real& s6,
|
real s[6],
|
||||||
real& ns1, real& ns2, real& ns3, real& ns4, real& ns5, real& ns6)
|
real ns[6])
|
||||||
{
|
{
|
||||||
TAssoc_array& a = (TAssoc_array&) _t[what];
|
TAssoc_array& a = (TAssoc_array&) _t[what];
|
||||||
TLineTotal *ll = (TLineTotal *) a.objptr(_codval);
|
TLineTotal *ll = (TLineTotal *) a.objptr(_codval);
|
||||||
@ -176,18 +151,11 @@ void TProspettoScadenze::update_totals(bool what, real& esp,
|
|||||||
ll = new TLineTotal;
|
ll = new TLineTotal;
|
||||||
a.add(_codval, ll);
|
a.add(_codval, ll);
|
||||||
}
|
}
|
||||||
ll->_s1 += s1;
|
for (int i = 0; i < NUMERO_FASCE; i++)
|
||||||
ll->_s2 += s2;
|
{
|
||||||
ll->_s3 += s3;
|
ll->_s[i] += s[i];
|
||||||
ll->_s4 += s4;
|
ll->_ns[i] += ns[i];
|
||||||
ll->_s5 += s5;
|
}
|
||||||
ll->_s6 += s6;
|
|
||||||
ll->_ns1 += ns1;
|
|
||||||
ll->_ns2 += ns2;
|
|
||||||
ll->_ns3 += ns3;
|
|
||||||
ll->_ns4 += ns4;
|
|
||||||
ll->_ns5 += ns5;
|
|
||||||
ll->_ns6 += ns6;
|
|
||||||
ll->_es += esp;
|
ll->_es += esp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +178,12 @@ void TProspettoScadenze::compute_unassigned(TPartita& p)
|
|||||||
|
|
||||||
void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
|
void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
|
||||||
{
|
{
|
||||||
real residuo, s1,s2,s3,s4,s5,s6,ns1,ns2,ns3,ns4,ns5,ns6,res_pagati,esposto;
|
real residuo;
|
||||||
|
real s[6];
|
||||||
|
real ns[6];
|
||||||
|
real res_pagati;
|
||||||
|
real esposto;
|
||||||
|
|
||||||
compute_unassigned(p);
|
compute_unassigned(p);
|
||||||
for (int r = p.last(); r > 0; r = p.pred(r)) // Browse all rows (partite)
|
for (int r = p.last(); r > 0; r = p.pred(r)) // Browse all rows (partite)
|
||||||
{
|
{
|
||||||
@ -219,36 +192,40 @@ void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
|
|||||||
// non deve scorrere le scadenze
|
// non deve scorrere le scadenze
|
||||||
const TDate data_reg(rp.get_date(PART_DATAREG));
|
const TDate data_reg(rp.get_date(PART_DATAREG));
|
||||||
if (data_reg > _limop) continue;
|
if (data_reg > _limop) continue;
|
||||||
for (int n=rp.rate(); n > 0; n--) // Browse all rows (scadenze)
|
for (int n = rp.rate(); n > 0; n--) // Browse all rows (scadenze)
|
||||||
{
|
{
|
||||||
const TRiga_scadenze& rs = rp.rata(n);
|
const TRiga_scadenze& rs = rp.rata(n);
|
||||||
const TDate d(rs.get_date(SCAD_DATASCAD));
|
const TDate d(rs.get_date(SCAD_DATASCAD));
|
||||||
const char* field = (_stvaluta && rs.in_valuta()) ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO;
|
const char* field = (_stvaluta && rs.in_valuta()) ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO;
|
||||||
const char* sfield = (_stvaluta && rs.in_valuta()) ? SCAD_IMPORTOVAL : SCAD_IMPORTO;
|
const char* sfield = (_stvaluta && rs.in_valuta()) ? SCAD_IMPORTOVAL : SCAD_IMPORTO;
|
||||||
const char ssez = rp.sezione();
|
const char ssez = rp.sezione();
|
||||||
|
TImporto scd(ssez,rs.get_real(sfield)); // Importo in scadenza...
|
||||||
TImporto scd,pag,bf,work_imp;
|
TImporto pag(rs.importo_pagato(_stvaluta)); // Quanto e' stato pagato per questa scadenza?
|
||||||
scd += TImporto(ssez,rs.get_real(sfield)); // Importo in scadenza...
|
TImporto bf;
|
||||||
pag += rs.importo_pagato(_stvaluta); // Quanto e' stato pagato per questa scadenza?
|
TImporto work_imp;
|
||||||
|
|
||||||
// Scorre le righe di pagamento per trovare la riga corripondente alla prima data pagamento
|
// Scorre le righe di pagamento per trovare la riga corripondente alla prima data pagamento
|
||||||
// di questa rata. Motivo: il primo pagamento delle rata corrente, effettuato tramite effetto
|
// di questa rata. Motivo: il primo pagamento delle rata corrente, effettuato tramite effetto
|
||||||
// (ai fini del calcolo B.F.) deve essere considerato con la data scadenza
|
// (ai fini del calcolo B.F.) deve essere considerato con la data scadenza
|
||||||
const int lst = rs.last();
|
const int lst = rs.last();
|
||||||
int prima_riga_pagamento = -1;
|
int prima_riga_pagamento = -1;
|
||||||
TDate first_date;// data relativa alla prima riga di pagamento
|
TDate first_date;// data relativa alla prima riga di pagamento
|
||||||
|
|
||||||
for (int pp = rs.first(); pp <= lst; pp = rs.succ(pp))
|
for (int pp = rs.first(); pp <= lst; pp = rs.succ(pp))
|
||||||
{
|
{
|
||||||
const TRiga_partite& sum = p.riga(pp);
|
const TRiga_partite& sum = p.riga(pp);
|
||||||
TDate current_date(sum.get_date(PART_DATAPAG));
|
TDate current_date(sum.get_date(PART_DATAPAG));
|
||||||
int tipo_pag = rs.get_int(SCAD_TIPOPAG);
|
int tipo_pag = rs.get_int(SCAD_TIPOPAG);
|
||||||
if (tipo_pag>=2 && tipo_pag<=7) //Incasso tramite effetto
|
const tipo_movimento tipomov = (tipo_movimento) sum.get_int(PART_TIPOMOV);
|
||||||
|
|
||||||
|
if (tipomov != tm_insoluto && tipo_pag >= 2 && tipo_pag <= 7) //Incasso tramite effetto
|
||||||
if (prima_riga_pagamento==-1 || first_date > current_date)
|
if (prima_riga_pagamento==-1 || first_date > current_date)
|
||||||
{
|
{
|
||||||
first_date = current_date;
|
first_date = current_date;
|
||||||
prima_riga_pagamento = pp;
|
prima_riga_pagamento = pp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (pp = rs.first(); pp <= lst; pp = rs.succ(pp)) // Browse all rows (pagamenti)
|
for (pp = rs.first(); pp <= lst; pp = rs.succ(pp)) // Browse all rows (pagamenti)
|
||||||
{
|
{
|
||||||
const TRectype pg = rs.row(pp);
|
const TRectype pg = rs.row(pp);
|
||||||
@ -258,13 +235,13 @@ void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
|
|||||||
// se tipomov e' 2 (Nota di credito assegnata)
|
// se tipomov e' 2 (Nota di credito assegnata)
|
||||||
// storna da scdz. In entrambi i casi si ha l'operatore +=, perche' nel TImporto e' gia'
|
// storna da scdz. In entrambi i casi si ha l'operatore +=, perche' nel TImporto e' gia'
|
||||||
// compresa la sezione opposta
|
// compresa la sezione opposta
|
||||||
if (tipomov==2)
|
if (tipomov == tm_nota_credito)
|
||||||
{
|
{
|
||||||
work_imp = TImporto(sez,pg.get_real(field));
|
work_imp = TImporto(sez,pg.get_real(field));
|
||||||
scd += work_imp;
|
scd += work_imp;
|
||||||
pag -= work_imp;
|
pag -= work_imp;
|
||||||
}
|
}
|
||||||
if ((tipomov==3 || tipomov==5) && _tipost==clienti && _gcr!=0)
|
if ((tipomov == tm_pagamento || tipomov == tm_pagamento_insoluto) && _tipost == clienti)
|
||||||
{
|
{
|
||||||
TDate data_pag(sum.get_date(PART_DATAPAG));
|
TDate data_pag(sum.get_date(PART_DATAPAG));
|
||||||
int tipo_pag = rs.get_int(SCAD_TIPOPAG);
|
int tipo_pag = rs.get_int(SCAD_TIPOPAG);
|
||||||
@ -273,79 +250,76 @@ void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
|
|||||||
if (prima_riga_pagamento > -1 && prima_riga_pagamento == pp)
|
if (prima_riga_pagamento > -1 && prima_riga_pagamento == pp)
|
||||||
data_pag = d; // Se e' il primo pagamento(in ordine di data) di questa rata
|
data_pag = d; // Se e' il primo pagamento(in ordine di data) di questa rata
|
||||||
// prende la data di scadenza relativa.
|
// prende la data di scadenza relativa.
|
||||||
if (data_pag >= _limbf) // && data_pag <= _limscad)
|
if (data_pag > _limbf) // && data_pag <= _limscad)
|
||||||
bf += TImporto(sez,pg.get_real(field));
|
bf += TImporto(sez,pg.get_real(field));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
char norm='D';
|
|
||||||
if (_tipost == fornitori)
|
const char scd_sez = (_tipost == fornitori ? 'A' : 'D');
|
||||||
norm = 'A';
|
const char pag_sez = (_tipost == fornitori ? 'D' : 'A');
|
||||||
pag.normalize((norm=='D') ? 'A' : 'D'); scd.normalize(norm); bf.normalize((norm=='D') ? 'A' : 'D');
|
|
||||||
real res,a,b; a = pag.valore(); b = scd.valore(); //buonf += bf.valore();
|
scd.normalize(scd_sez);
|
||||||
res = b - a;
|
|
||||||
|
real rscd = scd.valore();
|
||||||
|
|
||||||
|
pag -= bf;
|
||||||
|
pag.normalize(pag_sez);
|
||||||
|
|
||||||
|
real rpag = pag.valore();
|
||||||
|
|
||||||
|
real res = rscd - rpag;
|
||||||
|
|
||||||
if (_uns > ZERO) // Rettifica i pagamenti con i non assegnati (calcolo sul residuo: scadenza-pagamento)
|
if (_uns > ZERO) // Rettifica i pagamenti con i non assegnati (calcolo sul residuo: scadenza-pagamento)
|
||||||
{
|
{
|
||||||
real gap = (_uns > res ? res : _uns); // questo e' quanto manca per completare questa scadenza
|
real gap = (_uns > res ? res : _uns); // questo e' quanto manca per completare questa scadenza
|
||||||
a += gap;
|
res += gap;
|
||||||
_uns -= gap; // aggiorna la cache..
|
_uns -= gap; // aggiorna la cache..
|
||||||
}
|
}
|
||||||
if (_unsnc > ZERO) // Rettifica le scadenze con le N.C non assegnate.
|
if (_unsnc > ZERO) // Rettifica le scadenze con le N.C non assegnate.
|
||||||
{
|
{
|
||||||
real gap = (_unsnc > b ? b : _unsnc);
|
real gap = (_unsnc > rscd ? rscd : _unsnc);
|
||||||
b -= gap;
|
rscd -= gap;
|
||||||
_unsnc -= gap;
|
_unsnc -= gap;
|
||||||
}
|
}
|
||||||
res = b - a; // Scadenze - pagati = scaduto per questo gruppo di rate
|
res = rscd - rpag; // Scadenze - pagati = scaduto per questo gruppo di rate
|
||||||
if (b == ZERO) // Se le scadenze sono a zero, vuol dire che sono state stornate
|
if (rscd == ZERO) // Se le scadenze sono a zero, vuol dire che sono state stornate
|
||||||
res = ZERO; // da qualche nota di credito o non assegnato percio' non si ha residuo
|
res = ZERO; // da qualche nota di credito o non assegnato percio' non si ha residuo
|
||||||
|
|
||||||
//if (res < ZERO) // Significa che l'importo pagato e' maggiore dell'importo in scadenza
|
if (d > _limscad)
|
||||||
//{ // c'e' un residuo positivo, e quindi va memorizzato
|
|
||||||
// res *= -1.0; // cambia il segno
|
|
||||||
// res_pagati+= res; // Residui pagati in piu'
|
|
||||||
// res = ZERO;
|
|
||||||
// res *= -1.0;
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (d > _limscad)
|
|
||||||
{
|
{
|
||||||
if (d > _limscad && d <= (TDate&)_ns_date[0])
|
if (_nsinfasce)
|
||||||
ns1 += res;
|
|
||||||
if (d > (TDate&)_ns_date[0] && d <= (TDate&)_ns_date[1])
|
|
||||||
ns2 += res;
|
|
||||||
if (d > (TDate&)_ns_date[1] && d <= (TDate&)_ns_date[2])
|
|
||||||
ns3 += res;
|
|
||||||
if (d > (TDate&)_ns_date[2] && d <= (TDate&)_ns_date[3])
|
|
||||||
ns4 += res;
|
|
||||||
if (d > (TDate&)_ns_date[3] && d <= (TDate&)_ns_date[4])
|
|
||||||
ns5 += res;
|
|
||||||
if (d > (TDate&)_ns_date[4])
|
|
||||||
{
|
{
|
||||||
TDate data = (TDate&) _ns_date[4];
|
for (int i = _nsfasce + 1; i >= 0; i--)
|
||||||
if (data.year() != 0)
|
{
|
||||||
ns6 += res;
|
const TDate & limdate = (TDate&)_ns_date[i];
|
||||||
|
if (limdate.ok() && d > limdate)
|
||||||
|
{
|
||||||
|
ns[i] += res;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ns[0] += res;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Detrae dal residuo scaduto eventuali pagamenti in piu' effettuati
|
if (_sinfasce)
|
||||||
//real gap = (res_pagati > res ? res : res_pagati);
|
{
|
||||||
//res -= gap;
|
for (int i = _sfasce + 1; i >= 0; i--)
|
||||||
//res_pagati -= gap;
|
{
|
||||||
|
const TDate & limdate = (TDate&)_s_date[i];
|
||||||
|
if (limdate.ok() && d <= limdate)
|
||||||
|
{
|
||||||
|
s[i] += res;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
s[0] += res;
|
||||||
}
|
}
|
||||||
if (d <= _limscad && d > (TDate&)_s_date[0])
|
|
||||||
s1 += res;
|
|
||||||
if (d <= (TDate&)_s_date[0] && d > (TDate&)_s_date[1])
|
|
||||||
s2 += res;
|
|
||||||
if (d <= (TDate&)_s_date[1] && d > (TDate&)_s_date[2])
|
|
||||||
s3 += res;
|
|
||||||
if (d <= (TDate&)_s_date[2] && d > (TDate&)_s_date[3])
|
|
||||||
s4 += res;
|
|
||||||
if (d <= (TDate&)_s_date[3] && d > (TDate&)_s_date[4])
|
|
||||||
s5 += res;
|
|
||||||
if (d <= (TDate&)_s_date[4])
|
|
||||||
s6 += res;
|
|
||||||
residuo += res;
|
residuo += res;
|
||||||
bool sbf;
|
bool sbf;
|
||||||
TImporto esp = rs.esposto(_stvaluta, _limscad, _limbf, sbf);
|
TImporto esp = rs.esposto(_stvaluta, _limscad, _limbf, sbf);
|
||||||
@ -354,18 +328,15 @@ void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Aggiorna i totali...
|
// Aggiorna i totali...
|
||||||
if (s1!=ZERO || s2!=ZERO || s3!=ZERO || s4!= ZERO || s5!= ZERO || s6!=ZERO ||
|
update_totals(0, esposto, s, ns); // Singolo...
|
||||||
ns1!=ZERO || ns2!=ZERO || ns3!=ZERO || ns4!= ZERO || ns5!= ZERO || ns6!=ZERO || esposto!=ZERO)
|
update_totals(1, esposto, s, ns); // ...Generale
|
||||||
{
|
|
||||||
update_totals(0, esposto, s1, s2, s3, s4, s5, s6, ns1, ns2, ns3, ns4, ns5, ns6); // Singolo...
|
|
||||||
update_totals(1, esposto, s1, s2, s3, s4, s5, s6, ns1, ns2, ns3, ns4, ns5, ns6); // ...Generale
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TProspettoScadenze::calcola_saldo()
|
void TProspettoScadenze::calcola_saldo()
|
||||||
{
|
{
|
||||||
TAssoc_array& a = (TAssoc_array&) _t[0];
|
TAssoc_array& a = (TAssoc_array&) _t[0];
|
||||||
TLineTotal *ll = (TLineTotal *) a.objptr(_codval);
|
TLineTotal *ll = (TLineTotal *) a.objptr(_codval);
|
||||||
|
TEsercizi_contabili e;
|
||||||
TSaldo saldo;
|
TSaldo saldo;
|
||||||
int g,c;
|
int g,c;
|
||||||
const long s = atol(_cod_pre);
|
const long s = atol(_cod_pre);
|
||||||
@ -376,12 +347,17 @@ void TProspettoScadenze::calcola_saldo()
|
|||||||
g = cf.get_int(0);
|
g = cf.get_int(0);
|
||||||
c = cf.get_int(1);
|
c = cf.get_int(1);
|
||||||
TToken_string key;
|
TToken_string key;
|
||||||
key.add(g); key.add(c); key.add(s);
|
key.add(g); key.add(c); key.add("");
|
||||||
const TRectype& pc = cache().get(LF_PCON, key);
|
const TRectype& pc = cache().get(LF_PCON, key);
|
||||||
int indbil_conto = pc.get_int (PCN_INDBIL);
|
int indbil_conto = pc.get_int (PCN_INDBIL);
|
||||||
TDate dataini = TDate(1, 1, _limop.year());
|
const int codes = e.date2esc(_limop);
|
||||||
saldo.data_limite_bilancio( 1, g, c, s, dataini, _limop, indbil_conto, FALSE);
|
saldo.set_annoes(codes);
|
||||||
ll->_sl += saldo.saldo();
|
TDate dataini(e.esercizio(codes).inizio());
|
||||||
|
saldo.data_limite_bilancio( 1, g, c, s, dataini, _limop, indbil_conto, false);
|
||||||
|
if (_tipost == fornitori)
|
||||||
|
ll->_sl -= saldo.saldo();
|
||||||
|
else
|
||||||
|
ll->_sl += saldo.saldo();
|
||||||
}
|
}
|
||||||
// aggiorno il totale generale
|
// aggiorno il totale generale
|
||||||
TAssoc_array& at = (TAssoc_array&) _t[1];
|
TAssoc_array& at = (TAssoc_array&) _t[1];
|
||||||
@ -404,9 +380,9 @@ bool TProspettoScadenze::preprocess_page(int file, int counter)
|
|||||||
const bool checked = _m->selected(bill);
|
const bool checked = _m->selected(bill);
|
||||||
|
|
||||||
if (!checked && !_end_printed) // Se non e' stato selezionato salta al prossimo record
|
if (!checked && !_end_printed) // Se non e' stato selezionato salta al prossimo record
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
int nriga = 1;
|
// int nriga = 1;
|
||||||
if (_tipost == clienti || _tipost == fornitori)
|
if (_tipost == clienti || _tipost == fornitori)
|
||||||
{
|
{
|
||||||
const TRectype& clifo = current_cursor()->curr(LF_CLIFO);
|
const TRectype& clifo = current_cursor()->curr(LF_CLIFO);
|
||||||
@ -425,51 +401,42 @@ bool TProspettoScadenze::preprocess_page(int file, int counter)
|
|||||||
if (_cod != _cod_pre || _end_printed) // Controlla se e' cambiato il codice cli/fo/conto
|
if (_cod != _cod_pre || _end_printed) // Controlla se e' cambiato il codice cli/fo/conto
|
||||||
{
|
{
|
||||||
reset_print();
|
reset_print();
|
||||||
if (_cod_pre != "") // stampa i totali del precedente solo se non e' la prima
|
if (((TAssoc_array&) _t[0]).items() > 0)
|
||||||
{
|
print_totali(1);
|
||||||
//calcola_saldo();
|
|
||||||
TAssoc_array& sin_tot = (TAssoc_array&) _t[0];
|
|
||||||
if (sin_tot.items() > 0)
|
|
||||||
{
|
|
||||||
print_totali(nriga);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_des.trim();
|
_des.trim();
|
||||||
_cod_pre = _cod;
|
_cod_pre = _cod;
|
||||||
_des_pre = _des;
|
_des_pre = _des;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curr.empty()) // Attenzione: Possono succedere anche queste cose!
|
if (!curr.empty())
|
||||||
return FALSE;
|
{
|
||||||
TPartita p(curr);
|
TPartita p(curr);
|
||||||
|
|
||||||
//Pesca gli estremi dalla prima riga di fattura, che non e' necessariamente la riga #1
|
//Pesca gli estremi dalla prima riga di fattura, che non e' necessariamente la riga #1
|
||||||
const int r = p.prima_fattura();
|
const int r = p.prima_fattura();
|
||||||
if (r <= 0)
|
|
||||||
return TRUE; // se non ci sono fatture ... salta al prossimo
|
|
||||||
|
|
||||||
if (r > 0) //Skip next partita if no fatture!
|
if (r > 0) //Skip next partita if no fatture!
|
||||||
{
|
{
|
||||||
TRiga_partite& rp = p.riga(r);
|
TRiga_partite& rp = p.riga(r);
|
||||||
_anno = rp.get(PART_ANNO);
|
_anno = rp.get(PART_ANNO);
|
||||||
_anno.ltrim(2);
|
_anno.ltrim(2);
|
||||||
_numdoc = rp.get(PART_NUMDOC);
|
_numdoc = rp.get(PART_NUMDOC);
|
||||||
_protiva = rp.get(PART_PROTIVA);
|
_protiva = rp.get(PART_PROTIVA);
|
||||||
_datadoc = (const char*) rp.get_date(PART_DATADOC);
|
_datadoc = (const char*) rp.get_date(PART_DATADOC);
|
||||||
_codval = (_stvaluta ? rp.get(PART_CODVAL): "");
|
_codval = (_stvaluta ? rp.get(PART_CODVAL): "");
|
||||||
if (_codval.empty()) _codval = " ";
|
if (_codval.empty()) _codval = " ";
|
||||||
// Now performing fulkrum...
|
// Now performing fulkrum...
|
||||||
compute_all(p, bill);
|
compute_all(p, bill);
|
||||||
}
|
}
|
||||||
current_cursor()->repos(); // Very, very necessary...
|
current_cursor()->repos(); // Very, very necessary...
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TProspettoScadenze::preprocess_print(int file, int counter)
|
bool TProspettoScadenze::preprocess_print(int file, int counter)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
print_action TProspettoScadenze::postprocess_print(int file, int counter)
|
print_action TProspettoScadenze::postprocess_print(int file, int counter)
|
||||||
@ -481,18 +448,21 @@ print_action TProspettoScadenze::postprocess_print(int file, int counter)
|
|||||||
{
|
{
|
||||||
rt = REPEAT_PAGE;
|
rt = REPEAT_PAGE;
|
||||||
_end_printed = true;
|
_end_printed = true;
|
||||||
}
|
|
||||||
if (_end_printed)
|
|
||||||
{
|
|
||||||
TAssoc_array& gen_tot = (TAssoc_array&) _t[1];
|
|
||||||
|
|
||||||
if (gen_tot.items() > 0)
|
|
||||||
{
|
|
||||||
print_totali_rows(1,1);
|
|
||||||
print_one(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (((TAssoc_array&) _t[0]).items() > 0)
|
||||||
|
{
|
||||||
|
print_totali(1);
|
||||||
|
print_one(0);
|
||||||
|
}
|
||||||
|
if (((TAssoc_array&) _t[1]).items() > 0)
|
||||||
|
{
|
||||||
|
print_totali_rows(1,1);
|
||||||
|
print_one(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -517,18 +487,12 @@ bool TProspettoScadenze::user_create()
|
|||||||
_pagsca = new TLocalisamfile(LF_PAGSCA);
|
_pagsca = new TLocalisamfile(LF_PAGSCA);
|
||||||
_t.add(new TAssoc_array);_t.add(new TAssoc_array);
|
_t.add(new TAssoc_array);_t.add(new TAssoc_array);
|
||||||
|
|
||||||
for (int i = 0; i < NUMERO_FASCE; i++)
|
|
||||||
{
|
|
||||||
_s_date.add(new TDate);
|
|
||||||
_ns_date.add(new TDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
TConfig conf (CONFIG_DITTA,"cg");
|
TConfig conf (CONFIG_DITTA,"cg");
|
||||||
_m = new TSelection_ext_mask("sc2600a");
|
_m = new TSelection_ext_mask("sc2600a");
|
||||||
_m->enable(F_VALUTA,conf.get_bool("GesVal"));
|
_m->enable(F_VALUTA,conf.get_bool("GesVal"));
|
||||||
|
|
||||||
enable_print_menu();
|
enable_print_menu();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TProspettoScadenze::user_destroy()
|
bool TProspettoScadenze::user_destroy()
|
||||||
@ -539,9 +503,7 @@ bool TProspettoScadenze::user_destroy()
|
|||||||
if (_pagsca) delete _pagsca;
|
if (_pagsca) delete _pagsca;
|
||||||
if (_m) delete _m;
|
if (_m) delete _m;
|
||||||
_t.destroy();
|
_t.destroy();
|
||||||
_s_date.destroy();
|
return true;
|
||||||
_ns_date.destroy();
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TProspettoScadenze::riempi_conti_mastro(const char cf)
|
void TProspettoScadenze::riempi_conti_mastro(const char cf)
|
||||||
@ -564,21 +526,22 @@ void TProspettoScadenze::riempi_conti_mastro(const char cf)
|
|||||||
|
|
||||||
bool TProspettoScadenze::set_print(int)
|
bool TProspettoScadenze::set_print(int)
|
||||||
{
|
{
|
||||||
const bool rt = _m->run() == K_ENTER;
|
if (_m->run() == K_ENTER)
|
||||||
if (rt)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
reset_files();
|
reset_files();
|
||||||
reset_print();
|
reset_print();
|
||||||
|
printer().footerlen(5);
|
||||||
if (_m->get_who() == 'C')
|
if (_m->get_who() == 'C')
|
||||||
_tipost = clienti;
|
_tipost = clienti;
|
||||||
else
|
else
|
||||||
_tipost = fornitori;
|
_tipost = fornitori;
|
||||||
riempi_conti_mastro(_m->get_who());
|
riempi_conti_mastro(_m->get_who());
|
||||||
if (_m->get_key() == 1)
|
if (_m->get_key() == 1)
|
||||||
_ordcod = TRUE;
|
_ordcod = true;
|
||||||
else
|
else
|
||||||
_ordcod = FALSE;
|
_ordcod = false;
|
||||||
_end_printed = FALSE;
|
_end_printed = false;
|
||||||
_gcr = _m->get_int(F_GIORNI);
|
_gcr = _m->get_int(F_GIORNI);
|
||||||
_stvaluta = _m->get_bool(F_VALUTA);
|
_stvaluta = _m->get_bool(F_VALUTA);
|
||||||
_datas = (const char *)(_m->get(F_DATASTAMPA));
|
_datas = (const char *)(_m->get(F_DATASTAMPA));
|
||||||
@ -589,6 +552,18 @@ bool TProspettoScadenze::set_print(int)
|
|||||||
_sfasce = _m->get_int(F_SCADFASCE);
|
_sfasce = _m->get_int(F_SCADFASCE);
|
||||||
_nsinfasce = _m->get_bool(F_ASCADINFASCE);
|
_nsinfasce = _m->get_bool(F_ASCADINFASCE);
|
||||||
_nsfasce = _m->get_int(F_ASCADFASCE);
|
_nsfasce = _m->get_int(F_ASCADFASCE);
|
||||||
|
_s_date.destroy();
|
||||||
|
_ns_date.destroy();
|
||||||
|
for (int i = 0; i <= NUMERO_FASCE; i++)
|
||||||
|
{
|
||||||
|
_s_date.add(new TDate);
|
||||||
|
_ns_date.add(new TDate);
|
||||||
|
}
|
||||||
|
int limiti[NUMERO_FASCE + 1] = LIMITI;
|
||||||
|
for (int j = 0; j <= _sfasce; j++)
|
||||||
|
(TDate &)_s_date[j] = _limscad - (const long) limiti[j];
|
||||||
|
for (int k = 0; k <= _nsfasce; k++)
|
||||||
|
(TDate &)_ns_date[k] = _limscad + (const long) limiti[k];
|
||||||
_anno.cut(0);_numdoc.cut(0);_protiva.cut(0);_datadoc.cut(0);
|
_anno.cut(0);_numdoc.cut(0);_protiva.cut(0);_datadoc.cut(0);
|
||||||
_codval.cut(0);_cod.cut(0); _des.cut(0); _cod_pre.cut(0);
|
_codval.cut(0);_cod.cut(0); _des.cut(0); _cod_pre.cut(0);
|
||||||
for (int it=0; it < _t.items(); it++)
|
for (int it=0; it < _t.items(); it++)
|
||||||
@ -597,10 +572,10 @@ bool TProspettoScadenze::set_print(int)
|
|||||||
aa.destroy(); // Totali lineari (singolo e generale)
|
aa.destroy(); // Totali lineari (singolo e generale)
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cursor(_cur1)->set_filterfunction(fil_function,TRUE);
|
get_cursor(_cur1)->set_filterfunction(fil_function,true);
|
||||||
get_cursor(_cur2)->set_filterfunction(fil_function,TRUE);
|
get_cursor(_cur2)->set_filterfunction(fil_function,true);
|
||||||
get_cursor(_cur3)->set_filterfunction(fil_function,TRUE);
|
get_cursor(_cur3)->set_filterfunction(fil_function,true);
|
||||||
get_cursor(_cur4)->set_filterfunction(fil_function,TRUE);
|
get_cursor(_cur4)->set_filterfunction(fil_function,true);
|
||||||
_last_game.cut(0);
|
_last_game.cut(0);
|
||||||
|
|
||||||
TRectype filter_from(LF_PARTITE), filter_to(LF_PARTITE);
|
TRectype filter_from(LF_PARTITE), filter_to(LF_PARTITE);
|
||||||
@ -627,27 +602,9 @@ bool TProspettoScadenze::set_print(int)
|
|||||||
default: break;
|
default: break;
|
||||||
} // End of inner switch
|
} // End of inner switch
|
||||||
|
|
||||||
int limiti[2][NUMERO_FASCE] = LIMITI;
|
return true;
|
||||||
int row = 0;
|
|
||||||
if (_tipost == fornitori)
|
|
||||||
row = 1;
|
|
||||||
for (int j = 0; j < NUMERO_FASCE; j++)
|
|
||||||
{
|
|
||||||
long inc = (long) limiti[row][j];
|
|
||||||
TDate* d = (TDate *)_s_date.objptr(j);
|
|
||||||
|
|
||||||
if (j < _sfasce)
|
|
||||||
*d = _limscad - inc;
|
|
||||||
else
|
|
||||||
*d = NULLDATE;
|
|
||||||
TDate* dns = (TDate *)_ns_date.objptr(j);
|
|
||||||
if (j < _nsfasce)
|
|
||||||
*dns = _limscad + inc;
|
|
||||||
else
|
|
||||||
*dns = NULLDATE;
|
|
||||||
}
|
|
||||||
} // End if
|
} // End if
|
||||||
return rt;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TProspettoScadenze::print_totali_rows(int nriga, bool what)
|
void TProspettoScadenze::print_totali_rows(int nriga, bool what)
|
||||||
@ -663,136 +620,87 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what)
|
|||||||
{
|
{
|
||||||
if (!what)
|
if (!what)
|
||||||
calcola_saldo();
|
calcola_saldo();
|
||||||
|
|
||||||
TString k(as.row(i)); // Chiave di ordinamento(valuta)
|
TString k(as.row(i)); // Chiave di ordinamento(valuta)
|
||||||
TString value;
|
TString value;
|
||||||
TLineTotal& v = (TLineTotal&)xassoc[k];
|
TLineTotal& v = (TLineTotal&)xassoc[k];
|
||||||
|
real tot = ZERO;
|
||||||
int pos = 40;
|
int pos = 40;
|
||||||
TString rw(255);
|
TString rw(255);
|
||||||
rw = "";
|
|
||||||
|
|
||||||
if (_sinfasce)
|
|
||||||
{
|
|
||||||
if (v._s6 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._s6);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
if (_sfasce >= 5)
|
|
||||||
pos = pos + 11;
|
|
||||||
|
|
||||||
if (v._s5 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._s5);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
if (_sfasce >= 4)
|
|
||||||
pos = pos + 11;
|
|
||||||
|
|
||||||
if (v._s4 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._s4);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
if (_sfasce >= 3)
|
|
||||||
pos = pos + 11;
|
|
||||||
|
|
||||||
if (v._s3 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._s3);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
if (_sfasce >= 2)
|
|
||||||
pos = pos + 11;
|
|
||||||
|
|
||||||
if (v._s2 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._s2);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
if (_sfasce >= 1)
|
|
||||||
pos = pos + 11;
|
|
||||||
}
|
|
||||||
if (v._s1 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._s1);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
pos = pos + 11;
|
|
||||||
|
|
||||||
|
rw = "";
|
||||||
|
if (_sinfasce)
|
||||||
|
{
|
||||||
|
for (int i = _sfasce; i >= 0; i--)
|
||||||
|
{
|
||||||
|
if (v._s[i] != ZERO)
|
||||||
|
{
|
||||||
|
print_real(value, v._s[i]);
|
||||||
|
rw << format("@%dg%11s", pos, (const char*) value);
|
||||||
|
tot += v._s[i];
|
||||||
|
}
|
||||||
|
pos += 11;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (v._s[0] != ZERO)
|
||||||
|
{
|
||||||
|
print_real(value, v._s[0]);
|
||||||
|
rw << format("@%dg%11s", pos, (const char*) value);
|
||||||
|
tot += v._s[0];
|
||||||
|
}
|
||||||
|
pos += 11;
|
||||||
|
}
|
||||||
|
|
||||||
if (_nsinfasce)
|
if (_nsinfasce)
|
||||||
{
|
{
|
||||||
if (v._ns1 != ZERO)
|
for (int i = 0; i <= _nsfasce; i++)
|
||||||
{
|
{
|
||||||
print_real(value, v._ns1);
|
if (v._ns[i] != ZERO)
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
{
|
||||||
}
|
print_real(value, v._ns[i]);
|
||||||
if (_nsfasce >= 1)
|
rw << format("@%dg%11s", pos, (const char*) value);
|
||||||
pos = pos + 11;
|
tot += v._ns[i];
|
||||||
|
}
|
||||||
|
pos += 11;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (v._ns[0] != ZERO)
|
||||||
|
{
|
||||||
|
print_real(value, v._ns[0]);
|
||||||
|
rw << format("@%dg%11s", pos, (const char*) value);
|
||||||
|
tot += v._ns[0];
|
||||||
|
}
|
||||||
|
pos += 11;
|
||||||
|
}
|
||||||
|
|
||||||
if (v._ns2 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._ns2);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
if (_nsfasce >= 2)
|
|
||||||
pos = pos + 11;
|
|
||||||
|
|
||||||
if (v._ns3 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._ns3);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
if (_nsfasce >= 3)
|
|
||||||
pos = pos + 11;
|
|
||||||
|
|
||||||
if (v._ns4 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._ns4);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
if (_nsfasce >= 4)
|
|
||||||
pos = pos + 11;
|
|
||||||
|
|
||||||
if (v._ns5 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._ns5);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
if (_nsfasce >= 5)
|
|
||||||
pos = pos + 11;
|
|
||||||
}
|
|
||||||
if (v._ns6 != ZERO)
|
|
||||||
{
|
|
||||||
print_real(value, v._ns6);
|
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
|
||||||
}
|
|
||||||
pos = pos + 11;
|
|
||||||
const real tot = v._s1+v._s2+v._s3+v._s4+v._s5+v._s6+v._ns1+v._ns2+v._ns3+v._ns4+v._ns5+v._ns6;
|
|
||||||
if (tot != ZERO)
|
if (tot != ZERO)
|
||||||
{
|
{
|
||||||
print_real(value, tot);
|
print_real(value, tot);
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
rw << format("@%dg%11s", pos, (const char*) value);
|
||||||
}
|
}
|
||||||
pos = pos + 11;
|
pos += 11;
|
||||||
if (v._es != ZERO)
|
if (v._es != ZERO)
|
||||||
{
|
{
|
||||||
print_real(value, v._es);
|
print_real(value, v._es);
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
rw << format("@%dg%11s", pos, (const char*) value);
|
||||||
}
|
}
|
||||||
pos = pos + 11;
|
pos += 11;
|
||||||
if (v._sl != ZERO)
|
if (v._sl != ZERO)
|
||||||
{
|
{
|
||||||
print_real(value, v._sl);
|
print_real(value, v._sl);
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
rw << format("@%dg%11s", pos, (const char*) value);
|
||||||
}
|
}
|
||||||
pos = pos + 13;
|
pos += 11;
|
||||||
|
|
||||||
const real diff = v._sl + v._es - tot;
|
const real diff = v._sl - (tot - v._es);
|
||||||
if (diff != ZERO)
|
if (diff != ZERO)
|
||||||
{
|
{
|
||||||
print_real(value, diff);
|
print_real(value, diff);
|
||||||
rw << format("@%dg%10s", pos, (const char*) value);
|
rw << format("@%dg%11s", pos, (const char*) value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rw.not_empty())
|
if (rw.not_empty())
|
||||||
@ -817,7 +725,7 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what)
|
|||||||
xassoc.destroy(); // Distrugge il totale appena stampato
|
xassoc.destroy(); // Distrugge il totale appena stampato
|
||||||
}
|
}
|
||||||
|
|
||||||
void TProspettoScadenze::print_totali(int& nriga)
|
void TProspettoScadenze::print_totali(int nriga)
|
||||||
{
|
{
|
||||||
reset_row(nriga);
|
reset_row(nriga);
|
||||||
print_totali_rows(nriga,0);
|
print_totali_rows(nriga,0);
|
||||||
@ -858,53 +766,58 @@ void TProspettoScadenze::print_header()
|
|||||||
|
|
||||||
|
|
||||||
if (_tipost==fornitori)
|
if (_tipost==fornitori)
|
||||||
set_header(soh++,"@%ldg** PROSPETTO SCADENZE FORNITORI **", (last_column - 35) / 2);
|
set_header(soh++,"@%ldg** PREVISIONE PAGAMENTI FORNITORI **", (last_column - 37) / 2);
|
||||||
else
|
else
|
||||||
set_header(soh++,"@%ldg** PROSPETTO SCADENZE CLIENTI **", (last_column - 34) / 2);
|
set_header(soh++,"@%ldg** PREVISIONE INCASSI CLIENTI **", (last_column - 34) / 2);
|
||||||
set_header (soh++,"@%ldgAl %s - Operazioni al %s", (last_column - 40) / 2, (const char*)limscad, (const char*)limop);
|
set_header (soh++,"@%ldgAl %s - Operazioni al %s", (last_column - 40) / 2, (const char*)limscad, (const char*)limop);
|
||||||
meno.fill('-', last_column);
|
meno.fill('-', last_column);
|
||||||
set_header(soh++,(const char *)meno);
|
set_header(soh++,(const char *)meno);
|
||||||
set_header(soh,"CODICE@8gC O G N O M E E N O M E ");
|
set_header(soh,"CODICE@8gC O G N O M E E N O M E ");
|
||||||
int limiti[2][NUMERO_FASCE] = LIMITI;
|
int limiti[NUMERO_FASCE + 1] = LIMITI;
|
||||||
int row = 0;
|
|
||||||
if (_tipost==fornitori)
|
|
||||||
row = 1;
|
|
||||||
int pos = 40;
|
int pos = 40;
|
||||||
|
|
||||||
rw.cut(0);
|
rw.cut(0);
|
||||||
if (_sinfasce)
|
if (_sinfasce)
|
||||||
{
|
{
|
||||||
for (int i = _sfasce-1; i >= 0; i--)
|
rw << format("@%dg >%3d gg", pos, limiti[_sfasce]);
|
||||||
|
pos += 11;
|
||||||
|
for (int i = _sfasce; i > 0; i--)
|
||||||
{
|
{
|
||||||
rw << format("@%dg%7d gg", pos, limiti[row][i] + 30);
|
rw << format("@%dg <= %3d gg", pos, limiti[i] );
|
||||||
pos = pos + 11;
|
pos += 11;
|
||||||
}
|
}
|
||||||
rw << format("@%dg%10s", pos, "30 gg");
|
set_header(soh, format("@%dg%s", 40+((pos-40)/2), "SCADUTO"));
|
||||||
set_header(soh, format("@%dg%10s", 40+((pos-40)/2), "SCADUTO"));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
set_header(soh, format("@%dg%10s", pos, "SCADUTO"));
|
{
|
||||||
pos = pos + 11;
|
set_header(soh, format("@%dg%11s", pos, "SCADUTO"));
|
||||||
|
pos += 11;
|
||||||
|
}
|
||||||
|
|
||||||
const int pos_ascad = pos;
|
const int pos_ascad = pos;
|
||||||
if (_nsinfasce)
|
if (_nsinfasce)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _nsfasce; i++)
|
for (int i = 1; i <= _nsfasce; i++)
|
||||||
{
|
{
|
||||||
rw << format("@%dg%7d gg", pos, limiti[row][i]);
|
rw << format("@%dg <= %3d gg", pos, limiti[i]);
|
||||||
pos = pos + 11;
|
pos = pos + 11;
|
||||||
}
|
}
|
||||||
set_header(soh, format("@%dg%11s", pos_ascad+((pos-pos_ascad)/2)-5, " A SCADERE"));
|
rw << format("@%dg >%3d gg", pos, limiti[_nsfasce]);
|
||||||
|
pos = pos + 11;
|
||||||
|
set_header(soh, format("@%dg%s", pos_ascad+((pos-pos_ascad)/2)-5, "A SCADERE"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
set_header(soh, format("@%dg%11s", pos, " A SCADERE"));
|
{
|
||||||
pos = pos + 11;
|
set_header(soh, format("@%dg%11s", pos, "A SCADERE"));
|
||||||
set_header(soh, format("@%dg%11s", pos, " TOTALE"));
|
pos += 11;
|
||||||
pos = pos + 11;
|
}
|
||||||
set_header(soh, format("@%dg%11s", pos, " ESPOSTO"));
|
set_header(soh, format("@%dg%11s", pos, "TOTALE"));
|
||||||
pos = pos + 11;
|
pos += 11;
|
||||||
set_header(soh, format("@%dg%11s", pos, " SALDO"));
|
set_header(soh, format("@%dg%11s", pos, "ESPOSTO"));
|
||||||
pos = pos + 13;
|
pos += 11;
|
||||||
set_header(soh, format("@%dg%11s", pos, "DIFFERENZA"));
|
set_header(soh, format("@%dg%11s", pos, "SALDO"));
|
||||||
|
pos += 11;
|
||||||
|
set_header(soh, format("@%dg%11s", pos, " DIFFERENZA"));
|
||||||
set_header(++soh,(const char *)rw);
|
set_header(++soh,(const char *)rw);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -914,17 +827,23 @@ void TProspettoScadenze::print_header()
|
|||||||
set_header(++soh, (const char *) meno);
|
set_header(++soh, (const char *) meno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TProspettoScadenze::preprocess_footer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
int TProspettoScadenze::calc_last_column()
|
int TProspettoScadenze::calc_last_column()
|
||||||
// Setta le righe dell'intestazione
|
// Setta le righe dell'intestazione
|
||||||
{
|
{
|
||||||
int pos = 110;
|
int pos = 110;
|
||||||
|
|
||||||
if (_sinfasce)
|
if (_sinfasce)
|
||||||
for (int i = _sfasce-1; i >= 0; i--)
|
pos += _sfasce * 11;
|
||||||
pos = pos + 11;
|
else
|
||||||
|
pos += 11;
|
||||||
if (_nsinfasce)
|
if (_nsinfasce)
|
||||||
for (int i = 0; i < _nsfasce; i++)
|
pos = pos + _nsfasce * 11;
|
||||||
pos = pos + 11;
|
else
|
||||||
|
pos += 11;
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -941,6 +860,6 @@ TProspettoScadenze::TProspettoScadenze()
|
|||||||
int sc2600(int argc, char** argv)
|
int sc2600(int argc, char** argv)
|
||||||
{
|
{
|
||||||
TProspettoScadenze app;
|
TProspettoScadenze app;
|
||||||
app.run(argc, argv, "Stampa Prospetto Scadenze");
|
app.run(argc, argv, "Stampa Previsione Incassi/Pagamenti");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "sc2600.h"
|
#include "sc2600.h"
|
||||||
|
|
||||||
PAGE "Stampa Prospetto Scadenze" -1 -1 78 20
|
PAGE "Stampa Previsione Incassi/PagamentI" -1 -1 78 20
|
||||||
|
|
||||||
NUMBER F_CODDITTA 5
|
NUMBER F_CODDITTA 5
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -8,7 +8,8 @@ Item_02 = "Stampa scadenzario", "sc2 -1", ""
|
|||||||
Item_03 = "Stampa scaduto", "sc2 -2", ""
|
Item_03 = "Stampa scaduto", "sc2 -2", ""
|
||||||
Item_04 = "Stampa estratti conto", "sc2 -0", ""
|
Item_04 = "Stampa estratti conto", "sc2 -0", ""
|
||||||
Item_05 = "Stampa solleciti", "sc2 -3", ""
|
Item_05 = "Stampa solleciti", "sc2 -3", ""
|
||||||
Item_06 = "Servizio", [SCMENU_002]
|
Item_06 = "Stampa Previsione Incassi/Pagamenti", "sc2 -5", ""
|
||||||
|
Item_07 = "Servizio", [SCMENU_002]
|
||||||
|
|
||||||
[SCMENU_002]
|
[SCMENU_002]
|
||||||
Caption = "Servizio"
|
Caption = "Servizio"
|
||||||
|
@ -476,6 +476,7 @@ const wxString& TBaseServerApp::GetConfigName() const
|
|||||||
(wxString&)m_strIni = name.GetFullPath();
|
(wxString&)m_strIni = name.GetFullPath();
|
||||||
}
|
}
|
||||||
return m_strIni;
|
return m_strIni;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TBaseServerApp::SetConfigString(const wxChar* key, const wxChar* val, const wxChar* app) const
|
void TBaseServerApp::SetConfigString(const wxChar* key, const wxChar* val, const wxChar* app) const
|
||||||
@ -509,7 +510,7 @@ wxString TBaseServerApp::GetConfigString(const wxChar* key, const wxChar* def, c
|
|||||||
|
|
||||||
int TBaseServerApp::GetConfigInt(const wxChar* key, int def, const wxChar* app) const
|
int TBaseServerApp::GetConfigInt(const wxChar* key, int def, const wxChar* app) const
|
||||||
{
|
{
|
||||||
const wxString str = GetConfigString(key, "*", app);
|
const wxString str = GetConfigString(key, "*", app);
|
||||||
return str != "*" ? atoi(str) : def;
|
return str != "*" ? atoi(str) : def;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,7 +519,8 @@ bool TBaseServerApp::GetConfigBool(const wxChar* key, bool def, const wxChar* ap
|
|||||||
bool val = def;
|
bool val = def;
|
||||||
const wxString str = GetConfigString(key, "*", app);
|
const wxString str = GetConfigString(key, "*", app);
|
||||||
if (str != "*")
|
if (str != "*")
|
||||||
val = (str[0u] == '1') || (str[0u] == 'X') || (str[0u] == 'Y') || (str.CmpNoCase("On")==0);
|
val = (str[0u] == '1') || (str[0u] == 'X') || (str[0u] == 'Y') || (str.CmpNoCase("On")==0);
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -687,4 +689,3 @@ int TBaseServerApp::ParseArguments(wxString args, THashTable& hashArgs) const
|
|||||||
}
|
}
|
||||||
return hashArgs.GetCount();
|
return hashArgs.GetCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,10 +178,7 @@ wxDateTime julian2date(long julian)
|
|||||||
m = m + 2 - 12 * x;
|
m = m + 2 - 12 * x;
|
||||||
y = 100 * (z - 49) + y + x;
|
y = 100 * (z - 49) + y + x;
|
||||||
|
|
||||||
wxDateTime date;
|
wxDateTime date(d, wxDateTime::Month(m-1), y);
|
||||||
date.SetYear(y);
|
|
||||||
date.SetMonth((wxDateTime::Month)m);
|
|
||||||
date.SetDay(d);
|
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ BEGIN
|
|||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE PSV
|
USE PSV
|
||||||
INPUT CODTAB F_CODICE
|
INPUT CODTAB F_CODICE
|
||||||
DISPLAY "Codice" CODTAB
|
DISPLAY "Codice@20" CODTAB
|
||||||
DISPLAY "Descrizione@50" S0
|
DISPLAY "Descrizione@50" S0
|
||||||
OUTPUT F_CODICE CODTAB
|
OUTPUT F_CODICE CODTAB
|
||||||
OUTPUT F_DESCR S0
|
OUTPUT F_DESCR S0
|
||||||
@ -55,7 +55,7 @@ BEGIN
|
|||||||
USE PSV KEY 2
|
USE PSV KEY 2
|
||||||
INPUT S0 F_DESCR
|
INPUT S0 F_DESCR
|
||||||
DISPLAY "Descrizione@60" S0
|
DISPLAY "Descrizione@60" S0
|
||||||
DISPLAY "Codice" CODTAB
|
DISPLAY "Codice@20" CODTAB
|
||||||
COPY OUTPUT F_CODICE
|
COPY OUTPUT F_CODICE
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
ADD RUN SV0 -0 PSV
|
ADD RUN SV0 -0 PSV
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
34
|
34
|
||||||
0
|
0
|
||||||
$rdoc|21|21|473|31|Righe documenti di vendita|NDOC*3||
|
$rdoc|||513|31|Righe documenti di vendita|NDOC*3||
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
34
|
34
|
||||||
53
|
55
|
||||||
|
|
||||||
CODNUM|1|4|0|Codice Numeriazione
|
CODNUM|1|4|0|Codice Numeriazione
|
||||||
ANNO|2|4|0|Anno
|
ANNO|2|4|0|Anno
|
||||||
PROVV|1|1|0|Tipo numerazione <P>rovvisoria <D>efinitiva
|
PROVV|1|1|0|Tipo numerazione <P>rovvisoria <D>efinitiva
|
||||||
@ -53,7 +54,10 @@ DAIDRIGA|3|6|0|Identificatore riga originale
|
|||||||
CODCMS|1|20|0|Codice Commessa
|
CODCMS|1|20|0|Codice Commessa
|
||||||
FASCMS|1|10|0|Fase Commessa
|
FASCMS|1|10|0|Fase Commessa
|
||||||
CODCOSTO|1|20|0|Centro di costo
|
CODCOSTO|1|20|0|Centro di costo
|
||||||
|
CODAGG1|1|20|0|Codice aggiuntivo 1
|
||||||
|
CODAGG2|1|20|0|Codice aggiuntivo 2
|
||||||
7
|
7
|
||||||
|
|
||||||
CODNUM+ANNO+PROVV+NDOC+NRIGA|
|
CODNUM+ANNO+PROVV+NDOC+NRIGA|
|
||||||
CODNUM+ANNO+PROVV+CODART+LIVELLO+CODMAG|X
|
CODNUM+ANNO+PROVV+CODART+LIVELLO+CODMAG|X
|
||||||
PROVV+ANNO+CODNUM+NDOC+NRIGA|X
|
PROVV+ANNO+CODNUM+NDOC+NRIGA|X
|
||||||
|
@ -26,8 +26,8 @@ class TMotore_application : public TRelation_application
|
|||||||
// puntatore alla relazione
|
// puntatore alla relazione
|
||||||
TRelation * _rel;
|
TRelation * _rel;
|
||||||
|
|
||||||
TString16 _codnum;
|
TString4 _codnum;
|
||||||
TString16 _tipodoc;
|
TString4 _tipodoc;
|
||||||
TString80 __last_key;
|
TString80 __last_key;
|
||||||
|
|
||||||
// Array di maschere documento
|
// Array di maschere documento
|
||||||
|
@ -379,5 +379,12 @@ BEGIN
|
|||||||
GROUP 7
|
GROUP 7
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_ESPONIESENTI
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 17 "Esponi i clienti esenti"
|
||||||
|
FIELD ESPONIESENTI
|
||||||
|
GROUP 7
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
@ -3,10 +3,10 @@ TIPORIGA|2|2|Tipo riga|2
|
|||||||
CODMAG[1,3]|2|3|Mag. |3
|
CODMAG[1,3]|2|3|Mag. |3
|
||||||
CODMAG[4,5]|2|2|Dep.|2
|
CODMAG[4,5]|2|2|Dep.|2
|
||||||
CODART|2|20|Codice Articolo|20
|
CODART|2|20|Codice Articolo|20
|
||||||
CODG1|2|15|Codice\nLivello 1|15
|
CODG1|2|9|Codice\nLivello 1|9
|
||||||
CODG2|2|15|Codice\nLivello 2|15
|
CODG2|2|9|Codice\nLivello 2|9
|
||||||
CODG3|2|15|Codice\nLivello 3|15
|
CODG3|2|9|Codice\nLivello 3|9
|
||||||
CODG4|2|15|Codice\nLivello 4|15
|
CODG4|2|9|Codice\nLivello 4|9
|
||||||
DESCR|2|50|Descrizione|50
|
DESCR|2|50|Descrizione|50
|
||||||
UMQTA|2|2|UM|2
|
UMQTA|2|2|UM|2
|
||||||
QTA|3|1305|Quantita'|11
|
QTA|3|1305|Quantita'|11
|
||||||
@ -37,15 +37,5 @@ QTAGG4|3|1305|Quantita'\nagg. 4|13
|
|||||||
QTAGG5|3|1305|Quantita'\nagg. 5|13
|
QTAGG5|3|1305|Quantita'\nagg. 5|13
|
||||||
IMPIANTO|2|5|Impianto|8
|
IMPIANTO|2|5|Impianto|8
|
||||||
LINEA|2|5|Linea|5
|
LINEA|2|5|Linea|5
|
||||||
CDC1|2|20|Centro di costo 1|20
|
CODCMS|2|20|Codice\ncommessa|20
|
||||||
CDC2|2|20|Centro di costo 2|20
|
FASCMS|2|10|Fase\ncommessa|10
|
||||||
CDC3|2|20|Centro di costo 3|20
|
|
||||||
CDC4|2|20|Centro di costo 4|20
|
|
||||||
CDC5|2|20|Centro di costo 5|20
|
|
||||||
CDC6|2|20|Centro di costo 6|20
|
|
||||||
CDC7|2|20|Centro di costo 7|20
|
|
||||||
CDC8|2|20|Centro di costo 8|20
|
|
||||||
CDC9|2|20|Centro di costo 9|20
|
|
||||||
CDC10|2|20|Centro di costo 10|20
|
|
||||||
CDC11|2|20|Centro di costo 11|20
|
|
||||||
CDC12|2|20|Centro di costo 12|20
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
#include <postman.h>
|
#include <postman.h>
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
@ -2058,4 +2060,4 @@ int ve1100(int argc, char* argv[])
|
|||||||
const bool riep = argc == 4 && argv[2][0] == 'L'; // Lista documenti
|
const bool riep = argc == 4 && argv[2][0] == 'L'; // Lista documenti
|
||||||
a.run(argc, argv, riep ? TR("Lista documenti") : TR("Stampa documenti"));
|
a.run(argc, argv, riep ? TR("Lista documenti") : TR("Stampa documenti"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
168
ve/ve1300.cpp
168
ve/ve1300.cpp
@ -14,6 +14,7 @@
|
|||||||
#include <cfven.h>
|
#include <cfven.h>
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
|
#include <multirel.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TDoc_recordset
|
// TDoc_recordset
|
||||||
@ -87,16 +88,12 @@ const TVariant& TDoc_recordset::get(int logic, const char* field) const
|
|||||||
if (logic == 0 || logic == LF_DOC)
|
if (logic == 0 || logic == LF_DOC)
|
||||||
{
|
{
|
||||||
const TFieldref ref(field, LF_DOC);
|
const TFieldref ref(field, LF_DOC);
|
||||||
TVariant& tmp = get_tmp_var();
|
return get_tmp_var() = ref.read(*_doc);
|
||||||
tmp.set(ref.read(*_doc));
|
|
||||||
return tmp;
|
|
||||||
} else
|
} else
|
||||||
if (logic == LF_RIGHEDOC)
|
if (logic == LF_RIGHEDOC)
|
||||||
{
|
{
|
||||||
const TFieldref ref(field, LF_RIGHEDOC);
|
const TFieldref ref(field, LF_RIGHEDOC);
|
||||||
TVariant& tmp = get_tmp_var();
|
return get_tmp_var() = ref.read(riga_doc());
|
||||||
tmp.set(ref.read(riga_doc()));
|
|
||||||
return tmp;
|
|
||||||
}
|
}
|
||||||
return TISAM_recordset::get(logic, field);
|
return TISAM_recordset::get(logic, field);
|
||||||
}
|
}
|
||||||
@ -111,7 +108,7 @@ TDoc_recordset::TDoc_recordset(const TRecordset& doc, const TString& query)
|
|||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
const char* key[] = { DOC_PROVV, DOC_ANNO, DOC_CODNUM, DOC_NDOC };
|
const char* key[] = { DOC_PROVV, DOC_ANNO, DOC_CODNUM, DOC_NDOC };
|
||||||
TString80 filter = (i == 1) ? "FROM " : "TO ";
|
TString80 filter = (i == 0) ? "FROM " : "TO ";
|
||||||
for (int k = 0; k < 4; k++)
|
for (int k = 0; k < 4; k++)
|
||||||
{
|
{
|
||||||
const TString& val = doc.get(key[k]).as_string();
|
const TString& val = doc.get(key[k]).as_string();
|
||||||
@ -182,7 +179,7 @@ protected:
|
|||||||
int set_printed_status(TDocumento& doc) const;
|
int set_printed_status(TDocumento& doc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool print(const TRecordset& doc, TReport_book& book, bool def);
|
bool print(const TRecordset& doc, TReport_book& book, bool def, int copies, bool alleg);
|
||||||
|
|
||||||
TReport_doc(const char* name);
|
TReport_doc(const char* name);
|
||||||
virtual ~TReport_doc();
|
virtual ~TReport_doc();
|
||||||
@ -238,19 +235,89 @@ int TReport_doc::set_printed_status(TDocumento& doc) const
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TReport_doc::print(const TRecordset& doc, TReport_book& book, bool def)
|
bool TReport_doc::print(const TRecordset& doc, TReport_book& book, bool definitive, int copie, bool can_allegate)
|
||||||
{
|
{
|
||||||
const TString old_query = recordset()->query_text();
|
const TString old_query = recordset()->query_text();
|
||||||
|
|
||||||
TDoc_recordset* rs = new TDoc_recordset(doc, old_query);
|
TDoc_recordset* rs = new TDoc_recordset(doc, old_query);
|
||||||
set_recordset(rs);
|
set_recordset(rs);
|
||||||
|
|
||||||
const bool ok = book.add(*this, false);
|
bool printed = false;
|
||||||
if (ok && def)
|
|
||||||
|
for (int c = 1; c <= copie; c++)
|
||||||
|
{
|
||||||
|
// Tenta di stampare gli allegati solo sull'ultima copia definitiva
|
||||||
|
if (c == copie && can_allegate)
|
||||||
|
{
|
||||||
|
const TDocumento& d = rs->doc();
|
||||||
|
const TTipo_documento& tipodoc = d.tipo();
|
||||||
|
if (tipodoc.allega_documenti())
|
||||||
|
{
|
||||||
|
const long codcf = d.get_long(CLI_CODCF);
|
||||||
|
TString_array allegati;
|
||||||
|
for (bool ok = rs->move_first(); ok; ok = rs->move_next())
|
||||||
|
{
|
||||||
|
const TString& codart = rs->get(LF_RIGHEDOC, RDOC_CODARTMAG).as_string();
|
||||||
|
const TRectype& anamag = cache().get(LF_ANAMAG, codart);
|
||||||
|
TToken_string golem(anamag.get(ANAMAG_GOLEM), '\n');
|
||||||
|
if (!golem.empty_items())
|
||||||
|
{
|
||||||
|
TToken_string key;
|
||||||
|
key.add(d.get(DOC_PROVV));
|
||||||
|
key.add(d.get(DOC_ANNO));
|
||||||
|
key.add(d.get(DOC_CODNUM));
|
||||||
|
key.add(d.get(DOC_NDOC));
|
||||||
|
|
||||||
|
TLocalisamfile alleg(LF_MULTIREL);
|
||||||
|
alleg.put(MULTI_COD, "ALLEG");
|
||||||
|
alleg.put(MULTI_FIRST, codcf);
|
||||||
|
alleg.put(MULTI_SECOND, codart);
|
||||||
|
alleg.put(MULTI_DATA, key);
|
||||||
|
|
||||||
|
bool print_alleg = alleg.write() == NOERR; // Se riesco a scrivere vuol dire che non esisteva
|
||||||
|
|
||||||
|
if (!print_alleg)
|
||||||
|
{
|
||||||
|
alleg.put(MULTI_COD, "ALLEG");
|
||||||
|
alleg.put(MULTI_FIRST, codcf);
|
||||||
|
alleg.put(MULTI_SECOND, codart);
|
||||||
|
if (alleg.read() == NOERR)
|
||||||
|
print_alleg = alleg.get(MULTI_DATA) == key;
|
||||||
|
}
|
||||||
|
if (print_alleg)
|
||||||
|
{
|
||||||
|
FOR_EACH_TOKEN(golem, allegato)
|
||||||
|
{
|
||||||
|
TToken_string a(allegato);
|
||||||
|
TFilename name = a.get();
|
||||||
|
const bool link = a.get_char(2) > ' ';
|
||||||
|
if (!link)
|
||||||
|
{
|
||||||
|
TFilename golem_path = firm2dir(prefix().get_codditta());
|
||||||
|
golem_path.add("golem");
|
||||||
|
golem_path.add(name.name());
|
||||||
|
name = golem_path;
|
||||||
|
}
|
||||||
|
if (name.exist())
|
||||||
|
allegati.add(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set_allegates(allegati);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printed = book.add(*this, false);
|
||||||
|
if (!printed)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (printed && definitive)
|
||||||
set_printed_status(rs->doc());
|
set_printed_status(rs->doc());
|
||||||
|
|
||||||
set_recordset(old_query);
|
set_recordset(old_query);
|
||||||
return ok;
|
return printed;
|
||||||
}
|
}
|
||||||
|
|
||||||
TDocumentoEsteso& TReport_doc::doc()
|
TDocumentoEsteso& TReport_doc::doc()
|
||||||
@ -269,8 +336,8 @@ bool TReport_doc::msg_cliente(TVariant_stack& stack)
|
|||||||
{
|
{
|
||||||
TReport_field& cf = *curr_field();
|
TReport_field& cf = *curr_field();
|
||||||
|
|
||||||
TCli_for& cli_for = doc().clifor();
|
const TCli_for& cli_for = doc().clifor();
|
||||||
TOccasionale& cli_occ = doc().occas();
|
const TOccasionale& cli_occ = doc().occas();
|
||||||
const bool occasionale = cli_for.occasionale();
|
const bool occasionale = cli_for.occasionale();
|
||||||
|
|
||||||
TString in = stack.pop().as_string(); // prende la macro o il fieldref
|
TString in = stack.pop().as_string(); // prende la macro o il fieldref
|
||||||
@ -781,8 +848,8 @@ bool TReport_doc_app::print_loop(const TString& query)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool is_definitive = false;
|
bool is_definitive = false;
|
||||||
if (argc() >= 6) // Batch
|
if (argc() > 7) // Batch
|
||||||
is_definitive = *argv(6) == 'D';
|
is_definitive = *argv(7) == 'D';
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const KEY k = yesnocancel_box(FR("Stampare in definitiva %d documenti?"), docs);
|
const KEY k = yesnocancel_box(FR("Stampare in definitiva %d documenti?"), docs);
|
||||||
@ -797,19 +864,39 @@ bool TReport_doc_app::print_loop(const TString& query)
|
|||||||
TProgind pi(docs, TR("Elaborazione documenti..."), true, true);
|
TProgind pi(docs, TR("Elaborazione documenti..."), true, true);
|
||||||
for (int i = 0; i < docs; i++)
|
for (int i = 0; i < docs; i++)
|
||||||
{
|
{
|
||||||
pi.addstatus(1);
|
if (!pi.addstatus(1))
|
||||||
if (pi.iscancelled())
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
doc.move_to(i);
|
doc.move_to(i);
|
||||||
const TString& tipodoc = doc.get(DOC_TIPODOC).as_string();
|
const TString& tipodoc = doc.get(DOC_TIPODOC).as_string();
|
||||||
const TTipo_documento& tipo = _tipi_cache.tipo(tipodoc);
|
const TTipo_documento& tipo = _tipi_cache.tipo(tipodoc);
|
||||||
TFilename profilo;
|
TString16 codprof(tipo.main_print_profile());
|
||||||
if (tipo.main_print_profile(profilo) && profilo.ends_with(".rep"))
|
|
||||||
|
codprof.trim();
|
||||||
|
if (codprof.not_empty())
|
||||||
|
|
||||||
{
|
{
|
||||||
TReport_doc& report = reports.get(profilo);
|
TFilename profilo(codprof); profilo.ext("rep");
|
||||||
if (!report.print(doc, book, is_definitive))
|
|
||||||
break;
|
if (profilo.custom_path()) // Tenta di costruirsi il nome del report
|
||||||
|
{
|
||||||
|
int copies = _msk->get_int(F_NCOPIE);
|
||||||
|
if (copies <= 0 && is_definitive)
|
||||||
|
copies = tipo.ncopie();
|
||||||
|
if (copies <= 0)
|
||||||
|
copies = 1;
|
||||||
|
|
||||||
|
TReport_doc& report = reports.get(profilo);
|
||||||
|
if (!report.print(doc, book, is_definitive, copies, true))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TString msg; msg << TR("Report inesistente") << " : " << codprof;
|
||||||
|
statbar_set_title(TASK_WIN, msg);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -820,13 +907,32 @@ bool TReport_doc_app::print_loop(const TString& query)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Stampa eventuali allegati
|
// Stampa eventuali allegati
|
||||||
if (tipo.additional_print_profile(profilo) && profilo.ends_with(".rep"))
|
TString16 codalleg = tipo.additional_print_profile();
|
||||||
|
codalleg.trim();
|
||||||
|
if (codalleg.not_empty())
|
||||||
|
|
||||||
{
|
{
|
||||||
TReport_doc& allegato = reports.get(profilo);
|
TFilename profilo(codalleg); profilo.ext("rep");
|
||||||
allegato.print(doc, book, is_definitive);
|
|
||||||
|
if (profilo.custom_path())
|
||||||
|
{
|
||||||
|
int copies = tipo.additional_ncopie();
|
||||||
|
if (copies <= 0) copies = 1;
|
||||||
|
|
||||||
|
TReport_doc& allegato = reports.get(profilo);
|
||||||
|
// Il flag di definitvo deve essere false altrimenti riaggiorna lo stato e ristampa i documenti allegati
|
||||||
|
allegato.print(doc, book, false, copies, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TString msg; msg << TR("Report allegato inesistente") << " : " << codalleg;
|
||||||
|
statbar_set_title(TASK_WIN, msg);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (book.pages() > 0)
|
if (book.pages() > 0)
|
||||||
book.print_or_preview();
|
book.print_or_preview();
|
||||||
|
|
||||||
@ -844,16 +950,16 @@ void TReport_doc_app::print_selection()
|
|||||||
|
|
||||||
void TReport_doc_app::main_loop()
|
void TReport_doc_app::main_loop()
|
||||||
{
|
{
|
||||||
if (argc() >= 6) // Stampa da riga di comando
|
if (argc() > 6) // Stampa da riga di comando
|
||||||
{
|
{
|
||||||
_msk->set(F_DATA_O_NUM, "N"); // Stampa per numero documento
|
_msk->set(F_DATA_O_NUM, "N"); // Stampa per numero documento
|
||||||
_msk->set(F_PROVV, argv(4));
|
_msk->set(F_PROVV, argv(4));
|
||||||
_msk->set(F_ANNO, argv(3));
|
_msk->set(F_ANNO, argv(3));
|
||||||
_msk->set(F_CODNUM, argv(2));
|
_msk->set(F_CODNUM, argv(2));
|
||||||
_msk->set(F_DA_NDOC, argv(5));
|
_msk->set(F_DA_NDOC, argv(5));
|
||||||
_msk->set(F_A_NDOC, argv(5));
|
_msk->set(F_A_NDOC, argv(6));
|
||||||
if (argc() >= 8)
|
// argv(7) = stampa Definitiva o Provvisaoria
|
||||||
_msk->set(F_NCOPIE, argv(7)); // Numero copie
|
if (argc() > 8) _msk->set(F_NCOPIE, argv(8)); // Numero copie
|
||||||
print_selection();
|
print_selection();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -868,4 +974,4 @@ int ve1300(int argc, char* argv[])
|
|||||||
TReport_doc_app a;
|
TReport_doc_app a;
|
||||||
a.run(argc, argv, TR("Stampa documenti"));
|
a.run(argc, argv, TR("Stampa documenti"));
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user