Patch level : 2.2 179

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Riportatat la versione 2.1 patch 378


git-svn-id: svn://10.65.10.50/trunk@13349 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2005-09-19 12:45:16 +00:00
parent 4002d1a8d7
commit a280e22195
70 changed files with 1866 additions and 1337 deletions

View File

@ -1164,12 +1164,38 @@ class TImport_wizard : public TSkeleton_application
{
protected: // TSkeleton_application
virtual void main_loop();
};
public:
void import();
};
void TImport_wizard::import()
{
const int nLogicNum = atoi(argv(2));
if (nLogicNum >= LF_USER)
{
const TFilename strName = argv(3);
if (strName.exist())
{
TSystemisamfile file(nLogicNum);
file.load(strName);
}
else
error_box("Nome file errato: %s", (const char*)strName);
}
else
error_box("Numero file errato: %d", nLogicNum);
}
void TImport_wizard::main_loop()
{
TWizard_mask m;
m.run();
if (argc() < 3)
{
TWizard_mask m;
m.run();
}
else
import();
}
int ba1800(int argc, char* argv[])

View File

@ -1081,7 +1081,7 @@ void TReport_mask::add_field()
TReport_section& rs = curr_section();
TReport_field* rf = new TReport_field(&rs);
rf->set_type('S');
rf->set_pos(0, rs.compute_size().y);
rf->set_pos(0, rs.compute_size().y+100);
TReport_field_mask m(*rf);
m.disable(DLG_DELREC);
if (m.run() == K_ENTER)

View File

@ -54,6 +54,8 @@ END
BOOLEAN F_PAGE_BREAK
BEGIN
PROMPT 1 5 "Forza salto pagina"
MESSAGE FALSE ENABLE,F_KEEP_WITH_NEXT
MESSAGE TRUE CLEAR,F_KEEP_WITH_NEXT
END
BOOLEAN F_KEEP_WITH_NEXT

View File

