Correzzioni varie da PG
git-svn-id: svn://10.65.10.50/trunk@5113 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e034826879
commit
63ea4bab4d
@ -59,7 +59,10 @@ void TMotore_application::init_insert_mode( TMask& m )
|
|||||||
const int pos = m.id2pos( F_DATACAMBIO1);
|
const int pos = m.id2pos( F_DATACAMBIO1);
|
||||||
|
|
||||||
if (pos >= 0 && m.fld(pos).active())
|
if (pos >= 0 && m.fld(pos).active())
|
||||||
|
{
|
||||||
m.fld(pos).set(data_doc);
|
m.fld(pos).set(data_doc);
|
||||||
|
m.fld(pos).dirty();
|
||||||
|
}
|
||||||
m.disable(DLG_PRINT);
|
m.disable(DLG_PRINT);
|
||||||
_occas_mask->reset( );
|
_occas_mask->reset( );
|
||||||
const int ndefaults = pro( ).get_int( "NDEFAULTS", "DEFAULT" ); // prof
|
const int ndefaults = pro( ).get_int( "NDEFAULTS", "DEFAULT" ); // prof
|
||||||
@ -243,14 +246,34 @@ bool TMotore_application::elabora_handler( TMask_field& f, KEY key )
|
|||||||
{
|
{
|
||||||
if (key == K_SPACE)
|
if (key == K_SPACE)
|
||||||
{
|
{
|
||||||
|
#ifndef DBG
|
||||||
return message_box("Funzione in fase di implementazione");
|
return message_box("Funzione in fase di implementazione");
|
||||||
|
#endif
|
||||||
TString_array elabs;
|
TString_array elabs;
|
||||||
TMask & m = f.mask();
|
TMask & m = f.mask();
|
||||||
const TString16 tipo(m.get(F_TIPODOC));
|
const TString16 tipo(m.get(F_TIPODOC));
|
||||||
const TString16 stato(m.get(F_STATO));
|
const TString16 stato(m.get(F_STATO));
|
||||||
TLista_elaborazioni & elab = app().elab();
|
TLista_elaborazioni & elab = app().elab();
|
||||||
|
|
||||||
elab.select(elabs, TRUE, m.insert_mode(), NULL, NULL, tipo, stato);
|
const int items = elab.select(elabs, TRUE, m.insert_mode(), NULL, NULL, tipo, stato);
|
||||||
|
if (items == 0)
|
||||||
|
return message_box("Non ci sono elaborazioni attive per questo documento");
|
||||||
|
int selected = 0;
|
||||||
|
if (items > 1)
|
||||||
|
{
|
||||||
|
TMask selection("ve0100b");
|
||||||
|
TList_field & f = (TList_field &) selection.field(F_SELECT);
|
||||||
|
|
||||||
|
for (int i = 0; i < items; i++)
|
||||||
|
f.add_item(format("%d|%s", i, (const char *)elab[elabs.row(i)].descrizione()));
|
||||||
|
|
||||||
|
if (selection.run() == K_ENTER)
|
||||||
|
selected = atoi(selection.get(F_SELECT));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
selected = 1;
|
||||||
|
if (selected > 0)
|
||||||
|
TElaborazione & e = elab[elabs.row(selected)];
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -510,7 +533,7 @@ TMask* TMotore_application::get_mask( int mode )
|
|||||||
{
|
{
|
||||||
const TString & header = l.name(i);
|
const TString & header = l.name(i);
|
||||||
const int len = header.len() + 1;
|
const int len = header.len() + 1;
|
||||||
const int f_len = l.code_lenght(i);
|
const int f_len = l.code_length(i);
|
||||||
_doc->set_liv_giac_len(i, f_len);
|
_doc->set_liv_giac_len(i, f_len);
|
||||||
|
|
||||||
_sheet->set_column_header(pos, l.name(i));
|
_sheet->set_column_header(pos, l.name(i));
|
||||||
|
@ -47,8 +47,8 @@ int TDocisamfile::readat(TRecnotype nrec, word lockop)
|
|||||||
_doc->summary_filter(1);
|
_doc->summary_filter(1);
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
//return err == NOERR ? _doc->read(curr()) : err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class TRDocisamfile : public TLocalisamfile
|
class TRDocisamfile : public TLocalisamfile
|
||||||
{
|
{
|
||||||
TDocumento *_doc;
|
TDocumento *_doc;
|
||||||
@ -76,7 +76,8 @@ class TDocumento_form : public TForm
|
|||||||
TRelation &_firmrel; // relazione di gestione dei dati della ditta corrente
|
TRelation &_firmrel; // relazione di gestione dei dati della ditta corrente
|
||||||
TString _module; // codice del modulo di carta associato a questo al form
|
TString _module; // codice del modulo di carta associato a questo al form
|
||||||
TCond_vendita * _condv;
|
TCond_vendita * _condv;
|
||||||
TString_array _exclude_array; // array di coppie tipo/articolo da escludere dalla stampa
|
TString_array _exclude_array_t; // array di tipi riga da escludere dalla stampa
|
||||||
|
TString_array _exclude_array_a; // array di articoli da escludere dalla stampa
|
||||||
TDocumentoEsteso * _doc; // Documento da stampare
|
TDocumentoEsteso * _doc; // Documento da stampare
|
||||||
bool _valid, _cli_loaded; // flag che indica se il form e' valido | se l'oggetto cliente è già stato caricato
|
bool _valid, _cli_loaded; // flag che indica se il form e' valido | se l'oggetto cliente è già stato caricato
|
||||||
bool _is_lista; // flag che indica se il form e' usato per la stampa della lista documenti
|
bool _is_lista; // flag che indica se il form e' usato per la stampa della lista documenti
|
||||||
@ -116,7 +117,8 @@ public:
|
|||||||
bool doc_arrange();
|
bool doc_arrange();
|
||||||
int ncopie() { return _doc->tipo().ncopie(); }
|
int ncopie() { return _doc->tipo().ncopie(); }
|
||||||
const TString &get_module_code() { return _module; } // ritorna il codice del modulo di carta
|
const TString &get_module_code() { return _module; } // ritorna il codice del modulo di carta
|
||||||
TString_array & exclude_list() { return _exclude_array; }
|
TString_array & exclude_list_t() { return _exclude_array_t; }
|
||||||
|
TString_array & exclude_list_a() { return _exclude_array_a; }
|
||||||
TDocumentoEsteso& doc() { return *_doc; }
|
TDocumentoEsteso& doc() { return *_doc; }
|
||||||
TDocumento_form(TRectype&/*TDocumentoEsteso **/ doc, TRelation& rel, const bool definitiva, const bool interattivo);
|
TDocumento_form(TRectype&/*TDocumentoEsteso **/ doc, TRelation& rel, const bool definitiva, const bool interattivo);
|
||||||
TDocumento_form(const char* form, TRelation& rel);
|
TDocumento_form(const char* form, TRelation& rel);
|
||||||
@ -133,20 +135,21 @@ TDocumento_form::TDocumento_form(TRectype&/*TDocumentoEsteso**/ doc, TRelation&
|
|||||||
_tip = new TTable("%TIP");
|
_tip = new TTable("%TIP");
|
||||||
_tab = new TLocalisamfile(LF_TAB);
|
_tab = new TLocalisamfile(LF_TAB);
|
||||||
TString nomeform;
|
TString nomeform;
|
||||||
TFilename profilo;
|
// TFilename profilo;
|
||||||
TString codnum(doc.get(DOC_CODNUM));
|
TString codnum(doc.get(DOC_CODNUM));
|
||||||
TString numdoc(doc.get(DOC_NDOC));
|
TString numdoc(doc.get(DOC_NDOC));
|
||||||
|
// modificare ??
|
||||||
_tip->put("CODTAB", doc.get(DOC_TIPODOC)); // posiziona la tabella dei tipi di documento
|
_tip->put("CODTAB", doc.get(DOC_TIPODOC)); // posiziona la tabella dei tipi di documento
|
||||||
int err=_tip->read(); // legge la tabella
|
int err=_tip->read(); // legge la tabella
|
||||||
if (err==NOERR)
|
if (err==NOERR)
|
||||||
{ // se non ci sono errori procede con la stampa
|
{ // se non ci sono errori procede con la stampa
|
||||||
nomeform= _tip->get("S5"); // legge il nome del form di stampa
|
nomeform= _tip->get("S5"); // legge il nome del form di stampa
|
||||||
profilo= _tip->get("S4"); // legge il nome del profilo di configurazione
|
TFilename test(nomeform); test.ext("frm");
|
||||||
profilo.ext("ini"); // aggiunge l'estensione al nome del file del profilo
|
// profilo= _tip->get("S4"); // legge il nome del profilo di configurazione
|
||||||
if (profilo.empty() || nomeform.empty())
|
// profilo.ext("ini"); // aggiunge l'estensione al nome del file del profilo
|
||||||
|
if (/* profilo.empty() || */ fexist(nomeform))
|
||||||
{
|
{
|
||||||
error_box("Nome profilo o form di stampa non valido nella tabella TIP");
|
error_box("Nome form di stampa (%s) non valido per il tipo documento %s ", (const char *) nomeform, (const char *) ((TDocumento &)doc).tipo().codice());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -381,24 +384,14 @@ void TDocumento_form::modify_pictures()
|
|||||||
bool TDocumento_form::print_on_body(int r)
|
bool TDocumento_form::print_on_body(int r)
|
||||||
{
|
{
|
||||||
TPrint_section& body = section('B');
|
TPrint_section& body = section('B');
|
||||||
|
|
||||||
TRiga_documento& riga = doc()[r];
|
TRiga_documento& riga = doc()[r];
|
||||||
|
const TString & tiporiga = riga.get(RDOC_TIPORIGA);
|
||||||
|
bool ok = _exclude_array_t.find(tiporiga) < 0;
|
||||||
|
|
||||||
TString tiporiga(riga.get(RDOC_TIPORIGA));
|
if (ok)
|
||||||
TString codart(riga.get(RDOC_CODART));
|
|
||||||
const int items = _exclude_array.items();
|
|
||||||
bool ok = TRUE;
|
|
||||||
|
|
||||||
for (int i = 0; i < items && ok; i++)
|
|
||||||
{
|
{
|
||||||
TToken_string& s=_exclude_array.row(i);
|
const TString & codart = riga.get(RDOC_CODART);
|
||||||
TString tr(s.get(0));
|
ok = _exclude_array_a.find(codart) < 0;
|
||||||
TString ar(s.get(1));
|
|
||||||
tr.trim();ar.trim();
|
|
||||||
if (tr.empty() && ar.empty()) continue;
|
|
||||||
if (tr.empty() && ar == codart) ok = FALSE;
|
|
||||||
else if (tr == tiporiga)
|
|
||||||
if (ar.empty() || (ar.not_empty() && ar == codart)) ok = FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
@ -447,7 +440,15 @@ void TDocumento_form::extended_parse_general(TScanner &scanner)
|
|||||||
if (scanner.key() == "EX")
|
if (scanner.key() == "EX")
|
||||||
{
|
{
|
||||||
TToken_string s(scanner.string(),',');
|
TToken_string s(scanner.string(),',');
|
||||||
_exclude_array.add(s);
|
const char * i = s.get();
|
||||||
|
if (i)
|
||||||
|
{
|
||||||
|
if (*i)
|
||||||
|
_exclude_array_t.add(i);
|
||||||
|
i = s.get();
|
||||||
|
if (i && *i)
|
||||||
|
_exclude_array_a.add(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -719,7 +720,8 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
return (TRUE);
|
return (TRUE);
|
||||||
} // fine _CLIENTE
|
} // fine _CLIENTE
|
||||||
|
|
||||||
if (code == "_DESCRIGA") {
|
if (code == "_DESCRIGA")
|
||||||
|
{
|
||||||
// Messaggio per reperire la descrizione estesa sulle righe del documento
|
// Messaggio per reperire la descrizione estesa sulle righe del documento
|
||||||
TLocalisamfile &rdoc= (cursor())->file(LF_RIGHEDOC);
|
TLocalisamfile &rdoc= (cursor())->file(LF_RIGHEDOC);
|
||||||
TString descrizione = rdoc.get("DESCR");
|
TString descrizione = rdoc.get("DESCR");
|
||||||
@ -735,7 +737,8 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
cf.section().set_height(cf.effective_height());
|
cf.section().set_height(cf.effective_height());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code== "_ALIGN") {
|
if (code== "_ALIGN")
|
||||||
|
{
|
||||||
// allineamento della posizione di un campo rispetto ad un altro
|
// allineamento della posizione di un campo rispetto ad un altro
|
||||||
// sintassi: _ALIGN,<campo form>[,<allineamento>][,<allineamento>...]
|
// sintassi: _ALIGN,<campo form>[,<allineamento>][,<allineamento>...]
|
||||||
// dove: <campo form> è il campo della form (preceduto da '#') da cui prendere l'allineamento
|
// dove: <campo form> è il campo della form (preceduto da '#') da cui prendere l'allineamento
|
||||||
@ -801,7 +804,8 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
cf.put_paragraph(pg);
|
cf.put_paragraph(pg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code== "_RIEPILOGOIVA") {
|
if (code== "_RIEPILOGOIVA")
|
||||||
|
{
|
||||||
// tabella riepilogo aliquote iva e relative imposte
|
// tabella riepilogo aliquote iva e relative imposte
|
||||||
// sintassi: _RIEPILOGOIVA,<selettore>,<macro>,<cambio codice>
|
// sintassi: _RIEPILOGOIVA,<selettore>,<macro>,<cambio codice>
|
||||||
// dove: <selettore> è uno dei seguenti:
|
// dove: <selettore> è uno dei seguenti:
|
||||||
@ -872,7 +876,8 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
return (TRUE);
|
return (TRUE);
|
||||||
} // fine _TOTIMPONIBILI
|
} // fine _TOTIMPONIBILI
|
||||||
|
|
||||||
if (code== "_SCADENZE") {
|
if (code== "_SCADENZE")
|
||||||
|
{
|
||||||
// messaggio per stampare le scadenze
|
// messaggio per stampare le scadenze
|
||||||
// sintassi: _SCADENZE,<macro>,<cambio codice>
|
// sintassi: _SCADENZE,<macro>,<cambio codice>
|
||||||
// dove <macro> e' uno dei seguenti:
|
// dove <macro> e' uno dei seguenti:
|
||||||
|
@ -206,7 +206,7 @@ public:
|
|||||||
|
|
||||||
class TTipo_documento : public TRectype // velib03
|
class TTipo_documento : public TRectype // velib03
|
||||||
{
|
{
|
||||||
enum { _altro, _fattura, _bolla, _ordine};
|
enum { _altro, _bolla, _fattura, _ordine};
|
||||||
|
|
||||||
static TAssoc_array _formule_documento;
|
static TAssoc_array _formule_documento;
|
||||||
TToken_string _formule;
|
TToken_string _formule;
|
||||||
@ -707,6 +707,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
const TString& codice() const { return get("CODTAB"); }
|
const TString& codice() const { return get("CODTAB"); }
|
||||||
|
const TString& descrizione() const { return get("S0"); }
|
||||||
const TTipo_elaborazione tipo() const { return (TTipo_elaborazione) get_int("I0"); }
|
const TTipo_elaborazione tipo() const { return (TTipo_elaborazione) get_int("I0"); }
|
||||||
|
|
||||||
bool doc_uguale(int u) const { return get("S1")[u] == 'X'; }
|
bool doc_uguale(int u) const { return get("S1")[u] == 'X'; }
|
||||||
|
@ -857,7 +857,7 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
|
|||||||
for (int i = rows; i > 0; i--)
|
for (int i = rows; i > 0; i--)
|
||||||
{
|
{
|
||||||
TRiga_documento & r = myself.row(i);
|
TRiga_documento & r = myself.row(i);
|
||||||
if (!r.is_checked())
|
if ((r.is_merce() || r.is_omaggio()) && !r.is_checked())
|
||||||
{
|
{
|
||||||
const TString & codart = r.get("CODART");
|
const TString & codart = r.get("CODART");
|
||||||
anamag.put("CODART", codart);
|
anamag.put("CODART", codart);
|
||||||
|
@ -29,7 +29,7 @@ TGenerazione_effetti::TGenerazione_effetti(const char* cod)
|
|||||||
|
|
||||||
_docfile = new TLocalisamfile(LF_DOC);
|
_docfile = new TLocalisamfile(LF_DOC);
|
||||||
_rdocfile = new TLocalisamfile(LF_RIGHEDOC);
|
_rdocfile = new TLocalisamfile(LF_RIGHEDOC);
|
||||||
_cessfile = new TLocalisamfile(LF_CESS);
|
// _cessfile = new TLocalisamfile(LF_CESS);
|
||||||
_occas = new TLocalisamfile(LF_OCCAS);
|
_occas = new TLocalisamfile(LF_OCCAS);
|
||||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
_clifo = new TLocalisamfile(LF_CLIFO);
|
||||||
_cfven = new TLocalisamfile(LF_CFVEN);
|
_cfven = new TLocalisamfile(LF_CFVEN);
|
||||||
@ -50,7 +50,7 @@ TGenerazione_effetti::TGenerazione_effetti(const TRectype& rec)
|
|||||||
_valid_array.reset(9); // bonifici
|
_valid_array.reset(9); // bonifici
|
||||||
_docfile = new TLocalisamfile(LF_DOC);
|
_docfile = new TLocalisamfile(LF_DOC);
|
||||||
_rdocfile = new TLocalisamfile(LF_RIGHEDOC);
|
_rdocfile = new TLocalisamfile(LF_RIGHEDOC);
|
||||||
_cessfile = new TLocalisamfile(LF_CESS);
|
// _cessfile = new TLocalisamfile(LF_CESS);
|
||||||
_occas = new TLocalisamfile(LF_OCCAS);
|
_occas = new TLocalisamfile(LF_OCCAS);
|
||||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
_clifo = new TLocalisamfile(LF_CLIFO);
|
||||||
_cfven = new TLocalisamfile(LF_CFVEN);
|
_cfven = new TLocalisamfile(LF_CFVEN);
|
||||||
@ -64,7 +64,7 @@ TGenerazione_effetti::~TGenerazione_effetti()
|
|||||||
{
|
{
|
||||||
delete _docfile;
|
delete _docfile;
|
||||||
delete _rdocfile;
|
delete _rdocfile;
|
||||||
delete _cessfile;
|
// delete _cessfile;
|
||||||
delete _occas;
|
delete _occas;
|
||||||
delete _clifo;
|
delete _clifo;
|
||||||
delete _cfven;
|
delete _cfven;
|
||||||
|
@ -83,4 +83,6 @@
|
|||||||
#define F_CODLIST1 203
|
#define F_CODLIST1 203
|
||||||
#define F_CODCONT1 204
|
#define F_CODCONT1 204
|
||||||
#define F_CODZON 205
|
#define F_CODZON 205
|
||||||
|
|
||||||
|
#define F_SELECT 101
|
||||||
#endif // veuml.h
|
#endif // veuml.h
|
||||||
|
Loading…
x
Reference in New Issue
Block a user