Patch level : 12.0 no patch

Files correlati     : 
Commento            :

Aggiornati programmi personalizzati per poterli compilare.
Manca ps0883

git-svn-id: svn://10.65.10.50/branches/R_10_00@23224 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2016-09-08 20:06:48 +00:00
parent 05f6b4d1eb
commit d327a5c85f
66 changed files with 6256 additions and 6229 deletions

View File

@ -293,7 +293,7 @@ bool TOmasa::transfer()
TRecord_text curr; TRecord_text curr;
while (_trasfile->read(curr) == NOERR) while (_trasfile->read(curr) == NOERR)
{ {
pi.setstatus(_trasfile->read_file()->tellg()); pi.setstatus((long)_trasfile->read_file()->tellg());
TString impstr = curr.get(F_VALOREVOCE); TString impstr = curr.get(F_VALOREVOCE);
impstr.insert(".",11); impstr.insert(".",11);
negativo(impstr); negativo(impstr);

View File

@ -101,9 +101,11 @@ void TPartite2Euroasis::main_loop()
const TDate oggi(TODAY); const TDate oggi(TODAY);
TString16 ora; TString16 ora;
time_t tempo; time_t tempo;
struct tm d;
time(&tempo); time(&tempo);
const struct tm* d = localtime(&tempo); localtime_s(&d, &tempo);
ora.format("%02d:%02d:%02d", d->tm_hour, d->tm_min, d->tm_sec); ora.format("%02d:%02d:%02d", d.tm_hour, d.tm_min, d.tm_sec);
const TDate dataanalisi = m.get_date(F_DATA); const TDate dataanalisi = m.get_date(F_DATA);
const int giorni = m.get_int(F_GIORNI); const int giorni = m.get_int(F_GIORNI);
const TDate dataesposto = dataanalisi - (long) giorni; const TDate dataesposto = dataanalisi - (long) giorni;

View File

@ -159,6 +159,17 @@ public:
void TDistribuzione_f24::elabora() void TDistribuzione_f24::elabora()
{ {
TFilename src_files = _mask->get(F_PATH_SRC); TFilename src_files = _mask->get(F_PATH_SRC);
TString regexp = _mask->get(F_ELIMINA_EXPR);
if (regexp.starts_with("$"))
regexp = regexp.mid(1);
else
if (!regexp.starts_with("*"))
regexp.insert("*");
if (regexp.ends_with("^"))
regexp.rtrim(1);
else
regexp << "*";
src_files.add("*.pdf"); src_files.add("*.pdf");
TString_array src_files_list; TString_array src_files_list;
//dalla cartella origine prende tutti i files .pdf e crea una simpatica lista //dalla cartella origine prende tutti i files .pdf e crea una simpatica lista
@ -219,6 +230,8 @@ void TDistribuzione_f24::elabora()
} }
//se invece crea/trova la cartella -> copia il file //se invece crea/trova la cartella -> copia il file
if (!curr_fname.match(regexp))
{
dst_file.add(curr_fname.name()); dst_file.add(curr_fname.name());
const bool copia_riuscita = fcopy(curr_fname, dst_file); const bool copia_riuscita = fcopy(curr_fname, dst_file);
@ -242,6 +255,7 @@ void TDistribuzione_f24::elabora()
log.log(2, msg); log.log(2, msg);
continue; continue;
} }
}
//eliminazione del file sorgente //eliminazione del file sorgente
if (delete_src_files) if (delete_src_files)

View File

@ -1,3 +1,4 @@
#define F_PATH_SRC 101 #define F_PATH_SRC 101
#define F_PATH_DST 102 #define F_PATH_DST 102
#define F_ERASE_TRANSFERRED 103 #define F_ERASE_TRANSFERRED 103
#define F_ELIMINA_EXPR 104

View File

@ -20,6 +20,11 @@ BEGIN
WARNING "Selezionare una cartella destinazione valida!" WARNING "Selezionare una cartella destinazione valida!"
END END
STRING F_ELIMINA_EXPR 80 45
BEGIN
PROMPT 1 3 "Elimina i seguenti file "
END
BOOLEAN F_ERASE_TRANSFERRED BOOLEAN F_ERASE_TRANSFERRED
BEGIN BEGIN
PROMPT 1 4 "Eliminare i file di origine dopo la copia" PROMPT 1 4 "Eliminare i file di origine dopo la copia"

View File

@ -42,24 +42,16 @@ TLif_iterator::TLif_iterator(TLif_transfer* ht) : _ht(ht), _pi(NULL)
{ {
const TRecnotype tot = _ht->recordset().items(); const TRecnotype tot = _ht->recordset().items();
TString title; TString title;
title << _ht->title() << ": " << tot << ' ' << TR("righe"); title << _ht->title() << ": " << tot << ' ' << TR("righe");
if (tot > 1)
_pi = new TProgind(tot, title, true, true); _pi = new TProgind(tot, title, true, true);
else
::begin_wait();
if (tot > 0)
_ht->log(title); _ht->log(title);
_rec = -1; _rec = -1;
} }
TLif_iterator::~TLif_iterator() TLif_iterator::~TLif_iterator()
{ {
if (_pi != NULL)
delete _pi; delete _pi;
else
::end_wait();
} }
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////

View File

@ -613,6 +613,7 @@ void TPE_mask::save_rate()
const TString& codval = get(F_CODVAL); const TString& codval = get(F_CODVAL);
const real cambio = get(F_CAMBIO); const real cambio = get(F_CAMBIO);
const bool eurocambio = get_bool(F_EURO);
bool zeroes = FALSE; // Esistono righe effetto da cancellare bool zeroes = FALSE; // Esistono righe effetto da cancellare

View File

