Patch level : 10.0

Files correlati     : ve1.exe
Ricompilazione Demo : [ ]
Commento            :
Corretta stampa in duplice copia dei documenti, anche se non richiesta


git-svn-id: svn://10.65.10.50/trunk@17808 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-12-04 16:12:30 +00:00
parent a433b8844a
commit 1fdda00f00
6 changed files with 51 additions and 60 deletions

@ -933,7 +933,7 @@ void TMotore_application::print()
const TTipo_documento& tipo = doc.tipo(); const TTipo_documento& tipo = doc.tipo();
TFilename rep; TFilename rep;
if (tipo.main_print_profile(rep)) if (tipo.main_print_profile(rep, 0))
{ {
const bool da_stampare = doc.stampabile(); const bool da_stampare = doc.stampabile();

@ -186,9 +186,9 @@ TDocumento_form::TDocumento_form(TRectype& doc, TRelation& rel, bool definitiva,
if (tipo.printable()) if (tipo.printable())
{ // se non ci sono errori procede con la stampa { // se non ci sono errori procede con la stampa
if (aggiuntivo) if (aggiuntivo)
tipo.additional_print_profile(nomeform); tipo.additional_print_profile(nomeform, 1);
else else
tipo.main_print_profile(nomeform); // legge il nome del form di stampa tipo.main_print_profile(nomeform, 1); // legge il nome del form di stampa
nomeform.trim(); nomeform.trim();
TFilename test(nomeform); test.ext("frm"); TFilename test(nomeform); test.ext("frm");
@ -1446,13 +1446,11 @@ void TStampaDoc_application::print_selected()
extdoc.summary_reset(); extdoc.summary_reset();
extdoc.scadenze_reset(); extdoc.scadenze_reset();
const int ncopie2 = extdoc.tipo().get_int("I2");
// Stampa eventuali documenti allegati // Stampa eventuali documenti allegati
TFilename formagg; TFilename formagg;
// Se esiste un tipo documento da accodare
extdoc.tipo().additional_print_profile(formagg); if (ncopie2 > 0 && extdoc.tipo().additional_print_profile(formagg, 1))
const int ncopie2 = extdoc.tipo().get_int("I2");
if (!formagg.blank() && ncopie2 > 0) // Se esiste un tipo documento da accodare
{ {
TDocumento_form* secform = new TDocumento_form(cur.curr(), *_firmrel, _definitiva, _interattivo, true); TDocumento_form* secform = new TDocumento_form(cur.curr(), *_firmrel, _definitiva, _interattivo, true);
if (secform->valid()) if (secform->valid())

@ -997,12 +997,10 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
const TString& tipodoc = doc.get(DOC_TIPODOC).as_string(); const TString& tipodoc = doc.get(DOC_TIPODOC).as_string();
const TTipo_documento& tipo = cached_tipodoc(tipodoc); const TTipo_documento& tipo = cached_tipodoc(tipodoc);
TFilename profilo;
tipo.main_print_profile(profilo);
const bool send_mail = send_by_mail && get_mail_address().full(); const bool send_mail = send_by_mail && get_mail_address().full();
profilo.ext("rep"); TFilename profilo;
if (profilo.custom_path()) // Tenta di costruirsi il nome del report if (tipo.main_print_profile(profilo, 2)) // Tenta di costruirsi il nome del report
{ {
int copies = _msk->get_int(F_NCOPIE); int copies = _msk->get_int(F_NCOPIE);
if (copies <= 0 && is_definitive) if (copies <= 0 && is_definitive)
@ -1031,18 +1029,13 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
else else
{ {
TString msg; msg << TR("Report inesistente") << " : " << profilo; TString msg; msg << TR("Report inesistente") << " : " << profilo;
statbar_set_title(TASK_WIN, msg); statbar_set_title(TASK_WIN, msg);
beep(2); beep(2);
continue; continue;
} }
// Stampa eventuali allegati // Stampa eventuali allegati
tipo.additional_print_profile(profilo); if (tipo.additional_print_profile(profilo, 2))
if (profilo.full())
{
profilo.ext("rep");
if (profilo.custom_path())
{ {
int copies = tipo.additional_ncopie(); int copies = tipo.additional_ncopie();
if (copies <= 0) copies = 1; if (copies <= 0) copies = 1;
@ -1060,12 +1053,6 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
else else
allegato.print(doc, book, false, copies, false, arc); allegato.print(doc, book, false, copies, false, arc);
} }
else
{
TString msg; msg << TR("Report allegato inesistente") << " : " << profilo;
statbar_set_title(TASK_WIN, msg);
}
}
if (mail_book != NULL) if (mail_book != NULL)
{ {
@ -1122,7 +1109,6 @@ void TReport_doc_app::main_loop()
else else
{ {
KEY k; KEY k;
while ((k = _msk->run()) != K_QUIT) // Stampa interattiva while ((k = _msk->run()) != K_QUIT) // Stampa interattiva
print_selection(k != K_ENTER); print_selection(k != K_ENTER);
} }

@ -304,9 +304,9 @@ public:
bool stato_with_mov_mag(const char stato) const; bool stato_with_mov_mag(const char stato) const;
bool scarica_residuo() const; bool scarica_residuo() const;
bool clifo_optional() const { return get_bool("B5"); } bool clifo_optional() const { return get_bool("B5"); }
bool printable() const { return get("S5").not_empty(); } bool printable() const { return get("S5").full(); }
bool main_print_profile(TFilename& report) const; bool main_print_profile(TFilename& report, int filter) const;
bool additional_print_profile(TFilename& report) const; bool additional_print_profile(TFilename& report, int filter) const;
bool is_costo() const ; bool is_costo() const ;
bool is_ricavo() const ; bool is_ricavo() const ;
const TString & module() const { return _module; } const TString & module() const { return _module; }

@ -62,18 +62,21 @@ const TFilename& TTipo_documento::profile_name(TFilename& profile) const
return profile; return profile;
} }
bool TTipo_documento::main_print_profile(TFilename& report) const bool TTipo_documento::main_print_profile(TFilename& report, int filter) const
{ {
TString16 base = get("S5"); TString8 base = get("S5").left(8);
base.cut(8);
base.trim(); base.trim();
bool ok = base.not_empty(); bool ok = base.full();
if (ok) if (ok)
{
ok = false;
if (filter != 1)
{ {
report = base; report = base;
report.ext("rep"); report.ext("rep");
ok = report.custom_path(); ok = report.custom_path();
if (!ok) }
if (!ok && filter != 2)
{ {
report = base; report = base;
report.ext("frm"); report.ext("frm");
@ -83,17 +86,21 @@ bool TTipo_documento::main_print_profile(TFilename& report) const
return ok; return ok;
} }
bool TTipo_documento::additional_print_profile(TFilename& report) const bool TTipo_documento::additional_print_profile(TFilename& report, int filter) const
{ {
TString16 base = get("S5"); TString8 base = get("S5").mid(8, 8);
base.ltrim(8); base.rtrim(); base.trim();
bool ok = base.not_empty(); bool ok = base.full();
if (ok) if (ok)
{
ok = false;
if (filter != 1) // Non voglio i soli frm
{ {
report = base; report = base;
report.ext("rep"); report.ext("rep");
ok = report.custom_path(); ok = report.custom_path();
if (!ok) }
if (!ok && filter != 2) // Non voglio i soli rep
{ {
report = base; report = base;
report.ext("frm"); report.ext("frm");

@ -1039,7 +1039,7 @@ TVariable_mask* TDocumento_mask::riga_mask(int numriga)
const int pos = m->id2pos(FR_CODART); const int pos = m->id2pos(FR_CODART);
if (pos >= 0) if (pos >= 0)
{ {
const TMask_field & f = m->field(FR_CODART); const TMask_field & f = m->fld(pos);
if (f.is_edit()) if (f.is_edit())
{ {
TBrowse * browse = ((TEdit_field &) f).browse(); TBrowse * browse = ((TEdit_field &) f).browse();