1998-06-25 07:29:35 +00:00
|
|
|
|
// Stampa ordini
|
|
|
|
|
#include <applicat.h>
|
|
|
|
|
#include <mask.h>
|
|
|
|
|
#include <printer.h>
|
2003-06-27 14:55:37 +00:00
|
|
|
|
#include <tabutil.h>
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
#include "orlib.h"
|
1998-06-25 07:29:35 +00:00
|
|
|
|
#include "or1100a.h"
|
|
|
|
|
|
2003-06-27 14:55:37 +00:00
|
|
|
|
#include "../ve/velib.h"
|
|
|
|
|
|
|
|
|
|
#include "doc.h"
|
|
|
|
|
#include "rdoc.h"
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
// Tipi di stampa per selezionare il form
|
|
|
|
|
enum tipo_stampa {
|
|
|
|
|
numero, // or1100a.frm
|
|
|
|
|
clifo, // or1100b.frm
|
2002-12-17 12:06:42 +00:00
|
|
|
|
agente, // or1100c.frm
|
|
|
|
|
articolo // or1100d.frm
|
1998-06-25 07:29:35 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Tipi di ordinamento
|
|
|
|
|
enum tipo_ord {
|
|
|
|
|
num_doc, // ordinamento per numero documento
|
|
|
|
|
data_doc // ordinamento per data documento
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Applicazione di stampa
|
|
|
|
|
|
|
|
|
|
class TStampa_ordini : public TSkeleton_application
|
|
|
|
|
{
|
|
|
|
|
TMask * _m;
|
|
|
|
|
TOrdine_form * _frm;
|
|
|
|
|
tipo_stampa _tipo;
|
|
|
|
|
TCodgiac_livelli *_codgiac;
|
2002-12-17 12:06:42 +00:00
|
|
|
|
TAssoc_array _tipi_riga; // Cache dei tipi riga attivati: tipo M, S, P, C, O D
|
1998-06-25 07:29:35 +00:00
|
|
|
|
TString _codnum;
|
|
|
|
|
int _anno;
|
|
|
|
|
char _provv, _tipocf,
|
|
|
|
|
_TEA_ord, _TEA_rord; // Tipi ordini/righe 'T'utti/'E'vasi/'A'perti
|
|
|
|
|
tipo_ord _order;
|
2002-12-17 12:06:42 +00:00
|
|
|
|
bool _detail_rows, _detail_doc, _detail_cli, _detail_mag, _detail_dep,
|
|
|
|
|
_pr_spese, _pr_prest, _pr_sconti, _pr_omaggi, _pr_descr,
|
|
|
|
|
_opz_valore, _opz_prezzo, _opz_residuo, _opz_giacenza,
|
|
|
|
|
_force_evase;
|
1998-06-25 07:29:35 +00:00
|
|
|
|
int _detail_level; //0..4 0 = Articoli 4 = FCG #4 Maximum detail level
|
|
|
|
|
TString _from_age, _to_age,
|
|
|
|
|
_from_art, _to_art,
|
|
|
|
|
_from_mag, _to_mag,
|
|
|
|
|
_from_dep, _to_dep;
|
|
|
|
|
TString_array
|
|
|
|
|
_from_giac, _to_giac;
|
|
|
|
|
long _from_ndoc, _to_ndoc,
|
|
|
|
|
_from_cf, _to_cf;
|
|
|
|
|
TDate _from_date, _to_date,
|
|
|
|
|
_from_cons, _to_cons;
|
|
|
|
|
TArray _file;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
static bool stato_handler(TMask_field& f, KEY k);
|
|
|
|
|
static bool detail_handler(TMask_field& f, KEY k);
|
2003-06-12 09:02:18 +00:00
|
|
|
|
|
|
|
|
|
bool document_row_filter(const TRectype& row) const;
|
|
|
|
|
static bool document_filter(const TRelation* rel);
|
2003-06-10 08:26:39 +00:00
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
virtual bool create();
|
|
|
|
|
virtual bool destroy();
|
|
|
|
|
virtual void main_loop();
|
2002-12-17 12:06:42 +00:00
|
|
|
|
void set_totvaluta_items();
|
1998-06-25 07:29:35 +00:00
|
|
|
|
void filter_for_number();
|
|
|
|
|
void filter_for_clifo_agent();
|
|
|
|
|
void filter_for_articolo();
|
2003-06-10 08:26:39 +00:00
|
|
|
|
void show_body_field(short id, bool on); // Attiva un campo del body (sole se esiste!)
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
public:
|
|
|
|
|
TStampa_ordini() {};
|
|
|
|
|
virtual ~TStampa_ordini() {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inline TStampa_ordini& app() { return (TStampa_ordini&) main_app();}
|
|
|
|
|
|
|
|
|
|
bool TStampa_ordini::stato_handler(TMask_field& f, KEY k)
|
|
|
|
|
{
|
|
|
|
|
if (f.to_check(k))
|
|
|
|
|
{
|
|
|
|
|
TMask& m = f.mask();
|
|
|
|
|
const char v = f.get()[0];
|
|
|
|
|
const bool b = m.get_bool(F_DETTAGLIO);
|
|
|
|
|
if (v == 'E' && b) // Se si seleziona la stampa degli ordini totalmente evasi ha senso stampare solo le righe evase, cioe' tutte
|
|
|
|
|
{
|
|
|
|
|
m.set(F_STATORORD, "T");
|
|
|
|
|
m.disable(F_STATORORD);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (b) // Qualsiasi altro tipo di stampa dettaglio righe puo' essere selezionata
|
|
|
|
|
m.enable(F_STATORORD);
|
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TStampa_ordini::detail_handler(TMask_field& f, KEY k)
|
|
|
|
|
{
|
|
|
|
|
if (k == K_SPACE)
|
|
|
|
|
{
|
|
|
|
|
TMask& m = f.mask();
|
|
|
|
|
const bool b = m.get_bool(F_DETTAGLIO);
|
|
|
|
|
const tipo_stampa tipo = (tipo_stampa) m.get_int(F_TIPO);
|
|
|
|
|
|
|
|
|
|
if (tipo != numero)
|
|
|
|
|
{
|
|
|
|
|
m.enable(-GR_DETAIL,b);
|
|
|
|
|
m.enable(F_STATOORD,!b);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
m.reset(-GR_PRINT);
|
|
|
|
|
m.disable(-GR_PRINT);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m.enable(-GR_ART,b);
|
|
|
|
|
m.enable(-GR_MAG,b);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
m.enable(-GR_PRINT, b);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
m.enable(F_STATORORD,b);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
m.enable(F_DETAIL_BY_DOC, b);
|
|
|
|
|
}
|
|
|
|
|
m.enable(F_STATOORD,!b);
|
|
|
|
|
if (tipo != articolo)
|
|
|
|
|
m.set(F_DETAIL_BY_DOC, !b ? "" : "X");
|
|
|
|
|
if (!b)
|
|
|
|
|
{
|
|
|
|
|
m.reset(F_FORCE_EVASE);
|
|
|
|
|
m.disable(F_FORCE_EVASE);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TStampa_ordini::create()
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
open_files(LF_OCCAS, LF_CLIFO, LF_INDSP, LF_CFVEN, LF_UMART, LF_MAG, LF_STOMAG, LF_MOVMAG, LF_RMOVMAG, LF_RIGHEDOC, 0);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
_m = new TMask ("or1100a");
|
2002-12-17 12:06:42 +00:00
|
|
|
|
//_m->set_handler(F_STATOORD, stato_handler);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
_m->set_handler(F_DETTAGLIO, detail_handler);
|
|
|
|
|
_codgiac = new TCodgiac_livelli;
|
|
|
|
|
if (!_codgiac->enabled())
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
_m->disable(F_DETAIL_LEV);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
_m->hide(-GR_GIAC);
|
|
|
|
|
}
|
|
|
|
|
|
2003-06-27 14:55:37 +00:00
|
|
|
|
int err = NOERR;
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
short id = F_GIAC1;
|
2003-06-27 14:55:37 +00:00
|
|
|
|
TTable fcg("FCG");
|
|
|
|
|
for (err = fcg.first(); err == NOERR; err = fcg.next(), id+=4)
|
|
|
|
|
_m->set(id, fcg.get("CODTAB"));
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
// Carica i tipi riga dalla tabella TRI
|
|
|
|
|
TTable tri ("%TRI");
|
2003-06-27 14:55:37 +00:00
|
|
|
|
for (err = tri.first(); err == NOERR; err = tri.next())
|
2002-12-17 12:06:42 +00:00
|
|
|
|
{
|
2003-06-27 14:55:37 +00:00
|
|
|
|
const TString& ss = tri.get("CODTAB");
|
2002-12-17 12:06:42 +00:00
|
|
|
|
_tipi_riga.add(tri.get("S7"), ss);
|
|
|
|
|
}
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
return TSkeleton_application::create();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TStampa_ordini::destroy()
|
|
|
|
|
{
|
|
|
|
|
delete _m;
|
|
|
|
|
delete _codgiac;
|
|
|
|
|
return TSkeleton_application::destroy();
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
// Abilita disabilita i campi per i totali in valuta presenti alla fine del body
|
|
|
|
|
// per quel che riguarda le stampe per cli/fo/agenti/articoli
|
|
|
|
|
void TStampa_ordini::set_totvaluta_items()
|
|
|
|
|
{
|
|
|
|
|
TString16 sec_name;
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i<=4; i++)
|
|
|
|
|
{
|
|
|
|
|
sec_name = "TOTVAL";
|
|
|
|
|
sec_name << i;
|
|
|
|
|
TForm_subsection& asec = (TForm_subsection&)_frm->find_field('B', odd_page, sec_name);
|
|
|
|
|
short id = BODY_TOTVALORD + ((i-1) * 10);
|
|
|
|
|
asec.printsection().find_field(id).show(_opz_valore);
|
|
|
|
|
asec.printsection().find_field(id + 1).show(_opz_valore);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-06-12 09:02:18 +00:00
|
|
|
|
bool TStampa_ordini::document_row_filter(const TRectype& row) const
|
|
|
|
|
{
|
|
|
|
|
if (_from_cons.ok() || _to_cons.ok())
|
|
|
|
|
{
|
|
|
|
|
const TDate datacons = row.get(RDOC_DATACONS);
|
|
|
|
|
if (_from_cons.ok() && datacons < _from_cons)
|
|
|
|
|
return FALSE;
|
|
|
|
|
if (_to_cons.ok() && datacons > _from_cons)
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_TEA_rord > ' ')
|
|
|
|
|
{
|
|
|
|
|
const bool evasa = row.get_bool(RDOC_RIGAEVASA);
|
|
|
|
|
if (_TEA_rord == 'E')
|
|
|
|
|
{
|
|
|
|
|
if (!evasa)
|
|
|
|
|
return FALSE;
|
|
|
|
|
if (_force_evase) // Controlla se evasa con residuo
|
|
|
|
|
{
|
|
|
|
|
const real qta = row.get(RDOC_QTA);
|
|
|
|
|
const real qta_evasa = row.get(RDOC_QTAEVASA);
|
|
|
|
|
if (qta_evasa >= qta)
|
|
|
|
|
return FALSE; // Non c'e' residuo
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (_TEA_rord == 'A' && evasa)
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_from_art.not_empty() || _to_art.not_empty())
|
|
|
|
|
{
|
|
|
|
|
const TString& codart = row.get(RDOC_CODART);
|
|
|
|
|
if (_from_art.not_empty() && codart < _from_art)
|
|
|
|
|
return FALSE;
|
|
|
|
|
if (_to_art.not_empty() && codart > _to_art)
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TStampa_ordini::document_filter(const TRelation* rel)
|
2003-06-10 08:26:39 +00:00
|
|
|
|
{
|
|
|
|
|
const TRectype& doc = rel->curr(LF_DOC);
|
|
|
|
|
TRectype rdoc(LF_RIGHEDOC);
|
|
|
|
|
rdoc.put(RDOC_PROVV, doc.get(DOC_PROVV));
|
|
|
|
|
rdoc.put(RDOC_ANNO, doc.get(DOC_ANNO));
|
|
|
|
|
rdoc.put(RDOC_CODNUM, doc.get(DOC_CODNUM));
|
|
|
|
|
rdoc.put(RDOC_NDOC, doc.get(DOC_NDOC));
|
|
|
|
|
TRecord_array righe(LF_RIGHEDOC, RDOC_NRIGA);
|
|
|
|
|
righe.read(rdoc);
|
|
|
|
|
for (int r = righe.rows(); r > 0; r--)
|
|
|
|
|
{
|
2003-06-12 09:02:18 +00:00
|
|
|
|
if (app().document_row_filter(righe.row(r)))
|
2003-06-10 08:26:39 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
void TStampa_ordini::filter_for_number()
|
|
|
|
|
{
|
|
|
|
|
CHECK(_frm, "Form non valido");
|
|
|
|
|
|
|
|
|
|
TCursor* cur = _frm->cursor();
|
|
|
|
|
|
|
|
|
|
cur->setkey(_order == num_doc ? 1 : 3); // Selezione per numero doc o data emissione
|
|
|
|
|
|
|
|
|
|
TRectype f(LF_DOC), t(LF_DOC);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
TString filter_expr,s, lev_str, mag_str;
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
|
|
|
|
if (_order == num_doc)
|
|
|
|
|
{
|
|
|
|
|
f.put(DOC_PROVV, _provv);
|
|
|
|
|
f.put(DOC_ANNO, _anno);
|
|
|
|
|
f.put(DOC_CODNUM, _codnum);
|
|
|
|
|
t = f;
|
|
|
|
|
f.put(DOC_NDOC, _from_ndoc);
|
|
|
|
|
t.put(DOC_NDOC, _to_ndoc);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
f.put(DOC_DATADOC, _from_date);
|
|
|
|
|
t.put(DOC_DATADOC, _to_date);
|
2003-06-10 08:26:39 +00:00
|
|
|
|
filter_expr << "&&(PROVV==\"" << _provv << "\")";
|
2000-05-05 14:32:44 +00:00
|
|
|
|
if (_anno != 0)
|
2003-06-10 08:26:39 +00:00
|
|
|
|
filter_expr << "&&(ANNO==\"" << _anno << "\")";
|
|
|
|
|
filter_expr << "&&(CODNUM==\"" << _codnum << "\")";
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
cur->setregion(f,t);
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
// Imposta l'ordine CODNUM+ANNO+PROVV+NDOC+CODART+LIVELLO+CODMAG+DATACONS
|
|
|
|
|
// nel caso si voglia il dettaglio all'interno del singolo documento, per liv.giac e cod.mag.
|
|
|
|
|
// In tal caso viene sostituito LF_RIGHEDOC nella relazione con un TSortedfile siffatto
|
|
|
|
|
if (_detail_rows && !_detail_doc)
|
|
|
|
|
{
|
|
|
|
|
s << "CODNUM|ANNO|PROVV|NDOC|CODART|";
|
|
|
|
|
|
|
|
|
|
if (_detail_level > 0)
|
|
|
|
|
lev_str.format("LIVELLO[1,%d]",_codgiac->packed_length(_detail_level));
|
|
|
|
|
if (_detail_mag)
|
|
|
|
|
mag_str.format("CODMAG[1,3]");
|
|
|
|
|
if (_detail_dep)
|
|
|
|
|
mag_str.format("CODMAG");
|
|
|
|
|
|
|
|
|
|
if (lev_str.not_empty())
|
|
|
|
|
s << lev_str << "|";
|
|
|
|
|
if (mag_str.not_empty())
|
|
|
|
|
s << mag_str << "|";
|
2003-06-10 08:26:39 +00:00
|
|
|
|
s << RDOC_DATACONS;
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
|
|
|
|
TSortedfile *rdoc = new TSortedfile(LF_RIGHEDOC,NULL,s,"",1);
|
|
|
|
|
cur->relation()->replace(rdoc,1,"CODNUM==CODNUM|ANNO==ANNO|PROVV==PROVV|NDOC==NDOC");
|
|
|
|
|
|
|
|
|
|
TForm_subsection& ssec = (TForm_subsection&) _frm->find_field('B', odd_page, "RIGHEART");
|
|
|
|
|
ssec.enable();
|
|
|
|
|
TString cond(ssec.condition());
|
|
|
|
|
if (lev_str.not_empty())
|
|
|
|
|
cond << "+" << lev_str;
|
|
|
|
|
if (mag_str.not_empty())
|
|
|
|
|
cond << "+" << mag_str;
|
|
|
|
|
ssec.setcondition(cond, _strexpr);
|
|
|
|
|
}
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
if (_TEA_ord == 'E')
|
2003-06-10 08:26:39 +00:00
|
|
|
|
filter_expr << "&&(DOCEVASO==\"X\")";
|
1998-06-25 07:29:35 +00:00
|
|
|
|
else
|
|
|
|
|
if (_TEA_ord == 'A')
|
2003-06-10 08:26:39 +00:00
|
|
|
|
filter_expr << "&&(DOCEVASO!=\"X\")";
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
|
|
|
|
if (!_detail_rows)
|
1998-06-25 07:29:35 +00:00
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
// In caso di dettaglio per righe non va settato il filtro per dataconsegnain quanto
|
|
|
|
|
// gi<67> impostato sulla sottosezione (vedi sotto)
|
|
|
|
|
if (_from_cons.ok())
|
|
|
|
|
{
|
|
|
|
|
filter_expr << "&&";
|
|
|
|
|
s.format("(ANSI(DATACONS)>=\"%s\")",
|
|
|
|
|
(const char*)_from_cons.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_cons.ok())
|
|
|
|
|
{
|
|
|
|
|
filter_expr << "&&";
|
|
|
|
|
s.format("(ANSI(DATACONS)<=\"%s\")",
|
|
|
|
|
(const char*)_to_cons.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
2003-06-10 08:26:39 +00:00
|
|
|
|
|
|
|
|
|
if (filter_expr.starts_with("&&"))
|
|
|
|
|
filter_expr.ltrim(2);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
cur->setfilter(filter_expr);
|
2003-06-10 08:26:39 +00:00
|
|
|
|
|
|
|
|
|
// Filtro aggiuntivo per eliminare testate di documenti in cui tutte
|
2003-06-12 09:02:18 +00:00
|
|
|
|
// le righe hanno data di consegna fuori range.
|
|
|
|
|
if (_detail_doc) // Era if (_detail_rows && _detail_doc)
|
|
|
|
|
cur->set_filterfunction(document_filter);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
|
|
|
|
if (_detail_rows)
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
for (short i = BODY_COL_7; i<=BODY_COL_12; i++)
|
1998-06-25 07:29:35 +00:00
|
|
|
|
_frm->find_field('B', odd_page, i).show();
|
|
|
|
|
_frm->find_field('B', odd_page, "DET").show(); // Visualizza la sottosezione
|
|
|
|
|
TForm_subsection& ssec = (TForm_subsection&)_frm->find_field('B', odd_page, "RIGHE"); // Sottosezione padre
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
// Applica filtri alla sezione
|
1998-06-25 07:29:35 +00:00
|
|
|
|
TString cond;
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
|
|
|
|
// Aggiunge filtro sui tipi di riga
|
|
|
|
|
s.format("((%d->TIPORIGA==\"%s\")", LF_RIGHEDOC, (const char*)(TString&)_tipi_riga["M"]);
|
|
|
|
|
cond << s;
|
|
|
|
|
|
|
|
|
|
if (_pr_spese)
|
|
|
|
|
{
|
|
|
|
|
s.format("||(%d->TIPORIGA==\"%s\")", LF_RIGHEDOC,(const char*)(TString&)_tipi_riga["S"]);
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_pr_prest)
|
|
|
|
|
{
|
|
|
|
|
s.format("||(%d->TIPORIGA==\"%s\")", LF_RIGHEDOC,(const char*)(TString&)_tipi_riga["P"]);
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_pr_sconti)
|
|
|
|
|
{
|
|
|
|
|
s.format("||(%d->TIPORIGA==\"%s\")", LF_RIGHEDOC,(const char*)(TString&)_tipi_riga["C"]);
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_pr_omaggi)
|
|
|
|
|
{
|
|
|
|
|
s.format("||(%d->TIPORIGA==\"%s\")", LF_RIGHEDOC,(const char*)(TString&)_tipi_riga["O"]);
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_pr_descr)
|
|
|
|
|
{
|
|
|
|
|
s.format("||(%d->TIPORIGA==\"%s\")", LF_RIGHEDOC,(const char*)(TString&)_tipi_riga["D"]);
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cond << ")";
|
|
|
|
|
|
|
|
|
|
// TBI: stampa righe di sconto testata od esenzione. Siccome non sono righe fisiche
|
|
|
|
|
// credo sara' necessario implementarle con un messaggio nella validate...
|
|
|
|
|
|
|
|
|
|
// Applica il filtro per righe evase/aperte
|
|
|
|
|
s = "";
|
1998-06-25 07:29:35 +00:00
|
|
|
|
if (_TEA_rord == 'E')
|
2003-06-27 14:55:37 +00:00
|
|
|
|
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
else
|
2003-06-27 14:55:37 +00:00
|
|
|
|
if (_TEA_rord == 'A')
|
|
|
|
|
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
|
|
|
|
cond << s;
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
s = "";
|
|
|
|
|
if (_force_evase)
|
2003-06-12 09:02:18 +00:00
|
|
|
|
s.format("&&(STR(%d->QTAEVASA<%d->QTA))", LF_RIGHEDOC, LF_RIGHEDOC);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
cond << s;
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
// Setta i range per la data di consegna
|
|
|
|
|
if (_from_cons.ok())
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
if (cond.not_empty())
|
1998-06-25 07:29:35 +00:00
|
|
|
|
cond << "&&";
|
|
|
|
|
s.format("(ANSI(%d->DATACONS)>=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_from_cons.string(ANSI));
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_cons.ok())
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
if (cond.not_empty())
|
1998-06-25 07:29:35 +00:00
|
|
|
|
cond << "&&";
|
|
|
|
|
s.format("(ANSI(%d->DATACONS)<=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_to_cons.string(ANSI));
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Setta i range per il codice magazzino
|
|
|
|
|
if (_from_mag.not_empty())
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
if (cond.not_empty())
|
1998-06-25 07:29:35 +00:00
|
|
|
|
cond << "&&";
|
|
|
|
|
s.format("(%d->CODMAG>=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_from_mag);
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_mag.not_empty())
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
if (cond.not_empty())
|
1998-06-25 07:29:35 +00:00
|
|
|
|
cond << "&&";
|
|
|
|
|
s.format("(%d->CODMAG<=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_to_mag);
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Setta i range per il codice articolo
|
|
|
|
|
if (_from_art.not_empty())
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
if (cond.not_empty())
|
1998-06-25 07:29:35 +00:00
|
|
|
|
cond << "&&";
|
|
|
|
|
s.format("(%d->CODART>=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_from_art);
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_art.not_empty())
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
if (cond.not_empty())
|
1998-06-25 07:29:35 +00:00
|
|
|
|
cond << "&&";
|
|
|
|
|
s.format("(%d->CODART<=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_to_art);
|
|
|
|
|
cond << s;
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
s.format("&&(%d->CODART!=\"\")", LF_RIGHEDOC);
|
|
|
|
|
cond << s;
|
|
|
|
|
|
|
|
|
|
if (cond.not_empty())
|
1998-06-25 07:29:35 +00:00
|
|
|
|
ssec.setcondition(cond, _strexpr);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
|
|
|
|
if (!_detail_doc)
|
|
|
|
|
{
|
|
|
|
|
TForm_subsection& ss = (TForm_subsection&)_frm->find_field('B', odd_page, "RIGHE");
|
|
|
|
|
TPrint_section& ps = ss.printsection();
|
|
|
|
|
for (short j = BODY_COL_1; j <= BODY_COL_12; j++)
|
|
|
|
|
{
|
|
|
|
|
ps.find_field(j + 100).disable();
|
|
|
|
|
ps.find_field(j + 400).enable();
|
|
|
|
|
}
|
|
|
|
|
}
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
|
|
|
|
// Abilitazione intestazioni di colonna
|
|
|
|
|
_frm->find_field('B', odd_page, BODY_COL_5).show(_opz_valore);
|
|
|
|
|
_frm->find_field('B', odd_page, BODY_COL_6).show(_opz_valore);
|
|
|
|
|
_frm->find_field('F', last_page, BODY_COL_5+200).show(_opz_valore);
|
|
|
|
|
_frm->find_field('F', last_page, BODY_COL_6+200).show(_opz_valore);
|
|
|
|
|
_frm->find_field('B', odd_page, BODY_COL_10).show(_opz_prezzo);
|
|
|
|
|
_frm->find_field('B', odd_page, BODY_COL_11).show(_opz_residuo);
|
|
|
|
|
_frm->find_field('B', odd_page, BODY_COL_12).show(_opz_giacenza);
|
|
|
|
|
|
|
|
|
|
// Abilitazione delle righe
|
|
|
|
|
const short id = !_detail_doc && _detail_rows ? 400 : 100;
|
|
|
|
|
TForm_subsection& ssec = (TForm_subsection&)_frm->find_field('B', odd_page, "RIGHE"); // Sottosezione padre
|
|
|
|
|
ssec.printsection().find_field(BODY_COL_5 + id).show(_opz_valore);
|
|
|
|
|
ssec.printsection().find_field(BODY_COL_6 + id).show(_opz_valore);
|
|
|
|
|
ssec.printsection().find_field(BODY_COL_10 + id).show(_opz_prezzo);
|
|
|
|
|
ssec.printsection().find_field(BODY_COL_11 + id).show(_opz_residuo);
|
|
|
|
|
ssec.printsection().find_field(BODY_COL_12 + id).show(_opz_giacenza);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-06-10 08:26:39 +00:00
|
|
|
|
void TStampa_ordini::show_body_field(short id, bool on)
|
|
|
|
|
{
|
|
|
|
|
TForm_item* i = _frm->exist_field('B', odd_page, id);
|
|
|
|
|
if (i != NULL)
|
|
|
|
|
i->enable(on);
|
|
|
|
|
}
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
void TStampa_ordini::filter_for_clifo_agent()
|
|
|
|
|
{
|
|
|
|
|
CHECK(_frm, "Form non valido");
|
|
|
|
|
|
|
|
|
|
const bool is_for_cli = _tipo == clifo;
|
|
|
|
|
|
|
|
|
|
TString s, ws,lev_str, mag_str;
|
|
|
|
|
TSorted_cursor* cur = (TSorted_cursor*)_frm->cursor();
|
|
|
|
|
|
|
|
|
|
if (_detail_rows && !_detail_doc) // Cambia l'ordinamento se si vuol dettagliare per articolo e non per documento
|
|
|
|
|
{
|
|
|
|
|
if (_detail_level > 0)
|
|
|
|
|
lev_str.format("LIVELLO[1,%d]",_codgiac->packed_length(_detail_level));
|
|
|
|
|
if (_detail_mag)
|
|
|
|
|
mag_str.format("CODMAG[1,3]");
|
|
|
|
|
if (_detail_dep)
|
|
|
|
|
mag_str.format("CODMAG");
|
|
|
|
|
|
|
|
|
|
if (!is_for_cli)
|
|
|
|
|
s.format("%d->CODAG|",LF_DOC);
|
|
|
|
|
if (is_for_cli || _detail_cli)
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
ws.format("%d->TIPOCF|%d->CODCF|%d->OCFPI|",LF_DOC, LF_DOC, LF_DOC);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
s << ws;
|
|
|
|
|
}
|
|
|
|
|
s << "CODART|";
|
|
|
|
|
if (lev_str.not_empty())
|
|
|
|
|
s << lev_str << "|";
|
|
|
|
|
if (mag_str.not_empty())
|
|
|
|
|
s << mag_str << "|";
|
|
|
|
|
s << "DATACONS";
|
|
|
|
|
cur->change_order(s);
|
|
|
|
|
}
|
|
|
|
|
//Mo setto li filtri, altrimenti stampa tutto er file de' righe documento
|
|
|
|
|
TRectype f(LF_RIGHEDOC), t(LF_RIGHEDOC);
|
|
|
|
|
TString filter_expr;
|
|
|
|
|
|
|
|
|
|
f.put(DOC_CODNUM, _codnum);
|
2000-05-05 14:32:44 +00:00
|
|
|
|
if (_anno != 0)
|
|
|
|
|
{
|
2002-12-20 16:15:03 +00:00
|
|
|
|
f.put(DOC_PROVV, _provv);
|
|
|
|
|
f.put(DOC_ANNO, _anno);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
s.format("(PROVV==\"%c\")&&", _provv);
|
2000-05-05 14:32:44 +00:00
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
2002-12-20 16:15:03 +00:00
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
t = f;
|
|
|
|
|
cur->setregion(f,t); // This is the region...
|
|
|
|
|
|
|
|
|
|
s.format("(%d->TIPOCF==\"",LF_DOC);
|
|
|
|
|
filter_expr << s << _tipocf << "\")"; // Nel caso di stampa per agenti e' sempre "C"
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
s.format("&&(%d->CODART!=\"\")", LF_RIGHEDOC);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
// Filtro su Cli/Fo od agente
|
|
|
|
|
if (is_for_cli)
|
|
|
|
|
{
|
|
|
|
|
if (_from_cf > 0L)
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(STR(NUM(%d->CODCF)>=%ld))", LF_DOC, _from_cf);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_to_cf > 0L)
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(STR(NUM(%d->CODCF)<=%ld))", LF_DOC, _to_cf);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (_from_age.not_empty())
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
s.format("&&(%d->CODAG>=\"%s\")", LF_DOC, (const char*)_from_age);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_to_age.not_empty())
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
s.format("&&(%d->CODAG<=\"%s\")", LF_DOC, (const char*)_to_age);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Filtro sulla data ordine...
|
|
|
|
|
if (_from_date.ok())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(ANSI(%d->DATADOC)>=\"%s\")", LF_DOC,
|
|
|
|
|
(const char*)_from_date.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_date.ok())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(ANSI(%d->DATADOC)<=\"%s\")", LF_DOC,
|
|
|
|
|
(const char*)_to_date.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
2000-05-05 14:32:44 +00:00
|
|
|
|
}
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
|
|
|
|
// Filtro sulla data consegna...
|
|
|
|
|
if (_from_cons.ok())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(ANSI(DATACONS)>=\"%s\")",
|
|
|
|
|
(const char*)_from_cons.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_cons.ok())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(ANSI(DATACONS)<=\"%s\")",
|
|
|
|
|
(const char*)_to_cons.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_detail_rows)
|
|
|
|
|
{
|
|
|
|
|
// Setta i range per il codice articolo
|
|
|
|
|
if (_from_art.not_empty())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->CODART>=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_from_art);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_art.not_empty())
|
|
|
|
|
{
|
|
|
|
|
filter_expr << "&&";
|
|
|
|
|
s.format("(%d->CODART<=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_to_art);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
// Setta i range per i livelli di giacenza (da 1 a 4)
|
|
|
|
|
if (_detail_level > 0)
|
|
|
|
|
for (int lev=1, index=0; lev <= _detail_level; lev++)
|
|
|
|
|
{
|
|
|
|
|
if (!_codgiac->enabled(lev))
|
|
|
|
|
continue;
|
|
|
|
|
TString& from = (TString&) _from_giac[index];
|
|
|
|
|
TString& to = (TString&) _to_giac[index++];
|
|
|
|
|
const int starts = _codgiac->code_start(lev);
|
|
|
|
|
const int ends = starts+_codgiac->code_length(lev);
|
|
|
|
|
if (from.not_empty())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->LIVELLO[%d,%d]>=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC,starts,ends,(const char*)from);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (to.not_empty())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->LIVELLO[%d,%d]<=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC,starts,ends,(const char*)to);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Setta i range per il codice magazzino (deposito incluso)
|
|
|
|
|
if (_from_mag.not_empty())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->CODMAG>=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_from_mag);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_mag.not_empty())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->CODMAG<=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_to_mag);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s = "";
|
|
|
|
|
if (!_detail_rows)
|
|
|
|
|
{
|
|
|
|
|
if (_TEA_ord == 'E')
|
|
|
|
|
s.format("&&(%d->DOCEVASO==\"X\")",LF_DOC);
|
|
|
|
|
else
|
|
|
|
|
if (_TEA_ord == 'A')
|
|
|
|
|
s.format("&&(%d->DOCEVASO!=\"X\")",LF_DOC);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (_TEA_rord == 'E')
|
2003-06-27 14:55:37 +00:00
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
|
|
|
|
if (_force_evase)
|
|
|
|
|
s << "&&(STR(" << LF_RIGHEDOC << "->QTAEVASA<" << LF_RIGHEDOC << "->QTA))";
|
|
|
|
|
}
|
1998-06-25 07:29:35 +00:00
|
|
|
|
else
|
2003-06-27 14:55:37 +00:00
|
|
|
|
if (_TEA_rord == 'A')
|
|
|
|
|
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (s.not_empty())
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
cur->setfilter(filter_expr,TRUE,2);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
|
|
|
|
// Alla fine setta i campi da vedere
|
|
|
|
|
if (!is_for_cli && _detail_cli)
|
|
|
|
|
{
|
|
|
|
|
// Solo stampa per agenti: se si e' settato il distinguo per clienti
|
|
|
|
|
// mostra l'intestazione prima di ogni cambio cliente
|
|
|
|
|
TForm_subsection& ssec = (TForm_subsection&) _frm->find_field('B', odd_page, "HCLIENTI");
|
|
|
|
|
ssec.enable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_detail_rows || _detail_doc) // Stampa distinguendo per documento e non per righe articolo...
|
|
|
|
|
{
|
|
|
|
|
TForm_subsection& ssec = (TForm_subsection&) _frm->find_field('B', odd_page, "DOCUMENTI");
|
2002-12-17 12:06:42 +00:00
|
|
|
|
if (!is_for_cli)
|
1998-06-25 07:29:35 +00:00
|
|
|
|
ssec.enable(); // Se stampa per agenti e dettaglia documenti per cliente abilita la sezione
|
|
|
|
|
else
|
|
|
|
|
{ // Se stampa per cli/fo abilita i campi corrispondenti al distinguo per documento (valuta, residuo evaso ecc...)
|
2002-12-17 12:06:42 +00:00
|
|
|
|
ssec.printsection().find_field(BODY_COL_1 + 100).show();
|
|
|
|
|
for (short id = BODY_COL_2 + 100; id <= (BODY_COL_6 + 100); id++)
|
1998-06-25 07:29:35 +00:00
|
|
|
|
ssec.printsection().find_field(id).enable();
|
|
|
|
|
}
|
2002-12-17 12:06:42 +00:00
|
|
|
|
// Deve essere abilitata ma nascosta, per eseguire i raggruppamenti sulle righe
|
|
|
|
|
TForm_subsection& dsec = (TForm_subsection&) _frm->find_field('B', odd_page, "RIGHEDOC");
|
|
|
|
|
dsec.enable();
|
|
|
|
|
dsec.hide();
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
2000-05-05 14:32:44 +00:00
|
|
|
|
|
|
|
|
|
// In qualsiasi caso va fatta questa abilitazione
|
|
|
|
|
bool is_art = _detail_rows && !_detail_doc;
|
|
|
|
|
|
|
|
|
|
((TForm_subsection&) _frm->find_field('B', odd_page, "DOCUMENTI")).printsection().find_field(BODY_COL_5 + 100).enable(_opz_valore && !is_art);
|
|
|
|
|
((TForm_subsection&) _frm->find_field('B', odd_page, "DOCUMENTI")).printsection().find_field(BODY_COL_6 + 100).enable(_opz_valore && !is_art);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
|
|
|
|
if (_detail_rows) // Stampa dettaglio righe...
|
|
|
|
|
{
|
2002-12-17 12:06:42 +00:00
|
|
|
|
for (short i = BODY_COL_7; i<=BODY_COL_12; i++)
|
1998-06-25 07:29:35 +00:00
|
|
|
|
_frm->find_field('B', odd_page, i).show(); // Aggiunge le colonne di dettaglio
|
|
|
|
|
// dulcis in fundo (Dulcinea mia adorata), si abilita la sezione RIGHEART
|
|
|
|
|
// anziche' RIGHEDOC nel qual caso sia stato specificato il raggruppamento per Articoli (e sotto-opzioni)
|
|
|
|
|
if (!_detail_doc) // Se la stampa deve distinguere e dettagliare per articoli e non per documenti...
|
|
|
|
|
{
|
|
|
|
|
TString cond;
|
|
|
|
|
TForm_item& ff = _frm->find_field('B', odd_page, "RIGHEDOC");
|
|
|
|
|
ff.y() = 1;
|
|
|
|
|
|
|
|
|
|
if (!is_for_cli) // Abilita la sottosezione principale se stampa per agenti
|
|
|
|
|
{
|
|
|
|
|
TForm_subsection& ssec = (TForm_subsection&) _frm->find_field('B', odd_page, "ARTCLI");
|
|
|
|
|
ssec.enable();
|
2002-12-17 12:06:42 +00:00
|
|
|
|
ssec.printsection().find_field(BODY_COL_5 + 400).enable(_opz_valore);
|
|
|
|
|
ssec.printsection().find_field(BODY_COL_6 + 400).enable(_opz_valore);
|
|
|
|
|
ssec.printsection().find_field(BODY_COL_10 + 400).enable(_opz_prezzo);
|
|
|
|
|
ssec.printsection().find_field(BODY_COL_11 + 400).enable(_opz_residuo);
|
|
|
|
|
ssec.printsection().find_field(BODY_COL_12 + 400).enable(_opz_giacenza);
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
if (_detail_cli) // Se e' abilitata la distinzione per clienti setta l'espressione di raggruppamento
|
|
|
|
|
{
|
|
|
|
|
cond = ssec.condition();
|
2002-12-17 12:06:42 +00:00
|
|
|
|
cond << "+" << LF_CLIFO << "->TIPOCF+" << LF_CLIFO << "->CODCF+" << LF_DOC << "->OCFPI";
|
1998-06-25 07:29:35 +00:00
|
|
|
|
ssec.setcondition(cond, _strexpr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Setta la condizione di raggruppamento principale per articoli (comune alla stampa per cli/fo e per agenti)
|
|
|
|
|
TForm_subsection& ssec = (TForm_subsection&) _frm->find_field('B', odd_page, "RIGHEART");
|
|
|
|
|
ssec.enable();
|
|
|
|
|
cond = ssec.condition();
|
|
|
|
|
if (lev_str.not_empty())
|
|
|
|
|
cond << "+" << lev_str;
|
|
|
|
|
if (mag_str.not_empty())
|
|
|
|
|
cond << "+" << mag_str;
|
|
|
|
|
ssec.setcondition(cond, _strexpr);
|
|
|
|
|
|
|
|
|
|
if (is_for_cli)
|
|
|
|
|
{ // I seguenti campi non necessitano di abilitazione se la stampa e' per agente
|
|
|
|
|
TForm_subsection& dsec = (TForm_subsection&) _frm->find_field('B', odd_page, "DOCUMENTI");
|
2002-12-17 12:06:42 +00:00
|
|
|
|
for (short id = BODY_COL_1 + 400; id <= (BODY_COL_12 + 400); id++)
|
1998-06-25 07:29:35 +00:00
|
|
|
|
dsec.printsection().find_field(id).enable();
|
2002-12-17 12:06:42 +00:00
|
|
|
|
dsec.printsection().find_field(BODY_COL_5 + 400).enable(_opz_valore);
|
|
|
|
|
dsec.printsection().find_field(BODY_COL_6 + 400).enable(_opz_valore);
|
|
|
|
|
dsec.printsection().find_field(BODY_COL_10 + 400).enable(_opz_prezzo);
|
|
|
|
|
dsec.printsection().find_field(BODY_COL_11 + 400).enable(_opz_residuo);
|
|
|
|
|
dsec.printsection().find_field(BODY_COL_12 + 400).enable(_opz_giacenza);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
2002-12-17 12:06:42 +00:00
|
|
|
|
{
|
1998-06-25 07:29:35 +00:00
|
|
|
|
_frm->find_field('B', odd_page, "RIGHEDOC").enable(); // Abilita la sezione di dettaglio righe PER DOCUMENTO
|
2002-12-17 12:06:42 +00:00
|
|
|
|
TForm_subsection& rd = (TForm_subsection&) _frm->find_field('B', odd_page, "RIGHEDOC");
|
|
|
|
|
rd.printsection().find_field(BODY_COL_5 + 200).enable(_opz_valore);
|
|
|
|
|
rd.printsection().find_field(BODY_COL_6 + 200).enable(_opz_valore);
|
|
|
|
|
rd.printsection().find_field(BODY_COL_10 + 200).enable(_opz_prezzo);
|
|
|
|
|
rd.printsection().find_field(BODY_COL_11 + 200).enable(_opz_residuo);
|
|
|
|
|
rd.printsection().find_field(BODY_COL_12 + 200).enable(_opz_giacenza);
|
|
|
|
|
}
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
2002-12-17 12:06:42 +00:00
|
|
|
|
// Abilitazione intestazioni di colonna
|
2003-06-10 08:26:39 +00:00
|
|
|
|
show_body_field(BODY_COL_5, _opz_valore);
|
|
|
|
|
show_body_field(BODY_COL_6, _opz_valore);
|
|
|
|
|
show_body_field(BODY_COL_10, _opz_prezzo);
|
|
|
|
|
show_body_field(BODY_COL_11, _opz_residuo);
|
|
|
|
|
show_body_field(BODY_COL_12, _opz_giacenza);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
|
|
|
|
set_totvaluta_items();
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TStampa_ordini::filter_for_articolo()
|
|
|
|
|
{
|
|
|
|
|
CHECK(_frm, "Form non valido");
|
|
|
|
|
|
|
|
|
|
TString s, ws,lev_str, mag_str;
|
|
|
|
|
TSorted_cursor* cur = (TSorted_cursor*)_frm->cursor();
|
|
|
|
|
|
|
|
|
|
if (_detail_level > 0)
|
|
|
|
|
lev_str.format("LIVELLO[1,%d]",_codgiac->packed_length(_detail_level));
|
|
|
|
|
if (_detail_mag)
|
|
|
|
|
mag_str.format("CODMAG[1,3]");
|
|
|
|
|
if (_detail_dep)
|
|
|
|
|
mag_str.format("CODMAG");
|
|
|
|
|
|
|
|
|
|
s << "CODART|";
|
|
|
|
|
if (lev_str.not_empty())
|
|
|
|
|
s << lev_str << "|";
|
|
|
|
|
if (mag_str.not_empty())
|
|
|
|
|
s << mag_str << "|";
|
2003-06-10 08:26:39 +00:00
|
|
|
|
s << "ANNO|NDOC|DATACONS"; // MODIFICATO DA CRISTINA AGGIUNTO ANNO + NDOC
|
1998-06-25 07:29:35 +00:00
|
|
|
|
cur->change_order(s); // Setta l'ordine
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TRectype f(LF_RIGHEDOC), t(LF_RIGHEDOC);
|
|
|
|
|
TString filter_expr;
|
|
|
|
|
|
|
|
|
|
f.put(DOC_CODNUM, _codnum);
|
2000-05-05 14:32:44 +00:00
|
|
|
|
f.put(RDOC_CODART, _from_art);
|
|
|
|
|
if (_anno != 0)
|
|
|
|
|
{
|
2002-12-20 16:15:03 +00:00
|
|
|
|
f.put(DOC_PROVV, _provv);
|
|
|
|
|
f.put(DOC_ANNO, _anno);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
s.format("(PROVV==\"%c\") &&", _provv);
|
2000-05-05 14:32:44 +00:00
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
2002-12-20 16:15:03 +00:00
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
t = f;
|
2002-12-17 12:06:42 +00:00
|
|
|
|
t.put(RDOC_CODART, _to_art);
|
|
|
|
|
cur->setkey(2); // Questa chiave rende piu' veloce la costruzione se indicato un range di articoli
|
1998-06-25 07:29:35 +00:00
|
|
|
|
cur->setregion(f,t); // This is the region...
|
|
|
|
|
|
|
|
|
|
s.format("(%d->TIPOCF==\"",LF_DOC);
|
|
|
|
|
filter_expr << s << _tipocf << "\")"; // Nel caso di stampa per agenti e' sempre "C"
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
s.format("&&(%d->CODART!=\"\")", LF_RIGHEDOC);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
// Filtro su Cli/Fo
|
|
|
|
|
if (_from_cf > 0L)
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(STR(NUM(%d->CODCF)>=%ld))", LF_DOC, _from_cf);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_to_cf > 0L)
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(STR(NUM(%d->CODCF)<=%ld))", LF_DOC, _to_cf);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
// Filtro sulla data ordine...
|
|
|
|
|
if (_from_date.ok())
|
2000-05-05 14:32:44 +00:00
|
|
|
|
{
|
1998-06-25 07:29:35 +00:00
|
|
|
|
s.format("&&(ANSI(%d->DATADOC)>=\"%s\")", LF_DOC,
|
|
|
|
|
(const char*)_from_date.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_date.ok())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(ANSI(%d->DATADOC)<=\"%s\")", LF_DOC,
|
|
|
|
|
(const char*)_to_date.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
2000-05-05 14:32:44 +00:00
|
|
|
|
}
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
|
|
|
|
// Filtro sulla data consegna...
|
|
|
|
|
if (_from_cons.ok())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(ANSI(DATACONS)>=\"%s\")",
|
|
|
|
|
(const char*)_from_cons.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_cons.ok())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(ANSI(DATACONS)<=\"%s\")",
|
|
|
|
|
(const char*)_to_cons.string(ANSI));
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
1998-06-25 07:29:35 +00:00
|
|
|
|
// Setta i range per i livelli di giacenza (da 1 a 4)
|
|
|
|
|
if (_detail_level > 0)
|
|
|
|
|
for (int lev=1, index=0; lev <= _detail_level; lev++)
|
|
|
|
|
{
|
|
|
|
|
if (!_codgiac->enabled(lev))
|
|
|
|
|
continue;
|
|
|
|
|
TString& from = (TString&) _from_giac[index];
|
|
|
|
|
TString& to = (TString&) _to_giac[index++];
|
|
|
|
|
const int starts = _codgiac->code_start(lev);
|
|
|
|
|
const int ends = starts+_codgiac->code_length(lev);
|
|
|
|
|
if (from.not_empty())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->LIVELLO[%d,%d]>=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC,starts,ends,(const char*)from);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (to.not_empty())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->LIVELLO[%d,%d]<=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC,starts,ends,(const char*)to);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Setta i range per il codice magazzino (deposito incluso)
|
|
|
|
|
if (_from_mag.not_empty())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->CODMAG>=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_from_mag);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
if (_to_mag.not_empty())
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->CODMAG<=\"%s\")",
|
|
|
|
|
LF_RIGHEDOC, (const char*)_to_mag);
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
|
|
|
|
|
2003-06-27 14:55:37 +00:00
|
|
|
|
if (_TEA_rord > ' ')
|
|
|
|
|
{
|
|
|
|
|
s = "";
|
|
|
|
|
if (_TEA_rord == 'E')
|
|
|
|
|
{
|
|
|
|
|
s.format("&&(%d->RIGAEVASA==\"X\")",LF_RIGHEDOC);
|
|
|
|
|
if (_force_evase)
|
|
|
|
|
s << "&&(STR(" << LF_RIGHEDOC << "->QTAEVASA<" << LF_RIGHEDOC << "->QTA))";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (_TEA_rord == 'A')
|
|
|
|
|
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
|
|
|
|
|
if (s.not_empty())
|
|
|
|
|
filter_expr << s;
|
|
|
|
|
}
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
cur->setfilter(filter_expr,TRUE,2); // Setta il filtro e serra i ranghi
|
|
|
|
|
|
|
|
|
|
// Setta la condizione di raggruppamento principale per articoli
|
|
|
|
|
TForm_subsection& ssec = (TForm_subsection&) _frm->find_field('B', odd_page, "ARTMAIN");
|
1998-06-25 07:29:35 +00:00
|
|
|
|
ssec.enable();
|
|
|
|
|
s = ssec.condition();
|
|
|
|
|
if (lev_str.not_empty())
|
|
|
|
|
s << "+" << lev_str;
|
|
|
|
|
if (mag_str.not_empty())
|
|
|
|
|
s << "+" << mag_str;
|
|
|
|
|
ssec.setcondition(s, _strexpr);
|
|
|
|
|
|
2002-12-17 12:06:42 +00:00
|
|
|
|
for (short id = BODY_COL_1 + 400; id <= (BODY_COL_12 + 400); id++)
|
1998-06-25 07:29:35 +00:00
|
|
|
|
_frm->find_field('B',odd_page,id).enable();
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
|
|
|
|
// Abilitazione intestazioni di colonna
|
2003-06-10 08:26:39 +00:00
|
|
|
|
show_body_field(BODY_COL_5,_opz_valore);
|
|
|
|
|
show_body_field(BODY_COL_6,_opz_valore);
|
|
|
|
|
show_body_field(BODY_COL_10,_opz_prezzo);
|
|
|
|
|
show_body_field(BODY_COL_11,_opz_residuo);
|
|
|
|
|
show_body_field(BODY_COL_12,_opz_giacenza);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
|
|
|
|
// Abilitazione intestazioni di riga
|
|
|
|
|
TForm_subsection& asec = (TForm_subsection&)_frm->find_field('B', odd_page, "ARTMAIN"); // Sottosezione padre
|
|
|
|
|
asec.printsection().find_field(BODY_COL_5 + 400).show(_opz_valore);
|
|
|
|
|
asec.printsection().find_field(BODY_COL_6 + 400).show(_opz_valore);
|
|
|
|
|
asec.printsection().find_field(BODY_COL_10 + 400).show(_opz_prezzo);
|
|
|
|
|
asec.printsection().find_field(BODY_COL_11 + 400).show(_opz_residuo);
|
|
|
|
|
asec.printsection().find_field(BODY_COL_12 + 400).show(_opz_giacenza);
|
|
|
|
|
|
|
|
|
|
set_totvaluta_items();
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TStampa_ordini::main_loop()
|
|
|
|
|
{
|
|
|
|
|
TString form_name;
|
|
|
|
|
|
|
|
|
|
while (_m->run()!=K_QUIT)
|
|
|
|
|
{
|
|
|
|
|
// selezione tipo di stampa per il form appropriato
|
|
|
|
|
_tipo = (tipo_stampa) _m->get_int(F_TIPO);
|
|
|
|
|
_codnum = _m->get(F_CODNUM);
|
|
|
|
|
_provv = _m->get(F_PROVV)[0];
|
|
|
|
|
_anno = _m->get_int(F_ANNO);
|
|
|
|
|
_order = _m->get(F_DATA_O_NUM)[0] == 'N' ? num_doc : data_doc;
|
|
|
|
|
_from_ndoc = _m->get_long(F_NDOCFROM);
|
|
|
|
|
_to_ndoc = _m->get_long(F_NDOCTO);
|
|
|
|
|
_from_date = _m->get_date(F_EMISFROM);
|
|
|
|
|
_to_date = _m->get_date(F_EMISTO);
|
|
|
|
|
_from_cons = _m->get_date(F_CONSFROM);
|
|
|
|
|
_to_cons = _m->get_date(F_CONSTO);
|
|
|
|
|
_from_age = _m->get(F_AGEFROM);
|
|
|
|
|
_to_age = _m->get(F_AGETO);
|
|
|
|
|
_from_cf = _m->get_long(F_CFFROM);
|
|
|
|
|
_to_cf = _m->get_long(F_CFTO);
|
|
|
|
|
_from_mag = _m->get(F_MAGFROM);
|
|
|
|
|
_to_mag = _m->get(F_MAGTO);
|
|
|
|
|
_from_dep = _m->get(F_DEPFROM);
|
|
|
|
|
_to_dep = _m->get(F_DEPTO);
|
|
|
|
|
if (_from_mag.not_empty())
|
|
|
|
|
_from_mag.left_just(3);
|
|
|
|
|
if (_to_mag.not_empty())
|
|
|
|
|
_to_mag.left_just(3);
|
|
|
|
|
_from_mag << _from_dep;
|
|
|
|
|
_to_mag << _to_dep;
|
|
|
|
|
|
|
|
|
|
_from_art = _m->get(F_ARTFROM);
|
|
|
|
|
_to_art = _m->get(F_ARTTO);
|
|
|
|
|
|
|
|
|
|
_from_giac.destroy();
|
|
|
|
|
_to_giac.destroy();
|
|
|
|
|
_from_giac.add(_m->get(F_GIAC1_FROM),0);
|
|
|
|
|
_to_giac.add(_m->get(F_GIAC1_TO),0);
|
|
|
|
|
_from_giac.add(_m->get(F_GIAC2_FROM),1);
|
|
|
|
|
_to_giac.add(_m->get(F_GIAC2_TO),1);
|
|
|
|
|
_from_giac.add(_m->get(F_GIAC3_FROM),2);
|
|
|
|
|
_to_giac.add(_m->get(F_GIAC3_TO),2);
|
|
|
|
|
_from_giac.add(_m->get(F_GIAC4_FROM),3);
|
|
|
|
|
_to_giac.add(_m->get(F_GIAC4_TO),3);
|
|
|
|
|
|
|
|
|
|
if (!_from_date.ok())
|
|
|
|
|
_from_date = botime;
|
|
|
|
|
if (!_to_date.ok())
|
|
|
|
|
_to_date = eotime;
|
|
|
|
|
_tipocf = _m->get(F_TIPOCF)[0];
|
|
|
|
|
_detail_rows = _m->get_bool(F_DETTAGLIO);
|
|
|
|
|
_detail_doc = _m->get_bool(F_DETAIL_BY_DOC);
|
|
|
|
|
_detail_cli = _m->get_bool(F_DETAIL_BY_CLI);
|
|
|
|
|
_detail_mag = _m->get_bool(F_DETAIL_MAG);
|
|
|
|
|
_detail_dep = _m->get_bool(F_DETAIL_DEP);
|
|
|
|
|
_detail_level = _m->get_int(F_DETAIL_LEV);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
|
|
|
|
|
_pr_spese = _m->get_bool(F_PRINTSPESE);
|
|
|
|
|
_pr_prest = _m->get_bool(F_PRINTPREST);
|
|
|
|
|
_pr_sconti = _m->get_bool(F_PRINTSCONTI);
|
|
|
|
|
_pr_omaggi = _m->get_bool(F_PRINTOMAGGI);
|
|
|
|
|
_pr_descr = _m->get_bool(F_PRINTDESCR);
|
|
|
|
|
|
|
|
|
|
_opz_valore = _m->get_bool(F_OPZ_VALORE);
|
|
|
|
|
_opz_prezzo = _m->get_bool(F_OPZ_PREZZO);
|
|
|
|
|
_opz_residuo = _m->get_bool(F_OPZ_RESIDUO);
|
|
|
|
|
_opz_giacenza = _m->get_bool(F_OPZ_GIACENZA);
|
|
|
|
|
|
|
|
|
|
_force_evase = _m->get_bool(F_FORCE_EVASE);
|
1998-06-25 07:29:35 +00:00
|
|
|
|
|
|
|
|
|
_TEA_ord = _m->get(F_STATOORD)[0];
|
|
|
|
|
_TEA_rord = _m->get(F_STATORORD)[0];
|
|
|
|
|
|
|
|
|
|
switch (_tipo)
|
|
|
|
|
{
|
2002-12-20 16:15:03 +00:00
|
|
|
|
case clifo:
|
|
|
|
|
form_name = "or1100b";
|
|
|
|
|
break;
|
|
|
|
|
case agente:
|
|
|
|
|
form_name = "or1100c";
|
|
|
|
|
break;
|
|
|
|
|
case articolo:
|
|
|
|
|
form_name = "or1100d";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
form_name = "or1100a";
|
|
|
|
|
break;
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_frm = new TOrdine_form(form_name);
|
|
|
|
|
_frm->set_options(_detail_level, _detail_mag, _detail_dep);
|
|
|
|
|
// Selezione cursore & filtro
|
|
|
|
|
switch (_tipo)
|
|
|
|
|
{
|
2002-12-20 16:15:03 +00:00
|
|
|
|
case clifo:
|
|
|
|
|
case agente:
|
|
|
|
|
filter_for_clifo_agent();
|
|
|
|
|
break;
|
|
|
|
|
case articolo:
|
|
|
|
|
filter_for_articolo();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
filter_for_number();
|
|
|
|
|
break;
|
1998-06-25 07:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const int hh = 6;
|
|
|
|
|
const int fl = printer().formlen();
|
|
|
|
|
|
|
|
|
|
int rows[4]; // Righe orizzontali
|
|
|
|
|
rows[0] = hh-2;
|
|
|
|
|
rows[1] = hh;
|
2002-12-17 12:06:42 +00:00
|
|
|
|
rows[2] = fl;
|
1998-06-25 07:29:35 +00:00
|
|
|
|
rows[3] = 0;
|
|
|
|
|
_frm->genera_intestazioni(odd_page, hh-1);
|
2002-12-17 12:06:42 +00:00
|
|
|
|
_frm->genera_fincatura(odd_page, hh-2, fl, rows);
|
|
|
|
|
|
|
|
|
|
// Crea il cursore
|
1998-06-25 07:29:35 +00:00
|
|
|
|
if (_frm->cursor()->items() > 0)
|
2002-12-17 12:06:42 +00:00
|
|
|
|
{
|
|
|
|
|
// Sostituzione curr del cursore
|
|
|
|
|
TCursor* cur = _frm->cursor();
|
|
|
|
|
TDocumento *doc = new TDocumento; // Don't delete!
|
|
|
|
|
|
|
|
|
|
cur->file(LF_DOC).set_curr(doc);
|
|
|
|
|
cur->file(LF_RIGHEDOC).set_curr(new TRiga_documento(doc));// Don't delete!
|
|
|
|
|
|
|
|
|
|
// stampa
|
1998-06-25 07:29:35 +00:00
|
|
|
|
_frm->print();
|
2002-12-17 12:06:42 +00:00
|
|
|
|
}
|
1998-06-25 07:29:35 +00:00
|
|
|
|
delete _frm;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int or1100(int argc, char** argv)
|
|
|
|
|
{
|
|
|
|
|
TStampa_ordini a;
|
2003-06-27 14:55:37 +00:00
|
|
|
|
a.run(argc,argv, TR("Stampa ordini"));
|
1998-06-25 07:29:35 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|