@ -100,7 +100,7 @@ error_type TContabil_tsys::write_all(TDocumento& doc, TMovimentoPN_VE & moviment
const int iva_items = movimento.iva_items(); const int iva_items = movimento.iva_items();
const int cg_items = movimento.cg_items(); const int cg_items = movimento.cg_items();
TCurrency c(ZERO); TCurrency c(ZERO);
const real dec = c.decimals(); const int dec = c.decimals();
const real molt = pow(10.0, dec); const real molt = pow(10.0, dec);
if (test_swap()) if (test_swap())

View File

@ -359,13 +359,13 @@ void TStatistiche_ANIVAL_csv_recordset::aggiungi_riga(TDocument_recordset& righe
{ {
//codart //codart
new_rec(""); new_rec("");
set(0, TVariant(codart)); set(0, codart);
//descrart //descrart
const TString& descrart = cache().get(LF_ANAMAG, codart, ANAMAG_DESCR); const TString& descrart = cache().get(LF_ANAMAG, codart, ANAMAG_DESCR);
set(1, TVariant(descrart)); set(1, descrart);
set(28, TVariant(grmerc)); set(28, grmerc);
set(29, TVariant(codcf)); set(29, codcf);
//re-sorting per codart (serve perchè solo il recordset ordinato è scannerizzabile con il plutonico metodo dicotomico) //re-sorting per codart (serve perchè solo il recordset ordinato è scannerizzabile con il plutonico metodo dicotomico)
switch (tipo_stat) switch (tipo_stat)

View File

@ -6,6 +6,7 @@
#include <execp.h> #include <execp.h>
#include <progind.h> #include <progind.h>
#include <reprint.h> #include <reprint.h>
#include <sheet.h>
#include <utility.h> #include <utility.h>
#include "../or/orlib.h" #include "../or/orlib.h"
@ -265,34 +266,34 @@ void TGenera_ordini_mask::update_sheet()
TToken_string & row = sf.row(i); TToken_string & row = sf.row(i);
const TString & codart = recset.get(LF_ANAMAG, ANAMAG_CODART).as_string(); const TString & codart = recset.get(LF_ANAMAG, ANAMAG_CODART).as_string();
row.add(codart, sf.cid2index(F_CODART)); row.add(codart, sf.cid2index(SA_CODART));
art.read(codart); art.read(codart);
const real giac = art.giacenza_anno(codmag, "", anno); const real giac = art.giacenza_anno(codmag, "", anno);
row.add(recset.get(LF_ANAMAG, ANAMAG_DESCR).as_string(), sf.cid2index(F_DESCR)); row.add(recset.get(LF_ANAMAG, ANAMAG_DESCR).as_string(), sf.cid2index(SA_DESCR));
row.add(recset.get("UMART.UM").as_string(), sf.cid2index(F_UM)); row.add(recset.get("UMART.UM").as_string(), sf.cid2index(SA_UM));
const long codforn = recset.get(LF_ANAMAG, ANAMAG_CODFORN).as_int(); const long codforn = recset.get(LF_ANAMAG, ANAMAG_CODFORN).as_int();
row.add(codforn, sf.cid2index(F_FORNITORE)); row.add(codforn, sf.cid2index(SA_FORNITORE));
row.add(recset.get("CLIFO.RAGSOC").as_string(), sf.cid2index(F_RAGSOC)); row.add(recset.get("CLIFO.RAGSOC").as_string(), sf.cid2index(SA_RAGSOC));
row.add(recset.get(LF_ANAMAG, ANAMAG_GIORNIRIOR).as_string(), sf.cid2index(F_LEADTIME)); row.add(recset.get(LF_ANAMAG, ANAMAG_GIORNIRIOR).as_string(), sf.cid2index(SA_LEADTIME));
row.add(recset.get(LF_ANAMAG, ANAMAG_LOTTORIOR).as_string(), sf.cid2index(F_LOTTOMIN)); row.add(recset.get(LF_ANAMAG, ANAMAG_LOTTORIOR).as_string(), sf.cid2index(SA_LOTTOMIN));
row.add(recset.get(LF_ANAMAG, ANAMAG_DESCRAGG).as_string(), sf.cid2index(F_DESCRAGG)); row.add(recset.get(LF_ANAMAG, ANAMAG_DESCRAGG).as_string(), sf.cid2index(SA_DESCRAGG));
row.add(giac.string(), sf.cid2index(F_GIACENZA)); row.add(giac.string(), sf.cid2index(SA_GIACENZA));
row.add(recset.get(LF_ANAMAG, ANAMAG_PPCONF).as_string(), sf.cid2index(F_PPCONF)); row.add(recset.get(LF_ANAMAG, ANAMAG_PPCONF).as_string(), sf.cid2index(SA_PPCONF));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER1).as_string(), sf.cid2index(F_USER1)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER1).as_string(), sf.cid2index(SA_USER1));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER2).as_string(), sf.cid2index(F_USER2)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER2).as_string(), sf.cid2index(SA_USER2));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER3).as_string(), sf.cid2index(F_USER3)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER3).as_string(), sf.cid2index(SA_USER3));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER4).as_string(), sf.cid2index(F_USER4)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER4).as_string(), sf.cid2index(SA_USER4));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER5).as_string(), sf.cid2index(F_USER5)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER5).as_string(), sf.cid2index(SA_USER5));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER6).as_string(), sf.cid2index(F_USER6)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER6).as_string(), sf.cid2index(SA_USER6));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER7).as_string(), sf.cid2index(F_USER7)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER7).as_string(), sf.cid2index(SA_USER7));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER8).as_string(), sf.cid2index(F_USER8)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER8).as_string(), sf.cid2index(SA_USER8));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER9).as_string(), sf.cid2index(F_USER9)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER9).as_string(), sf.cid2index(SA_USER9));
row.add(recset.get(LF_ANAMAG, ANAMAG_USER10).as_string(), sf.cid2index(F_USER10)); row.add(recset.get(LF_ANAMAG, ANAMAG_USER10).as_string(), sf.cid2index(SA_USER10));
const real disp = art.disponibilita(codes, get(F_MAG), NULL); const real disp = art.disponibilita(codes, get(F_MAG), NULL);
row.add(disp.string(), sf.cid2index(F_DISPON)); row.add(disp.string(), sf.cid2index(SA_DISPON));
sf.check_row(i); sf.check_row(i);
if (check_expr) if (check_expr)
{ {
@ -323,7 +324,7 @@ void TGenera_ordini_mask::update_orders()
_order_changed = false; _order_changed = false;
TWait_cursor hourglass; TWait_cursor hourglass;
TSheet_field& sh = sfield(F_ORDERS); TSheet_field& sh = sfield(F_DOCUMENTS);
sh.destroy(); sh.destroy();
TString query; TString query;
@ -350,7 +351,7 @@ void TGenera_ordini_mask::update_orders()
TMask& m = sh.sheet_mask(); TMask& m = sh.sheet_mask();
TRelation& rel = *orders.cursor()->relation(); TRelation& rel = *orders.cursor()->relation();
const int status_pos = sh.cid2index(S_STATODOC); const int status_pos = sh.cid2index(SD_STATODOC);
for (bool ok = orders.move_first(); ok; ok = orders.move_next()) for (bool ok = orders.move_first(); ok; ok = orders.move_next())
{ {
TToken_string& row = sh.row(-1); TToken_string& row = sh.row(-1);
@ -387,7 +388,7 @@ void TGenera_ordini_mask::next_page(int p)
} }
if (_order_changed) if (_order_changed)
{ {
const TSheet_field& sf = sfield(F_ORDERS); const TSheet_field& sf = sfield(F_DOCUMENTS);
if (win() == sf.parent()) if (win() == sf.parent())
update_orders(); update_orders();
} }
@ -734,7 +735,7 @@ void TGenera_ordini_mask::on_idle()
{ {
//si posiziona sulla qta //si posiziona sulla qta
TSheet_field& sf_righe = sfield(F_ARTICLES); TSheet_field& sf_righe = sfield(F_ARTICLES);
const int column = sf_righe.cid2index(F_QTA); const int column = sf_righe.cid2index(SA_QTA);
sf_righe.select(_riga_da_selezionare, column, true); sf_righe.select(_riga_da_selezionare, column, true);
_riga_da_selezionare = -1; _riga_da_selezionare = -1;
sf_righe.set_focus(); sf_righe.set_focus();
@ -772,8 +773,8 @@ TGenera_ordini_mask::TGenera_ordini_mask()
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 10; i++)
{ {
const int col = sh.cid2index(F_USER1 + i -1); const int col = sh.cid2index(SA_USER1 + i -1);
TEditable_field & f = sh_mask.efield(F_USER1 + i - 1); TEditable_field & f = sh_mask.efield(SA_USER1 + i - 1);
if (c.get_bool("CHK_USER", "ve", i) && c.get_bool("USERDEF", "or", i)) if (c.get_bool("CHK_USER", "ve", i) && c.get_bool("USERDEF", "or", i))
{ {
@ -876,7 +877,7 @@ void TCreazione_ordini::aggiorna_stato_doc_orig(const TRectype& rdoc)
void TCreazione_ordini::generate_carics() void TCreazione_ordini::generate_carics()
{ {
TGenera_ordini_mask& mask = *_mask; TGenera_ordini_mask& mask = *_mask;
TSheet_field& sf = mask.sfield(F_ORDERS); TSheet_field& sf = mask.sfield(F_DOCUMENTS);
long minforn = 999999L; long minforn = 999999L;
long maxforn = 0L; long maxforn = 0L;
@ -912,21 +913,21 @@ void TCreazione_ordini::generate_carics()
{ {
if (!pi.setstatus(n)) if (!pi.setstatus(n))
break; break;
if (row->get_char(sf.cid2index(S_DAEVADERE) == 'X')) if (row->get_char(sf.cid2index(SD_DAEVADERE) == 'X'))
{ {
const real qta = row->get(sf.cid2index(S_QTADAEVADERE)); const real qta = row->get(sf.cid2index(SD_QTADAEVADERE));
if (!qta.is_zero()) if (!qta.is_zero())
{ {
const TString8 codforn(row->get(sf.cid2index(S_FORNITORE))); const TString8 codforn(row->get(sf.cid2index(SD_FORNITORE)));
const long cod = atol(codforn); const long cod = atol(codforn);
TString8 key; key.format("F|%ld", cod); TString8 key; key.format("F|%ld", cod);
const TRectype& forn = cache().get(LF_CLIFO, key); const TRectype& forn = cache().get(LF_CLIFO, key);
const TDate datacons(row->get(sf.cid2index(S_DATACONS))); const TDate datacons(row->get(sf.cid2index(SD_DATACONS)));
const TString4 codval(forn.get(CLI_CODVAL)); const TString4 codval(forn.get(CLI_CODVAL));
const TRectype& forven = cache().get(LF_CFVEN, key); const TRectype& forven = cache().get(LF_CFVEN, key);
const TString4 codiva(forven.get(CFV_ASSFIS)); const TString4 codiva(forven.get(CFV_ASSFIS));
const TString commessa = row->get(sf.cid2index(S_CDC)); const TString commessa = row->get(sf.cid2index(SA_CDC));
const TString fase = row->get(sf.cid2index(S_FSC)); const TString fase = row->get(sf.cid2index(SA_FSC));
TDocumento* d = (TDocumento*)orders.objptr(codforn); TDocumento* d = (TDocumento*)orders.objptr(codforn);
if (d == NULL) if (d == NULL)
@ -1022,9 +1023,9 @@ void TCreazione_ordini::generate_carics()
rdoc.put(RDOC_CODAGG1, row->get(sf.cid2index(F_CODAGG1))); rdoc.put(RDOC_CODAGG1, row->get(sf.cid2index(F_CODAGG1)));
rdoc.put(RDOC_CODAGG2, row->get(sf.cid2index(F_CODAGG2))); rdoc.put(RDOC_CODAGG2, row->get(sf.cid2index(F_CODAGG2)));
*/ */
const TDate dataord = row->get(sf.cid2index(S_DATADOC)); const TDate dataord = row->get(sf.cid2index(SD_DATADOC));
const long ndoc = row->get_long(sf.cid2index(S_NUMDOC)); const long ndoc = row->get_long(sf.cid2index(SD_NUMDOC));
const int nriga = row->get_int(sf.cid2index(S_NUMRIGA)); const int nriga = row->get_int(sf.cid2index(SD_NUMRIGA));
TRectype& rigord = righedoc.curr(); TRectype& rigord = righedoc.curr();
rigord.put(RDOC_PROVV, 'D'); rigord.put(RDOC_PROVV, 'D');
rigord.put(RDOC_ANNO, dataord.year()); rigord.put(RDOC_ANNO, dataord.year());
@ -1141,19 +1142,19 @@ void TCreazione_ordini::generate_orders()
if (!pi.setstatus(n)) if (!pi.setstatus(n))
break; break;
const real qta = row->get(sf.cid2index(F_QTA)); const real qta = row->get(sf.cid2index(SA_QTA));
if (!qta.is_zero()) if (!qta.is_zero())
{ {
const TString8 codforn(row->get(sf.cid2index(F_FORNITORE))); const TString8 codforn(row->get(sf.cid2index(SA_FORNITORE)));
const long cod = atol(codforn); const long cod = atol(codforn);
TString8 key; key.format("F|%ld", cod); TString8 key; key.format("F|%ld", cod);
const TRectype& forn = cache().get(LF_CLIFO, key); const TRectype& forn = cache().get(LF_CLIFO, key);
const TDate datacons(row->get(sf.cid2index(F_DATACONS))); const TDate datacons(row->get(sf.cid2index(SA_DATACONS)));
const TString4 codval(forn.get(CLI_CODVAL)); const TString4 codval(forn.get(CLI_CODVAL));
const TRectype& forven = cache().get(LF_CFVEN, key); const TRectype& forven = cache().get(LF_CFVEN, key);
const TString4 codiva(forven.get(CFV_ASSFIS)); const TString4 codiva(forven.get(CFV_ASSFIS));
const TString commessa = row->get(sf.cid2index(F_CDC)); const TString commessa = row->get(sf.cid2index(SA_CDC));
const TString fase = row->get(sf.cid2index(F_FSC)); const TString fase = row->get(sf.cid2index(SA_FSC));
TDocumento* d = (TDocumento*)orders.objptr(codforn); TDocumento* d = (TDocumento*)orders.objptr(codforn);
if (d == NULL) if (d == NULL)
@ -1203,23 +1204,23 @@ void TCreazione_ordini::generate_orders()
} }
TRiga_documento& rdoc = d->new_row("01"); TRiga_documento& rdoc = d->new_row("01");
const TString codart(row->get(sf.cid2index(F_CODART))); const TString codart(row->get(sf.cid2index(SA_CODART)));
rdoc.put(RDOC_CODMAG, codmag); rdoc.put(RDOC_CODMAG, codmag);
rdoc.put(RDOC_CODMAGC, codmagc); rdoc.put(RDOC_CODMAGC, codmagc);
rdoc.put(RDOC_CODART, codart); rdoc.put(RDOC_CODART, codart);
rdoc.put(RDOC_CODARTMAG, codart); rdoc.put(RDOC_CODARTMAG, codart);
rdoc.put(RDOC_CHECKED, "X"); rdoc.put(RDOC_CHECKED, "X");
rdoc.put(RDOC_DESCR, row->get(sf.cid2index(F_DESCR))); rdoc.put(RDOC_DESCR, row->get(sf.cid2index(SA_DESCR)));
const TString descr_agg(row->get(sf.cid2index(F_DESCRAGG))); const TString descr_agg(row->get(sf.cid2index(SA_DESCRAGG)));
if (descr_agg.full()) if (descr_agg.full())
{ {
rdoc.put(RDOC_DESCLUNGA, "X"); rdoc.put(RDOC_DESCLUNGA, "X");
rdoc.put(RDOC_DESCEST, descr_agg); rdoc.put(RDOC_DESCEST, descr_agg);
} }
rdoc.put(RDOC_UMQTA, row->get(sf.cid2index(F_UM))); rdoc.put(RDOC_UMQTA, row->get(sf.cid2index(SA_UM)));
rdoc.put(RDOC_QTA, qta); rdoc.put(RDOC_QTA, qta);
rdoc.put(RDOC_DATACONS, datacons); rdoc.put(RDOC_DATACONS, datacons);
@ -1240,10 +1241,10 @@ void TCreazione_ordini::generate_orders()
for (int i = 0; i < 10 ; i++) for (int i = 0; i < 10 ; i++)
if (_userfld.row(i).full()) if (_userfld.row(i).full())
rdoc.put(_userfld.row(i), mask.get(F_USER1 + i)); rdoc.put(_userfld.row(i), mask.get(SA_USER1 + i));
rdoc.put(RDOC_CODAGG1, row->get(sf.cid2index(F_CODAGG1))); rdoc.put(RDOC_CODAGG1, row->get(sf.cid2index(SA_CODAGG1)));
rdoc.put(RDOC_CODAGG2, row->get(sf.cid2index(F_CODAGG2))); rdoc.put(RDOC_CODAGG2, row->get(sf.cid2index(SA_CODAGG2)));
} }
} }
} }

View File

@ -132,7 +132,7 @@ void TListinoPs0816::import_listino(const TMask& m)
TRecord_text curr; TRecord_text curr;
while (file.read(curr) == NOERR) while (file.read(curr) == NOERR)
{ {
pi.setstatus(file.read_file()->tellg()); pi.setstatus((long)file.read_file()->tellg());
if (pi.iscancelled()) if (pi.iscancelled())
break; break;
codart = file.get_field(curr, "CODICE ARTICOLO"); codart = file.get_field(curr, "CODICE ARTICOLO");

View File

@ -3,6 +3,7 @@
#include <defmask.h> #include <defmask.h>
#include <relation.h> #include <relation.h>
#include <reprint.h> #include <reprint.h>
#include <sheet.h>
#include "ps0872.h" #include "ps0872.h"
#include "ps0872200a.h" #include "ps0872200a.h"

View File

@ -284,7 +284,7 @@ bool TImpPaghe::transfer()
TRecord_text curr; TRecord_text curr;
while (_trasfile->read(curr) == NOERR) while (_trasfile->read(curr) == NOERR)
{ {
pi.setstatus(_trasfile->read_file()->tellg()); pi.setstatus((long)_trasfile->read_file()->tellg());
TString impstr = curr.get(F_IMPORTO); TString impstr = curr.get(F_IMPORTO);
real importo(impstr); real importo(impstr);
importo = importo/100; importo = importo/100;

View File

@ -3,6 +3,7 @@
#include <defmask.h> #include <defmask.h>
#include <relation.h> #include <relation.h>
#include <reprint.h> #include <reprint.h>
#include <sheet.h>
#include "ps0920.h" #include "ps0920.h"
#include "ps0920100a.h" #include "ps0920100a.h"

View File

@ -467,17 +467,17 @@ void TClosure_msk::load_sheet()
FOR_EACH_TOKEN(rif, tok) FOR_EACH_TOKEN(rif, tok)
row.add(tok); row.add(tok);
row.add(rec.get("S1"), s.cid2index(F_CODART)); row.add(rec.get("S1"), s.cid2index(S_CODART));
row.add(rec.get("I1"), s.cid2index(F_PALET1)); row.add(rec.get("I1"), s.cid2index(S_PALET1));
row.add(rec.get("I2"), s.cid2index(F_SPEZZ1)); row.add(rec.get("I2"), s.cid2index(S_SPEZZ1));
row.add(rec.get("I3"), s.cid2index(F_PALET2)); row.add(rec.get("I3"), s.cid2index(S_PALET2));
row.add(rec.get("I4"), s.cid2index(F_SPEZZ2)); row.add(rec.get("I4"), s.cid2index(S_SPEZZ2));
row.add(rec.get("B0"), s.cid2index(F_SALDO)); row.add(rec.get("B0"), s.cid2index(S_SALDO));
row.add(rec.get("S6"), s.cid2index(F_LOTTO)); row.add(rec.get("S6"), s.cid2index(S_LOTTO));
row.add(rec.get("D0"), s.cid2index(F_DATA)); row.add(rec.get("D0"), s.cid2index(S_DATA));
row.add(rec.get("B1"), s.cid2index(F_EVASA)); row.add(rec.get("B1"), s.cid2index(S_EVASA));
row.add(rec.get("D1"), s.cid2index(F_DATEVAS)); row.add(rec.get("D1"), s.cid2index(S_DATEVAS));
row.add(rec.get("CODTAB"), s.cid2index(F_RECORD)); row.add(rec.get("CODTAB"), s.cid2index(S_RECORD));
s.check_row(s.items()-1, 0x3); // Do outputs and checks s.check_row(s.items()-1, 0x3); // Do outputs and checks
} }
@ -498,9 +498,11 @@ bool TClosure_msk::chiudi_righe(TString_array& records, TLog_report& log)
const TDate datadoc = get(F_DATADOC); const TDate datadoc = get(F_DATADOC);
int err = NOERR; int err = NOERR;
TLocalisamfile mmag(LF_TABMOD); TLocalisamfile mmag(LF_TABMOD);
FOR_EACH_ARRAY_ROW(records, r, row) if (row->get_char(0) > ' ' && row->get_char(F_EVASA-101) > ' ') TSheet_field& s = sfield(F_SHEET);
FOR_EACH_ARRAY_ROW(records, r, row) if (row->get_char(0) > ' ' && row->get_char(s.cid2index(S_EVASA)) > ' ')
{ {
const TString16 rec = row->get(F_RECORD-101); const TString16 rec = row->get(s.cid2index(S_RECORD));
mmag.put("MOD", "PS"); mmag.put("MOD", "PS");
mmag.put("CUST", 920); mmag.put("CUST", 920);
mmag.put("COD", "MAG"); mmag.put("COD", "MAG");
@ -525,25 +527,27 @@ bool TClosure_msk::chiudi_righe(TString_array& records, TLog_report& log)
bool TClosure_msk::evadi_ordine(TEvasione_mmag& jail, TToken_string& row, TLista_documenti& doc_in, TLista_documenti& doc_out, TLog_report& log) bool TClosure_msk::evadi_ordine(TEvasione_mmag& jail, TToken_string& row, TLista_documenti& doc_in, TLista_documenti& doc_out, TLog_report& log)
{ {
TSheet_field& s = sfield(F_SHEET);
for (int scelta = 1; scelta <= 2; scelta++) for (int scelta = 1; scelta <= 2; scelta++)
{ {
const int pall = row.get_int((scelta == 1 ? F_PALET1 : F_PALET2) - 101); const int pall = row.get_int(s.cid2index(scelta == 1 ? S_PALET1 : S_PALET2));
const int spez = row.get_int((scelta == 1 ? F_SPEZZ1 : F_SPEZZ2) - 101); const int spez = row.get_int(s.cid2index(scelta == 1 ? S_SPEZZ1 : S_SPEZZ2));
const int pezzi = row.get_int((scelta == 1 ? F_PEZZ1 : F_PEZZ2 ) - 101); const int pezzi = row.get_int(s.cid2index(scelta == 1 ? S_PEZZ1 : S_PEZZ2 ));
bool sld = false; bool sld = false;
if (row.get_char(F_SALDO - 101) > ' ') if (row.get_char(s.cid2index(S_SALDO)) > ' ')
{ {
if (scelta == 1) if (scelta == 1)
sld = row.get_int(F_PEZZ2 - 101) <= 0; sld = row.get_int(s.cid2index(S_PEZZ2)) <= 0;
else else
sld = pezzi > 0; sld = pezzi > 0;
} }
if (pezzi > 0 || sld) if (pezzi > 0 || sld)
{ {
const TString codart = row.get(F_CODART - 101); const TString codart = row.get(S_CODART - 101);
const long codcf = atol(codart.left(3)); const long codcf = atol(codart.left(3));
const int idriga = row.get_int(F_IDRIGA - 101); const int idriga = row.get_int(S_IDRIGA - 101);
const int lotto = row.get_long(F_LOTTO - 101); const int lotto = row.get_long(S_LOTTO - 101);
jail.evade(scelta, codart, idriga, pezzi, sld, lotto, pall, spez); jail.evade(scelta, codart, idriga, pezzi, sld, lotto, pall, spez);
TString8 s, t; TString8 s, t;
@ -554,7 +558,7 @@ bool TClosure_msk::evadi_ordine(TEvasione_mmag& jail, TToken_string& row, TLista
const bool good = jail.elabora(doc_in, doc_out, get_date(F_DATADOC)); const bool good = jail.elabora(doc_in, doc_out, get_date(F_DATADOC));
if (good) if (good)
{ {
row.add("X", F_EVASA-101); row.add("X", S_EVASA-101);
} }
else else
{ {
@ -581,13 +585,15 @@ bool TClosure_msk::elabora(TString_array& records, TLog_report& log)
const long codcf = records.row(0).get_long(1); const long codcf = records.row(0).get_long(1);
const int indsped = records.row(0).get_int(2); const int indsped = records.row(0).get_int(2);
TSheet_field& s = sfield(F_SHEET);
TDocumento* mmag = NULL; TDocumento* mmag = NULL;
FOR_EACH_ARRAY_ROW(records, r, row) FOR_EACH_ARRAY_ROW(records, r, row)
{ {
const char provv = 'D'; const char provv = 'D';
const int anno = row->get_int (F_ANNO -101); const int anno = row->get_int (s.cid2index(S_ANNO));
const TString4 codnum = row->get (F_CODNUM-101); const TString4 codnum = row->get (s.cid2index(S_CODNUM));
const long ndoc = row->get_long(F_NDOC -101); const long ndoc = row->get_long(s.cid2index(S_NDOC));
if (!doc_in.find(provv, anno, codnum, ndoc)) if (!doc_in.find(provv, anno, codnum, ndoc))
{ {
if (mmag != NULL && doc_in.items()) if (mmag != NULL && doc_in.items())
@ -666,8 +672,8 @@ bool TClosure_msk::elabora()
FOR_EACH_SHEET_ROW(s, r, row) if (row->get_char(0) > ' ') FOR_EACH_SHEET_ROW(s, r, row) if (row->get_char(0) > ' ')
{ {
const long codcf = row->get_long(s.cid2index(F_CLIFO)); const long codcf = row->get_long(s.cid2index(S_CLIFO));
const int indsped = row->get_int(s.cid2index(F_INDSPED)); const int indsped = row->get_int(s.cid2index(S_INDSPED));
if (codcf != last_cf || indsped != last_ind) if (codcf != last_cf || indsped != last_ind)
{ {
elabora(records, log); elabora(records, log);
@ -718,7 +724,7 @@ bool TClosure_msk::cancella()
// Elminazione su richiesta // Elminazione su richiesta
if (k > 0 && noyes_box(FR("Confermare l'eliminazione di %ld record?"), k)) if (k > 0 && noyes_box(FR("Confermare l'eliminazione di %ld record?"), k))
{ {
const int nRec = s.cid2index(F_RECORD); const int nRec = s.cid2index(S_RECORD);
TLocalisamfile mmag(LF_TABMOD); TLocalisamfile mmag(LF_TABMOD);
TString16 n; TString16 n;
FOR_EACH_SHEET_ROW(s, r2, row2) if (row2->starts_with("X")) FOR_EACH_SHEET_ROW(s, r2, row2) if (row2->starts_with("X"))
@ -746,13 +752,13 @@ bool TClosure_msk::salva()
TSheet_field& s = sfield(F_SHEET); TSheet_field& s = sfield(F_SHEET);
const int nRec = s.cid2index(F_RECORD); const int nRec = s.cid2index(S_RECORD);
const int nPa1 = s.cid2index(F_PALET1); const int nPa1 = s.cid2index(S_PALET1);
const int nSp1 = s.cid2index(F_SPEZZ1); const int nSp1 = s.cid2index(S_SPEZZ1);
const int nPa2 = s.cid2index(F_PALET2); const int nPa2 = s.cid2index(S_PALET2);
const int nSp2 = s.cid2index(F_SPEZZ2); const int nSp2 = s.cid2index(S_SPEZZ2);
const int nSld = s.cid2index(F_SALDO); const int nSld = s.cid2index(S_SALDO);
const int nLot = s.cid2index(F_LOTTO); const int nLot = s.cid2index(S_LOTTO);
TLocalisamfile mmag(LF_TABMOD); TLocalisamfile mmag(LF_TABMOD);
TString16 n; TString16 n;
@ -869,18 +875,18 @@ bool TClosure_msk::on_field_event(TOperable_field& o, TField_event e , long joll
enable(DLG_ELABORA, !one_empty); enable(DLG_ELABORA, !one_empty);
} }
break; break;
case F_PALET1: case S_PALET1:
case F_SPEZZ1: case S_SPEZZ1:
case F_PALET2: case S_PALET2:
case F_SPEZZ2: case S_SPEZZ2:
if (e == fe_modify || e == fe_init) if (e == fe_modify || e == fe_init)
{ {
TMask& sm = o.mask(); TMask& sm = o.mask();
const TRectype& art = cache().get(LF_ANAMAG, sm.get(F_CODART)); const TRectype& art = cache().get(LF_ANAMAG, sm.get(S_CODART));
const int pps = art.get_int(ANAMAG_PPCOLLO); // Pezzi per spezzone const int pps = art.get_int(ANAMAG_PPCOLLO); // Pezzi per spezzone
const int ppp = art.get_int(ANAMAG_USER1) * art.get_int(ANAMAG_USER2) * pps; // Pezzi per pallet const int ppp = art.get_int(ANAMAG_USER1) * art.get_int(ANAMAG_USER2) * pps; // Pezzi per pallet
const real peso = art.get(ANAMAG_PESO); const real peso = art.get(ANAMAG_PESO);
const int id = o.dlg() < F_PALET2 ? F_PALET1 : F_PALET2; const int id = o.dlg() < S_PALET2 ? S_PALET1 : S_PALET2;
sm.set(id+2, sm.get_int(id)*ppp + sm.get_int(id+1)*pps); sm.set(id+2, sm.get_int(id)*ppp + sm.get_int(id+1)*pps);
sm.set(id+3, real(peso * sm.get_int(id+2))); sm.set(id+3, real(peso * sm.get_int(id+2)));
@ -888,8 +894,8 @@ bool TClosure_msk::on_field_event(TOperable_field& o, TField_event e , long joll
enable(DLG_SAVEREC, _dirty = true); enable(DLG_SAVEREC, _dirty = true);
} }
break; break;
case F_SALDO: case S_SALDO:
case F_LOTTO: case S_LOTTO:
if (e == fe_modify && !_dirty && is_running()) if (e == fe_modify && !_dirty && is_running())
enable(DLG_SAVEREC, _dirty = true); enable(DLG_SAVEREC, _dirty = true);
break; break;

View File

@ -139,41 +139,41 @@ ENDMASK
PAGE "Riga" -1 -1 75 12 PAGE "Riga" -1 -1 75 12
BOOLEAN F_SELECT BOOLEAN S_SELECT
BEGIN BEGIN
PROMPT 1 1 "Selezione" PROMPT 1 1 "Selezione"
END END
DATE F_DATA DATE S_DATA
BEGIN BEGIN
PROMPT 21 1 "Data " PROMPT 21 1 "Data "
FLAGS "D" FLAGS "D"
END END
NUMBER F_RECORD 10 NUMBER S_RECORD 10
BEGIN BEGIN
PROMPT 54 1 "Record " PROMPT 54 1 "Record "
FLAGS "DZ" FLAGS "DZ"
END END
NUMBER F_CLIFO 6 NUMBER S_CLIFO 6
BEGIN BEGIN
PROMPT 1 2 "Cliente " PROMPT 1 2 "Cliente "
USE LF_CLIFO USE LF_CLIFO
INPUT TIPOCF "C" INPUT TIPOCF "C"
INPUT CODCF F_CLIFO INPUT CODCF F_CLIFO
OUTPUT F_RAGSOC RAGSOC OUTPUT S_RAGSOC RAGSOC
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
FLAGS "DG" FLAGS "DG"
END END
STRING F_RAGSOC 50 STRING S_RAGSOC 50
BEGIN BEGIN
PROMPT 21 2 "" PROMPT 21 2 ""
FLAGS "D" FLAGS "D"
END END
NUMBER F_INDSPED 3 NUMBER S_INDSPED 3
BEGIN BEGIN
PROMPT 1 3 "Indirizzo " PROMPT 1 3 "Indirizzo "
/* /*
@ -186,43 +186,43 @@ BEGIN
FLAGS "DG" FLAGS "DG"
END END
STRING F_CODNUM 4 STRING S_CODNUM 4
BEGIN BEGIN
PROMPT 1 4 "Ordine " PROMPT 1 4 "Ordine "
FLAGS "D" FLAGS "D"
END END
NUMBER F_ANNO 4 NUMBER S_ANNO 4
BEGIN BEGIN
PROMPT 17 4 "" PROMPT 17 4 ""
FLAGS "D" FLAGS "D"
END END
NUMBER F_NDOC 7 NUMBER S_NDOC 7
BEGIN BEGIN
PROMPT 23 4 "" PROMPT 23 4 ""
FLAGS "D" FLAGS "D"
END END
NUMBER F_IDRIGA 4 NUMBER S_IDRIGA 4
BEGIN BEGIN
PROMPT 33 4 "Riga " PROMPT 33 4 "Riga "
FLAGS "D" FLAGS "D"
END END
BOOLEAN F_EVASA BOOLEAN S_EVASA
BEGIN BEGIN
PROMPT 48 4 "Evasa il" PROMPT 48 4 "Evasa il"
FLAGS "D" FLAGS "D"
END END
DATE F_DATEVAS DATE S_DATEVAS
BEGIN BEGIN
PROMPT 61 4 "" PROMPT 61 4 ""
FLAGS "D" FLAGS "D"
END END
STRING F_CODART 20 STRING S_CODART 20
BEGIN BEGIN
PROMPT 1 6 "Articolo " PROMPT 1 6 "Articolo "
USE LF_ANAMAG USE LF_ANAMAG
@ -232,7 +232,7 @@ BEGIN
FLAGS "DG" FLAGS "DG"
END END
STRING F_DESCR 50 STRING S_DESCR 50
BEGIN BEGIN
PROMPT 10 7 "" PROMPT 10 7 ""
FLAGS "D" FLAGS "D"
@ -263,37 +263,37 @@ BEGIN
PROMPT 1 9 "@bI scelta" PROMPT 1 9 "@bI scelta"
END END
NUMBER F_LOTTO 5 NUMBER S_LOTTO 5
BEGIN BEGIN
PROMPT 51 8 "Lotto " PROMPT 51 8 "Lotto "
END END
NUMERO F_PALET1 3 NUMERO S_PALET1 3
BEGIN BEGIN
PROMPT 11 9 "" PROMPT 11 9 ""
FLAGS "U" FLAGS "U"
END END
NUMERO F_SPEZZ1 3 NUMERO S_SPEZZ1 3
BEGIN BEGIN
PROMPT 21 9 "" PROMPT 21 9 ""
FLAGS "U" FLAGS "U"
END END
NUMERO F_PEZZ1 7 NUMERO S_PEZZ1 7
BEGIN BEGIN
PROMPT 31 9 "" PROMPT 31 9 ""
FLAGS "D" FLAGS "D"
END END
NUMERO F_PESO1 7 NUMERO S_PESO1 7
BEGIN BEGIN
PROMPT 41 9 "" PROMPT 41 9 ""
FLAGS "D" FLAGS "D"
END END
BOOLEAN F_SALDO BOOLEAN S_SALDO
BEGIN BEGIN
PROMPT 51 9 "Saldo" PROMPT 51 9 "Saldo"
END END
@ -303,25 +303,25 @@ BEGIN
PROMPT 1 10 "@bII scelta" PROMPT 1 10 "@bII scelta"
END END
NUMERO F_PALET2 3 NUMERO S_PALET2 3
BEGIN BEGIN
PROMPT 11 10 "" PROMPT 11 10 ""
FLAGS "U" FLAGS "U"
END END
NUMERO F_SPEZZ2 3 NUMERO S_SPEZZ2 3
BEGIN BEGIN
PROMPT 21 10 "" PROMPT 21 10 ""
FLAGS "U" FLAGS "U"
END END
NUMERO F_PEZZ2 7 NUMERO S_PEZZ2 7
BEGIN BEGIN
PROMPT 31 10 "" PROMPT 31 10 ""
FLAGS "D" FLAGS "D"
END END
NUMERO F_PESO2 7 NUMERO S_PESO2 7
BEGIN BEGIN
PROMPT 41 10 "" PROMPT 41 10 ""
FLAGS "D" FLAGS "D"

View File

@ -95,7 +95,7 @@ void TLis2fil::import(const TString& filename)
TRecord_text curr; TRecord_text curr;
while (trasfile.read(curr) == NOERR) while (trasfile.read(curr) == NOERR)
{ {
pi.setstatus(trasfile.read_file()->tellg()); pi.setstatus((long)trasfile.read_file()->tellg());
trasfile.autosave(rel, curr); trasfile.autosave(rel, curr);
trasfile.save_price(curr, _um); trasfile.save_price(curr, _um);
} }

View File

@ -33,7 +33,7 @@ TMaskPt00031::TMaskPt00031()
{ {
TRelation * r = new TRelation(LF_DOC); TRelation * r = new TRelation(LF_DOC);
r->file().set_curr(new TDocumento); r->file().set_curr(new TDocumento);
_cur = new TCursor(r, "", 2); _cur = new TCursor(r, "", 4);
((TButton_field&) field(DLG_SAVEREC)).set_exit_key(K_ENTER); ((TButton_field&) field(DLG_SAVEREC)).set_exit_key(K_ENTER);
} }
@ -145,10 +145,11 @@ void TMaskPt00031::update_sheet()
from.put(DOC_CODCF, codcli); from.put(DOC_CODCF, codcli);
from.put(DOC_ANNO, get(F_ANNO)); from.put(DOC_ANNO, get(F_ANNO));
from.put(DOC_PROVV, "D"); from.put(DOC_PROVV, "D");
from.put(DOC_CODNUM, get(F_NUM));
TRectype to(from); TRectype to(from);
TString filter; TString filter;
filter << "(CODNUM==\"" << get(F_NUM) << "\")&&(G1:TOTDOC>IMPPAGATO)"; filter << "(" << DOC_ACCSALDO "!=\"X\")";
_cur->setfilter(filter); _cur->setfilter(filter);
_cur->setregion(from, to); _cur->setregion(from, to);
TDocumento & doc = (TDocumento &)_cur->curr(); TDocumento & doc = (TDocumento &)_cur->curr();
@ -250,6 +251,7 @@ void TIncassoFatture0003::main_loop()
pagato += val; pagato += val;
doc.put(DOC_IMPPAGATO, pagato); doc.put(DOC_IMPPAGATO, pagato);
doc.put(DOC_ACCSALDO, (bool)(pagato >= doc.totale_doc()));
doc.rewrite(); doc.rewrite();
} }
} }

View File

@ -6,6 +6,7 @@ BUTTON DLG_SAVEREC 2 2
BEGIN BEGIN
PROMPT 1 1 "~Registra" PROMPT 1 1 "~Registra"
PICTURE TOOL_SAVEREC PICTURE TOOL_SAVEREC
MESSAGE EXIT,K_ENTER
END END
#include <helpbar.h> #include <helpbar.h>

View File

@ -225,7 +225,7 @@ bool TImpDoc0195::transfer_testata()
while (_trasfile->read(curr) == NOERR && !pi.iscancelled() && err == NOERR) while (_trasfile->read(curr) == NOERR && !pi.iscancelled() && err == NOERR)
{ {
pi.setstatus(_trasfile->read_file()->tellg()); pi.setstatus((long) _trasfile->read_file()->tellg());
if (!decifra_codici (curr, codnum, tipodoc)) if (!decifra_codici (curr, codnum, tipodoc))
continue; continue;
@ -393,7 +393,7 @@ bool TImpDoc0195::transfer_dettaglio()
curr.set_type("D"); curr.set_type("D");
while (_trasfile->read(curr) == NOERR && !pi.iscancelled() && err == NOERR) while (_trasfile->read(curr) == NOERR && !pi.iscancelled() && err == NOERR)
{ {
pi.setstatus(_trasfile->read_file()->tellg()); pi.setstatus((long) _trasfile->read_file()->tellg());
//decifra i codici numerazione e tipo documento //decifra i codici numerazione e tipo documento
if (!decifra_codici (curr, codnum, tipodoc)) if (!decifra_codici (curr, codnum, tipodoc))