@ -2,7 +2,7 @@
#include <automask.h>
#include <defmask.h>
#include <execp.h>
#include <printer.h>
#include <prefix.h>
#include <reprint.h>
#include <utility.h>
@ -180,7 +180,7 @@ void TKlarkKent_app::main_loop()
{
TFilename report_name = *row;
report_name.ext("rep");
if (report_name.empty() || !report_name.custom_path())
if (row->blank() || !report_name.custom_path())
{
TKlarkKent_mask m;
m.set(F_REPORT, report_name);

View File

@ -71,6 +71,9 @@ Descrizione = Provvigioni Agenti
[sv]
Descrizione = Statistiche di Vendita
[dt]
Descrizione = Importazione documenti STORE
[_area_magazzino_produzione]
Descrizione=AREA MAGAZZINO E PRODUZIONE

View File

@ -499,9 +499,10 @@ bool TMov_emask::on_field_event(TOperable_field& o, TField_event e, long jolly)
const TRectype& cat = _cespite.categoria();
set(F_CATEGORIA, _cespite.get(CESPI_CODCAT), TRUE);
set(F_DESC_CAT, cat.get("S0"), TRUE);
if (o.enabled())
if (e != fe_init && o.enabled())
{
const TRectype& tpmov = cache().get("%TMC", get(F_CODMOV));
switch (_cespite.tipo())
{
case tc_immateriale:

View File

@ -380,10 +380,24 @@ void TCalc_cesp_cms::stampa_docs()
darec.put(RDOC_PROVV, 'D');
darec.put(RDOC_ANNO, _mask->get_int(F_ESERCIZIO));
darec.put(RDOC_CODNUM, _mask->get(F_CODNUM));
darec.put(RDOC_NDOC, _mask->get_long(F_DA_IDCESPITE));
// darec.put(RDOC_NDOC, ); da usare se si volesse aggiungere la ricerca per categoria (NDOC)
TRectype arec(darec);
arec.put(RDOC_NDOC, _mask->get_long(F_A_IDCESPITE));
// arec.put(RDOC_NDOC, );
curform.setregion(darec, arec);
TString filtro;
const TString& dacespite = _mask->get(F_DA_IDCESPITE);
const TString& acespite = _mask->get(F_A_IDCESPITE);
if (dacespite.not_empty())
filtro << "(CODART>='" << dacespite << "')" ;
if (acespite.not_empty())
{
if (dacespite.not_empty())
filtro << "&&";
filtro << "(CODART<='" << acespite << "')" ;
}
curform.setfilter(filtro);
_form->print();
}

View File

@ -1,7 +1,7 @@
#include "ce4200.h"
USE LF_DOC
JOIN LF_RIGHEDOC INTO PROVV==PROVV ANNO==ANNO CODNUM==CODNUM NDOC==NDOC
USE LF_RIGHEDOC
END
//-----------------------parte grafica con le righe di separazione-------------------
@ -125,36 +125,35 @@ SECTION BODY ODD 3
BEGIN
KEY "codcms"
PROMPT 5 1 ""
FIELD LF_RIGHEDOC->CODCMS
FIELD CODCMS
END
STRINGA FR_B_IDCESP 10
BEGIN
KEY "idcespite"
PROMPT 26 1 ""
FIELD LF_RIGHEDOC->CODART
FIELD CODART
END
STRINGA FR_B_DESC 30
BEGIN
KEY "descrizione cespite"
PROMPT 37 1 ""
FIELD LF_RIGHEDOC->DESCR
FIELD DESCR
END
NUMERO FR_B_PERC 6 2
BEGIN
KEY "percentuale"
PROMPT 88 1 ""
FIELD LF_RIGHEDOC->QTAGG4
// MESSAGE ADD,FR_B_TOTPERC
FIELD QTAGG4
END
VALUTA FR_B_VALAMM 15
BEGIN
KEY "valamm"
PROMPT 104 1 ""
FIELD LF_RIGHEDOC->PREZZO
FIELD PREZZO
MESSAGE ADD,FR_B_TOTVALAMM
END
@ -166,12 +165,6 @@ SECTION BODY ODD 3
PROMPT 26 2 "@bTotali"
END
/* NUMERO FR_B_TOTPERC 6 2
BEGIN
KEY "totale percentuale"
PROMPT 88 2 "@b"
END*/
VALUTA FR_B_TOTVALAMM 15
BEGIN
KEY "totale valamm"

View File

@ -2147,19 +2147,15 @@ void TStampa_IVdirettiva::stampa_risultato_prima_delle_imposte()
_i++;
}
// Guy was here 05/03/2004: La prima imposta e' gia' stata sommata
const real te = _totale_economico -_sale;
// Guy was here 08/06/2004: Nuova moda non capibile
// Guy was here 05/03/2004: La prima imposta a volte e' gia' stata sommata
const real te = _totale_economico ;//-_sale;
set_row (_i,"@4g%s@81g%r", TR("Risultato prima delle imposte"), &te);
if (raff)
{
// Guy was here 10/03/2004: La prima imposta e' gia' stata sommata anche qui
const real te = _totale_economico_raf -_salerafr;
// Guy was here 08/06/2004: Nuova moda non capibile
// Guy was here 10/03/2004: La prima imposta a volte e' gia' stata sommata anche qui
const real te = _totale_economico_raf; // -_salerafr;
set_row (_i,"@111g%r", &te);
}

View File

@ -54,7 +54,7 @@ bool TCausale::read(const char* cod, int year)
add(rcaus.curr(), riga);
}
const TString16 codreg(_rec.get(CAU_REG));
const TString4 codreg(_rec.get(CAU_REG));
const bool ok = _reg.read(codreg, year); // Read register
if (!ok && codreg.not_empty())
return error_box(FR("Non esiste il registro '%s' del %d"),
@ -68,7 +68,7 @@ bool TCausale::read(const char* cod, int year)
_reg.read("", year);
}
return TRUE;
return true;
}
@ -156,12 +156,9 @@ bool TCausale::link_analitica() const
bool TCausale::ok() const
{
if (iva() == iva_errata)
return FALSE;
return TRUE;
return iva() != iva_errata;
}
char TCausale::sezione(int riga) const
{
const TRectype* rec = row(riga);

View File

@ -94,8 +94,8 @@ protected:
bool i_proforma_conti();
public:
const real get_importo() {return _importo;};
const long get_nregcosto() {return _nregcosto;};
const long get_nregpag() {return _nregpag;};
const char* get_nregcosto() {return format("%d", _nregcosto);};
const char* get_nregpag() {return format("%d", _nregpag);};
TInvioP() {};
virtual ~TInvioP() {};
};
@ -397,7 +397,7 @@ bool TInvioP::i_proforma_pagamenti(const TCursor& cur)
const int nrigapart = curpart_rec.get_int(PART_NRIGA);
TString80 filtro;
filtro.format("NRIGP == %d", nrigapart);
TCursor curpag(&relpart, filtro, 1, &da, &da);
TCursor curpag(&relpag, filtro, 1, &da, &da);
const long curpag_items = curpag.items();
if (curpag_items != 0)
{
@ -422,11 +422,11 @@ bool TInvioP::i_proforma_pagamenti(const TCursor& cur)
for (cp = (real*) pagame.first_item(); cp != NULL; cp = (real*) pagame.succ_item())
{
TToken_string keypart;
keypart << curpart_rec.get(PART_TIPOCF);
keypart << curpart_rec.get(PART_GRUPPO);
keypart << curpart_rec.get(PART_CONTO);
keypart << curpart_rec.get(PART_SOTTOCONTO);
keypart << pagame.get_hashobj()->key();
keypart.add(curpart_rec.get(PART_TIPOCF));
keypart.add(curpart_rec.get(PART_GRUPPO));
keypart.add(curpart_rec.get(PART_CONTO));
keypart.add(curpart_rec.get(PART_SOTTOCONTO));
keypart.add(pagame.get_hashobj()->key());
const TRectype& partita = cache().get(LF_PARTITE, keypart);
_nregpag = cur.curr().get_long(MOV_NUMREG);
_nregcosto = partita.get_long(PART_NREG);

View File

@ -959,7 +959,7 @@ bool TBill::required_cdc() const
bool TBill::default_cdc(TString& cdc, TString& fas) const
{
bool ok = tipo() <= ' ' && sottoconto() > 0;
bool ok = tipo() <= ' ' && sottoconto() > 0;
if (ok)
{
TString16 key;

View File

@ -21,7 +21,6 @@ ALIGN = R
DATA = N
DECIMAL = 0
FILLER = '0'
LENGTH = 0
PICTURE =
[TYPE DATA]
@ -407,7 +406,7 @@ MESSAGE(1) = _NREGCOSTO
NAME(2) = IMPORTO
TYPE(2) = IMPORTO
POSITION(2) = 20
MESSAGE(2) = _IMPORTOPAG
MESSAGE(2) = _IMPORTO
NAME(3) = FLAG ACCONTO/SALDO
TYPE(3) = STRINGA

View File

@ -8,7 +8,7 @@ se Contabilita' Semplificata
cg Contabilita' Generale
ci Contabilita' Industriale
mi Modello IVA 11
ai Archiviazione Immagini
dt Importazione documenti STORE
ce Cespiti
rs Report di Stampa
sc Saldaconto
@ -45,4 +45,4 @@ xx Modulo vario 4
xx Modulo vario 5
xx Modulo vario 6
xx Modulo vario 7
es Estimi
es Estimi

View File

@ -1080,6 +1080,12 @@ void TControl::set_rjust(bool on)
// @doc INTERNAL
// @mfunc Allineamento a destra del testo
void TControl::read_only(bool on)
{
change_attrib(XI_ATR_READONLY, on);
}
const char* TControl::caption() const
{
const char* c = xi_get_text(_obj, NULL, 512);
@ -1346,7 +1352,8 @@ bool TField_control::event_handler(XI_OBJ* itf, XI_EVENT* xiev)
notify_key(K_CTRL+K_TAB);
break;
case XIE_DBL_FIELD:
notify_key(K_F9);
if (!read_only())
notify_key(K_F9);
break;
case XIE_CHAR_FIELD:
{
@ -2300,7 +2307,7 @@ bool TListbox_control::event_handler(XI_OBJ* itf, XI_EVENT* xiev)
{
case XIE_DBL_FIELD:
case XIE_BUTTON:
if (!_button_blocked)
if (!_button_blocked && !read_only())
{
if (_ddl->is_open())
_ddl->close();
@ -2310,18 +2317,30 @@ bool TListbox_control::event_handler(XI_OBJ* itf, XI_EVENT* xiev)
break;
case XIE_CHAR_FIELD:
{
const KEY k = xiev_to_key(xiev);
if (k >= ' ' && k <= 'z')
_ddl->select_by_initial(char(k));
else if (k == K_F9)
_ddl->open();
else if (k == K_RIGHT) // poor man's substitute for down arrow
_ddl->select_by_ofs(1);
else if (k == K_LEFT) // poor man's substitute for up arrow
_ddl->select_by_ofs(-1);
else if (k == K_F2 || k == K_F11 || k == K_F12)
notify_key(k);
xiev->refused = true;
const KEY k = xiev_to_key(xiev);
if (!read_only())
{
if (k >= ' ' && k <= 'z')
_ddl->select_by_initial(char(k));
else
if (k == K_F9)
_ddl->open();
else
if (k == K_RIGHT) // poor man's substitute for down arrow
_ddl->select_by_ofs(1);
else
if (k == K_LEFT) // poor man's substitute for up arrow
_ddl->select_by_ofs(-1);
else
if (k == K_F2 || k == K_F11 || k == K_F12)
notify_key(k);
}
else
if (k == K_F11 || k == K_F12)
notify_key(k);
xiev->refused = true;
}
break;
case XIE_CHG_FIELD:

View File

@ -100,6 +100,9 @@ public:
void hide() { show(FALSE); }
virtual void destroy();
virtual void read_only(bool on = TRUE);
virtual void set_rjust(bool on = TRUE);
void set_ljust() { set_rjust(FALSE); }
@ -356,4 +359,4 @@ public:
#endif
#endif

View File

@ -39,11 +39,9 @@ XVT_IMAGE TImage::set(
XVT_IMAGE TImage::load(
const char* n) // @parm Nome del file contenente l'immagine
{
// WinManager.free_handle();
XVT_IMAGE i = xvt_image_read((char*)n);
// WinManager.lock_handle();
if (i != NULL) set(i);
if (i != NULL)
set(i);
return i;
}
@ -53,11 +51,11 @@ XVT_IMAGE TImage::load(short id)
return set(xvt_res_get_image(id));
}
// Certified 100%
TImage::TImage(const char* n) : _image(NULL)
{
if (n && *n) load(n);
if (n && *n)
load(n);
}
// Certified 100%

View File

@ -25,6 +25,7 @@ class TPage_field : public TRadio_field
protected:
virtual void current(int) { } // Evita il reset
virtual int current() const { return _def; }
virtual bool is_editable() const { return false; }
public:
virtual void set_prompt(const char* p);
@ -97,46 +98,28 @@ TMask::TMask(const char* title, int pages, int cols, int rows,
cols, rows, title, this, pages > 1);
}
HIDDEN int customize_field(TConfig & cfg, void * jolly)
void TMask::set_locking(TBit_array & read_only, TToken_string & fields, bool on)
{
TMask & m = *((TMask *) jolly);
TToken_string para(cfg.get_paragraph(), ',');
const int id = para.get_int();
const int nmask = para.get_int();
if (nmask != m.number())
return 0;
const int pos = m.id2pos(id);
if (pos < 0)
{
TScanner scanner(cfg.name());
scanner.paragraph(para);
scanner.popkey();
TMask_field * f = m.parse_field(scanner);
const int npage = para.get_int();
f->construct(scanner, m.win(npage));
m.add_field(f);
return 0;
}
TMask_field & f = m.fld(pos);
f.update_flags(cfg.get("FLAGS"));
f.update_flags(cfg.get("NFLAGS"), TRUE);
if (f.is_operable())
{
for (int n = 0; cfg.exist("MESSAGE", n) ; n++)
{
const TString m(cfg.get("MESSAGE", NULL, n));
((TOperable_field &)f).message(n, TRUE)->add(m);
}
}
return 0;
FOR_EACH_TOKEN(fields, fld)
{
short id = 0;
if (real::is_natural(fld))
id = atoi(fld);
else
{
TMask_field * f = find_by_fieldname(fld);
if (f != NULL)
id = f->dlg();
}
if (id > 0)
{
const int pos = id2pos(id);
if (pos >= 0)
read_only.set(pos, on);
}
}
}
// @doc EXTERNAL
// @mfunc Legge la maschera da file
void TMask::read_mask(
@ -200,18 +183,34 @@ void TMask::read_mask(
if (_pages > 1 || toolwin())
add_tag_buttons(captions);
TFilename cust("cust/");
cust << name; cust.ext("ini");
if (cust.exist())
{
TConfig cfg(cust);
cfg.for_each_paragraph(customize_field, this);
}
if (num == 0)
_total_time = clock()-start_t;
{
_total_time = clock()-start_t;
TFilename prof;
make_profile_name(prof);
TString16 para(user()); para << "_Locks";
TConfig ini(prof, para);
const int items = fields();
TBit_array read_only(items);
TAuto_token_string fields(ini.get("Lock"));
if (fields == "*")
read_only.set();
else
set_locking(read_only, fields);
fields = ini.get("Unlock");
set_locking(read_only, fields, false);
for (int j = 0; j < items; j++)
{
TMask_field & f = fld(j);
if (read_only[j] && f.is_editable())
f.set_read_only(true);
}
}
}
void TMask::add_field(TMask_field* f)

View File

@ -154,6 +154,8 @@ public:
// @cmember Distruttore
virtual ~TMask();
// @cmember Imposta i bit di read_only
void set_locking(TBit_array & read_only, TToken_string & fields, bool on = true);
// @cmember Legge la maschera da file
void read_mask(const char* name, int num, int max);

View File

@ -57,7 +57,7 @@ TMask_field::TField_Flags::TField_Flags()
uppercase = rightjust = FALSE;
zerofilled = button = FALSE;
dirty = focusdirty = FALSE;
roman = FALSE;
roman = read_only = FALSE;
firm = ghost = FALSE;
password = FALSE;
trim = 3;
@ -95,6 +95,8 @@ char TMask_field::TField_Flags::update(const char* f, bool reset)
show_default = shown = reset; break;
case 'I':
break; // reserved for sheetfield insert
case 'L':
read_only = reset; break;
case 'M':
roman = !reset; break;
case 'P':
@ -202,6 +204,13 @@ void TMask_field::set_justify(bool r)
_ctl->set_rjust(r);
}
void TMask_field::set_read_only(bool r)
{
_flags.read_only = r;
if (_ctl)
_ctl->read_only(r);
}
// @doc INTERNAL
// Certified 100%
@ -426,7 +435,7 @@ void TMask_field::show_default()
// Certified 100%
bool TMask_field::active() const
{
return is_operable() && enabled() && shown();
return is_operable() && enabled() && shown() && !read_only();
}
@ -1670,8 +1679,11 @@ bool TBoolean_field::on_key(KEY key)
return TRUE;
break;
case K_F2:
set("");
set_dirty();
if (!read_only())
{
set("");
set_dirty();
}
return TRUE;
break;
default:
@ -1804,17 +1816,17 @@ void TList_sheet::do_output(CheckTime t)
const short id = field().atodlg(fld);
TMask_field& f = field(id);
const char* val = rowsel.get();
if (t != STARTING_CHECK || f.field() == NULL)
{
const bool hit = f.get() != val;
f.set(val);
if (field().dlg() != id && hit)
{
f.on_hit();
if (t == RUNNING_CHECK)
f.check();
}
}
if (t != STARTING_CHECK || f.field() == NULL)
{
const bool hit = f.get() != val;
f.set(val);
if (field().dlg() != id && hit)
{
f.on_hit();
if (t == RUNNING_CHECK)
f.check();
}
}
}
}
@ -3296,13 +3308,59 @@ bool TEdit_field::parse_item(TScanner& scanner)
return TEditable_field::parse_item(scanner);
}
void TEdit_field::set_background()
{
COLOR c = NORMAL_BACK_COLOR;
if (enabled())
{
int status = required() ? 1 : 0;
if (read_only())
status |= 2;
switch (status)
{
case 1:
if (NORMAL_BACK_COLOR != REQUIRED_BACK_COLOR)
c = REQUIRED_BACK_COLOR;
break;
case 2:
c = blend_colors(DISABLED_BACK_COLOR, NORMAL_BACK_COLOR, 0.5);
break;
case 3:
c = blend_colors(DISABLED_BACK_COLOR, REQUIRED_BACK_COLOR, 0.5);
break;
default:
break;
}
}
((TField_control*)_ctl)->set_back_color(c);
if (_browse)
((TField_control*)_ctl)->show_button(active());
}
void TEdit_field::check_type(CheckType c)
{
_check = c;
if (NORMAL_BACK_COLOR != REQUIRED_BACK_COLOR)
((TField_control*)_ctl)->set_back_color(required() ? REQUIRED_BACK_COLOR : NORMAL_BACK_COLOR);
set_background();
}
void TEdit_field::set_read_only(bool r)
{
if (r != read_only())
{
TMask_field::set_read_only(r);
set_background();
if (_browse && _browse->is_browse())
{
TToken_string out_ids(((TBrowse *)_browse)->get_output_fields());
TMask & m = mask();
FOR_EACH_TOKEN(out_ids, fld)
m.field(atoi(fld)).set_read_only(r);
}
}
}
// Filtro magico sulle ditte esistenti
HIDDEN bool firm_filter(const TRelation* rel)
@ -3327,7 +3385,7 @@ void TEdit_field::create(WINDOW parent)
_ctl_data._flags, "");
if (_browse && !enabled_default())
((TField_control*)_ctl)->show_button(FALSE);
((TField_control*)_ctl)->show_button(false);
if (_browse && validate_func() == 24)
{
@ -3588,67 +3646,71 @@ bool TEdit_field::on_key(KEY key)
}
break;
case K_F2:
set("");
if (!read_only())
set("");
break;
case K_F9:
if (check_enabled())
{
if (focusdirty())
get_window_data();
if (!read_only())
{
if (check_enabled())
{
if (focusdirty())
get_window_data();
KEY k = K_ESC;
if (_browse) k = _browse->run();
else beep();
KEY k = K_ESC;
if (_browse) k = _browse->run();
else beep();
if (k != K_F9)
set_focus();
if (k != K_F9)
set_focus();
if (k == K_ENTER)
{
bool ok = TRUE;
if (k == K_ENTER)
{
bool ok = TRUE;
set_dirty();
// Controlla i validate che non vengono fatti da on_hit
const int vf = validate_func();
if (vf >= 0 && vf != AUTOEXIT_FUNC && vf != NUMCALC_FUNC &&
vf != STRCALC_FUNC && vf != 21)
{
ok = validate(K_TAB);
if (!ok && has_warning())
default_error_box();
}
set_dirty();
// Controlla i validate che non vengono fatti da on_hit
const int vf = validate_func();
if (vf >= 0 && vf != AUTOEXIT_FUNC && vf != NUMCALC_FUNC &&
vf != STRCALC_FUNC && vf != 21)
{
ok = validate(K_TAB);
if (!ok && has_warning())
default_error_box();
}
// Esegue handler
if (ok)
ok = on_hit();
// Esegue handler
if (ok)
ok = on_hit();
if (ok)
{
TMask & m = mask();
if (m.is_running())
{
set_focusdirty(FALSE); // Evita doppia esecuzione handlers!
if (m.query_mode() && in_key(0))
test_key_complete();
if (m.is_running())
{
set_focusdirty(FALSE);
send_key(K_TAB, 0); // Passa al campo successivo
}
}
}
return ok;
}
else
return FALSE;
}
else
if (_browse == NULL && has_button())
{
if (focusdirty())
get_window_data();
return handler(K_F9);
}
if (ok)
{
TMask & m = mask();
if (m.is_running())
{
set_focusdirty(FALSE); // Evita doppia esecuzione handlers!
if (m.query_mode() && in_key(0))
test_key_complete();
if (m.is_running())
{
set_focusdirty(FALSE);
send_key(K_TAB, 0); // Passa al campo successivo
}
}
}
return ok;
}
else
return FALSE;
}
else
if (_browse == NULL && has_button())
{
if (focusdirty())
get_window_data();
return handler(K_F9);
}
}
break;
case K_CTRL+K_SPACE:
set_dirty(TRUE);
@ -3696,8 +3758,7 @@ void TEdit_field::set_query_button(TBrowse_button * brw)
void TEdit_field::enable(bool on)
{
TEditable_field::enable(on);
if (_browse)
((TField_control*)_ctl)->show_button(on);
set_background();
}
// @mfunc Permette di abilitare/disabilitare un check di un campo
@ -3708,7 +3769,7 @@ void TEdit_field::enable_check(
// @flag FALSE | Disabilita il check del campo
{
_check_enabled = on;
((TField_control*)_ctl)->show_button(on);
((TField_control*)_ctl)->show_button(on && active());
}
@ -4712,7 +4773,8 @@ bool TList_field::on_key(KEY key)
set_dirty();
return on_hit();
case K_F2:
current(0);
if (!read_only())
current(0);
break;
default:
if (to_check(key, TRUE) || key == K_ENTER)
@ -4960,7 +5022,7 @@ bool TZoom_field::on_key( KEY key )
}
m.set(101, _str);
if (m.run() == K_ENTER)
if (m.run() == K_ENTER && !read_only())
{
_str = m.get(101);
set_window_data(raw2win(_str));

View File

@ -114,6 +114,7 @@ protected:
bool ghost : 1;
bool password : 1;
bool persistent : 1;
bool read_only : 1;
bool rightjust : 1;
bool roman : 1; // Is a Roman number ?
bool shown : 1; // Is visible
@ -187,11 +188,19 @@ public:
// @cmember Setta la giustificazione a destra del campo
void set_justify(bool r);
// @cmember Setta il flag read-only
virtual void set_read_only(bool r);
// @cmember Verifica la giustificazione a destra del campo
bool right_justified() const
{ return _flags.rightjust; }
// @cmember Ritorna true se il campo e' in maiuscolo
// @cmember Verifica il read-only del campo
bool read_only() const
{ return _flags.read_only; }
// @cmember Ritorna true se il campo e' in maiuscolo
bool uppercase() const
{ return _flags.uppercase; }
@ -395,7 +404,7 @@ public:
// @field bool | ghost: 1 | Indica se il campo e' ghost
// @field bool | password: 1 | Indica che e' un campo password (no si vede quello che scrivi)
// @field bool | persistent: 1 | Indica se il valore del campo deve rimanere anche quando viene ricaricata la maschera
// @field bool | rightjust: 1 | Indica se il campo e' allineato a destra
// @field bool | read_only: 1 | Indica se il campo e' di sola lettura// @field bool | rightjust: 1 | Indica se il campo e' allineato a destra
// @field bool | roman: 1 | Indica se il campo contiene un numero romano
// @field bool | shown: 1 | Indica se il campo e' visibile
// @field bool | show_default: 1 | Indica se il campo e' visibile di default
@ -412,7 +421,7 @@ protected:
virtual void create(WINDOW parent);
public: // TObject
word class_id() const;
virtual word class_id() const;
bool is_kind_of(word cid) const;
public:
@ -1103,6 +1112,12 @@ protected:
// @cmember Mostra un messaggio di errore di default per il campo
bool default_error_box() const;
// @cmember Imposta lo sfondo del campo
void set_background();
// @cmember Setta il flag read-only
virtual void set_read_only(bool r);
// @access Public Member
public:
// @cmember Ritorna l'identificatore della classe
@ -1696,4 +1711,4 @@ public:
virtual ~TGolem_client_field();
};
#endif // __MASKFLD_H
#endif // __MASKFLD_H

View File

@ -11,7 +11,7 @@
#define CGAUT 7
#define CIAUT 8
#define MIAUT 9
#define AIAUT 10
#define DTAUT 10
#define CEAUT 11
#define RSAUT 12
#define SCAUT 13
@ -42,4 +42,4 @@
#define ESAUT 47
#define ENDAUT 48
#endif // __MODAUT_H
#endif // __MODAUT_H

View File

@ -2290,7 +2290,7 @@ void TSpreadsheet::set_columns_order(TToken_string* order)
XI_OBJ* col = cid ? find_column(cid) : column[0];
if (col)
{
if (index >= fixed)
if (index >= fixed)
{
const int cur_pos = xi_obj_to_idx(col);
if (cur_pos != next_pos)
@ -2316,7 +2316,8 @@ void TSpreadsheet::set_columns_order(TToken_string* order)
XI_OBJ* col = cid ? find_column(cid) : column[0];
if (col) // Controlla che esista ancora
{
if (pos >= fixed && pos < num_cols)
//if (pos >= fixed && pos < num_cols) // Da' problemi in presenza di colonne nascoste (livelli giacenza)
if (pos >= 1 && pos < num_cols)
{
const int cur_pos = xi_obj_to_idx(col);
if (cur_pos != pos)

View File

@ -1,8 +1,8 @@
#ifndef __RECORDSET_H
#define __RECORDSET_H
#ifndef __ISAM_H
#include <isam.h>
#ifndef __ASSOC_H
#include <assoc.h>
#endif
#ifndef __SHEET_H

View File

@ -2633,12 +2633,9 @@ void TReport::msg_isam_read(TVariant_stack& stack)
keyrec.put(fld, var.as_string()); // scrive il risultato dell'espressione nel campo del file
}
const TRectype& file = cache().get(keyrec);
if (!file.empty())
{
TToken_string out(stack.pop().as_string(), '!');
do_isam_read_output(file, out);
}
const TRectype& rec = cache().get(keyrec);
TToken_string out(stack.pop().as_string(), '!');
do_isam_read_output(rec, out); // Se rec e' vuoto azzera gli outputs
}
void TReport::msg_table_read(TVariant_stack& stack)
@ -2650,12 +2647,9 @@ void TReport::msg_table_read(TVariant_stack& stack)
const TString& codtab = stack.pop().as_string();
TVariant var;
evaluate(codtab, var, _alfafld);
const TRectype& file = cache().get(t_code, var.as_string());
if (!file.empty())
{
TToken_string out(stack.pop().as_string(), '!');
do_isam_read_output(file, out);
}
const TRectype& rec = cache().get(t_code, var.as_string());
TToken_string out(stack.pop().as_string(), '!');
do_isam_read_output(rec, out); // Se rec e' vuoto azzera gli outputs
}
}

View File

@ -5,6 +5,10 @@
#include <image.h>
#endif
#ifndef __ISAMS_H
class TRectype;
#endif
#ifndef __WINDOW_H
#include <window.h>
#endif

View File

@ -1,5 +1,6 @@
#include <automask.h>
#include <colors.h>
#include <config.h>
#include <defmask.h>
#include <diction.h>
#include <printer.h>
@ -1501,7 +1502,7 @@ void TReport_book::define_frame(const TRectangle& r)
long TReport_book::print_section(char type, int level)
{
long h = 0;
long h = -3; // Hidden
TReport_section* rs = _report->find_section(type, level);
if (rs != NULL)
h = print_section(*rs);
@ -1527,14 +1528,22 @@ bool TReport_book::open_page()
}
if (_rep_page == 1)
_delta.y += print_section('H', 1);
{
const long height = print_section('H', 1);
if (height > 0)
_delta.y += height;
}
TReport_section* page_head = _report->find_section('H', 0);
if (page_head != NULL && (_rep_page > 1 || !page_head->hidden_if_needed()))
{
_delta += page_head->pos();
_delta.y += print_section(*page_head);
_delta.x = 0;
const long height = print_section(*page_head);
if (height > 0)
{
_delta.y += height;
_delta.x = 0;
}
}
return true;
@ -1598,10 +1607,15 @@ void TReport_book::reprint_group_headers(const TReport_section& rs)
}
}
// Stampa una sezione e ne ritorna l'altezza.
// In caso di problemi particolari torna un'altezza negativa:
// -1 Abort
// -2 Condizione di stampa non verificata
// -3 Nascosta
long TReport_book::print_section(TReport_section& rs)
{
if (_print_aborted)
return 0;
return -1;
rs.load_fields();
@ -1611,15 +1625,18 @@ long TReport_book::print_section(TReport_section& rs)
TVariant var;
_report->evaluate(rs.condition(), var, _nullfld);
if (!var.as_bool())
return 0;
return -2;
}
if (!rs.execute_prescript())
{
_print_aborted = true;
return 0;
return -1;
}
if (rs.hidden())
return -3;
const long height = rs.compute_size().y; // Compute size after the initilization script!
if (height > 0) // Has some visible fields
@ -1684,7 +1701,10 @@ long TReport_book::print_section(TReport_section& rs)
}
if (!rs.execute_postscript())
{
_print_aborted = true;
return -1;
}
return height;
}
@ -1708,8 +1728,8 @@ bool TReport_book::init(TReport& rep)
}
_report = &rep;
if (_report->use_printer_font())
_report->load_printer_font();
if (rep.use_printer_font())
rep.load_printer_font();
const TPoint siz = page_size();
const TPoint res = page_res();
@ -1735,7 +1755,7 @@ bool TReport_book::init(TReport& rep)
void TReport_book::print_subsections(int father)
{
for (int i = 1; i <= 9; i++)
for (int i = 1; i <= 9 && !_print_aborted; i++)
{
const int level = father*10+i;
TReport_section* rs = _report->find_section('B', level);
@ -1748,13 +1768,21 @@ void TReport_book::print_subsections(int father)
rex->requery();
if (rex->items() > 0)
{
_delta.y += print_section('H', level);
long height = print_section('H', level);
if (height > 0)
_delta.y += height;
for (bool ok = rex->move_to(0); ok && !_print_aborted; ok = rex->move_next())
{
_delta.y += print_section('B', level);
print_subsections(level);
height = print_section('B', level);
if (height >= 0)
{
_delta.y += height;
print_subsections(level);
}
}
_delta.y += print_section('F', level);
height = print_section('F', level);
if (height > 0)
_delta.y += height;
}
}
}
@ -1828,17 +1856,25 @@ bool TReport_book::add(TReport& rep, bool progind)
if (rex->current_row() > 0)
{
for (int g = max_group; g >= first_changed ; g--)
_delta.y += print_section('F', g);
{
const long height = print_section('F', g);
if (height > 0)
_delta.y += height;
}
}
for (int g = first_changed; g <= max_group; g++)
_delta.y += print_section('H', g);
{
const long height = print_section('H', g);
if (height > 0)
_delta.y += height;
}
}
}
// Stampa di tutti i body
for (int b = 1; b <= max_body; b++)
{
const int dy = print_section('B', b);
if (dy > 0) // Ho stampato qualcosa
if (dy > 0) // Ho stampato fisicamente qualcosa
{
// Cerco di vedere se e' possibile la stampa etichette
int column_delta = 0;
@ -1858,7 +1894,9 @@ bool TReport_book::add(TReport& rep, bool progind)
_delta.y += dy;
last_body_height = 0; // Non servirebbe strettamente
}
}
if (dy >= 0)
{
// Stampa eventuali sottosezioni
print_subsections(b);
}
@ -1876,7 +1914,11 @@ bool TReport_book::add(TReport& rep, bool progind)
{
// Devo stampare tutte le code degli eventuali raggrupamenti
for (int g = max_group; g >= 2 ; g--)
_delta.y += print_section('F', g);
{
const long height = print_section('F', g);
if (height > 0)
_delta.y += height;
}
TReport_section* fl = _report->find_section('F',1);
if (fl != NULL) // Gestione footer last (se esite)

View File

@ -266,7 +266,7 @@ const TString & TVariable_rectype::get_str(const char* fieldname) const
if (_memo_fld_to_load && f == NULL)
{
((TVariable_rectype *) this)->_memo_fld_to_load = FALSE;
((TVariable_rectype *) this)->_memo_fld_to_load = false;
TToken_string values(get(_memo_fld), '\n');
for (const char * s = values.get(0); s && *s; s = values.get())
{

View File

@ -78,7 +78,7 @@ void TStampa_listamov::main_loop()
void TStampa_listamov::setprint_x_mov()
{
_form = new TForm("mg4100", "");
_form = new TForm("mg4100");
TRectype darec(LF_RMOVMAG),arec(LF_RMOVMAG);
TSorted_cursor& cur = (TSorted_cursor& )*_form->cursor();
@ -187,7 +187,7 @@ void TStampa_listamov::setprint_x_mov()
void TStampa_listamov::setprint_x_art()
{
_form = new TForm("mg4100b", "");
_form = new TForm("mg4100b");
TRectype darec(LF_RMOVMAG),arec(LF_RMOVMAG);
TSorted_cursor& cur = (TSorted_cursor& )*_form->cursor();
@ -195,13 +195,12 @@ void TStampa_listamov::setprint_x_art()
TString sortexp;
TString filter;
TString16 anno(_mask->get(F_ANNOES));
TString4 anno(_mask->get(F_ANNOES));
if (anno.not_empty())
filter << '(' << LF_MOVMAG << "->ANNOES==\""<< _mask->get(F_ANNOES) << "\")";
filter << '(' << LF_MOVMAG << "->ANNOES==\""<< anno << "\")";
long codcf = _mask->get_long(F_CODCF);
if (codcf != 0)
{
if (filter.not_empty())
@ -264,6 +263,7 @@ void TStampa_listamov::setprint_x_art()
cur.setfilter(filter,TRUE, 1);
cur.setregion(darec,arec, 0x2);
}
int mg4100(int argc, char* argv[])
{
TStampa_listamov a;// derivata da Application e con uso di form

View File

@ -1,7 +1,5 @@
#include <applicat.h>
#include <currency.h>
#include <progind.h>
#include <utility.h>
#include "../cg/cglib01.h"
#include "../ve/veconf.h"
@ -27,7 +25,7 @@ bool TForm_inventario::validate(TForm_item &cf, TToken_string &s)
const TString subcode=s.get();
if (subcode=="GIAC")
{
real v=curr_art().giacenza_corretta(magrec, FALSE,_valcomp);
real v=curr_art().giacenza_corretta(magrec, false,_valcomp);
cf.set(v.string());
}
else
@ -51,13 +49,16 @@ bool TForm_inventario::validate(TForm_item &cf, TToken_string &s)
else
if (subcode=="LINEATOTALI")
{
TString l(29*_colonne+12,'-');
const TString l(29*_colonne+12,'-');
cf.set(l);
}
}
else
if (code == "_ANNO")
cf.set(format("%d", _annoes));
{
TString4 anno; anno << _annoes;
cf.set(anno);
}
return TForm_stampemg::validate(cf, s);
}
@ -131,36 +132,36 @@ bool TForm_inventario::valorizzazione(TForm_item &cf, TTipo_valorizz t)
v=curr_art().costo_medio(annoes,codmag,livello);
}
// arrotonda le valorizzazioni a costo unitario
_currency->set_price(TRUE);
_currency->set_price(true);
_currency->set_num(v);
v = _currency->get_num();
if (t==valorizz_LIFO) {
const TString4 codmag = magrec.get(MAG_CODMAG).left(3);
const TString80 livello(magrec.get(MAG_LIVELLO));
v=curr_art().LIFO(annoes,codmag,livello, FALSE,_valcomp);
v=curr_art().LIFO(annoes,codmag,livello, false,_valcomp);
}
if (t==valorizz_FIFO) {
const TString4 codmag = magrec.get(MAG_CODMAG).left(3);
const TString80 livello(magrec.get(MAG_LIVELLO));
v=curr_art().FIFO(annoes,codmag,livello, FALSE,_valcomp);
v=curr_art().FIFO(annoes,codmag,livello, false,_valcomp);
}
if (t==valorizz_LIFOa) {
const TString4 codmag = magrec.get(MAG_CODMAG).left(3);
const TString80 livello(magrec.get(MAG_LIVELLO));
v=curr_art().LIFO_annuale(annoes,codmag,livello, FALSE,_valcomp);
v=curr_art().LIFO_annuale(annoes,codmag,livello, false,_valcomp);
}
if (t==valorizz_FIFOa) {
const TString4 codmag = magrec.get(MAG_CODMAG).left(3);
const TString80 livello(magrec.get(MAG_LIVELLO));
v=curr_art().FIFO_annuale(annoes,codmag,livello, FALSE,_valcomp);
v=curr_art().FIFO_annuale(annoes,codmag,livello, false,_valcomp);
}
const real giac_corretta = curr_art().giacenza_corretta(magrec, FALSE,_valcomp);
const real giac_corretta = curr_art().giacenza_corretta(magrec, false,_valcomp);
v= v * giac_corretta ;
_currency->set_price(FALSE);
_currency->set_price(false);
_currency->set_num(v);
cf.set(_currency->get_num().string());
return TRUE;
return true;
}
@ -168,11 +169,11 @@ bool TForm_inventario::genera_intestazione_supplementare(pagetype p, short y)
{
TPrint_section* body = exist('B', p);
if (body == NULL || !body->columnwise())
return FALSE;
return false;
TPrint_section* header = exist('H', p);
if (header == NULL)
return FALSE;
return false;
TForm_string* s;
TString des;
@ -189,11 +190,11 @@ bool TForm_inventario::genera_intestazione_supplementare(pagetype p, short y)
s->set_x(fi.x());
s->y() = y;
s->set_prompt(des);
s->temp() = TRUE;
s->temp() = true;
header->add_field(s);
}
return TRUE;
return true;
}
void TForm_inventario::set_parametri(const char * codcatv,const char * codlist,bool giaceff, bool valcomp, bool alladata, int annoes)
@ -206,11 +207,11 @@ void TForm_inventario::set_parametri(const char * codcatv,const char * codlist,b
_annoes = annoes;
}
TForm_inventario::TForm_inventario(const char *name,const char *code) :
TForm_stampemg(name,code),_curr_art(NULL)
TForm_inventario::TForm_inventario(const char *name) :
TForm_stampemg(name, ""), _curr_art(NULL)
{
_sortcur = new TSorted_cursor(relation(),"RAGGFIS|CODART");
_use_alternate_cursor = FALSE;
_use_alternate_cursor = false;
_colonne=0;
_currency = new TCurrency(ZERO,"_FIRM");
}
@ -268,7 +269,7 @@ bool TStampainv_mask::handle_filt(TMask_field &fld, KEY k)
m.show(F_ORDINEMAG, !articles);
m.send_key(K_SPACE, articles ? F_ORDINEART : F_ORDINEMAG);
}
return TRUE;
return true;
}
bool TStampainv_mask::handle_subord(TMask_field &fld, KEY k)
@ -298,7 +299,7 @@ bool TStampainv_mask::handle_subord(TMask_field &fld, KEY k)
break;
}
}
return TRUE;
return true;
}
bool TStampainv_mask::handle_liv(TMask_field &fld, KEY k)
@ -311,13 +312,17 @@ bool TStampainv_mask::handle_liv(TMask_field &fld, KEY k)
if (fld.mask().get_int(F_TOLIVELLOART) || fld.mask().get_int(F_TOLIVELLOGIAC))
{
// raggruppamenti prima del dettaglio magazzini
ftotmag.reset(); ftotmag.disable();ftotmag.do_message(0);
} else {
ftotmag.reset();
ftotmag.disable();
ftotmag.do_message(0);
}
else
{
ftotmag.enable();
}
}
}
return TRUE;
return true;
}
@ -336,13 +341,13 @@ bool TStampainv_mask::handle_ragg(TMask_field &fld, KEY k)
fraggcod.reset(); fraggcod.disable();
fragggiac.reset(); fragggiac.disable();
fraggcod.do_message(0);fragggiac.do_message(0);
return TRUE;
return true;
}
}
fraggcod.enable();
fragggiac.enable();
}
return TRUE;
return true;
}
@ -365,7 +370,7 @@ bool TStampainv_mask::handle_codlist(TMask_field &fld, KEY k)
}
}
return TRUE;
return true;
}
@ -387,7 +392,7 @@ bool TStampa_inventario::create()
bool TStampa_inventario::destroy()
{
delete _mask;
return TRUE;
return true;
}
bool TStampa_inventario::crea_tempmag(const bool b)
@ -395,7 +400,7 @@ bool TStampa_inventario::crea_tempmag(const bool b)
{
const bool valcomp = *_mask->get(F_FIN_COMP)=='C';
TIsamtempfile* temp_mag = new TIsamtempfile(LF_MAG, "tmpmag", TRUE, b);
TIsamtempfile* temp_mag = new TIsamtempfile(LF_MAG, "tmpmag", true, b);
TRectype darec(LF_ANAMAG), arec(LF_ANAMAG);
darec.put(ANAMAG_CODART, _mask->get(F_DAART));
@ -407,29 +412,28 @@ bool TStampa_inventario::crea_tempmag(const bool b)
ana_cur.freeze();
const TDate data_limite(_mask->get_date(F_DATALIM));
TArticolo_giacenza art_giac;
TString16 annoes(_mask->get(F_ANNOES));
const TString4 annoes(_mask->get(F_ANNOES));
TString msg;
msg << "Creazione giacenze temporanee anno " << annoes;
TProgind pi(items, msg, FALSE, TRUE);
TProgind pi(items, msg, false, true);
for (ana_cur = 0L; ana_cur.pos() < items; ++ana_cur)
for (ana_cur = 0; ana_cur.pos() < items; ++ana_cur)
{
art_giac.read(ana_cur.curr());
pi.addstatus(1);
const TArticolo_giacenza art_giac(ana_cur.curr());
TRecord_array& mag = art_giac.mag(annoes);
// Scrive i records sul file temporaneo
TRecord_array& mag = art_giac.mag(annoes);
for (int i = mag.last_row(); i > 0 && temp_mag->good(); i = mag.pred_row(i))
{
TRectype & magrec = (TRectype &) mag.row(i);
TRectype& magrec = (TRectype&)mag.row(i);
real v=art_giac.giacenza_corretta(magrec, TRUE, valcomp);
const real v = art_giac.giacenza_corretta(magrec, true, valcomp);
magrec.put(MAG_GIAC, v);
temp_mag->write(magrec);
magrec.write(*temp_mag);
}
pi.addstatus(1L);
}
// Se il file è ok lo sostituisce all'interno della relazione del form
@ -455,7 +459,7 @@ bool TStampa_inventario::calcola_giacenze(const bool b)
//Scorre l'anagrafica di magazzino e calcola per ognuno la giacenza alla data indicata
//Memorizzando i records in un file temporaneo che avrà lo stesso tracciato di LF_MAG
TIsamtempfile* temp_mag = new TIsamtempfile(LF_MAG, "tmpmag", TRUE, b);
TIsamtempfile* temp_mag = new TIsamtempfile(LF_MAG, "tmpmag", true, b);
TRectype darec(LF_ANAMAG), arec(LF_ANAMAG);
darec.put(ANAMAG_CODART, _mask->get(F_DAART));
@ -467,35 +471,34 @@ bool TStampa_inventario::calcola_giacenze(const bool b)
ana_cur.freeze();
const TDate data_limite(_mask->get_date(F_DATALIM));
TArticolo_giacenza_data art_giac;
const TEsercizi_contabili esc;
const int anno = esc.date2esc(data_limite);
TString16 annoes; annoes.format("%04d", anno);
TString4 annoes; annoes.format("%04d", anno);
TString msg;
msg << TR("Elaborazione saldi al ") << data_limite << " ...";
TProgind pi(items, msg, FALSE, TRUE);
TProgind pi(items, msg, false, true);
for (ana_cur = 0L; ana_cur.pos() < items; ++ana_cur)
{
art_giac.read(ana_cur.curr());
pi.addstatus(1);
TArticolo_giacenza_data art_giac(ana_cur.curr());
art_giac.al(data_limite); // Calcola la giacenza alla data per questo articolo
// Scrive i records sul file temporaneo
TRecord_array& mag = art_giac.mag(annoes);
for (int i = mag.last_row(); i > 0 && temp_mag->good(); i = mag.pred_row(i))
{
TRectype & magrec = (TRectype &) mag.row(i);
TRectype& magrec = (TRectype&)mag.row(i);
if (giaceff)
{
real v=art_giac.giacenza_corretta(magrec, TRUE,valcomp);
const real v = art_giac.giacenza_corretta(magrec, true, valcomp);
magrec.put(MAG_GIAC, v);
}
temp_mag->write(magrec);
magrec.write(*temp_mag);
}
pi.addstatus(1L);
}
// Se il file è ok lo sostituisce all'interno della relazione del form
@ -506,10 +509,12 @@ bool TStampa_inventario::calcola_giacenze(const bool b)
delete temp_mag;
}
else
{
if (b) // Non sostituire in caso di stampa tutti gli articoli
_form->relation()->replace(temp_mag);
else
delete temp_mag; // in caso di stampa tutti gli articoli, non cancella fisicamente il file; per riaprirlo poi
}
return rt;
}
@ -636,7 +641,7 @@ void TStampa_inventario::setprint_permagazzini()
_form->setdett_permag(
_mask->get_bool(F_RAGGCODICE),_mask->get_int(F_FROMLIVELLOART),_mask->get_int(F_TOLIVELLOART),
_mask->get_bool(F_RAGGLIVGIAC),_mask->get_int(F_FROMLIVELLOGIAC),_mask->get_int(F_TOLIVELLOGIAC),
TRUE,_mask->get_bool(F_TOTALIDEPOSITI),_mask->get_bool(F_DETTAGLIODEP));
true,_mask->get_bool(F_TOTALIDEPOSITI),_mask->get_bool(F_DETTAGLIODEP));
((TSorted_cursor *)_cur)->change_order(espr1);
@ -644,7 +649,7 @@ void TStampa_inventario::setprint_permagazzini()
darec.put("CODMAG",_mask->get(F_DAMAG));
arec.put("ANNOES",_mask->get(F_ANNOES));
arec.put("CODMAG",_mask->get(F_AMAG));
_cur->setfilter(cfilter, TRUE);
_cur->setfilter(cfilter, true);
_cur->setregion(darec,arec);
}
@ -918,7 +923,7 @@ void TStampa_inventario::setprint_perarticoli_all()
if (_mask->get_bool(F_ALLADATA) || *_mask->get(F_REALE_GIAC)=='R')
{
TIsamtempfile* temp_mag = new TIsamtempfile(LF_MAG, "tmpmag", FALSE, TRUE); // Non crearlo, auto cancella il file
TIsamtempfile* temp_mag = new TIsamtempfile(LF_MAG, "tmpmag", false, true); // Non crearlo, auto cancella il file
rel = new TRelation(temp_mag);
}
else
@ -942,11 +947,11 @@ void TStampa_inventario::main_loop()
{
while (_mask->run() == K_ENTER)
{
if (_mask->magazz_ini().gestmag(TRUE))
if (_mask->magazz_ini().gestmag(true))
{
if (_mask->get(F_DAMAG).blank() && _mask->get(F_AMAG).blank())
{
bool empty = FALSE;
bool empty = false;
if (_mask->get(F_ORDINEART) == "D")
empty = _mask->get(F_DADES).blank() && _mask->get(F_ADES).blank();
else
@ -962,14 +967,14 @@ void TStampa_inventario::main_loop()
{
if (_mask->get(F_FILTRO)[0]=='T') // tutti gli articoli
{
_form = new TForm_inventario("mg4200aa", "");
if (b && !calcola_giacenze(FALSE))
_form = new TForm_inventario("mg4200aa");
if (b && !calcola_giacenze(false))
{
delete _form;
continue;
}
else
if (!b && r && !crea_tempmag(FALSE))
if (!b && r && !crea_tempmag(false))
{
delete _form;
continue;
@ -978,7 +983,7 @@ void TStampa_inventario::main_loop()
}
else
{
_form = new TForm_inventario("mg4200a", "");
_form = new TForm_inventario("mg4200a");
if (b && !calcola_giacenze())
{
delete _form;
@ -995,7 +1000,7 @@ void TStampa_inventario::main_loop()
}
else
{
_form = new TForm_inventario("mg4200b", "");
_form = new TForm_inventario("mg4200b");
if (b && !calcola_giacenze())
{
delete _form;

View File

@ -578,7 +578,7 @@ SECTION BODY ODD 0 COLUMNWISE
STRINGA 60 40 1
BEGIN
FLAGS "H"
KEY "CATMER"
KEY "Livello giac"
PROMPT 2 1 ""
MESSAGE RESET,2@
END

View File

@ -30,7 +30,7 @@ public:
bool validate(TForm_item &cf, TToken_string &s);
void use_alternate_cursor(const bool b = TRUE) { _use_alternate_cursor = b; }
void add_colval(int tipo);
TForm_inventario(const char *name,const char *code) ;
TForm_inventario(const char *name);
~TForm_inventario();
};

View File

@ -125,8 +125,7 @@ public:
class TArticolo_giacenza : public TArticolo
{
TString16 _anno_mag;
TString16 _anno_sto;
TString4 _anno_mag, _anno_sto;
protected:
// la get_str supporta anche la sintassi:
@ -568,8 +567,6 @@ class TForm_stampemg : public TForm
bool _permag;
int _fromlivgiac,_tolivgiac,_fromlivart,_tolivart;
TTipo_ordinamento_mg _ordering;
//sostituire con le funzioni di TLivelli_... :
//TDecoder *_giacgrp,*_artgrp;
protected:
bool setdettaglio(bool show, int fromlivart,int livart,int fromlivgiac,int livgiac,bool dettgiac);

View File

@ -952,13 +952,14 @@ TCodgiac_livelli::TCodgiac_livelli()
static TCodgiac_livelli *_livelli_giacenza=NULL;
static TCodart_livelli *_livelli_articolo=NULL;
TCodgiac_livelli &livelli_giacenza()
TCodgiac_livelli& livelli_giacenza()
{
if (_livelli_giacenza==NULL)
_livelli_giacenza=new TCodgiac_livelli();
return *_livelli_giacenza;
}
TCodart_livelli &livelli_articolo()
TCodart_livelli& livelli_articolo()
{
if (_livelli_articolo==NULL)
_livelli_articolo=new TCodart_livelli();

View File

@ -584,9 +584,9 @@ int TArticolo_giacenza::find_storico(const char * annoesrif, const char * codmag
return find_storico(rsto, codmag, from);
}
TRecord_array & TArticolo_giacenza::mag(const char * annoes) const
TRecord_array & TArticolo_giacenza::mag(const char* annoes) const
{
TString16 anno = annoes;
TString4 anno = annoes;
if (anno.blank())
{
TEsercizi_contabili ese;

View File

@ -212,24 +212,19 @@ void TForm_stampemg::set_ordering(const TTipo_ordinamento_mg t)
TString cond;
switch (_ordering)
{
default:
case mg_normale:
cond = "CODART";
break;
case mg_ragg_fisc:
cond = "RAGGFIS";
break;
case mg_cat_merc:
cond = "GRMERC[1,3]";
break;
case mg_normale: cond = "CODART"; break;
case mg_ragg_fisc: cond = "RAGGFIS"; break;
case mg_cat_merc: cond = "GRMERC[1,3]"; break;
default: break;
}
s.setcondition(cond,_strexpr);
}
bool TForm_stampemg::setdett_perart(bool totaliart,int fromlivart,int livart,bool totaligiac,int fromlivgiac,int livgiac,bool showmag, bool showdep)
{
const int last_artlev=livelli_articolo().last_level() ? livelli_articolo().last_level() : 1;
const int last_giaclev=livelli_giacenza().last_level();
const TCodart_livelli& la = livelli_articolo();
const int last_artlev = la.last_level() ? la.last_level() : 1;
const int last_giaclev = livelli_giacenza().last_level();
if (totaliart) // voglio i totali di articolo
{
@ -244,7 +239,7 @@ bool TForm_stampemg::setdett_perart(bool totaliart,int fromlivart,int livart,boo
if (totaligiac) // voglio i totali di giacenza
{
if (livgiac==0 && livart==0)
livgiac=last_giaclev; //
livgiac=last_giaclev;
}
else
{
@ -290,13 +285,14 @@ bool TForm_stampemg::setdett_permag(bool totaliart,int fromlivart,int livart,boo
find_field('B',odd_page,FF_DIVDEPOSITI).enable(showdep);
find_field('B',odd_page,"H_DEPOSITO").show(showdep && showdett);
find_field('B',odd_page,"TOT_DEPOSITO").show(showdep);
return setdettaglio(showdett,fromlivart,livart,fromlivgiac,livgiac,FALSE);
return setdettaglio(showdett,fromlivart,livart,fromlivgiac,livgiac, FALSE);
}
bool TForm_stampemg::setdettaglio(bool show, int fromlivart,int livart,int fromlivgiac,int livgiac,bool dettgiac)
{
const int last_artlev=livelli_articolo().last_level() ? livelli_articolo().last_level() : 1;
const TCodart_livelli& la = livelli_articolo();
const int last_artlev=la.last_level() ? la.last_level() : 1;
const int last_giaclev=livelli_giacenza().last_level();
const int tolivart =min(( livart ? livart :last_artlev) ,last_artlev-1);
@ -341,36 +337,32 @@ bool TForm_stampemg::setdettaglio(bool show, int fromlivart,int livart,int froml
sname="H_GLIVGIAC";
sname << i;
TForm_subsection &s2=(TForm_subsection &)find_field('B',odd_page,sname);
s2.show(show && i>=fromlivgiac && (i<tolivgiac ||(i==tolivgiac && dettgiac)) && livart==0);
const bool on = show && i>=fromlivgiac && (i<tolivgiac ||(i==tolivgiac && dettgiac)) && livart==0;
s2.show(on);
}
// ***********
fromlivart = fromlivart ? fromlivart :1;
fromlivgiac=fromlivgiac ? fromlivgiac :1;
// codice livello giacenza
for (i=fromlivgiac;i<=tolivgiac ; i++) {
if (livart==0)
if (livart==0)
{
for (i=fromlivgiac;i<=tolivgiac ; i++)
{
TString80 sname;
sname << "GRUPPI_LIVGIAC" << i;
TForm_subsection &s=(TForm_subsection &)find_field('B',odd_page,sname);
// ATTENZIONE, WARNING, ACHTUNG: Libera interpretazione
// cond finiva per essere CODART+CODART+LIVELLO+LIVELLO[1.6]+LIVELLO[7,8]
// cond ora vale "giustamente" CODART+LIVELLO[1,8]
// TString cond(s.condition()); // Augusto Mode
// cond << "+LIVELLO[" << livelli_giacenza().packed_length(i-1)+1 << "," << livelli_giacenza().packed_length(i) <<']';
TString cond = "CODART"; // Guy Mode
cond << "+LIVELLO[1," << livelli_giacenza().packed_length(i) <<']';
TString cond(s.condition());
cond << "+LIVELLO[" << livelli_giacenza().packed_length(i-1)+1 << "," << livelli_giacenza().packed_length(i) <<']';
s.setcondition(cond,_strexpr);
}
}
// sezioni livello codice
// for (i=fromlivart;i<=tolivart ; i++) {
for (i=1;i<=tolivart ; i++) {
for (i=1;i<=tolivart ; i++)
{
TString sname("GRUPPI_CODART");
sname << i;
TForm_subsection &s=(TForm_subsection &)find_field('B',odd_page,sname);
@ -386,8 +378,6 @@ bool TForm_stampemg::setdettaglio(bool show, int fromlivart,int livart,int froml
TForm_stampemg::TForm_stampemg(const char *name,const char *code)
: TForm(name,code)
{
// _giaclev= new TCodgiac_livelli();
// _artlev= new TCodart_livelli();
_fromlivgiac=_tolivgiac=0;
_fromlivart=_tolivart=0;
_ordering = mg_normale;
@ -395,8 +385,6 @@ TForm_stampemg::TForm_stampemg(const char *name,const char *code)
}
TForm_stampemg::~TForm_stampemg()
{
// delete _giaclev;
// delete _artlev;
}
// maschera delle stampe magazzino

View File

@ -1,3 +1,3 @@
152
0
$rilprod|0|0|127|0|Rilevazione produzione|||
$rilprod|65|65|135|0|Rilevazione produzione|||

View File

@ -1,5 +1,5 @@
152
19
20
CODART|1|20|0|Codice articolo
DATA|5|8|0|Data di scadenza
PROG|2|3|0|Progressivo del giorno
@ -13,6 +13,7 @@ OPERATORE|1|16|0|Codice Operatore
NRIGA|2|3|0|Numero riga ordine di produzione
QTA|4|15|5|Quantità prodotta totale
SCARTO|4|15|4|Scarto di produzione totale
PROD|4|8|3|Produttività per articoli non codificati
CHIUSO|8|1|0|Lotto chiuso
CODNUMP|1|4|0|Codice numerazione bolla di produzione
ANNOP|2|4|0|Anno bolla di produzione
@ -25,4 +26,4 @@ IMPIANTO+LINEA+CODART+DATA|X
DATA+IMPIANTO+LINEA+CODART|X
PROVV+ANNO+CODNUM+NDOC+NRIGA|X
PROVVP+ANNOP+CODNUMP+NDOCP+NRIGAP|X
CODNUM+ANNO+PROVV+NDOC+CODART+DATA|X
CODNUM+ANNO+PROVV+NDOC+DATA+CODART|X

View File

@ -303,7 +303,6 @@ void TRilprod_mask::load_prod_file(const char * nomefile, bool savefile, bool on
int type_field = 0;
int ord_field = 0;
int cod_field = 0;
TDate filedate;
TProduzione prd;
TLocalisamfile rigaord(LF_RIGHEDOC);
TString val;
@ -608,9 +607,10 @@ void TRilprod_mask::load_prod_file(const char * nomefile, bool savefile, bool on
dest = dest.path();
TString filemask(dest);
TString_array arr;
TDate filedate(TODAY);
int cnt = 0;
filemask << "pr" << filedate.month() << filedate.day() << "*.dat";
filemask << format("pr%02d%02d*.dat", filedate.month(), filedate.day());
list_files(filemask, arr);
const int items = arr.items();
@ -620,7 +620,8 @@ void TRilprod_mask::load_prod_file(const char * nomefile, bool savefile, bool on
cnt = atoi(arr.row(items - 1).right(5));
}
cnt++;
dest << "pr" << filedate.month() << filedate.day() << cnt; dest.ext("dat");
dest << format("pr%02d%02d%02d.dat", filedate.month(), filedate.day(), cnt);
if (fcopy(nomefile, dest))
remove_file(nomefile);

View File

@ -24,7 +24,8 @@
#define F_DESCRLIN 222
#define F_DESCRNUM 223
#define F_DESCRNUMP 224
#define F_SCARTO 225
#define F_SCARTO 225
#define F_PROD 226
#define F_BOTTONE 240
#define F_DATALOG 241

View File

@ -47,14 +47,15 @@ STRING F_DESCRCOD 50
BEGIN
PROMPT 2 2 "Descrizione "
USE LF_ANAMAG KEY 2
FLAGS "U"
FLAGS "UG"
INPUT DESCR F_DESCRCOD
DISPLAY "Descrizione@50" DESCR
DISPLAY "Codice articolo@20" CODART
COPY OUTPUT F_CODART
CHECKTYPE NORMAL
KEY 1
MESSAGE COPY,12@
MESSAGE EMPTY ENABLE,F_PROD
MESSAGE COPY,12@|CLEAR,F_PROD
END
DATE F_DATA
@ -77,11 +78,11 @@ BEGIN
INPUT CODNUM F_CODNUM
INPUT NDOC F_NDOC
INPUT NRIGA F_NRIGA
DISPLAY "Ordine@10" NDOC
DISPLAY "Riga@7" NRIGA
DISPLAY "Codice articolo@20" CODART
DISPLAY "Descrizione@50" LF_ANAMAG->DESCR
DISPLAY "Ordine@10" NDOC
DISPLAY "Riga@7" NRIGA
DISPLAY "Data ordine" DATA
DISPLAY "Codice articolo@20" CODART
DISPLAY "Descrizione@50" LF_ANAMAG->DESCR
DISPLAY "Prog." PROG
OUTPUT F_CODART CODART
OUTPUT F_DATA DATA
@ -287,6 +288,12 @@ BEGIN
FIELD SCARTO
END
NUMBER F_PROD 8 3
BEGIN
PROMPT 38 14 "Produttivita' teorica "
FI PROD
END
GROUPBOX DLG_NULL 78 4
BEGIN
PROMPT 1 15 "@bBolla di produzione"

View File

@ -3484,10 +3484,8 @@ bool TMatResPlanning::menu(MENU_TAG mt)
void TMatResPlanning::main_loop()
{
open_files(LF_TABCOM, LF_TAB, LF_DOC, LF_RIGHEDOC, 0);
open_files(LF_CLIFO, LF_CFVEN, LF_OCCAS, LF_INDSP,LF_CONDV, 0);
open_files(LF_ANAMAG, LF_DIST, LF_RDIST, 0);
open_files(LF_MAG, LF_STOMAG, LF_DESLIN, LF_CODCORR, 0);
open_files(LF_TABCOM, LF_TAB, LF_DOC, LF_RIGHEDOC, LF_CLIFO, LF_CFVEN, LF_OCCAS, LF_INDSP,LF_CONDV,
LF_ANAMAG, LF_DIST, LF_RDIST, LF_MAG, LF_STOMAG, LF_DESLIN, LF_CODCORR, 0);
_mask = new TMatResMask;

View File

@ -3394,6 +3394,170 @@ TPlanning_mask::TPlanning_mask()
init();
}
static bool handle_subcodice(TMask_field &fld, KEY k)
{
TMask &mask=fld.mask();
if (k == K_TAB && (fld.focusdirty()||!mask.is_running())) //c'e' qualcosa nel campo
{
//quale e' l'ultimo campo valido per codart in multilevel?
short id_last = fld.dlg();
while (id_last <= F_LIVART9 && mask.id2pos(id_last+1) > 0)
id_last++;
if (fld.empty())
{
//gira su tutti i campi di livart esistenti e successivi al livello corrente
for(short id = fld.dlg()+1; id <= id_last; id++)
{
mask.set(id, "");
mask.disable(id);
}
}
else
{
const int pos = mask.id2pos(fld.dlg()+1);
if (pos > 0)
{
TMask_field& next_fld = mask.fld(pos);
next_fld.enable();
}
}
//riempie in automatico il campo codice complessivo
TString80 stringone;
bool completo = true;
for(short id = F_LIVART1; id <= id_last; id++)
{
const TString& val = mask.get(id);
if (val.blank())
{
completo = false;
break;
}
stringone << val;
}
mask.set(F_CODART, stringone, fld.dlg()==id_last ? 0x3 : 0x0);
}
return true;
}
static bool handle_codice(TMask_field &fld, KEY k)
{
if (k == K_TAB && fld.focusdirty() && !fld.empty())
{
TSheet_field& sheet = fld.mask().sfield(F_ARTICOLI);
bool found = false;
FOR_EACH_SHEET_ROW(sheet, i, row)
{
if (fld.get() == row->get(2))
{
sheet.select(i);
found = true;
break;
}
}
if (!found)
fld.error_box(TR("Articolo non pianificato"));
}
return true;
}
void TPlanning_mask::create_browse1(TEdit_field& kfld, int level, short key_id, short des_id, const TCodart_livelli &cal)
{
TFilename tmp; tmp.temp();
ofstream out(tmp);
out << "USE GCA" << endl; //usa la tabella dei livelli articolo
const short id = key_id + level - 1;
const TString& prompt = cal.name(level);
const TString& picture = cal.picture(level);
out << "IN CODTAB[1,1] \"" << level << "\"" << endl;
out << "IN CODTAB[2,0] " << id << endl;
out << "DI \"" << prompt;
const int length = cal.code_length(level);
if (length > prompt.len())
out << '@' << length;
out << "\" CODTAB[2,0]" << endl;
out << "DI \"" << TR("Descrizione") << "@50\" S0" << endl;
out << "OU " << id << " CODTAB[2,0]" << endl;
out << "OU " << (des_id + level -1) << " S0" << endl;
out << "EN" << endl;
out.close();
TScanner scan(tmp);
while (scan.pop() != "EN")
kfld.parse_item(scan);
xvt_fsys_removefile(tmp);
}
void TPlanning_mask::create_browse2(TEdit_field& kfld, int level, short key_id, short des_id, const TCodart_livelli &cal)
{
TFilename tmp; tmp.temp();
ofstream out(tmp);
out << "USE GCA KE 2 SELECT CODTAB[1,1]=='" << level << "'" << endl; //cerca per descrizione
const short id = des_id + level - 1;
out << "IN S0 " << id << endl;
out << "DI \"" << TR("Descrizione") << "@50\" S0" << endl;
const TString& prompt = cal.name(level);
out << "DI \"" << prompt;
const int length = cal.code_length(level);
if (length > prompt.len())
out << '@' << length;
out << "\" CODTAB[2,0]" << endl;
out << "CO OU " << (key_id + level -1) << endl;
out << "EN" << endl;
out.close();
TScanner scan(tmp);
while (scan.pop() != "EN")
kfld.parse_item(scan);
xvt_fsys_removefile(tmp);
}
int TPlanning_mask::create_codart_fields(int x, int y, short key_id, short des_id)
{
const TCodart_livelli cal;
const int last_level = cal.last_level();
int tab0 = x;
int i;
for (i = 1; i <= last_level; i++) //cicla su tutti i livelli del codart abilitati
{
// codice livello articolo
const short kid = key_id+i-1;
const TString& picture = cal.picture(i);
TString4 flags = "BU";
if (picture[0] == '0')
flags << 'Z';
TEdit_field& kfld = add_string(kid, 3, "", tab0, y, picture.len(), flags);
kfld.set_key(1);
create_browse1(kfld, i, key_id, des_id, cal);
kfld.set_handler(handle_subcodice);
tab0 += picture.len()+3;
}
for (i = 1; i <= last_level; i++)
{
// descrizione livello articolo
const short did = des_id+i-1;
TEdit_field& dfld = add_string(did, 3, "", 200, y, 50, "", 50);
dfld.set_key(1);
create_browse2(dfld, i, key_id, des_id, cal);
}
return cal.last_level();
}
void TPlanning_mask::init()
{
TSheet_field& sf = sfield(F_ARTICOLI);
@ -3401,6 +3565,9 @@ void TPlanning_mask::init()
for (short l = 0; l < 4; l++)
livelli_giacenza().set_sheetcolumn(sf, F_LIV1+l, l+1);
create_codart_fields(10, 4, F_LIVART1, F_DESART1);
set_handler(F_CODART, handle_codice);
TConfig ini(CONFIG_DITTA, "mg");
if (!ini.get_bool("GESDEPOSITI"))
@ -3924,10 +4091,8 @@ int TCRPCheck_mask::fill_mask(const bool show_fields)
void TPlanning_app ::openfiles()
{
open_files(LF_TABCOM, LF_TAB, LF_DOC, LF_RIGHEDOC, 0);
open_files(LF_CLIFO, LF_CFVEN, LF_OCCAS, LF_INDSP, LF_CONDV, 0);
open_files(LF_MAG, LF_MOVMAG, LF_RMOVMAG, 0);
open_files(LF_ANAMAG, LF_DIST, LF_RDIST, LF_MRPREPORT, 0);
open_files(LF_TABCOM, LF_TAB, LF_DOC, LF_RIGHEDOC, LF_CLIFO, LF_CFVEN, LF_OCCAS, LF_INDSP, LF_CONDV,
LF_MAG, LF_MOVMAG, LF_RMOVMAG, LF_ANAMAG, LF_DIST, LF_RDIST, LF_MRPREPORT, 0);
}
bool TPlanning_app ::create()

View File

@ -17,9 +17,10 @@ class TSave_mask;
class TPrint_mask;
class TPlanning_mask : public TCalendar_mask
{
friend TSave_mask;
friend TPrint_mask;
static bool _week_complete;
friend TSave_mask;
friend TPrint_mask;
static bool _week_complete;
TMagazzini _magazzini;
long _standard_for;
TDate _start_date;
@ -87,10 +88,16 @@ protected:
int salva_cella(int r, int b, TPlan_docs &doc_rows, TToken_string & save_opt);
void create_browse1(TEdit_field& kfld, int level, short key_id, short des_id, const TCodart_livelli &cal);
void create_browse2(TEdit_field& kfld, int level, short key_id, short des_id, const TCodart_livelli &cal);
int create_codart_fields(int x, int y, short key_id, short des_id);
void init();
// costruttore per la derivazione
TPlanning_mask(const char * name);
public:
static void get_week_year(const TDate &d, int &week, int &year);
public:
bool on_savefields_event(long jolly);
@ -136,7 +143,6 @@ public:
bool sortMSPsheet();
bool sortCRPsheet();
void init();
virtual bool is_acq_planning() { return FALSE;}
TSelect_color_mask & sel() { return _sel_color; }
TPlanning_mask();

View File

@ -163,6 +163,28 @@
#define F_MSP_RESORT 457
#define F_CRP_RESORT 458
#define F_CODART 500
#define F_LIVART1 501
#define F_LIVART2 502
#define F_LIVART3 503
#define F_LIVART4 504
#define F_LIVART5 505
#define F_LIVART6 506
#define F_LIVART7 507
#define F_LIVART8 508
#define F_LIVART9 509
#define F_DESART 510
#define F_DESART1 511
#define F_DESART2 512
#define F_DESART3 513
#define F_DESART4 514
#define F_DESART5 515
#define F_DESART6 516
#define F_DESART7 517
#define F_DESART8 518
#define F_DESART9 519
// spreadsheet num/ tipi doc
#define F_NUMERAZ 101
#define F_DESCNUMERAZ 102

View File

@ -705,7 +705,7 @@ PAGE "Ordini" -1 -1 78 20
LIST F_RECALC_TYPE2 19
BEGIN
FLAGS "D"
PROMPT 2 1 "Proposte "
PROMPT 1 1 "Proposte "
ITEM "1|FirstFit "
ITEM "1_INF|FirstFit cap.inf. "
ITEM "1_INFH|FirstFit c.u.inf. "
@ -730,7 +730,7 @@ END
LIST F_MSP_SORT 23
BEGIN
PROMPT 2 3 "Ordinamento "
PROMPT 1 3 "Ordinamento "
ITEM " | "
#ifdef _IS_ACQ
ITEM "1|*Fornit.+Articolo+Linea"
@ -794,53 +794,56 @@ END
// GROUP G_POSTPROCESS
//END
BUTTON F_SHRINK_ALL 17 1
STRING F_CODART 20
BEGIN
PROMPT 1 4 "Comprimi Tutto"
PROMPT 1 5 "Articolo "
USE LF_ANAMAG
INPUT CODART F_CODART
DISPLAY "Codice@20" CODART
DISPALY "Descrizione@50" DESCR
OUTPUT F_CODART CODART
OUTPUT F_DESART DESCR
CHECKTYPE SEARCH
END
BUTTON F_ZOOM_ALL 17 1
STRING F_DESART 50 44
BEGIN
PROMPT 20 4 "Espandi Tutto"
END
BUTTON F_SHRINK_ROW 17 1
BEGIN
PROMPT 41 4 "Comprimi Riga"
END
BUTTON F_ZOOM_ROW 17 1
BEGIN
PROMPT 60 4 "Espandi Riga"
PROMPT 34 5 ""
USE LF_ANAMAG KEY 2
INPUT DESCR F_DESART
DISPALY "Descrizione@50" DESCR
DISPLAY "Codice@20" CODART
COPY OUTPUT F_CODART
CHECKTYPE SEARCH
END
BOOL F_SHOW_WEEK
BEGIN
PROMPT 42 5 "Mostra settimana"
PROMPT 42 6 "Mostra settimana"
GROUP G_BUCKET_WEEK
END
BOOL F_SHOWPRICES
BEGIN
PROMPT 64 5 "Mostra prezzi"
PROMPT 64 6 "Mostra prezzi"
END
TEXT DLG_NULL
BEGIN
PROMPT 2 5 "@bMaster Schedule Plan"
PROMPT 2 6 "@bMaster Schedule Plan"
GROUP G_MASTERSCHEDULE
END
TEXT DLG_NULL
BEGIN
PROMPT 2 5 "@bPianificazione ordini"
PROMPT 2 6 "@bPianificazione ordini"
GROUP G_NOMASTERSCHEDULE
END
SPREADSHEET F_ARTICOLI
SPREADSHEET F_ARTICOLI -1 -2
BEGIN
PROMPT 0 6 ""
PROMPT 0 7 ""
ITEM " @F3"
ITEM "CliFor@F6"
ITEM "Articolo@F20"
@ -893,6 +896,26 @@ BEGIN
DEFAULT NONE
END
BUTTON F_SHRINK_ALL 17 1
BEGIN
PROMPT 1 -1 "Comprimi Tutto"
END
BUTTON F_ZOOM_ALL 17 1
BEGIN
PROMPT 20 -1 "Espandi Tutto"
END
BUTTON F_SHRINK_ROW 17 1
BEGIN
PROMPT 41 -1 "Comprimi Riga"
END
BUTTON F_ZOOM_ROW 17 1
BEGIN
PROMPT 60 -1 "Espandi Riga"
END
ENDPAGE
PAGE "C.R.P." -1 -1 78 20

44
projects/dt.dsw Executable file
View File

@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "AgaLib"=.\AgaLib.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "dt0"=.\dt0.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name AgaLib
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

417
projects/dt0.dsp Executable file
View File

@ -0,0 +1,417 @@
# Microsoft Developer Studio Project File - Name="dt0" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=dt0 - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "dt0.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "dt0.mak" CFG="dt0 - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "dt0 - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "dt0 - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "dt0 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "..\release"
# PROP Intermediate_Dir "..\release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /O2 /I "..\include" /I "..\xvaga" /I "..\xi" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "XVT" /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x410 /i "..\..\wx240\include" /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 version.lib wsock32.lib kernel32.lib gdi32.lib user32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib comctl32.lib rpcrt4.lib winspool.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /out:"D:\Release\Campo21/dt0.exe"
# SUBTRACT LINK32 /map /debug /nodefaultlib
!ELSEIF "$(CFG)" == "dt0 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "..\debug"
# PROP Intermediate_Dir "..\debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "..\include" /I "..\xvaga" /I "..\xi" /D "_DEBUG" /D "WIN32" /D "DBG" /D "_WINDOWS" /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x410 /i "..\..\wx240\include" /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 version.lib wsock32.lib kernel32.lib gdi32.lib user32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib comctl32.lib rpcrt4.lib winspool.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\exed\dt0.exe" /pdbtype:sept
# SUBTRACT LINK32 /nodefaultlib
!ENDIF
# Begin Target
# Name "dt0 - Win32 Release"
# Name "dt0 - Win32 Debug"
# Begin Group "Sources"
# PROP Default_Filter "cpp"
# Begin Source File
SOURCE=..\cg\cg2103.cpp
# End Source File
# Begin Source File
SOURCE=..\cg\cglib01.cpp
# End Source File
# Begin Source File
SOURCE=..\cg\cgpagame.cpp
# End Source File
# Begin Source File
SOURCE=..\cg\cgsaldac.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\clifor.cpp
# End Source File
# Begin Source File
SOURCE=..\db\dblib.cpp
# End Source File
# Begin Source File
SOURCE=..\dt\dt0.cpp
# End Source File
# Begin Source File
SOURCE=..\dt\dt0100.cpp
# End Source File
# Begin Source File
SOURCE=..\dt\dt0300.cpp
# End Source File
# Begin Source File
SOURCE=..\dt\dt0400.cpp
# End Source File
# Begin Source File
SOURCE=..\ef\ef0101.cpp
# End Source File
# Begin Source File
SOURCE=..\ef\ef0301.cpp
# End Source File
# Begin Source File
SOURCE=..\mg\mglib01.cpp
# End Source File
# Begin Source File
SOURCE=..\mg\mglib02.cpp
# End Source File
# Begin Source File
SOURCE=..\mg\mglib02a.cpp
# End Source File
# Begin Source File
SOURCE=..\pr\prlib01.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\sconti.cpp
# End Source File
# Begin Source File
SOURCE=..\sv\svlib01.cpp
# End Source File
# Begin Source File
SOURCE=..\sv\svlib09.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib01.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib02.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib03.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib03a.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib05.cpp
# End Source File
# End Group
# Begin Group "Masks"
# PROP Default_Filter "uml"
# Begin Source File
SOURCE=..\dt\dt0300a.uml
!IF "$(CFG)" == "dt0 - Win32 Release"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=D:\Release\Campo21
InputPath=..\dt\dt0300a.uml
InputName=dt0300a
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ELSEIF "$(CFG)" == "dt0 - Win32 Debug"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\dt\dt0300a.uml
InputName=dt0300a
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\dt\dt0300b.uml
!IF "$(CFG)" == "dt0 - Win32 Release"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=D:\Release\Campo21
InputPath=..\dt\dt0300b.uml
InputName=dt0300b
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ELSEIF "$(CFG)" == "dt0 - Win32 Debug"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\dt\dt0300b.uml
InputName=dt0300b
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\dt\dt0400a.uml
!IF "$(CFG)" == "dt0 - Win32 Release"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=D:\Release\Campo21
InputPath=..\dt\dt0400a.uml
InputName=dt0400a
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ELSEIF "$(CFG)" == "dt0 - Win32 Debug"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\dt\dt0400a.uml
InputName=dt0400a
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\dt\dttbdti.uml
!IF "$(CFG)" == "dt0 - Win32 Release"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=D:\Release\Campo21
InputPath=..\dt\dttbdti.uml
InputName=dttbdti
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ELSEIF "$(CFG)" == "dt0 - Win32 Debug"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\dt\dttbdti.uml
InputName=dttbdti
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\dt\dttbdtp.uml
!IF "$(CFG)" == "dt0 - Win32 Release"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=D:\Release\Campo21
InputPath=..\dt\dttbdtp.uml
InputName=dttbdtp
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ELSEIF "$(CFG)" == "dt0 - Win32 Debug"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\dt\dttbdtp.uml
InputName=dttbdtp
"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
msk32 $(InputPath) $(TargetDir)\$(InputName).msk
# End Custom Build
!ENDIF
# End Source File
# End Group
# Begin Group "Header"
# PROP Default_Filter "h"
# Begin Source File
SOURCE=..\dt\dt0.h
# End Source File
# Begin Source File
SOURCE=..\dt\dt0300a.h
# End Source File
# Begin Source File
SOURCE=..\dt\dt0400a.h
# End Source File
# Begin Source File
SOURCE=..\dt\dttbdti.h
# End Source File
# Begin Source File
SOURCE=..\dt\dttbdtp.h
# End Source File
# End Group
# Begin Group "Ini"
# PROP Default_Filter "ini"
# Begin Source File
SOURCE=..\dt\dt0400a.ini
!IF "$(CFG)" == "dt0 - Win32 Release"
# Begin Custom Build - Copy ini $(InputPath)...
TargetDir=D:\Release\Campo21
InputPath=..\dt\dt0400a.ini
InputName=dt0400a
"$(TargetDir)\$(InputName).ini" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(InputPath) $(TargetDir)\$(InputName).ini
# End Custom Build
!ELSEIF "$(CFG)" == "dt0 - Win32 Debug"
# Begin Custom Build - Copy ini $(InputPath)...
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\dt\dt0400a.ini
InputName=dt0400a
"$(TargetDir)\$(InputName).ini" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(InputPath) $(TargetDir)\$(InputName).ini
# End Custom Build
!ENDIF
# End Source File
# End Group
# Begin Source File
SOURCE=.\dt0.rc
# End Source File
# End Target
# End Project

4
projects/dt0.rc Executable file
View File

@ -0,0 +1,4 @@
"9012" ICON DISCARDABLE "../exed/res/exe.ico"
rcinclude ../../wx240/include/wx/msw/wx.rc

View File

@ -3,7 +3,8 @@ echo Compiling %1 into %2
copy ..\include\uml.h+%1 %TMP%\tmp.tmp
set oldinc=%include
set include=..\include;..\ab;..\aec;..\at;..\ba;..\ca;..\ce;..\ci;..\cg;..\cm;..\db;..\dl;..\ef;..\in;..\li;..\m770;..\mg;..\mr;..\or;..\pr;..\ps;..\sc;..\si;..\sv;..\ve;..\xvaga
set include=..\include;..\ab;..\aec;..\at;..\ba;..\ca;..\ce;..\ci;..\cg;..\cm;..\db;..\dt;..\dl;..\ef;..\in;..\li;..\m770;..\mg;..\mr;..\or;..\pr;..\ps;..\sc;..\si;..\sv;..\ve;..\xvaga
cl /nologo /EP %TMP%\tmp.tmp >%TMP%\tmp.msk
set include=%oldinc
set oldinc=
@ -13,4 +14,3 @@ del %TMP%\tmp.msk
del %TMP%\tmp1.msk
del %TMP%\tmp.tmp

View File

@ -156,6 +156,64 @@ SOURCE=..\ps\pd6030100.h
# Begin Source File
SOURCE=..\ps\pd6030100a.rep
!IF "$(CFG)" == "pd6030 - Win32 Release"
# Begin Custom Build - Compiling rep $(InputPath)...
TargetDir=D:\Release\Campo21
InputPath=..\ps\pd6030100a.rep
InputName=pd6030100a
"$(TargetDir)\$(InputName).rep" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(InputPath) $(TargetDir)\$(InputName).rep
# End Custom Build
!ELSEIF "$(CFG)" == "pd6030 - Win32 Debug"
# Begin Custom Build - Compiling rep $(InputPath)...
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ps\pd6030100a.rep
InputName=pd6030100a
"$(TargetDir)\$(InputName).rep" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(InputPath) $(TargetDir)\$(InputName).rep
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\ps\pd6030100b.rep
!IF "$(CFG)" == "pd6030 - Win32 Release"
# Begin Custom Build - Compiling rep $(InputPath)...
TargetDir=D:\Release\Campo21
InputPath=..\ps\pd6030100b.rep
InputName=pd6030100b
"$(TargetDir)\$(InputName).rep" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(InputPath) $(TargetDir)\$(InputName).rep
# End Custom Build
!ELSEIF "$(CFG)" == "pd6030 - Win32 Debug"
# Begin Custom Build - Compiling rep $(InputPath)...
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ps\pd6030100b.rep
InputName=pd6030100b
"$(TargetDir)\$(InputName).rep" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(InputPath) $(TargetDir)\$(InputName).rep
# End Custom Build
!ENDIF
# End Source File
# End Group
# Begin Source File

View File

@ -60,24 +60,6 @@ Package=<4>
###############################################################################
Project: "ps"=.\ps.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name ps0816
End Project Dependency
Begin Project Dependency
Project_Dep_Name ps0872
End Project Dependency
}}}
###############################################################################
Project: "ps0816"=.\ps0816.dsp - Package Owner=<4>
Package=<5>

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 version.lib wsock32.lib kernel32.lib gdi32.lib user32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib comctl32.lib rpcrt4.lib winspool.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /out:"D:\Release\Campo22/ve1.exe"
# ADD LINK32 version.lib wsock32.lib kernel32.lib gdi32.lib user32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib comctl32.lib rpcrt4.lib winspool.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /out:"D:\Release\Campo21/ve1.exe"
# SUBTRACT LINK32 /map /debug /nodefaultlib
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
@ -96,10 +96,58 @@ LINK32=link.exe
# PROP Default_Filter "cpp"
# Begin Source File
SOURCE=..\cg\cg2103.cpp
# End Source File
# Begin Source File
SOURCE=..\cg\cglib01.cpp
# End Source File
# Begin Source File
SOURCE=..\cg\cgpagame.cpp
# End Source File
# Begin Source File
SOURCE=..\cg\cgsaldac.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\clifor.cpp
# End Source File
# Begin Source File
SOURCE=..\db\dblib.cpp
# End Source File
# Begin Source File
SOURCE=..\mg\mglib01.cpp
# End Source File
# Begin Source File
SOURCE=..\mg\mglib02.cpp
# End Source File
# Begin Source File
SOURCE=..\mg\mglib02a.cpp
# End Source File
# Begin Source File
SOURCE=..\pr\prlib01.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\sconti.cpp
# End Source File
# Begin Source File
SOURCE=..\sv\svlib01.cpp
# End Source File
# Begin Source File
SOURCE=..\sv\svlib09.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\ve1.cpp
# End Source File
# Begin Source File
@ -120,15 +168,27 @@ SOURCE=..\ve\ve1400.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib01.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib02.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib03.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib03a.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\velib04.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\vereplib.cpp
# End Source File
# Begin Source File
SOURCE=..\ve\vereplib.h
SOURCE=..\ve\velib05.cpp
# End Source File
# End Group
# Begin Group "Masks"
@ -141,7 +201,7 @@ SOURCE=..\ve\ve1000b.uml
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\ve1000b.uml
InputName=ve1000b
@ -153,7 +213,7 @@ InputName=ve1000b
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\ve1000b.uml
InputName=ve1000b
@ -172,7 +232,7 @@ SOURCE=..\ve\ve1100a.uml
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\ve1100a.uml
InputName=ve1100a
@ -184,7 +244,7 @@ InputName=ve1100a
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\ve1100a.uml
InputName=ve1100a
@ -203,7 +263,7 @@ SOURCE=..\ve\ve1100b.uml
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\ve1100b.uml
InputName=ve1100b
@ -215,7 +275,7 @@ InputName=ve1100b
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\ve1100b.uml
InputName=ve1100b
@ -234,7 +294,7 @@ SOURCE=..\ve\ve1200a.uml
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\ve1200a.uml
InputName=ve1200a
@ -246,7 +306,7 @@ InputName=ve1200a
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling mask $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\ve1200a.uml
InputName=ve1200a
@ -273,7 +333,7 @@ SOURCE=..\ve\listadoc.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\listadoc.frm
InputName=listadoc
@ -285,7 +345,7 @@ InputName=listadoc
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\listadoc.frm
InputName=listadoc
@ -304,7 +364,7 @@ SOURCE=..\ve\scontid.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\scontid.frm
InputName=scontid
@ -316,7 +376,7 @@ InputName=scontid
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\scontid.frm
InputName=scontid
@ -335,7 +395,7 @@ SOURCE=..\ve\scontii.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\scontii.frm
InputName=scontii
@ -347,7 +407,7 @@ InputName=scontii
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\scontii.frm
InputName=scontii
@ -366,7 +426,7 @@ SOURCE=..\ve\scontir.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\scontir.frm
InputName=scontir
@ -378,7 +438,7 @@ InputName=scontir
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\scontir.frm
InputName=scontir
@ -397,7 +457,7 @@ SOURCE=..\ve\ve1200a.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\ve1200a.frm
InputName=ve1200a
@ -409,7 +469,7 @@ InputName=ve1200a
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\ve1200a.frm
InputName=ve1200a
@ -428,7 +488,7 @@ SOURCE=..\ve\veacc.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\veacc.frm
InputName=veacc
@ -440,7 +500,7 @@ InputName=veacc
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\veacc.frm
InputName=veacc
@ -459,7 +519,7 @@ SOURCE=..\ve\veaccbmp.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\veaccbmp.frm
InputName=veaccbmp
@ -471,7 +531,7 @@ InputName=veaccbmp
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\veaccbmp.frm
InputName=veaccbmp
@ -490,7 +550,7 @@ SOURCE=..\ve\vebol.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\vebol.frm
InputName=vebol
@ -502,7 +562,7 @@ InputName=vebol
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\vebol.frm
InputName=vebol
@ -521,7 +581,7 @@ SOURCE=..\ve\vebolbmp.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\vebolbmp.frm
InputName=vebolbmp
@ -533,7 +593,7 @@ InputName=vebolbmp
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\vebolbmp.frm
InputName=vebolbmp
@ -552,7 +612,7 @@ SOURCE=..\ve\vefat.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\vefat.frm
InputName=vefat
@ -564,7 +624,7 @@ InputName=vefat
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\vefat.frm
InputName=vefat
@ -583,7 +643,7 @@ SOURCE=..\ve\vefatbmp.frm
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\vefatbmp.frm
InputName=vefatbmp
@ -595,7 +655,7 @@ InputName=vefatbmp
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Compiling form $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\vefatbmp.frm
InputName=vefatbmp
@ -618,7 +678,7 @@ SOURCE=..\ve\ve1300.alx
!IF "$(CFG)" == "ve1 - Win32 Release"
# Begin Custom Build - Copying $(InputPath)...
TargetDir=D:\Release\Campo22
TargetDir=D:\Release\Campo21
InputPath=..\ve\ve1300.alx
InputName=ve1300
@ -630,7 +690,7 @@ InputName=ve1300
!ELSEIF "$(CFG)" == "ve1 - Win32 Debug"
# Begin Custom Build - Copying $(InputPath)...
TargetDir=\U\Luca\R_02_02\exed
TargetDir=\U\Luca\D_02_01\exed
InputPath=..\ve\ve1300.alx
InputName=ve1300

View File

@ -302,12 +302,13 @@ void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
if (b == ZERO) // Se le scadenze sono a zero, vuol dire che sono state stornate
res = ZERO; // da qualche nota di credito o non assegnato percio' non si ha residuo
if (res < ZERO) // Significa che l'importo pagato e' maggiore dell'importo in scadenza
{ // c'e' un residuo positivo, e quindi va memorizzato
res *= -1.0; // cambia il segno
res_pagati+= res; // Residui pagati in piu'
res = ZERO;
}
//if (res < ZERO) // Significa che l'importo pagato e' maggiore dell'importo in scadenza
//{ // c'e' un residuo positivo, e quindi va memorizzato
// res *= -1.0; // cambia il segno
// res_pagati+= res; // Residui pagati in piu'
// res = ZERO;
// res *= -1.0;
//}
if (d > _limscad)
{
@ -322,26 +323,30 @@ void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
if (d > (TDate&)_ns_date[3] && d <= (TDate&)_ns_date[4])
ns5 += res;
if (d > (TDate&)_ns_date[4])
ns6 += res;
{
TDate data = (TDate&) _ns_date[4];
if (data.year() != 0)
ns6 += res;
}
}
else
{
// Detrae dal residuo scaduto eventuali pagamenti in piu' effettuati
real gap = (res_pagati > res ? res : res_pagati);
res -= gap;
res_pagati -= gap;
//real gap = (res_pagati > res ? res : res_pagati);
//res -= gap;
//res_pagati -= gap;
}
if (d <= _limscad && d >= (TDate&)_s_date[0])
if (d <= _limscad && d > (TDate&)_s_date[0])
s1 += res;
if (d < (TDate&)_s_date[0] && d >= (TDate&)_s_date[1])
if (d <= (TDate&)_s_date[0] && d > (TDate&)_s_date[1])
s2 += res;
if (d < (TDate&)_s_date[1] && d >= (TDate&)_s_date[2])
if (d <= (TDate&)_s_date[1] && d > (TDate&)_s_date[2])
s3 += res;
if (d < (TDate&)_s_date[2] && d >= (TDate&)_s_date[3])
if (d <= (TDate&)_s_date[2] && d > (TDate&)_s_date[3])
s4 += res;
if (d < (TDate&)_s_date[3] && d >= (TDate&)_s_date[4])
if (d <= (TDate&)_s_date[3] && d > (TDate&)_s_date[4])
s5 += res;
if (d < (TDate&)_s_date[4])
if (d <= (TDate&)_s_date[4])
s6 += res;
residuo += res;
}
@ -387,7 +392,12 @@ void TProspettoScadenze::calcola_saldo()
}
// aggiorno il totale generale
TAssoc_array& at = (TAssoc_array&) _t[1];
TLineTotal *lt = (TLineTotal *) a.objptr(_codval);
TLineTotal *lt = (TLineTotal *) at.objptr(_codval);
if (lt == NULL)
{
lt = new TLineTotal;
at.add(_codval, lt);
}
lt->_sl += ll->_sl;
}
}
@ -428,17 +438,20 @@ bool TProspettoScadenze::preprocess_page(int file, int counter)
//calcola_saldo();
TAssoc_array& sin_tot = (TAssoc_array&) _t[0];
if (sin_tot.items() > 0)
{
print_totali(nriga);
if (_end_printed)
{
TAssoc_array& gen_tot = (TAssoc_array&) _t[1];
if (gen_tot.items() > 0)
{
nriga++;
print_totali_rows(nriga,1);
}
return TRUE; // Go back, print and exit!
}
return TRUE;
}
//if (_end_printed)
//{
// TAssoc_array& gen_tot = (TAssoc_array&) _t[1];
// if (gen_tot.items() > 0)
// {
// nriga++;
// print_totali_rows(nriga,1);
// }
// return TRUE; // Go back, print and exit!
//}
}
_des.trim();
_cod_pre = _cod;
@ -486,6 +499,17 @@ print_action TProspettoScadenze::postprocess_print(int file, int counter)
rt = REPEAT_PAGE;
_end_printed = TRUE;
}
if (_end_printed)
{
TAssoc_array& gen_tot = (TAssoc_array&) _t[1];
if (gen_tot.items() > 0)
{
int nriga = 1;
print_totali_rows(nriga,1);
}
//return REPEAT_PAGE; // Go back, print and exit!
}
return rt;
}
@ -788,12 +812,12 @@ void TProspettoScadenze::print_totali_rows(int& nriga, bool what)
rw << format("@%dg%15s", pos, (const char*) value);
}
pos = pos + 16;
if (v._es != ZERO)
{
print_real(value, v._es);
rw << format("@%dg%15s", pos, (const char*) value);
}
pos = pos + 16;
//if (v._es != ZERO)
//{
// print_real(value, v._es);
// rw << format("@%dg%15s", pos, (const char*) value);
//}
//pos = pos + 16;
if (v._sl != ZERO)
{
print_real(value, v._sl);
@ -826,11 +850,7 @@ void TProspettoScadenze::print_totali_rows(int& nriga, bool what)
void TProspettoScadenze::print_totali(int& nriga)
{
reset_row(nriga);
//set_row(nriga++,"");
//reset_row(nriga);
print_totali_rows(nriga,0);
//set_row(++nriga,"");
//nriga++;
}
void TProspettoScadenze::print_header()
@ -906,8 +926,8 @@ void TProspettoScadenze::print_header()
pos = pos + 16;
set_header(soh, format("@%dg%15s", pos, "TOTALE"));
pos = pos + 16;
set_header(soh, format("@%dg%15s", pos, "ESPOSTO"));
pos = pos + 16;
//set_header(soh, format("@%dg%15s", pos, "ESPOSTO"));
//pos = pos + 16;
set_header(soh, format("@%dg%15s", pos, "SALDO"));
pos = pos + 16;
set_header(soh, format("@%dg%15s", pos, "DIFFERENZA"));

View File

@ -77,6 +77,7 @@ TYPE(4) = NUMERO
LENGTH(4) = 6
POSITION(4) = 19
MESSAGE(4) = _BOLLA,NUMERO
FILLER(4)='0'
FIELD(4) = 33->NDOC
NAME(5) = DATA BOLLA

View File

@ -57,6 +57,8 @@ class TMotore_application : public TRelation_application
void user_set_handler( int fieldid, int index, TMask* m = NULL );
virtual const char * extra_modules() const {return "dt";}
protected:
virtual void on_firm_change();

View File

@ -22,6 +22,9 @@ class TConf_vendite : public TConfig_application
static bool check_fields(TMask_field& f, KEY k);
static bool check_fields_iva(TMask_field& f, KEY k);
virtual const char * extra_modules() const {return "dt";}
public:
virtual bool preprocess_config (TMask& mask, TConfig& config);

View File

@ -108,6 +108,9 @@ TVendite_mask::TVendite_mask(const char* name) : TAutomask(name)
class TVendite_tabapp : public TTable_application
{
virtual const char * extra_modules() const {return "dt";}
protected:
virtual TMask* set_mask(TMask* m);
virtual void init_query_mode(TMask& m);

View File

@ -7,6 +7,8 @@ class TGlossario_application : public TRelation_application
TMask* _msk;
TRelation* _rel;
virtual const char * extra_modules() const {return "dt";}
protected:
virtual bool user_create();
virtual bool user_destroy();

View File

@ -86,6 +86,134 @@ bool rep2app(const char* name, TString& app, TString& desc)
return true;
}
///////////////////////////////////////////////////////////
// TDocument_cache
///////////////////////////////////////////////////////////
class TDocument_cache : TCache
{
protected:
virtual TObject* key2obj(const char* key);
public:
TDocumento& doc(const TRectype& rec);
TDocument_cache() : TCache(23) { }
virtual ~TDocument_cache() { }
};
TObject* TDocument_cache::key2obj(const char* key)
{
TToken_string k(key);
const char provv = *k.get(0);
const int anno = k.get_int();
const TString4 codnum= k.get();
const long ndoc = k.get_long();
return new TDocumento(provv, anno, codnum, ndoc);
}
TDocumento& TDocument_cache::doc(const TRectype& rec)
{
TToken_string key;
key = rec.get(DOC_PROVV);
key.add(rec.get(DOC_ANNO));
key.add(rec.get(DOC_CODNUM));
key.add(rec.get(DOC_NDOC));
TDocumento& d = *(TDocumento*)objptr(key);
return d;
}
///////////////////////////////////////////////////////////
// TDocument_recordset
///////////////////////////////////////////////////////////
class TDocument_recordset : public TISAM_recordset
{
TDocument_cache _cache;
protected:
virtual const TVariant& get(int logic, const char* field) const;
public:
TDocument_recordset(const char* use) : TISAM_recordset(use) { }
virtual ~TDocument_recordset() { }
};
const TVariant& TDocument_recordset::get(int num, const char* field) const
{
const int idx = relation()->log2ind(num);
if (idx < 0)
return NULL_VARIANT;
const TRectype& rec = relation()->file(idx).curr();
const int logic = rec.num();
if (logic == LF_DOC || logic == LF_RIGHEDOC)
{
// Se non e' un campo standard, ma e' calcolato da una formula...
if (rec.type(field) == _nullfld)
{
const TDocumento& doc = ((TDocument_cache&)_cache).doc(rec);
TVariant& var = get_tmp_var();
const TFieldref ref(field, logic);
if (logic == LF_DOC)
{
var = ref.read(doc);
}
else
{
const int nriga = rec.get_int(RDOC_NRIGA);
const TRiga_documento& rdoc = doc[nriga];
var = ref.read(rdoc);
}
return var;
}
}
return TISAM_recordset::get(num, field);
}
///////////////////////////////////////////////////////////
// TDocument_report
///////////////////////////////////////////////////////////
class TDocument_report : public TReport
{
protected:
virtual bool set_recordset(const TString& query);
public:
bool load(const char* name);
};
bool TDocument_report::set_recordset(const TString& query)
{
return TReport::set_recordset(new TDocument_recordset(query));
}
bool TDocument_report::load(const char* name)
{
const bool ok = TReport::load(name);
if (ok)
{
// Purtroppo il recordset delle sottosezioni deve essere reimpostato a mano
for (int i = 11; i <= 999; i++)
{
TReport_section* sec = find_section('B', i);
if (sec != NULL)
{
TRecordset* recset = sec->recordset();
if (recset != NULL)
{
const TString use = recset->query_text();
recset = new TDocument_recordset(use);
sec->set_recordset(recset);
}
}
}
}
return ok;
}
///////////////////////////////////////////////////////////
// TKlarkKent_mask
///////////////////////////////////////////////////////////
@ -243,4 +371,4 @@ int ve1400(int argc, char* argv[])
TKlarkKent_app app;
app.run(argc, argv, TR("Stampa Report Vendite"));
return 0;
}
}

View File

@ -18,6 +18,9 @@ public:
class TStatus_change : public TSkeleton_application
{
virtual const char * extra_modules() const {return "dt";}
protected: // TSkeleton_application
virtual void main_loop();
virtual bool create();

View File

@ -53,6 +53,8 @@ class TContabilizzazione_app : public TApplication
TArray_sheet *_num_sheet; // Array sheet selezionabile dei codici numerazione
TString_array _tipi_doc; // Array di stringhe contenente i tipi documenti da elaborare
virtual const char * extra_modules() const {return "dt";}
protected: // TApplication
// Contabilizza i documenti
void contabilize();

View File

@ -12,6 +12,7 @@ Item_06 = "Contabilita' Industriale", <cimenu.men>
Item_07 = "Statistiche di vendita", <svmenu.men>
Item_08 = "Servizi", [ACQVEN_021]
Item_09 = "Configurazione", [ACQVEN_020]
Item_10 = "Importazione documenti STORE", <dtmenu.men>
[ACQVEN_001]
Caption = "Archivi e tabelle di base"
@ -264,4 +265,3 @@ Item_09 = "Variazione p.n. da ricevere", "cg6 -7 P", "F"
Item_10 = "Variazione iva da ricevere", "cg6 -7 I", "F"
Item_11 = "Annul. movimenti da ricevere", "cg6 -7 A", "F"
Item_12 = "Variazione saldaconto da ricevere", "cg6 -7 B", "F"

View File

@ -270,9 +270,10 @@ void TDocumento::test_firm()
real TDocumento::spese_incasso(int ndec, TTipo_importo t) const
{
real imp_spese;
const real percentuale = get_real("PERCSPINC");
static TArray spese_inc;
real imp_spese;
const real percentuale = get(DOC_PERCSPINC);
if (percentuale > ZERO)
{
@ -281,9 +282,9 @@ real TDocumento::spese_incasso(int ndec, TTipo_importo t) const
if (spese_inc.objptr(_rim_dir) == NULL)
{
TConfig conf(CONFIG_STUDIO, "ve");
for (TTipo_pag p = _rim_dir; p < _nessun_pag; p = (TTipo_pag) ((int)p + 1))
for (TTipo_pag p = _rim_dir; p < _nessun_pag; p = TTipo_pag((int)p + 1))
{
real r(conf.get("IMPSPINC", "ve", p));
const real r(conf.get("IMPSPINC", "ve", p));
spese_inc.add(r, p);
}
}
@ -293,14 +294,13 @@ real TDocumento::spese_incasso(int ndec, TTipo_importo t) const
for (int i = 0; i < nrate; i++)
{
const TTipo_pag p = (TTipo_pag) pag.tipo_rata(i);
imp_spese += (real &) spese_inc[p];
imp_spese += (const real&) spese_inc[p];
}
imp_spese *= percentuale / 100.0;
imp_spese = imp_spese * percentuale / CENTO;
if (t == _lordo || t == _imposta)
{
TString16 codiva_es;
TString4 codiva_es;
iva_esente(codiva_es);
real iva_spese(TRiga_documento::iva(codiva_es.not_empty() ? (const TString &) codiva_es : codiva_spese()).imposta(imp_spese, ndec));
if (t == _lordo)
@ -310,7 +310,7 @@ real TDocumento::spese_incasso(int ndec, TTipo_importo t) const
imp_spese = iva_spese;
}
const real cambio = get_real("CAMBIO");
const real cambio = get(DOC_CAMBIO);
if (!cambio.is_zero())
{
const exchange_type ce = get_bool(DOC_CONTROEURO) ? _exchange_contro : _exchange_base;
@ -1679,7 +1679,7 @@ void TDocumento::update_tabella_iva()
const bool doc_al_lordo = tipo().calcolo_lordo();
const int ndec = decimals();
const bool fatt_comm = tipo().fattura_commerciale();
TString16 codiva_es;
TString4 codiva_es;
iva_esente(codiva_es);
for (int i = items; i > 0; i--)
@ -1783,9 +1783,9 @@ void TDocumento::update_tabella_iva()
real val = spese_incasso(ALL_DECIMALS, doc_al_lordo ? _lordo : _netto);
if (val != ZERO)
if (!val.is_zero())
{
const TString16 codiva = codiva_es.not_empty() ? (const TString &) codiva_es : codiva_spese();
const TString4 codiva = codiva_es.not_empty() ? (const TString &) codiva_es : codiva_spese();
TRiepilogo_iva* ri = (TRiepilogo_iva*)table.objptr(codiva);
if (ri == NULL)
{
@ -1990,10 +1990,10 @@ real TDocumento::valore(bool totale, int ndec) const
void TDocumento::put_str(const char* fieldname, const char* val)
{
if (strcmp(fieldname, "TIPODOC") == 0)
if (strcmp(fieldname, DOC_TIPODOC) == 0)
{
const TString16 v(val);
if (TRectype::get("TIPODOC") != v)
if (TRectype::get(DOC_TIPODOC) != v)
{
TAuto_variable_rectype::put_str(fieldname, v);
reset_fields(*this);
@ -2003,7 +2003,7 @@ void TDocumento::put_str(const char* fieldname, const char* val)
dirty_fields();
}
else
if (strcmp(fieldname, "CODCF") == 0)
if (strcmp(fieldname, DOC_CODCF) == 0)
{
const TString16 v(val);
put("SPESEUPD", TRectype::get("CODCF") == v);
@ -2022,7 +2022,7 @@ void TDocumento::put_str(const char* fieldname, const char* val)
const TString& TDocumento::get_str(const char* fieldname) const
{
if (_dirty_deny && variable_field(fieldname) != NULL)
(bool&) _dirty_deny = FALSE;
(bool&) _dirty_deny = false;
return TMultiple_rectype::get_str(fieldname);
}
@ -2102,20 +2102,24 @@ TRecord_array& TDocumento::body(int logicnum) const
{
const bool reset_data_cons = loaded_rows(logicnum) == 0;
if (reset_data_cons)
((TDocumento*)this)->_dirty_deny = true;
TRecord_array& r = TMultiple_rectype::body(logicnum);
if (reset_data_cons)
{
const TDate datacons(get_date(DOC_DATACONS));
const TDate datacons(get(DOC_DATACONS));
const TString80 codcms(get(DOC_CODCMS));
const TString80 fascms(get(DOC_FASCMS));
const TString80 codcos(get(DOC_CODCOSTO));
const bool order = is_ordine();
for (int i = r.rows(); i > 0; i--)
{
TRectype& rec = r[i];
TRecfield dcons(rec, RDOC_DATACONS);
if (is_ordine() && datacons == dcons)
if (order && datacons == dcons)
dcons = "";
TRecfield ccms(rec, RDOC_CODCMS);
TRecfield fcms(rec, RDOC_FASCMS);
@ -2127,6 +2131,7 @@ TRecord_array& TDocumento::body(int logicnum) const
ccos = "";
}
}
((TDocumento*)this)->_dirty_deny = false;
}
return r;
}
@ -2432,4 +2437,4 @@ const TRiga_documento* TDocumento::get_row_id(long id) const
return &row;
}
return NULL;
}
}

View File

@ -53,7 +53,7 @@ const TFilename& TTipo_documento::profile_name(TFilename& profile) const
const char TTipo_documento::tipocf() const
{
if (_tipocf == '\0')
if (_tipocf < ' ')
{
TFilename pn; profile_name(pn);
TConfig prof(pn);
@ -147,9 +147,9 @@ const TString_array& TTipo_documento::sheet_columns() const
TConfig prof(pn, "SHEET");
for (int i = 0; i < MAX_COLUMNS; i++)
{
const TString& id = prof.get("Col", NULL, i);
const TString& id = prof.get("Col", NULL, i);
if (atoi(id) <= 0)
break;
break;
((TString_array&)_sheet_columns).add(id);
}
}
@ -336,7 +336,7 @@ bool TTipo_documento::scarica_residuo() const
///////////////////////////////////////////////////////////
TExpr_documento::TExpr_documento(const char* expression, TTypeexp type,
TDocumento * doc, TRiga_documento * row)
TDocumento* doc, TRiga_documento * row)
: TExpression(type), _doc(doc), _row(row)
{
if (!set(expression, type))
@ -821,4 +821,4 @@ int TFormula_documento::read(const char* codice, const char * expr, bool numexpr
put("CODTAB", codice);
}
return err;
}
}

View File

@ -370,27 +370,28 @@ bool TMovimentoPN_VE::add_row_cp_re(int i)
void TMovimentoPN_VE::map_conto_re(TBill& c)
{
TString16 key;
key.format("%3d%3d%6ld",c.gruppo(), c.conto(), c.sottoconto());
TRectype rs = cache().get("MRE", key);
if (rs.empty())
key.format("%3d%3d%6ld",c.gruppo(), c.conto(), c.sottoconto());
const TRectype* rs = &cache().get("MRE", key);
if (rs->empty())
{
key.cut(6);
rs = cache().get("MRE", key);
if (rs.empty())
rs = &cache().get("MRE", key);
if (rs->empty())
{
key.cut(3);
rs = cache().get("MRE", key);
rs = &cache().get("MRE", key);
}
}
if (rs.empty())
if (rs->empty())
_caus->bill(1, c);
else
{
const int gr = rs.get_int("I0");
const int co = rs.get_int("I1");
const long so = rs.get_int("I2");
const char tipo = rs.get_char("S6");
const int gr = rs->get_int("I0");
const int co = rs->get_int("I1");
const long so = rs->get_int("I2");
const char tipo = rs->get_char("S6");
c.set(gr, co, so, tipo);
}
if (c.tipo() > ' ')
@ -592,7 +593,7 @@ error_type TIVA_array::add_omaggi(const TRiga_documento & r, const TBill& conto,
return no_error;
}
error_type TIVA_array::add(const TRiga_documento & r, const TBill& conto, const int ndec, const real & p)
error_type TIVA_array::add(const TRiga_documento& r, const TBill& conto, const int ndec, const real& p)
{
const TTipo_riga_documento & t = r.tipo();
TString80 key;
@ -609,24 +610,24 @@ error_type TIVA_array::add(const TRiga_documento & r, const TBill& conto, const
if (rdoc != NULL && rdoc->get(RDOC_PROVV).not_empty())
{
TString80 key(rdoc->get(RDOC_CODNUM ));
TString80 key(rdoc->get(RDOC_CODNUM));
const TCodice_numerazione & num = TDocumento::codice_numerazione(key);
const TCodice_numerazione& num = TDocumento::codice_numerazione(key);
if (num.fattura_emettere_ricevere())
{
key.format("%3d%3d%6ld", c.gruppo(), c.conto(), c.sottoconto());
TRectype & rs = (TRectype &) cache().get("MRE", key);
if (rs.empty())
const TRectype* rs = &cache().get("MRE", key);
if (rs->empty())
{
key.cut(6);
rs = cache().get("MRE", key);
if (rs.empty())
rs = &cache().get("MRE", key);
if (rs->empty())
{
key.cut(3);
rs = cache().get("MRE", key);
rs = &cache().get("MRE", key);
}
}
if (rs.empty())
if (rs->empty())
{
key = rdoc->get(RDOC_PROVV);
key << '|' << rdoc->get(RDOC_ANNO);
@ -635,8 +636,8 @@ error_type TIVA_array::add(const TRiga_documento & r, const TBill& conto, const
const TRectype & doc = cache().get(LF_DOC, key);
const TTipo_documento & td = TDocumento::tipo(doc.get(DOC_TIPODOC));
const TString16 codcau(td.causale());
TCausale caus(codcau);
const TString& codcau = td.causale();
const TCausale caus(codcau);
caus.bill(1, c);
}
@ -646,10 +647,11 @@ error_type TIVA_array::add(const TRiga_documento & r, const TBill& conto, const
const int co = rs.get_int("I1");
const long so = rs.get_int("I2");
const char tipo = rs.get_char("S6");
c.set(gr, co, so, tipo);
}
if (c.tipo() > ' ')
c.set(c.gruppo(), c.conto(), _movimento->curr().get_long(MOV_CODCF), c.tipo());
if (c.tipo() > ' ')
c.set(c.gruppo(), c.conto(), r.doc().get_long(DOC_CODCF), c.tipo());
}
}
if (!sconto_lordo) // Al netto dello sconto
@ -659,26 +661,26 @@ error_type TIVA_array::add(const TRiga_documento & r, const TBill& conto, const
switch (t.tipo())
{
case RIGA_MERCE:
ord = 1;
break;
case RIGA_OMAGGI:
impon = r.imponibile_omaggio();
ord = 2;
break;
case RIGA_SPESEDOC:
ord = 3;
break;
case RIGA_PRESTAZIONI:
ord = 4;
break;
case RIGA_SCONTI:
ord = 5;
break;
case RIGA_DESCRIZIONI:
default:
return no_error;
break;
case RIGA_MERCE:
ord = 1;
break;
case RIGA_OMAGGI:
impon = r.imponibile_omaggio();
ord = 2;
break;
case RIGA_SPESEDOC:
ord = 3;
break;
case RIGA_PRESTAZIONI:
ord = 4;
break;
case RIGA_SCONTI:
ord = 5;
break;
case RIGA_DESCRIZIONI:
default:
return no_error;
break;
}
impon *= p;
@ -766,14 +768,11 @@ error_type TIVA_array::add(const TRiga_documento & r, const TBill& conto, const
{
if (sconto_lordo) // Se e' settato il flag di contabilizzare anche gli sconti merce
{
real sconto;
sconto = - r.sconto(); // Imponibile dello sconto (positivo, quindi si cambia di segno)
if (sconto != ZERO) // Le righe Omaggio con Addebito IVA hanno comunque sconto ZERO!
const real sconto = -r.sconto(); // Imponibile dello sconto (positivo, quindi si cambia di segno)
if (!sconto.is_zero()) // Le righe Omaggio con Addebito IVA hanno comunque sconto ZERO!
{
TRiga_documento r_sconto(r);
r_sconto.put(RDOC_QTA, "1.00");
r_sconto.put(RDOC_QTA, UNO);
r_sconto.put(RDOC_PREZZO, sconto);
add(r_sconto, _sco_perc_bill, ndec, p);
}
@ -1195,7 +1194,7 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
}
// Dati del cliente...
TString16 tipocf(doc.get(DOC_TIPOCF));
TString4 tipocf(doc.get(DOC_TIPOCF));
long codcf = doc.get_long(DOC_CODCF);
TString80 occas;
{
@ -1797,7 +1796,7 @@ error_type TContabilizzazione::add_spese_inbo(TDocumento& doc, const int ndec)
real tot_netto, sp_incasso, sp_bolli;
real iva_sp_incasso, iva_sp_bolli;
const real rit = doc.ritenute();
bool is_cli = doc.get(DOC_TIPOCF) == "C";
bool is_cli = doc.get_char(DOC_TIPOCF) == 'C';
// Aggiunge le spese d'incasso
tot_netto = doc.totale_netto();
sp_incasso = doc.spese_incasso(ndec, _netto);
@ -2147,6 +2146,10 @@ bool TContabilizzazione::valid_row_type(const char* rt) const
error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
// Compila le righe
{
TString4 tiporiga, codiva1, codiva2;
const int rows = doc.rows();
const int ndec = doc.decimals();
const bool fat_com = doc.tipo().fattura_commerciale();
static TString_array tabella_ripartizione;
@ -2180,9 +2183,6 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
const bool spesa = r.tipo().tipo() == RIGA_SPESEDOC;
char tipo_rit = '\0';
if (!riga_omaggio && r.imponibile().is_zero())
continue;
if (spesa)
tipo_rit = r.spesa().tipo_ritenuta();
@ -2190,7 +2190,11 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
TBill conto;
if (!ritenuta)
{
if (!riga_omaggio && r.imponibile().is_zero())
continue;
search_costo_ricavo(conto,r); // l'errore eventuale viene settato qui dentro
}
if (good())
{
if (fat_com)
@ -2199,7 +2203,7 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
for (int j=0; j < MAX_IVA_SLICES; j++)
{
const real perc = real(tabella_ripartizione.row(j).get(0)) / CENTO;
const TString4 codiva1 = tabella_ripartizione.row(j).get(1);
codiva1 = tabella_ripartizione.row(j).get(1);
if (perc == ZERO || codiva1.blank())
continue;
@ -2244,6 +2248,8 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
_righe_iva->add_omaggi(r, conto);
else
_righe_iva->add(r, conto);
const TString4 cod(r.get(RDOC_CODIVA));
if (r.doc().tipo().calcolo_lordo()) // Si ricorda che calcolo_lordo() e fattura_commerciale() sono esclusivi.
{
@ -2308,11 +2314,9 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
if (!iva_mov)
{
const int cgitems = _movimento->cg_items();
for (int i = cgitems - 1 ; i >= 0; i--)
{
TRectype & rec_cg = _movimento->cg(i);
rec_cg.zero(RMV_ROWTYPE);
}
_movimento->destroy_iva_row();
@ -3855,7 +3859,6 @@ bool TContabilizzazione::elabora(TLista_documenti& doc_in, TLista_documenti& doc
{
if (ft_em_ric)
{
compile_head_mov_re(doc);
if (good())

View File

@ -445,17 +445,24 @@ bool TConsegna_ordini::elabora(TLista_documenti& doc_in, TLista_documenti& doc_o
{
const TString4 tiporiga = inrec.get(RDOC_TIPORIGA);
TRiga_documento& outrec = outdoc.new_row(tiporiga);
const TString& qta_field_orig = inrec.field_qta();
const TString& qta_field = outrec.field_qta();
const TString& qtaevasa_field = outrec.field_qtaevasa();
const TString& qtaevasa_field = inrec.field_qtaevasa();
TDocumento::copy_data(outrec, inrec);
outrec.put(qta_field, daeva);
if (qta_field != RDOC_QTA)
if (qta_field_orig != RDOC_QTA)
{
const real q = inrec.get_real(RDOC_QTA);
if (q.is_zero())
outrec.put(RDOC_QTA, UNO); // Pezza temporanea
// const real q = inrec.get_real(RDOC_QTA);
// if (q.is_zero())
outrec.put(RDOC_QTA, UNO);
outrec.put(qta_field_orig, daeva);
}
else
{
outrec.put(qta_field, daeva);
if (qta_field != RDOC_QTA)
outrec.put(RDOC_QTA, UNO);
}
aggiorna_ncolli_tara_pnetto(outrec);
if (kill_descrizione_estesa()) // Cancello eventualmente la descrizione estesa
{

View File

@ -45,10 +45,13 @@ void TDocumentoEsteso::compile_summary()
void TDocumentoEsteso::summary_filter(byte selector)
{
if (_sum_filter == -1) compile_summary(); // Crea la tabella se deve ancora farlo
if (_sum_filter == -1)
compile_summary(); // Crea la tabella se deve ancora farlo
// se ha selezionato una riga in precedenza deve finire di stamparla
// ovvero non seleziona il filtro fino a quando non ha ricevuto una summary_set_next()
if (_sum_selected) return;
if (_sum_selected)
return;
//
// Procedimento:
// Memorizza in un TString_array tante TToken_string quanti sono i filtri possibili
@ -221,7 +224,8 @@ void TDocumentoEsteso::scadenze_reset()
real TDocumentoEsteso::tot_imponibili(byte selector)
{
if (!summary_compiled()) compile_summary();
if (!summary_compiled())
compile_summary();
real number = 0.0;
const int items = summary_items();

View File

@ -1039,56 +1039,61 @@ void set_curr_um(const TString & um)
bool umart_handler( TMask_field& f, KEY key )
{
TMask& row_mask = f.mask( );
TSheet_field& sh = *row_mask.get_sheet();
TDocumento_mask & mask = (TDocumento_mask &)sh.mask();
// Se qualcuno cerca di modificare la maschera
if ( key == K_TAB && f.focusdirty() && mask.is_running())
{
const int current_doc_row = sh.selected() + 1;
TMask& row_mask = f.mask( );
TSheet_field& sh = *row_mask.get_sheet();
TDocumento_mask & mask = (TDocumento_mask &)sh.mask();
// Se qualcuno cerca di modificare la maschera
if ( key == K_TAB && f.focusdirty() && mask.is_running())
{
const int current_doc_row = sh.selected() + 1;
TCond_vendita & condv = mask.condv();
condv.set_riga(&row_mask);
TCond_vendita & condv = mask.condv();
condv.set_riga(&row_mask);
const TString& um = f.get();
real fc(1.0);
const TString& um = f.get();
real fc(1.0);
if (um.not_empty() && curr_um.not_empty() && um != curr_um)
{
TLocalisamfile umart(LF_UMART);
umart.setkey(2);
umart.put(UMART_CODART, row_mask.get(FR_CODARTMAG));
umart.put(UMART_UM, um);
if (umart.read() == NOERR)
{
real qta(row_mask.get_real(FR_QTA));
fc = umart.get_real(UMART_FC);
if (curr_fc < ZERO)
{
umart.put(UMART_CODART, row_mask.get(FR_CODARTMAG));
umart.put(UMART_UM, curr_um);
if (umart.read() == NOERR)
curr_fc = umart.get_real(UMART_FC);
else
curr_fc = 1.0;
}
qta *= curr_fc;
qta /= fc;
qta.round(5);
row_mask.set(FR_QTA, qta);
qta = row_mask.get_real(FR_QTAEVASA);
qta *= curr_fc;
qta /= fc;
qta.round(5);
row_mask.set(FR_QTAEVASA, qta);
}
}
curr_um = um;
curr_fc = fc;
condv.ricerca(TRUE);
mask.doc()[current_doc_row].put(RDOC_PREZZO, row_mask.get(FR_PREZZO));
if (um.not_empty() && curr_um.not_empty() && um != curr_um)
{
TLocalisamfile umart(LF_UMART);
umart.setkey(2);
umart.put(UMART_CODART, row_mask.get(FR_CODARTMAG));
umart.put(UMART_UM, um);
if (umart.read() == NOERR)
{
real qta(row_mask.get_real(FR_QTA));
fc = umart.get_real(UMART_FC);
if (curr_fc < ZERO)
{
umart.put(UMART_CODART, row_mask.get(FR_CODARTMAG));
umart.put(UMART_UM, curr_um);
if (umart.read() == NOERR)
curr_fc = umart.get_real(UMART_FC);
else
curr_fc = 1.0;
}
qta *= curr_fc;
qta /= fc;
qta.round(5);
row_mask.set(FR_QTA, qta);
qta = row_mask.get_real(FR_QTAEVASA);
qta *= curr_fc;
qta /= fc;
qta.round(5);
row_mask.set(FR_QTAEVASA, qta);
}
}
curr_um = um;
curr_fc = fc;
condv.ricerca(true);
mask.doc()[current_doc_row].put(RDOC_PREZZO, row_mask.get(FR_PREZZO));
}
return true;
const int pos = row_mask.id2pos(FR_CODIVA);
if (pos >= 0)
iva_handler(row_mask.fld(pos), 0);
}
return TRUE;
}
bool um_handler( TMask_field& f, KEY key )
@ -1575,4 +1580,4 @@ bool cdc_mag_handler(TMask_field& f, KEY key)
if ((key == K_TAB && f.focusdirty()) || key == K_ENTER)
ca_mag_handler(f);
return true;
}
}