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:
parent
a433b8844a
commit
1fdda00f00
@ -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();
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ TDocumento_form::TDocumento_form(TRectype& doc, TRelation& rel, bool definitiva,
|
|||||||
const TString4 tipodoc(doc.get(DOC_TIPODOC));
|
const TString4 tipodoc(doc.get(DOC_TIPODOC));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
TFilename nomeform;
|
TFilename nomeform;
|
||||||
const TTipo_documento & tipo = cached_tipodoc(tipodoc);
|
const TTipo_documento& tipo = cached_tipodoc(tipodoc);
|
||||||
|
|
||||||
if (tipo.empty())
|
if (tipo.empty())
|
||||||
{
|
{
|
||||||
@ -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,40 +1029,29 @@ 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");
|
int copies = tipo.additional_ncopie();
|
||||||
if (profilo.custom_path())
|
if (copies <= 0) copies = 1;
|
||||||
{
|
|
||||||
int copies = tipo.additional_ncopie();
|
|
||||||
if (copies <= 0) copies = 1;
|
|
||||||
|
|
||||||
TReport_doc& allegato = reports.get(profilo);
|
TReport_doc& allegato = reports.get(profilo);
|
||||||
// Cambio _codnum per non sovrascrivere il pdf precedente
|
// Cambio _codnum per non sovrascrivere il pdf precedente
|
||||||
if (arc)
|
if (arc)
|
||||||
{
|
{
|
||||||
_codnum = profilo.name();
|
_codnum = profilo.name();
|
||||||
_codnum = _codnum.before(".");
|
_codnum = _codnum.before(".");
|
||||||
}
|
}
|
||||||
// Il flag di definitvo deve essere false altrimenti riaggiorna lo stato e ristampa i documenti allegati
|
// Il flag di definitvo deve essere false altrimenti riaggiorna lo stato e ristampa i documenti allegati
|
||||||
if (send_mail)
|
if (send_mail)
|
||||||
allegato.print(doc, *mail_book, false, 1, false, arc);
|
allegato.print(doc, *mail_book, false, 1, false, arc);
|
||||||
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)
|
||||||
{
|
{
|
||||||
report = base;
|
ok = false;
|
||||||
report.ext("rep");
|
if (filter != 1)
|
||||||
ok = report.custom_path();
|
{
|
||||||
if (!ok)
|
report = base;
|
||||||
|
report.ext("rep");
|
||||||
|
ok = report.custom_path();
|
||||||
|
}
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
report = base;
|
ok = false;
|
||||||
report.ext("rep");
|
if (filter != 1) // Non voglio i soli frm
|
||||||
ok = report.custom_path();
|
{
|
||||||
if (!ok)
|
report = base;
|
||||||
|
report.ext("rep");
|
||||||
|
ok = report.custom_path();
|
||||||
|
}
|
||||||
|
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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user