Patch level : 10.0

Files correlati     : ve1.exe
Ricompilazione Demo : [ ]
Commento            :
Corretta interpretazione formule di riga documento


git-svn-id: svn://10.65.10.50/trunk@17583 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-11-10 12:07:11 +00:00
parent 3e23894419
commit 376b8008d3
4 changed files with 31 additions and 48 deletions

View File

@ -11,7 +11,6 @@
#include "vetbrss.h"
#include "vetbatr.h"
///////////////////////////////////////////////////////////
// TVendite_mask
///////////////////////////////////////////////////////////
@ -56,7 +55,7 @@ bool TVendite_mask::get_printer_name(TString& name) const
void TVendite_mask::reset_printer_config() const
{
TString16 config; get_printer_config(config);
TString config; get_printer_config(config);
TConfig ini(CONFIG_STAMPE, config);
ini.remove_all();
}
@ -70,7 +69,7 @@ bool TVendite_mask::on_field_event(TOperable_field& o, TField_event e, long joll
{
if (is_table("NUM"))
return on_num_event(o, e, jolly);
return TRUE;
return true;
}
TVendite_mask::TVendite_mask(const char* name) : TAutomask(name)
@ -99,7 +98,6 @@ protected:
virtual int write(const TMask& m);
virtual int rewrite(const TMask& m);
public:
};
@ -295,6 +293,6 @@ int TVendite_tabapp::rewrite(const TMask& m)
int ve0400(int argc, char* argv[])
{
TVendite_tabapp vta;
vta.run(argc, argv, "Tabella Vendite");
vta.run(argc, argv, TR("Tabella Vendite"));
return 0;
}

View File

@ -574,7 +574,7 @@ real TDocumento::bolli(real & imp, int ndec, TTipo_importo t) const
if (in_valuta())
{
const real cambio = get_real("CAMBIO");
const real cambio = get_real(DOC_CAMBIO);
const exchange_type ce = get_bool(DOC_CONTROEURO) ? _exchange_contro : _exchange_base;
tot_bolli = change_currency(tot_bolli, "", ZERO, _exchange_undefined,
get(DOC_CODVAL), cambio, ce, -1);

View File

@ -1,26 +1,27 @@
#include "velib07.h"
#include "../db/dblib.h"
///////////////////////////////////////////////////////////
// TMateriali_base_recordset
///////////////////////////////////////////////////////////
const TVariant& TMateriali_base_recordset::get(const char* column_name) const
{
const TString name(column_name);
if (name[0] != '#')
if (column_name[0] != '#')
{
TVariant& var = get_tmp_var();
int rownum = current_row();
if (_reverse)
if (reverse())
rownum = items() - 1 - rownum;
const TRiga_esplosione * row = (const TRiga_esplosione *)boom().objptr(rownum);
const TRiga_esplosione* row = (const TRiga_esplosione*)boom().objptr(rownum);
if (row != NULL)
{
if (name == "LASTQTA")
{
const TFixed_string name(column_name);
if (name == "LASTQTA")
var = row->last_qta();
else
if (name == "TOTQTA")
@ -58,21 +59,18 @@ const TVariant& TMateriali_base_recordset::get(const char* column_name) const
const TVariant& TMateriali_base_recordset::get(unsigned int column) const
{
const TRecordset_column_info & ci = column_info(column);
return get(ci._name);
}
void TMateriali_base_recordset::requery()
{
TDistinta_tree distinta;
_boom.destroy();
int pos1 = query_text().find("MATBASE");
if (pos1 > 0)
{
pos1 += 7;
_reverse = query_text()[pos1] == '-';
if (_reverse)
set_reverse(query_text()[pos1] == '-');
if (reverse())
pos1++;
int pos = query_text().find("==", pos1);
int pos2 = -1;
@ -95,8 +93,8 @@ void TMateriali_base_recordset::requery()
val = var.as_string();
}
TCodice_articolo art(val);
const TCodice_articolo art(val);
TDistinta_tree distinta;
if (distinta.set_root(art))
{
while (isspace(query_text()[pos1]))
@ -174,14 +172,12 @@ TMateriali_base_recordset::TMateriali_base_recordset(const char* use) : _query(u
void TScalare_recordset::requery()
{
TDistinta_tree distinta;
boom().destroy();
int pos1 = query_text().find("SCALARE");
if (pos1 > 0)
{
pos1 += 7;
reverse() = query_text()[pos1] == '-';
set_reverse(query_text()[pos1] == '-');
if (reverse())
pos1++;
int pos = query_text().find("==", pos1);
@ -200,8 +196,8 @@ void TScalare_recordset::requery()
val = var.as_string();
}
TCodice_articolo art(val);
const TCodice_articolo art(val);
TDistinta_tree distinta;
if (distinta.set_root(art))
{
while (isspace(query_text()[pos1]))
@ -291,7 +287,7 @@ TDocument_cache:: ~TDocument_cache()
// TDocument_recordset
///////////////////////////////////////////////////////////
const TVariant& TDocument_recordset::get(int num, const char* field) const
const TVariant& TDocument_recordset::get_field(int num, const char* field) const
{
if (*field != '#')
{
@ -571,15 +567,10 @@ size_t TDocument_report::get_usr_words(TString_array& words) const
{
TReport::get_usr_words(words);
const char* const name[] =
{
"DOC_PARENT_DOC", "DOC_PARENT_ROW",
NULL
};
const char* const name[] = { "DOC_PARENT_DOC", "DOC_PARENT_ROW", NULL };
((TDocument_report*)this)->_first_msg = words.items(); // Calcola il primo numero disponibile
size_t i;
for (i = 0; name[i] != NULL; i++)
for (size_t i = 0; name[i] != NULL; i++)
words.add(name[i]);
return words.items();

View File

@ -5,16 +5,10 @@
#include "velib.h"
#endif
#ifndef __ASSOC_H
#include <assoc.h>
#ifndef __REPORT_H
#include <report.h>
#endif
#ifndef __REPRINT_H
#include <reprint.h>
#endif
#include "../db/dblib.h"
///////////////////////////////////////////////////////////
// TMateriali_base_recordset
///////////////////////////////////////////////////////////
@ -30,14 +24,14 @@ class TMateriali_base_recordset : public TRecordset
TRectype * _rdist;
protected:
const TString& query_text() const { return _query; }
TArray& boom() { return _boom; }
const TArray& boom() const { return _boom; }
const TString & query_text() const { return _query; }
TArray & boom() { return _boom; }
const TArray & boom() const { return _boom; }
bool & reverse() { return _reverse;}
void set_reverse(bool r) { _reverse = r; }
bool reverse() const { return _reverse;}
public:
virtual TRecnotype items() const { return _boom.items(); }
virtual bool move_to(TRecnotype pos) { _pos = pos; _lastrow = -1; return pos < items();}
virtual TRecnotype current_row() const { return _pos; }
@ -93,10 +87,10 @@ class TDocument_recordset : public TISAM_recordset
TDocument_cache _cache;
protected:
virtual const TVariant& get(int num, const char* field) const;
virtual const TVariant& get_field(int num, const char* field) const;
public:
const TDocumento & doc(const TRectype& rec) { return _cache.doc(rec);}
const TDocumento& doc(const TRectype& rec) { return _cache.doc(rec);}
TDocument_recordset(const char* use) : TISAM_recordset(use) { }
virtual ~TDocument_recordset() { }