Patch level : 2.1 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento : Corretta stampa documenti con nuovi report git-svn-id: svn://10.65.10.50/trunk@12167 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
2fb82efac7
commit
1f95d09817
@ -1770,9 +1770,9 @@ bool TStampaDoc_application::select_button(TMask_field& f, KEY key)
|
||||
|
||||
void TStampaDoc_application::reset_choices(TMask& m)
|
||||
{
|
||||
m.reset(F_SELECTED);
|
||||
m.reset(F_CODFR);
|
||||
m.reset(F_CODTO);
|
||||
m.reset(F_SELECTED);
|
||||
m.reset(F_CODFR);
|
||||
m.reset(F_CODTO);
|
||||
_clifo_sheet->check(-1, FALSE);
|
||||
}
|
||||
|
||||
|
@ -3,12 +3,11 @@
|
||||
\ Messaggi specifici per stampa documenti
|
||||
|
||||
: MESSAGE_DESCRIGA ( ... -- )
|
||||
#RDOC.DESCR @ \ Legge campo descrizione riga
|
||||
#RDOC.DESCLUNGA @ \ Se e' presente una descrizione estesa
|
||||
EMPTY=
|
||||
NEGATE
|
||||
"34.DESCR" @ \ Legge campo descrizione riga
|
||||
"34.DESCLUNGA" @ \ Se e' presente una descrizione estesa
|
||||
"X" =
|
||||
IF
|
||||
#RDOC.DESCEST @ \ Legge memo descrizione
|
||||
"34.DESCEST" @ \ Legge memo descrizione
|
||||
+ \ Lo somma alla descrizione normale
|
||||
THEN
|
||||
BEGIN \ Ciclo sugli eventuali parametri successivi
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <modaut.h>
|
||||
#include <postman.h>
|
||||
#include <printer.h>
|
||||
#include <progind.h>
|
||||
@ -787,6 +788,9 @@ void TReport_doc_app::add_filter(TString& query, bool from) const
|
||||
|
||||
bool TReport_doc_app::create()
|
||||
{
|
||||
if (!has_module(RSAUT))
|
||||
return error_box(TR("Modulo non autorizzato"));
|
||||
|
||||
_msk = new TReport_doc_mask;
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
@ -845,7 +849,6 @@ bool TReport_doc_app::print_loop(const TString& query)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void TReport_doc_app::main_loop()
|
||||
{
|
||||
while (_msk->run() == K_ENTER)
|
||||
|
@ -20,7 +20,8 @@ class TIndustriosa_app : public TSkeleton_application
|
||||
protected:
|
||||
const TString& conto_industriale(const TRiga_documento& row, TString& conto) const;
|
||||
void trim_and_cut(TString& val, int len) const;
|
||||
void get_field(const TDocumento& doc, const TRectype& mov, const TRectype& rec, const char* field, TString& val) const;
|
||||
void get_field(const TDocumento& doc, const TRectype& mov, TCausale& causale,
|
||||
const TRectype& rec, const char* field, TString& val) const;
|
||||
bool filerr(const char* name) const;
|
||||
bool get_mci_path(TFilename& shell) const;
|
||||
bool call_mci(TDocumento& doc, const TRectype& movimento);
|
||||
@ -69,7 +70,8 @@ void TIndustriosa_app::trim_and_cut(TString& val, int len) const
|
||||
val.cut(0);
|
||||
}
|
||||
|
||||
void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, const TRectype& rec, const char* field, TString& val) const
|
||||
void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, TCausale& causale,
|
||||
const TRectype& rec, const char* field, TString& val) const
|
||||
{
|
||||
if (field[0] == '"' || field[0] == '\'')
|
||||
{
|
||||
@ -80,13 +82,13 @@ void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, con
|
||||
if (field[0] == '_')
|
||||
{
|
||||
val.cut(0);
|
||||
if (xvt_str_compare_ignoring_case(field, "_CANTIERE") == 0)
|
||||
if (stricmp(field, "_CANTIERE") == 0)
|
||||
{
|
||||
TString cms, fas;
|
||||
cms = rec.get(RDOC_CODCMS);
|
||||
if (cms.blank())
|
||||
{
|
||||
cms = doc.get(DOC_CODCMS);
|
||||
cms = doc.get(DOC_CODCMS);
|
||||
fas = doc.get(DOC_FASCMS);
|
||||
}
|
||||
else
|
||||
@ -95,17 +97,21 @@ void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, con
|
||||
trim_and_cut(fas, _len_fase);
|
||||
val << cms << fas;
|
||||
} else
|
||||
if (xvt_str_compare_ignoring_case(field, "_CONINDU") == 0)
|
||||
if (stricmp(field, "_CODCAUS") == 0)
|
||||
{
|
||||
val = causale.codice();
|
||||
} else
|
||||
if (stricmp(field, "_CONINDU") == 0)
|
||||
{
|
||||
conto_industriale((TRiga_documento&)rec, val);
|
||||
} else
|
||||
if (xvt_str_compare_ignoring_case(field, "_IMPORTO") == 0)
|
||||
if (stricmp(field, "_IMPORTO") == 0)
|
||||
{
|
||||
TCurrency_documento imp(((TRiga_documento&)rec).importo(TRUE, FALSE), doc);
|
||||
imp.change_to_firm_val();
|
||||
val = imp.get_num().stringa();
|
||||
} else
|
||||
if (xvt_str_compare_ignoring_case(field, "_IMPORTOVAL") == 0)
|
||||
if (stricmp(field, "_IMPORTOVAL") == 0)
|
||||
{
|
||||
if (doc.in_valuta())
|
||||
{
|
||||
@ -113,7 +119,7 @@ void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, con
|
||||
val = imp.get_num().stringa();
|
||||
}
|
||||
} else
|
||||
if (xvt_str_compare_ignoring_case(field, "_IMPOSTADOC") == 0)
|
||||
if (stricmp(field, "_IMPOSTADOC") == 0)
|
||||
{
|
||||
TString16 conto;
|
||||
real impval;
|
||||
@ -128,13 +134,12 @@ void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, con
|
||||
imposta.change_to_firm_val();
|
||||
val = imposta.get_num().stringa();
|
||||
} else
|
||||
if (xvt_str_compare_ignoring_case(field, "_SEZIONE") == 0)
|
||||
if (stricmp(field, "_SEZIONE") == 0)
|
||||
{
|
||||
TCausale causale(mov.get(MOV_CODCAUS));
|
||||
const char str[2] = { causale.sezione_clifo(), '\0' };
|
||||
const char str[2] = { causale.sezione(2), '\0' };
|
||||
val = str;
|
||||
} else
|
||||
if (xvt_str_compare_ignoring_case(field, "_TOTDOC") == 0)
|
||||
if (stricmp(field, "_TOTDOC") == 0)
|
||||
{
|
||||
TString16 conto;
|
||||
real totval;
|
||||
@ -147,7 +152,9 @@ void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, con
|
||||
}
|
||||
TCurrency_documento tot(totval, doc);
|
||||
tot.change_to_firm_val();
|
||||
val = tot.get_num().stringa();
|
||||
val = tot.get_num().stringa();
|
||||
if (val[0] == '-')
|
||||
val.ltrim(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -180,7 +187,11 @@ void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, con
|
||||
{
|
||||
const real n(r->get(field));
|
||||
if (!n.is_zero())
|
||||
{
|
||||
val = n.stringa();
|
||||
if (r->num() == LF_MOV && field == MOV_TOTDOC && val[0] == '-')
|
||||
val.ltrim(1);
|
||||
}
|
||||
else
|
||||
val.cut(0);
|
||||
}
|
||||
@ -197,16 +208,14 @@ bool TIndustriosa_app::filerr(const char* name) const
|
||||
|
||||
bool TIndustriosa_app::get_mci_path(TFilename& shell) const
|
||||
{
|
||||
bool ok = FALSE;
|
||||
|
||||
#ifdef WIN32
|
||||
char winpath[_MAX_PATH];
|
||||
|
||||
::GetWindowsDirectory(winpath, sizeof(winpath));
|
||||
|
||||
shell = winpath;
|
||||
shell.add("mci4.ini");
|
||||
|
||||
bool ok = FALSE;
|
||||
|
||||
if (shell.exist())
|
||||
{
|
||||
TConfig mci4(shell, "Paths");
|
||||
@ -238,7 +247,6 @@ bool TIndustriosa_app::get_mci_path(TFilename& shell) const
|
||||
else
|
||||
filerr(shell);
|
||||
|
||||
#endif
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -265,10 +273,14 @@ bool TIndustriosa_app::call_mci(TDocumento& doc, const TRectype& movimento)
|
||||
|
||||
TAssoc_array& hvar = mci.list_variables(para.row(0));
|
||||
ini.set_paragraph(para.row(0));
|
||||
|
||||
|
||||
const TTipo_documento& td = doc.tipo();
|
||||
const TString4 codcaus = td.causale();
|
||||
TCausale causale(codcaus);
|
||||
|
||||
FOR_EACH_ASSOC_STRING(hvar, obj, key, field)
|
||||
{
|
||||
get_field(doc, movimento, movimento, field, val);
|
||||
get_field(doc, movimento, causale, movimento, field, val);
|
||||
ini.set(key, val);
|
||||
}
|
||||
|
||||
@ -287,14 +299,15 @@ bool TIndustriosa_app::call_mci(TDocumento& doc, const TRectype& movimento)
|
||||
ini.set_paragraph(pr);
|
||||
FOR_EACH_ASSOC_STRING(rvar, obj, key, field)
|
||||
{
|
||||
get_field(doc, movimento, doc[r], field, val);
|
||||
get_field(doc, movimento, causale, doc[r], field, val);
|
||||
ini.set(key, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
mci.set_paragraph(para.row(0)); // Forza scrittura ultima riga
|
||||
}
|
||||
else
|
||||
error_box("Il file 've6600.ini' non e' valido");
|
||||
error_box("Il file ve6600.ini non e' valido");
|
||||
|
||||
if (ininame.exist())
|
||||
{
|
||||
@ -334,7 +347,7 @@ void TIndustriosa_app::main_loop()
|
||||
|
||||
if (ininame.exist())
|
||||
{
|
||||
open_files(LF_TAB, LF_TABCOM, LF_DOC, LF_RIGHEDOC, LF_CLIFO, LF_CFVEN, LF_MOV, LF_ANAMAG, 0);
|
||||
open_files(LF_TAB, LF_TABCOM, LF_CAUSALI, LF_RCAUSALI, LF_DOC, LF_RIGHEDOC, LF_CLIFO, LF_CFVEN, LF_MOV, LF_ANAMAG, 0);
|
||||
|
||||
TString8 para; para.format("%d", LF_DOC);
|
||||
TConfig ini(ininame, para);
|
||||
|
Loading…
x
Reference in New Issue
Block a user