Patch level : 2.1 nopatch
Files correlati : ve1.exe Ricompilazione Demo : [ ] Commento : Corretto errore 17 Non funziona la possibilità di poter, attraverso l'istruzione di EXCLUDE"02,BO" esclude dalla stampa tutte le righe 02 che ho inserito e non solo quelle che hanno come codice BO Serve per costruire meglio il programma di stampa documenti git-svn-id: svn://10.65.10.50/trunk@11891 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
43d034e447
commit
c02ff3d796
@ -3,6 +3,7 @@
|
|||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
@ -11,6 +12,7 @@
|
|||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
|
#include <strings.h>
|
||||||
|
|
||||||
#include "velib.h"
|
#include "velib.h"
|
||||||
#include "sconti.h"
|
#include "sconti.h"
|
||||||
@ -90,8 +92,7 @@ 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
|
||||||
|
|
||||||
TString_array _exclude_array_t; // array di tipi riga da escludere dalla stampa
|
TString_array _exclude_array; // array di tipi riga e articoli 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
|
||||||
TAssoc_array _doc_totals; // Assocarray per codice numerazione contenente i totali nel caso di stampa lista documenti
|
TAssoc_array _doc_totals; // Assocarray per codice numerazione contenente i totali nel caso di stampa lista documenti
|
||||||
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
|
||||||
@ -135,8 +136,7 @@ public:
|
|||||||
bool doc_arrange();
|
bool doc_arrange();
|
||||||
int ncopie() const { return _doc->tipo().ncopie(); }
|
int ncopie() const { return _doc->tipo().ncopie(); }
|
||||||
const TString &get_module_code() const { return _module; } // ritorna il codice del modulo di carta
|
const TString &get_module_code() const { return _module; } // ritorna il codice del modulo di carta
|
||||||
TString_array& exclude_list_t() { return _exclude_array_t; }
|
TString_array& exclude_list() { return _exclude_array; }
|
||||||
TString_array& exclude_list_a() { return _exclude_array_a; }
|
|
||||||
|
|
||||||
TDocumentoEsteso& doc() { return *_doc; }
|
TDocumentoEsteso& doc() { return *_doc; }
|
||||||
void set_doc_ext(TRectype* doc);
|
void set_doc_ext(TRectype* doc);
|
||||||
@ -540,15 +540,29 @@ 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);
|
const TString & tiporiga = riga.get(RDOC_TIPORIGA);
|
||||||
bool ok = _exclude_array_t.find(tiporiga) < 0;
|
bool ok = TRUE;
|
||||||
|
|
||||||
if (ok)
|
|
||||||
{
|
|
||||||
const TString & codart = riga.get(RDOC_CODART);
|
|
||||||
ok = _exclude_array_a.find(codart) < 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ok)
|
FOR_EACH_ARRAY_ROW(_exclude_array, i, row)
|
||||||
|
{
|
||||||
|
if (row->starts_with(tiporiga))
|
||||||
|
{
|
||||||
|
const int pos = row->find(',');
|
||||||
|
|
||||||
|
if (pos <= 0)
|
||||||
|
ok = FALSE;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const TString & codart = riga.get(RDOC_CODART);
|
||||||
|
const TString art_to_exclude(row->mid(pos+1));
|
||||||
|
|
||||||
|
ok = art_to_exclude.not_empty() && (art_to_exclude.find(codart) < 0);
|
||||||
|
}
|
||||||
|
if (!ok)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ok)
|
||||||
body.update(); // Crea la vera riga di stampa, eventuali allineamenti avverranno nella validate(), come al solito.
|
body.update(); // Crea la vera riga di stampa, eventuali allineamenti avverranno nella validate(), come al solito.
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
@ -595,15 +609,7 @@ 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(),',');
|
||||||
const char * i = s.get();
|
_exclude_array.add(s);
|
||||||
if (i)
|
|
||||||
{
|
|
||||||
if (*i)
|
|
||||||
_exclude_array_t.add(i);
|
|
||||||
i = s.get();
|
|
||||||
if (i && *i)
|
|
||||||
_exclude_array_a.add(i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user