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:
parent
fafc1c5993
commit
1c5d7fd097
@ -992,46 +992,45 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
|
||||
arc = cache().get("%NUM", codnum, "B6").full();
|
||||
}
|
||||
set_next_pdf(doc.get(DOC_ANNO).as_int(), doc.get(DOC_CODNUM).as_string(),
|
||||
doc.get(DOC_NDOC).as_int(),
|
||||
doc.get(DOC_TIPOCF).as_string())[0],
|
||||
doc.get(DOC_NDOC).as_int(), doc.get(DOC_TIPOCF).as_string()[0],
|
||||
doc.get(DOC_CODCF).as_int());
|
||||
|
||||
const TString& tipodoc = doc.get(DOC_TIPODOC).as_string();
|
||||
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();
|
||||
|
||||
if (codprof.full())
|
||||
{
|
||||
TFilename profilo(codprof); profilo.ext("rep");
|
||||
|
||||
if (profilo.custom_path()) // Tenta di costruirsi il nome del report
|
||||
{
|
||||
int copies = _msk->get_int(F_NCOPIE);
|
||||
if (copies <= 0 && is_definitive)
|
||||
copies = tipo.ncopie();
|
||||
if (copies <= 0)
|
||||
copies = 1;
|
||||
|
||||
TReport_doc& report = reports.get(profilo);
|
||||
|
||||
if (send_mail)
|
||||
{
|
||||
mail_book = new TDoc_book;
|
||||
if (!report.print(doc, *mail_book, is_definitive, 1, true, arc))
|
||||
break;
|
||||
TString mesg(TDocumento::tipo(doc.get(DOC_TIPODOC).as_string()).descrizione());
|
||||
profilo.ext("rep");
|
||||
if (profilo.custom_path()) // Tenta di costruirsi il nome del report
|
||||
{
|
||||
int copies = _msk->get_int(F_NCOPIE);
|
||||
if (copies <= 0 && is_definitive)
|
||||
copies = tipo.ncopie();
|
||||
if (copies <= 0)
|
||||
copies = 1;
|
||||
|
||||
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;
|
||||
}
|
||||
TReport_doc& report = reports.get(profilo);
|
||||
|
||||
if (send_mail)
|
||||
{
|
||||
mail_book = new TDoc_book;
|
||||
if (!report.print(doc, *mail_book, is_definitive, 1, true, arc))
|
||||
break;
|
||||
TString mesg(TDocumento::tipo(doc.get(DOC_TIPODOC).as_string()).descrizione());
|
||||
|
||||
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;
|
||||
}
|
||||
} //if(profilo.custom_path()...
|
||||
else
|
||||
{
|
||||
TString msg; msg << TR("Report inesistente") << " : " << codprof;
|
||||
TString msg; msg << TR("Report inesistente") << " : " << profilo;
|
||||
|
||||
statbar_set_title(TASK_WIN, msg);
|
||||
beep(2);
|
||||
@ -1039,11 +1038,10 @@ bool TReport_doc_app::print_loop(const TString& query, bool send_by_mail)
|
||||
}
|
||||
|
||||
// Stampa eventuali allegati
|
||||
const TString8 codalleg = tipo.additional_print_profile();
|
||||
if (codalleg.full())
|
||||
tipo.additional_print_profile(profilo);
|
||||
if (profilo.full())
|
||||
{
|
||||
TFilename profilo(codalleg); profilo.ext("rep");
|
||||
|
||||
profilo.ext("rep");
|
||||
if (profilo.custom_path())
|
||||
{
|
||||
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);
|
||||
// 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
|
||||
if (send_mail)
|
||||
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
|
||||
{
|
||||
TString msg; msg << TR("Report allegato inesistente") << " : " << codalleg;
|
||||
TString msg; msg << TR("Report allegato inesistente") << " : " << profilo;
|
||||
statbar_set_title(TASK_WIN, msg);
|
||||
}
|
||||
}
|
||||
|
||||
if (mail_book != NULL)
|
||||
{
|
||||
if (mail_book->pages() > 0)
|
||||
|
@ -20,7 +20,6 @@ int main( int argc, char** argv )
|
||||
ve7300(argc, argv); break; // stampa riepilogo entrate fornitori
|
||||
case 1:
|
||||
ve7200(argc, argv); break; // stampa flussi di cassa per white sun
|
||||
case 0:
|
||||
default:
|
||||
ve7100(argc, argv); break; // trasferimento documenti Team System
|
||||
}
|
||||
|
@ -399,23 +399,6 @@ bool TTipo_documento::scarica_residuo() const
|
||||
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
|
||||
|
@ -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
|
||||
// numero documento
|
||||
TString descr; doc.riferimento(descr);
|
||||
const TTipo_documento& tipo = doc.tipo();
|
||||
|
||||
if (descr.empty()) descr = tipo.descrizione();
|
||||
|
||||
|
158
ve/velib06.cpp
158
ve/velib06.cpp
@ -223,7 +223,7 @@ TDocumento_mask::TDocumento_mask(const char* td)
|
||||
}
|
||||
else
|
||||
{
|
||||
hide(F_CODCONT);
|
||||
hide(F_CODCONT);
|
||||
hide(F_CODCONT1);
|
||||
}
|
||||
|
||||
@ -260,13 +260,9 @@ TDocumento_mask::TDocumento_mask(const char* td)
|
||||
fld(pos).show(has_movmag);
|
||||
|
||||
FOR_EACH_MASK_FIELD((*this), j, f)
|
||||
{
|
||||
const TMask_field& f = fld(i);
|
||||
|
||||
const int p = f.page();
|
||||
|
||||
if (f.dlg() > BASE_PIEDE)
|
||||
_calculated_pages.set(p);
|
||||
{
|
||||
if (f->dlg() > BASE_PIEDE)
|
||||
_calculated_pages.set(f->page());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1299,9 +1295,9 @@ bool TDocumento_mask::ss_handler(TMask_field& f, KEY key)
|
||||
if (key == K_ENTER && f.mask().insert_mode())
|
||||
{
|
||||
TSheet_field& ss = (TSheet_field&)f;
|
||||
if (!app().is_transaction() && ss.empty()
|
||||
ok = yesno_box("Il documento e' privo di righe:\n"
|
||||
"Si desidera continuare ugualmente?");
|
||||
if (!app().is_transaction() && ss.empty())
|
||||
ok = yesno_box(TR("Il documento e' privo di righe:\n"
|
||||
"Si desidera continuare ugualmente?"));
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
@ -1347,12 +1343,12 @@ bool TDocumento_mask::ss_notify( TSheet_field& ss, int r, KEY key )
|
||||
m.update_progs();
|
||||
}
|
||||
break;
|
||||
case K_INS: // Inserimento
|
||||
{
|
||||
if (r < doc.rows())
|
||||
{
|
||||
TRiga_documento & riga = doc[r + 1];
|
||||
if (riga.is_omaggio() && riga.is_generata())
|
||||
case K_INS: // Inserimento
|
||||
{
|
||||
if (r < doc.rows())
|
||||
{
|
||||
TRiga_documento & riga = doc[r + 1];
|
||||
if (riga.is_omaggio() && riga.is_generata())
|
||||
{
|
||||
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);
|
||||
ss.force_update(r);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
doc.insert_row(r + 1, m.get( F_LBTIPORIGA ));
|
||||
}
|
||||
break;
|
||||
case K_CTRL + K_INS:
|
||||
}
|
||||
}
|
||||
doc.insert_row(r + 1, m.get( F_LBTIPORIGA ));
|
||||
}
|
||||
break;
|
||||
case K_CTRL + K_INS:
|
||||
{
|
||||
TRiga_documento & riga = doc[r + 1];
|
||||
TRectype & ven_rec = doc.clifor().vendite();
|
||||
TString8 s(ven_rec.get(CFV_CODMAG));
|
||||
const TTipo_riga_documento & t = riga.tipo();
|
||||
|
||||
if (s.full())
|
||||
{
|
||||
s.left_just(3);
|
||||
s << ven_rec.get(CFV_CODDEP);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = m.get(F_CAUSMAG);
|
||||
if (s.full())
|
||||
{
|
||||
TRiga_documento & riga = doc[r + 1];
|
||||
TRectype & ven_rec = doc.clifor().vendite();
|
||||
TString8 s(ven_rec.get(CFV_CODMAG));
|
||||
const TTipo_riga_documento & t = riga.tipo();
|
||||
|
||||
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
|
||||
{
|
||||
s = m._std_mag;
|
||||
s.left_just(3);
|
||||
s << ven_rec.get(CFV_CODDEP);
|
||||
s << m._std_dep;
|
||||
}
|
||||
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
|
||||
{
|
||||
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 (!selecting && m.is_running())
|
||||
}
|
||||
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 (!selecting && m.is_running())
|
||||
{
|
||||
m.update_giacenza();
|
||||
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();
|
||||
ss.sheet_mask().enable(DLG_USER, on);
|
||||
|
||||
if (rdoc.get(RDOC_CODART).empty() && rdoc.get(RDOC_DESCR).empty())
|
||||
{
|
||||
selecting = true; // semaforo per impedire l'evento di selezione doppio
|
||||
ss.select(r, 1, false);
|
||||
selecting = false;
|
||||
}
|
||||
if (rdoc.get(RDOC_CODART).empty() && rdoc.get(RDOC_DESCR).empty())
|
||||
{
|
||||
selecting = true; // semaforo per impedire l'evento di selezione doppio
|
||||
ss.select(r, 1, false);
|
||||
selecting = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -1482,11 +1479,8 @@ bool TDocumento_mask::occas_handler( TMask_field& f, KEY key )
|
||||
|
||||
TMask occas_mask("ve0100o");
|
||||
occas_mask.set_handler(O_CODICE, occas_code_handler );
|
||||
occas_mask.set_handler(O_COFI, 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 );
|
||||
occas_mask.set_handler(O_COFI, occas_cfpi_handler );
|
||||
occas_mask.set_handler(O_PAIV, occas_cfpi_handler );
|
||||
|
||||
for (int i = occas_mask.fields() - 1; i >= 0; i--)
|
||||
{
|
||||
@ -2495,6 +2489,7 @@ bool TElabora_mask::elabora()
|
||||
else
|
||||
d.zero(DOC_CAUSMAG);
|
||||
}
|
||||
|
||||
in.add(app_doc);
|
||||
out.add(d);
|
||||
if (e->elabora(in, out, TDate(TODAY), TRUE))
|
||||
@ -2523,33 +2518,12 @@ bool TElabora_mask::elabora()
|
||||
{
|
||||
TDocumento* d = new TDocumento(provv, anno, codnum, ndoc);
|
||||
|
||||
if (numdoc <= 0)
|
||||
{
|
||||
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);
|
||||
in.add(d);
|
||||
}
|
||||
if (update_header)
|
||||
{
|
||||
const TString16 tipo_doc(app_doc.get(DOC_TIPODOC));
|
||||
const TString16 caus_mag(app_doc.get(DOC_CAUSMAG));
|
||||
const TString4 tipo_doc(app_doc.get(DOC_TIPODOC));
|
||||
const TString8 caus_mag(app_doc.get(DOC_CAUSMAG));
|
||||
const long movmag = app_doc.get_long(DOC_MOVMAG);
|
||||
const TDate datadoc = app_doc.get_date(DOC_DATADOC);
|
||||
const TDate datainsc = app_doc.get_date(DOC_DATAINSC);
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "sconti.h"
|
||||
#include "veini.h"
|
||||
#include "vepriv.h"
|
||||
#include "verig.h"
|
||||
#include "veuml1.h"
|
||||
#include "veini.h"
|
||||
@ -365,17 +366,17 @@ void row_set_handler( TMask& m, const int field, const int index )
|
||||
case 2:
|
||||
m.set_handler( field, dummy_hndl );
|
||||
break;
|
||||
case 3:
|
||||
case 3:
|
||||
if (field == FR_CODART)
|
||||
m.set_handler( field, search_price_handler );
|
||||
case 4:
|
||||
break;
|
||||
case 4:
|
||||
if (field == FR_CODART)
|
||||
m.set_handler( field, find_price_handler );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
yesnofatal_box( false, "Funzione di handler sulla riga non definita( %d ).", index );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user