Patch level :4.0 / 10.0

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :corretti errori di riporto


git-svn-id: svn://10.65.10.50/trunk@16383 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2008-03-26 16:43:54 +00:00
parent fafc1c5993
commit 1c5d7fd097
6 changed files with 112 additions and 153 deletions

View File

@ -992,46 +992,45 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
arc = cache().get("%NUM", codnum, "B6").full(); arc = cache().get("%NUM", codnum, "B6").full();
} }
set_next_pdf(doc.get(DOC_ANNO).as_int(), doc.get(DOC_CODNUM).as_string(), set_next_pdf(doc.get(DOC_ANNO).as_int(), doc.get(DOC_CODNUM).as_string(),
doc.get(DOC_NDOC).as_int(), doc.get(DOC_NDOC).as_int(), doc.get(DOC_TIPOCF).as_string()[0],
doc.get(DOC_TIPOCF).as_string())[0],
doc.get(DOC_CODCF).as_int()); doc.get(DOC_CODCF).as_int());
const TString& tipodoc = doc.get(DOC_TIPODOC).as_string(); const TString& tipodoc = doc.get(DOC_TIPODOC).as_string();
const TTipo_documento& tipo = _tipi_cache.tipo(tipodoc); const TTipo_documento& tipo = _tipi_cache.tipo(tipodoc);
const TString8 codprof(tipo.main_print_profile()); 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();
if (codprof.full()) profilo.ext("rep");
if (profilo.custom_path()) // Tenta di costruirsi il nome del report
{ {
TFilename profilo(codprof); profilo.ext("rep"); int copies = _msk->get_int(F_NCOPIE);
if (copies <= 0 && is_definitive)
copies = tipo.ncopie();
if (copies <= 0)
copies = 1;
if (profilo.custom_path()) // Tenta di costruirsi il nome del report TReport_doc& report = reports.get(profilo);
if (send_mail)
{ {
int copies = _msk->get_int(F_NCOPIE); mail_book = new TDoc_book;
if (copies <= 0 && is_definitive) if (!report.print(doc, *mail_book, is_definitive, 1, true, arc))
copies = tipo.ncopie(); break;
if (copies <= 0) TString mesg(TDocumento::tipo(doc.get(DOC_TIPODOC).as_string()).descrizione());
copies = 1;
TReport_doc& report = reports.get(profilo); mesg << " n. " << doc.get(DOC_NDOC).as_int() << " a " << get_mail_address();
log.log(0, mesg);
if (send_mail) }
{ else
mail_book = new TDoc_book; {
if (!report.print(doc, *mail_book, is_definitive, 1, true, arc)) if (!report.print(doc, book, is_definitive, copies, true, arc))
break; break;
TString mesg(TDocumento::tipo(doc.get(DOC_TIPODOC).as_string()).descrizione()); }
} //if(profilo.custom_path()...
mesg << " n. " << doc.get(DOC_NDOC).as_int() << " a " << get_mail_address();
log.log(0, mesg);
}
else
if (!report.print(doc, book, is_definitive, copies, true, arc))
break;
}
else else
{ {
TString msg; msg << TR("Report inesistente") << " : " << codprof; TString msg; msg << TR("Report inesistente") << " : " << profilo;
statbar_set_title(TASK_WIN, msg); statbar_set_title(TASK_WIN, msg);
beep(2); beep(2);
@ -1039,11 +1038,10 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
} }
// Stampa eventuali allegati // Stampa eventuali allegati
const TString8 codalleg = tipo.additional_print_profile(); tipo.additional_print_profile(profilo);
if (codalleg.full()) if (profilo.full())
{ {
TFilename profilo(codalleg); profilo.ext("rep"); profilo.ext("rep");
if (profilo.custom_path()) if (profilo.custom_path())
{ {
int copies = tipo.additional_ncopie(); int copies = tipo.additional_ncopie();
@ -1051,7 +1049,11 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
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) _codnum = codalleg; if (arc)
{
_codnum = profilo.name();
_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);
@ -1060,10 +1062,11 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
} }
else else
{ {
TString msg; msg << TR("Report allegato inesistente") << " : " << codalleg; TString msg; msg << TR("Report allegato inesistente") << " : " << profilo;
statbar_set_title(TASK_WIN, msg); statbar_set_title(TASK_WIN, msg);
} }
} }
if (mail_book != NULL) if (mail_book != NULL)
{ {
if (mail_book->pages() > 0) if (mail_book->pages() > 0)

View File

@ -20,7 +20,6 @@ int main( int argc, char** argv )
ve7300(argc, argv); break; // stampa riepilogo entrate fornitori ve7300(argc, argv); break; // stampa riepilogo entrate fornitori
case 1: case 1:
ve7200(argc, argv); break; // stampa flussi di cassa per white sun ve7200(argc, argv); break; // stampa flussi di cassa per white sun
case 0:
default: default:
ve7100(argc, argv); break; // trasferimento documenti Team System ve7100(argc, argv); break; // trasferimento documenti Team System
} }

