Patch level : NO PATCH

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@20018 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca83 2010-01-29 10:19:33 +00:00
parent c308d5af28
commit c4abf9b089

View File

@ -948,24 +948,41 @@ bool TGenera_documenti_app::transfer()
if (_msk->get_bool(F_STAMPA)) if (_msk->get_bool(F_STAMPA))
{ {
//preparo il pezzo fisso della linea di comando per richiamare la stampa dei documenti TFilename tmp;
TDoc_key kd(documenti.get_hashobj()->key()); tmp.temp("", "ini");
const TString4 codnum = kd.codnum();
const int anno = kd.anno();
const char provv = kd.provv();
TDoc_key& dk1 = *(TDoc_key*)documenti.first_item(); // Ensure that the ofstream is well closed before ve1 call
const int dandoc = dk1.ndoc(); if (tmp.full()) // dummy test
{
TDoc_key kd(documenti.get_hashobj()->key());
TString16 chiavedoc; // Parte della chiave comune a tutti i documenti
chiavedoc << kd.provv() << '|' << kd.anno() << '|' << kd.codnum() << '|';
TDoc_key& dk2 = *(TDoc_key*)documenti.last_item(); ofstream outf(tmp);
const int andoc = dk2.ndoc(); outf << "[Transaction]" << endl; // Transaction header
outf << "Action=S" << endl; // 'S'tampa o 'A'nteprima
outf << "Mode=D" << endl; // Definitive (always?)
outf << "NoPrintDlg=X" << endl; // Dont' prompt the user with the print dialog
outf << endl;
outf << "[33]" << endl; // Transaction body
long nx = 0; // Document counter
FOR_EACH_ASSOC_OBJECT(documenti, obj, r, riga)
{
TDoc_key& kdoc = *(TDoc_key*)riga;
outf << "Doc(" << (nx++) << ")=";
int cazzone = kdoc.ndoc();
outf << chiavedoc << kdoc.ndoc() << endl;
}
}
//lancia la stampa dei documenti ve1 -2 da documento a documento if (tmp.exist())
TString80 str; {
str << "ve1 -2 " << codnum << ' ' << anno << ' ' << provv << ' ' << dandoc << '-' << andoc << " S D"; TString cmdline; cmdline << "ve1 -2 -i" << tmp;
TExternal_app app(cmdline);
TExternal_app stampa(str); app.run();
stampa.run(); tmp.fremove();
}
} }
if (adata < TODAY && _msk->get_int(F_TPGEN) == 0) if (adata < TODAY && _msk->get_int(F_TPGEN) == 0)