View File

@ -399,23 +399,6 @@ bool TTipo_documento::scarica_residuo() const
return get_bool("B4"); return get_bool("B4");
} }
const TString& TTipo_documento::main_print_profile() const
{
TString& tmp = get_tmp_string();
tmp = get("S5");
tmp.cut(8); tmp.rtrim();
return tmp;
}
const TString& TTipo_documento::additional_print_profile() const
{
TString& tmp = get_tmp_string();
tmp = get("S5");
tmp.ltrim(8); tmp.rtrim();
return tmp;
}
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// Espressione documento // Espressione documento

View File

@ -1121,7 +1121,6 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
// reperisce la descrizione dal tipo documento e la completa con la data documento ed il // reperisce la descrizione dal tipo documento e la completa con la data documento ed il
// numero documento // numero documento
TString descr; doc.riferimento(descr); TString descr; doc.riferimento(descr);
const TTipo_documento& tipo = doc.tipo();
if (descr.empty()) descr = tipo.descrizione(); if (descr.empty()) descr = tipo.descrizione();

View File

@ -223,7 +223,7 @@ TDocumento_mask::TDocumento_mask(const char* td)
} }
else else
{ {
hide(F_CODCONT); hide(F_CODCONT);
hide(F_CODCONT1); hide(F_CODCONT1);
} }
@ -261,12 +261,8 @@ TDocumento_mask::TDocumento_mask(const char* td)
FOR_EACH_MASK_FIELD((*this), j, f) FOR_EACH_MASK_FIELD((*this), j, f)
{ {
const TMask_field& f = fld(i); if (f->dlg() > BASE_PIEDE)
_calculated_pages.set(f->page());
const int p = f.page();
if (f.dlg() > BASE_PIEDE)
_calculated_pages.set(p);
} }
} }
@ -1299,9 +1295,9 @@ bool TDocumento_mask::ss_handler(TMask_field& f, KEY key)
if (key == K_ENTER && f.mask().insert_mode()) if (key == K_ENTER && f.mask().insert_mode())
{ {
TSheet_field& ss = (TSheet_field&)f; TSheet_field& ss = (TSheet_field&)f;
if (!app().is_transaction() && ss.empty() if (!app().is_transaction() && ss.empty())
ok = yesno_box("Il documento e' privo di righe:\n" ok = yesno_box(TR("Il documento e' privo di righe:\n"
"Si desidera continuare ugualmente?"); "Si desidera continuare ugualmente?"));
} }
return ok; return ok;
} }
@ -1347,12 +1343,12 @@ bool TDocumento_mask::ss_notify( TSheet_field& ss, int r, KEY key )
m.update_progs(); m.update_progs();
} }
break; break;
case K_INS: // Inserimento case K_INS: // Inserimento
{ {
if (r < doc.rows()) if (r < doc.rows())
{ {
TRiga_documento & riga = doc[r + 1]; TRiga_documento & riga = doc[r + 1];
if (riga.is_omaggio() && riga.is_generata()) if (riga.is_omaggio() && riga.is_generata())
{ {
const bool enabled = ss.cell_enabled(r, 0); const bool enabled = ss.cell_enabled(r, 0);
@ -1363,48 +1359,49 @@ bool TDocumento_mask::ss_notify( TSheet_field& ss, int r, KEY key )
if (!enabled) ss.disable_row(r); if (!enabled) ss.disable_row(r);
ss.force_update(r); ss.force_update(r);
return false; return false;
} }
} }
doc.insert_row(r + 1, m.get( F_LBTIPORIGA )); doc.insert_row(r + 1, m.get( F_LBTIPORIGA ));
} }
break; break;
case K_CTRL + K_INS: case K_CTRL + K_INS:
{ {
TRiga_documento & riga = doc[r + 1]; TRiga_documento & riga = doc[r + 1];
TRectype & ven_rec = doc.clifor().vendite(); TRectype & ven_rec = doc.clifor().vendite();
TString8 s(ven_rec.get(CFV_CODMAG)); TString8 s(ven_rec.get(CFV_CODMAG));
const TTipo_riga_documento & t = riga.tipo(); const TTipo_riga_documento & t = riga.tipo();
if (s.full()) if (s.full())
{ {
s.left_just(3); s.left_just(3);
s << ven_rec.get(CFV_CODDEP); s << ven_rec.get(CFV_CODDEP);
} }
else
{
s = m.get(F_CAUSMAG);
if (s.full())
{
const TRectype & c=cache().get("%CAU", s);
if (!c.empty() && c.get_char("S10") > ' ') // Ignora magazzini non validi
s = c.get("S10");
else else
{ {
s = m.get(F_CAUSMAG); s = m._std_mag;
if (s.full()) s.left_just(3);
{ s << m._std_dep;
const TRectype & c=cache().get("%CAU", s);
if (!c.empty() && c.get_char("S10") > ' ') // Ignora magazzini non validi
s = c.get("S10");
else
{
s = m._std_mag;
s.left_just(3);
s << m._std_dep;
}
}
} }
if (s.full())
riga.put("CODMAG", s);
riga.autoload(ss);
ss.check_row(r);
t.set_defaults(ss, r + 1);
} }
break; }
case K_TAB: // ingresso nella riga if (s.full())
if (!selecting && m.is_running()) riga.put("CODMAG", s);
riga.autoload(ss);
ss.check_row(r);
t.set_defaults(ss, r + 1);
}
break;
case K_TAB: // ingresso nella riga
if (!selecting && m.is_running())
{ {
m.update_giacenza(); m.update_giacenza();
const TRectype& rdoc = doc[r + 1]; const TRectype& rdoc = doc[r + 1];
@ -1412,16 +1409,16 @@ bool TDocumento_mask::ss_notify( TSheet_field& ss, int r, KEY key )
const bool on = rdoc.get(RDOC_DACODNUM).not_empty(); const bool on = rdoc.get(RDOC_DACODNUM).not_empty();
ss.sheet_mask().enable(DLG_USER, on); ss.sheet_mask().enable(DLG_USER, on);
if (rdoc.get(RDOC_CODART).empty() && rdoc.get(RDOC_DESCR).empty()) if (rdoc.get(RDOC_CODART).empty() && rdoc.get(RDOC_DESCR).empty())
{ {
selecting = true; // semaforo per impedire l'evento di selezione doppio selecting = true; // semaforo per impedire l'evento di selezione doppio
ss.select(r, 1, false); ss.select(r, 1, false);
selecting = false; selecting = false;
} }
} }
break; break;
default: default:
break; break;
} }
return true; return true;
} }
@ -1482,11 +1479,8 @@ bool TDocumento_mask::occas_handler( TMask_field& f, KEY key )
TMask occas_mask("ve0100o"); TMask occas_mask("ve0100o");
occas_mask.set_handler(O_CODICE, occas_code_handler ); occas_mask.set_handler(O_CODICE, occas_code_handler );
occas_mask.set_handler(O_COFI, occas_cfpi_handler ); occas_mask.set_handler(O_COFI, occas_cfpi_handler );
occas_mask.set_handler(O_PAIV, occas_cfpi_handler ); occas_mask.set_handler(O_PAIV, occas_cfpi_handler );
TMask occas_mask("ve0100o");
occas_mask.set_handler( O_CODICE, occas_code_handler );
for (int i = occas_mask.fields() - 1; i >= 0; i--) for (int i = occas_mask.fields() - 1; i >= 0; i--)
{ {
@ -2495,6 +2489,7 @@ bool TElabora_mask::elabora()
else else
d.zero(DOC_CAUSMAG); d.zero(DOC_CAUSMAG);
} }
in.add(app_doc); in.add(app_doc);
out.add(d); out.add(d);
if (e->elabora(in, out, TDate(TODAY), TRUE)) if (e->elabora(in, out, TDate(TODAY), TRUE))
@ -2523,33 +2518,12 @@ bool TElabora_mask::elabora()
{ {
TDocumento* d = new TDocumento(provv, anno, codnum, ndoc); TDocumento* d = new TDocumento(provv, anno, codnum, ndoc);
if (numdoc <= 0) in.add(d);
{
TDocumento::copy_data(d.head(), app_doc.head());
d.put(DOC_TIPODOC, get(F_TIPODOC_ELAB));
d.put(DOC_STATO, get(F_STATODOC_ELAB));
const TDate datadoc = d.get_date(DOC_DATADOC);
const TDate datainsc = d.get_date(DOC_DATAINSC);
const bool equal = !datainsc.ok() || datadoc == datainsc;
d.put(DOC_DATADOC, get(F_DATADOC_ELAB));
if (equal)
d.zero(DOC_DATAINSC);
const TTipo_documento & t = d.tipo();
if (t.mov_mag())
d.put(DOC_CAUSMAG, t.caus_mov());
else
d.zero(DOC_CAUSMAG);
}
in.add(d);
} }
if (update_header) if (update_header)
{ {
const TString16 tipo_doc(app_doc.get(DOC_TIPODOC)); const TString4 tipo_doc(app_doc.get(DOC_TIPODOC));
const TString16 caus_mag(app_doc.get(DOC_CAUSMAG)); const TString8 caus_mag(app_doc.get(DOC_CAUSMAG));
const long movmag = app_doc.get_long(DOC_MOVMAG); const long movmag = app_doc.get_long(DOC_MOVMAG);
const TDate datadoc = app_doc.get_date(DOC_DATADOC); const TDate datadoc = app_doc.get_date(DOC_DATADOC);
const TDate datainsc = app_doc.get_date(DOC_DATAINSC); const TDate datainsc = app_doc.get_date(DOC_DATAINSC);

View File

@ -9,6 +9,7 @@
#include "sconti.h" #include "sconti.h"
#include "veini.h" #include "veini.h"
#include "vepriv.h"
#include "verig.h" #include "verig.h"
#include "veuml1.h" #include "veuml1.h"
#include "veini.h" #include "veini.h"
@ -365,17 +366,17 @@ void row_set_handler( TMask& m, const int field, const int index )
case 2: case 2:
m.set_handler( field, dummy_hndl ); m.set_handler( field, dummy_hndl );
break; break;
case 3: case 3:
if (field == FR_CODART) if (field == FR_CODART)
m.set_handler( field, search_price_handler ); m.set_handler( field, search_price_handler );
case 4: break;
case 4:
if (field == FR_CODART) if (field == FR_CODART)
m.set_handler( field, find_price_handler ); m.set_handler( field, find_price_handler );
break; break;
default:
break;
default: default:
yesnofatal_box( false, "Funzione di handler sulla riga non definita( %d ).", index ); yesnofatal_box( false, "Funzione di handler sulla riga non definita( %d ).", index );
break;
} }