Patch level : xx.7.054
Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 1.7 patch 054 aga sul main trunk git-svn-id: svn://10.65.10.50/trunk@9659 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
657dd8b432
commit
12d9315082
@ -4,8 +4,6 @@
|
||||
|
||||
#include <default.url>
|
||||
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ void TLavorazione_tab::fill_sheet(TSheet_field & sheet)
|
||||
row=cod_linea(j);
|
||||
if (!row.blank())
|
||||
{
|
||||
row.add(raw_numpers_linea(j) ,F_LNUMPERS-101);
|
||||
row.add(raw_produttiv_linea(j).string() ,F_LPRODUTTIV-101);
|
||||
row.add(raw_numpers_linea(j), F_LNUMPERS-101);
|
||||
row.add(raw_produttiv_linea(j).string(), F_LPRODUTTIV-101);
|
||||
sheet.check_row(righe);
|
||||
righe++;
|
||||
}
|
||||
@ -91,8 +91,11 @@ protected:
|
||||
virtual bool user_create();
|
||||
|
||||
virtual TString& get_mask_name(TString& name) const;
|
||||
|
||||
virtual TMask * set_mask(TMask * _m);
|
||||
|
||||
virtual void ini2sheet(TConfig& ini, TSheet_field &sheet);
|
||||
virtual void sheet2ini(TSheet_field &sheet,TConfig& ini);
|
||||
|
||||
public:
|
||||
void rows2rel(const TMask& m);
|
||||
};
|
||||
@ -172,6 +175,54 @@ int TDistinta_tables::rewrite(const TMask& m)
|
||||
return err;
|
||||
}
|
||||
|
||||
void TDistinta_tables::ini2sheet(TConfig& ini, TSheet_field &sheet)
|
||||
{
|
||||
if (get_tabname() == "LAV")
|
||||
{
|
||||
TString8 para;
|
||||
for (int i = 0; ; i++)
|
||||
{
|
||||
para.format("%d,%d", LF_TAB, i+1);
|
||||
if (ini.set_paragraph(para))
|
||||
{
|
||||
TToken_string& row = sheet.row(i);
|
||||
row.add(ini.get("CODLIN"), 0);
|
||||
row.add(ini.get("CODIMP"), 2);
|
||||
row.add(ini.get("LNUMPERS"), 3);
|
||||
row.add(ini.get("LPRODUTTIV"), 4);
|
||||
sheet.check_row(i);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TDistinta_tables::sheet2ini(TSheet_field& sheet,TConfig& ini)
|
||||
{
|
||||
if (get_tabname() == "LAV")
|
||||
{
|
||||
TString8 para;
|
||||
FOR_EACH_SHEET_ROW(sheet, i, row)
|
||||
{
|
||||
para.format("%d,%d", LF_TAB, i+1);
|
||||
ini.set_paragraph(para);
|
||||
ini.set("CODLIN", row->get(0));
|
||||
ini.set("CODIMP", row->get(2));
|
||||
ini.set("LNUMPERS", row->get(3));
|
||||
ini.set("LPRODUTTIV", row->get(4));
|
||||
}
|
||||
for ( ; ; i++)
|
||||
{
|
||||
para.format("%d,%d", LF_TAB, i+1);
|
||||
if (ini.set_paragraph(para))
|
||||
ini.remove_all();
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main program
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
104
db/db0500.cpp
104
db/db0500.cpp
@ -69,6 +69,10 @@ protected:
|
||||
virtual int write(const TMask& m);
|
||||
virtual int rewrite(const TMask& m);
|
||||
virtual bool remove();
|
||||
virtual void ini2sheet(TConfig& ini, TSheet_field &sheet);
|
||||
virtual void sheet2ini(TSheet_field &sheet,TConfig& ini);
|
||||
|
||||
void load_memo(TMask& m, TToken_string& memo);
|
||||
|
||||
public:
|
||||
TRelation & relation() {return *_therel;}
|
||||
@ -555,24 +559,25 @@ void TDistinta_mask::sheetrighe_put(TSheet_field &fld_righe, int item)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TDistinta_mask::load_um()
|
||||
{
|
||||
// *****************************
|
||||
// LETTURA SHEET UNITA' DI MISURA
|
||||
char tree_type=_tree.get_type(get(F_CODICE));
|
||||
|
||||
TSheet_field &units= (TSheet_field &)field(F_UNITA); // prende lo sheet delle unità di misura
|
||||
if (tree_type=='L')
|
||||
const char tree_type=_tree.get_type(get(F_CODICE));
|
||||
|
||||
if (!app().is_transaction())
|
||||
{
|
||||
units.destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
app().relation().lfile().put("CODDIST",get(F_CODICE));
|
||||
units.record()->read(*units.putkey(app().relation()));
|
||||
units.autoload(app().relation());
|
||||
if (tree_type=='L')
|
||||
{
|
||||
units.destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
app().relation().lfile().put("CODDIST",get(F_CODICE));
|
||||
units.record()->read(*units.putkey(app().relation()));
|
||||
units.autoload(app().relation());
|
||||
}
|
||||
}
|
||||
units.disable_cell(0, units.cid2index(FU_FC));
|
||||
const bool virtuale=tree_type!='A' && tree_type !='L';
|
||||
@ -1151,6 +1156,25 @@ TMask* TDistinta_app::get_mask(int mode)
|
||||
void TDistinta_app::init_query_mode(TMask& m)
|
||||
{
|
||||
((TQuery_mask&)m).restart_tree();
|
||||
set_search_field(F_CODICE);
|
||||
}
|
||||
|
||||
void TDistinta_app::load_memo(TMask& m, TToken_string& memo)
|
||||
{
|
||||
TSheet_field& params = m.sfield(F_PARAMS);
|
||||
params.destroy();
|
||||
const int righe = memo.items();
|
||||
for (int i = 0; i < righe; i++)
|
||||
{
|
||||
TToken_string& row = params.row(i);
|
||||
memo.get(i, row);
|
||||
int equal = row.find('=');
|
||||
if (equal > 0)
|
||||
row[equal] = SAFE_PIPE_CHR;
|
||||
row.insert(format(" %c",SAFE_PIPE_CHR),0);
|
||||
if (_tree.is_global(row.get(1)))
|
||||
row[0]='G';
|
||||
}
|
||||
}
|
||||
|
||||
int TDistinta_app::read(TMask& m)
|
||||
@ -1165,28 +1189,32 @@ int TDistinta_app::read(TMask& m)
|
||||
sheet.check_row(nrig);
|
||||
sheet.row(nrig).add(nrig+1, sheet.cid2index(F_SORT0));
|
||||
}
|
||||
|
||||
|
||||
TToken_string memo(1024, '\n');
|
||||
memo = _therel->curr().get("PARAMETRI");
|
||||
const int righe = memo.items();
|
||||
TSheet_field& params = m.sfield(F_PARAMS);
|
||||
params.destroy();
|
||||
for (int i = 0; i < righe; i++)
|
||||
{
|
||||
TToken_string& row = params.row(i);
|
||||
memo.get(i, row);
|
||||
int equal = row.find('=');
|
||||
if (equal > 0)
|
||||
row[equal] = SAFE_PIPE_CHR;
|
||||
row.insert(format(" %c",SAFE_PIPE_CHR),0);
|
||||
if (_tree.is_global(row.get(1)))
|
||||
row[0]='G';
|
||||
}
|
||||
load_memo(m, memo);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void TDistinta_app::ini2sheet(TConfig& ini, TSheet_field& s)
|
||||
{
|
||||
if (s.dlg() == F_PARAMS)
|
||||
{
|
||||
const TFixed_string fname("PARAMETRI");
|
||||
TFieldref memof(fname, 0);
|
||||
TToken_string memo(1024, '\n');
|
||||
memo = memof.read(ini, "112");
|
||||
memo.replace(SAFE_PIPE_CHR, '\n');
|
||||
load_memo(s.mask(), memo);
|
||||
}
|
||||
else
|
||||
{
|
||||
TRelation_application::ini2sheet(ini, s);
|
||||
}
|
||||
}
|
||||
|
||||
bool TDistinta_app::parms2rel(const TMask& m)
|
||||
{
|
||||
TToken_string memo(1024, '\n');
|
||||
@ -1195,7 +1223,7 @@ bool TDistinta_app::parms2rel(const TMask& m)
|
||||
FOR_EACH_SHEET_ROW(parms, r, row)
|
||||
{
|
||||
var = row->get(0);
|
||||
const char typ = var[0];
|
||||
const char typ = var[0];
|
||||
var = row->get();
|
||||
if (!var.blank())
|
||||
{
|
||||
@ -1222,6 +1250,7 @@ int TDistinta_app::write(const TMask& m)
|
||||
if (err == NOERR)
|
||||
{
|
||||
TSheet_field& f = m.sfield(F_UNITA); // prende lo sheet delle unità di misura
|
||||
f.record()->renum_key(UMART_CODART, m.get(F_CODICE));
|
||||
err = f.record()->write(FALSE);
|
||||
}
|
||||
return err;
|
||||
@ -1234,11 +1263,29 @@ int TDistinta_app::rewrite(const TMask& m)
|
||||
if (err == NOERR)
|
||||
{
|
||||
TSheet_field& f= m.sfield(F_UNITA); // prende lo sheet delle unità di misura
|
||||
f.record()->renum_key(UMART_CODART, m.get(F_CODICE));
|
||||
err = f.record()->write(TRUE);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
void TDistinta_app::sheet2ini(TSheet_field& s, TConfig& ini)
|
||||
{
|
||||
if (s.dlg() == F_PARAMS)
|
||||
{
|
||||
parms2rel(s.mask());
|
||||
const TFixed_string fname("PARAMETRI");
|
||||
TFieldref memof(fname, LF_DIST);
|
||||
TString memo = memof.read(_therel->curr());
|
||||
memo.replace('\n', SAFE_PIPE_CHR);
|
||||
memof.write(ini, "112", memo);
|
||||
}
|
||||
else
|
||||
{
|
||||
TRelation_application::sheet2ini(s, ini);
|
||||
}
|
||||
}
|
||||
|
||||
bool TDistinta_app::remove()
|
||||
{
|
||||
bool ok = TRelation_application::remove();
|
||||
@ -1263,7 +1310,6 @@ bool TDistinta_app::remove()
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// db0500 gestione distinte
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
@ -154,7 +154,7 @@ END
|
||||
|
||||
STRING F_VAR_IMPIANTO 5
|
||||
BEGIN
|
||||
FLAGS "UF"
|
||||
FLAGS "U"
|
||||
PROMPT 2 5 "Impianto "
|
||||
USE IMP
|
||||
INPUT CODTAB F_VAR_IMPIANTO
|
||||
@ -167,7 +167,7 @@ END
|
||||
|
||||
STRING F_VAR_LINEA 5
|
||||
BEGIN
|
||||
FLAGS "UF"
|
||||
FLAGS "U"
|
||||
PROMPT 22 5 "Linea "
|
||||
USE LNP
|
||||
INPUT CODTAB F_VAR_LINEA
|
||||
@ -176,7 +176,7 @@ BEGIN
|
||||
DISPLAY "Impianto" S6
|
||||
OUPUT F_VAR_LINEA CODTAB
|
||||
OUPUT F_VAR_IMPIANTO S6
|
||||
CHECKTYPE FORCED
|
||||
CHECKTYPE SEARCH
|
||||
END
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,5 @@
|
||||
#define QFIRMNAME "A.G.A. Informatica Srl"
|
||||
|
||||
#include <default.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
155
db/db1100.cpp
155
db/db1100.cpp
@ -51,7 +51,9 @@ struct _ParmStruct
|
||||
_vis_art, _vis_lav, _vis_vir, _vis_gho,
|
||||
_fabbisogno, _no_fabbis_fin, _no_zero_ord,
|
||||
_val_magmb, _val_depmb, _newpage, _det_ord_for,
|
||||
_separate_dist, _separate_giac;
|
||||
_separate_dist, _separate_giac,
|
||||
_add_orc, _add_orf, _add_prf, _add_prc, _add_acl, _add_incl,
|
||||
_normal_disp;
|
||||
char _liv_attenzione;
|
||||
};
|
||||
|
||||
@ -505,23 +507,36 @@ void TArticolo_giacenza_static::calc_ordinato_fornitori(_ParmStruct* p, const ch
|
||||
// ad ogni stampa
|
||||
|
||||
// Toglie l'ordinato fornitori dalla disponibilita
|
||||
TString16 annoes(p->_anno_es);
|
||||
TRecord_array & rmag = mag(annoes);
|
||||
for (int i = find_mag(annoes, codmag, livello); i > 0;
|
||||
i = find_mag(annoes, codmag, livello, i))
|
||||
_disp -= rmag.row(i).get_real(MAG_ORDF);
|
||||
if (p->_add_orf)
|
||||
{
|
||||
TString16 annoes(p->_anno_es);
|
||||
TRecord_array & rmag = mag(annoes);
|
||||
for (int i = find_mag(annoes, codmag, livello); i > 0;
|
||||
i = find_mag(annoes, codmag, livello, i))
|
||||
_disp -= rmag.row(i).get_real(MAG_ORDF);
|
||||
TEsercizi_contabili ese;
|
||||
const int prev = ese.pred(atoi(annoes)); // Controllo anche l'anno precedente
|
||||
if (prev > 0)
|
||||
{
|
||||
TString16 oldannoes; oldannoes.format("%04d", prev);
|
||||
TRecord_array & rmag = mag(oldannoes);
|
||||
for (int i = find_mag(oldannoes, codmag, livello); i > 0;
|
||||
i = find_mag(oldannoes, codmag, livello, i))
|
||||
_disp -= rmag.row(i).get_real(MAG_ORDF);
|
||||
}
|
||||
}
|
||||
|
||||
// Rimuove eventuali elementi rimasti, anche se questo metodo viene effettivamente chiamato una sola
|
||||
// volta per articolo.
|
||||
_ordinato_fornitori.destroy();
|
||||
// Azzera l'array...
|
||||
for (i=0; i <= p->_periods; i++)
|
||||
for (int i=0; i <= p->_periods; i++)
|
||||
_ordinato_fornitori.add(new real);
|
||||
|
||||
//Scorre tutte le numerazioni
|
||||
TString_array& a = p->_numerazioni;
|
||||
|
||||
for (i = a.last(); i >= 0; i--)
|
||||
for (i = a.last(); i >= 0; i--)
|
||||
{
|
||||
TToken_string& t = (TToken_string&) a[i];
|
||||
const int items = t.items();
|
||||
@ -535,13 +550,11 @@ void TArticolo_giacenza_static::calc_ordinato_fornitori(_ParmStruct* p, const ch
|
||||
doc.put(DOC_PROVV, "D");
|
||||
|
||||
calcola_ordinato_documento(doc);
|
||||
if (::riporta_ordinato())
|
||||
{
|
||||
doc.put(DOC_CODNUM, t.get(0));
|
||||
doc.put(DOC_ANNO, p->_year - 1);
|
||||
doc.put(DOC_PROVV, "D");
|
||||
calcola_ordinato_documento(doc);
|
||||
}
|
||||
|
||||
doc.put(DOC_CODNUM, t.get(0));
|
||||
doc.put(DOC_ANNO, p->_year - 1);
|
||||
doc.put(DOC_PROVV, "D");
|
||||
calcola_ordinato_documento(doc);
|
||||
}
|
||||
else // Se invece vi sono piu' tipi doc. per questa numerazione e' necessario considerare le testate doc.
|
||||
if (items >= 3)
|
||||
@ -569,32 +582,39 @@ void TArticolo_giacenza_static::calc_ordinato_fornitori(_ParmStruct* p, const ch
|
||||
for (cur = 0L; cur.pos() < cur.items(); ++cur)
|
||||
// Per ogni documento scorre le sue righe
|
||||
calcola_ordinato_documento(cur.curr());
|
||||
if (::riporta_ordinato())
|
||||
{
|
||||
from.zero();
|
||||
from.put(DOC_CODNUM, t.get(0));
|
||||
from.put(DOC_ANNO, p->_year - 1);
|
||||
from.put(DOC_PROVV, "D");
|
||||
to = from;
|
||||
cur.setregion(from, to);
|
||||
for (cur = 0L; cur.pos() < cur.items(); ++cur)
|
||||
from.zero();
|
||||
from.put(DOC_CODNUM, t.get(0));
|
||||
from.put(DOC_ANNO, p->_year - 1);
|
||||
from.put(DOC_PROVV, "D");
|
||||
to = from;
|
||||
cur.setregion(from, to);
|
||||
for (cur = 0L; cur.pos() < cur.items(); ++cur)
|
||||
// Per ogni documento scorre le sue righe
|
||||
calcola_ordinato_documento(cur.curr());
|
||||
}
|
||||
calcola_ordinato_documento(cur.curr());
|
||||
}
|
||||
}
|
||||
|
||||
// Progressivizza gli importi
|
||||
for (i=2; i <= p->_periods ; i++)
|
||||
const int periods = p->_periods;
|
||||
if (periods > 1)
|
||||
{
|
||||
real& rr = (real&)_ordinato_fornitori[i];
|
||||
rr += (real&)_ordinato_fornitori[i-1];
|
||||
if (i==p->_periods)
|
||||
{
|
||||
real& zz = (real&)_ordinato_fornitori[0]; // Totale...
|
||||
zz += rr;
|
||||
for (i=2; i <= periods ; i++)
|
||||
{
|
||||
real& rr = (real&)_ordinato_fornitori[i];
|
||||
rr += (real&)_ordinato_fornitori[i-1];
|
||||
if (i== periods)
|
||||
{
|
||||
real& zz = (real&)_ordinato_fornitori[0]; // Totale...
|
||||
zz += rr;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
real& rr = (real&)_ordinato_fornitori[1];
|
||||
real& zz = (real&)_ordinato_fornitori[0]; // Totale...
|
||||
zz += rr;
|
||||
}
|
||||
}
|
||||
|
||||
real& TArticolo_giacenza_static::static_disp(_ParmStruct* p, const char * codmag, const char * livello)
|
||||
@ -602,7 +622,47 @@ real& TArticolo_giacenza_static::static_disp(_ParmStruct* p, const char * codmag
|
||||
if (!_calc)
|
||||
{
|
||||
_calc =TRUE;
|
||||
_disp = disponibilita(p->_anno_es, codmag, livello);
|
||||
const char * annoes = p->_anno_es;
|
||||
_disp = ZERO;
|
||||
|
||||
TRecord_array & rmag = mag(annoes);
|
||||
for (int i = find_mag(annoes, codmag, livello); i > 0;
|
||||
i = find_mag(annoes, codmag, livello, i))
|
||||
{
|
||||
const TRectype & rec = rmag.row(i);
|
||||
_disp += rec.get_real(MAG_GIAC);
|
||||
if (p->_add_orf)
|
||||
_disp += rec.get_real(MAG_ORDF);
|
||||
if (p->_add_orc)
|
||||
_disp -= rec.get_real(MAG_ORDC);
|
||||
if (p->_add_prf)
|
||||
_disp += rec.get_real(MAG_PRODFIN);
|
||||
if (p->_add_prc)
|
||||
_disp -= rec.get_real(MAG_PRODCOMP);
|
||||
if (p->_add_acl)
|
||||
_disp += rec.get_real(MAG_ACL);
|
||||
if (p->_add_incl)
|
||||
_disp -= rec.get_real(MAG_INCL);
|
||||
}
|
||||
if ((p->_add_orc || p->_add_orf) && !riporta_ordinato()) // Se l-ordinato viene riportato
|
||||
{
|
||||
TEsercizi_contabili ese;
|
||||
const int prev = ese.pred(atoi(annoes)); // Controllo anche l'anno precedente
|
||||
if (prev > 0)
|
||||
{
|
||||
TString16 oldannoes; oldannoes.format("%04d", prev);
|
||||
const TRecord_array& oldrmag = mag(oldannoes);
|
||||
for (int i = find_mag(oldannoes, codmag, livello); i > 0;
|
||||
i = find_mag(oldannoes, codmag, livello, i))
|
||||
{
|
||||
const TRectype& rec = oldrmag.row(i);
|
||||
if (p->_add_orf)
|
||||
_disp += rec.get_real(MAG_ORDF); // Sommo l'ordinato fornitori
|
||||
if (p->_add_orc)
|
||||
_disp -= rec.get_real(MAG_ORDC); // Sottraggo l'ordinato clienti
|
||||
}
|
||||
}
|
||||
}
|
||||
_umbase = ((TRectype&)(um()[1])).get("UM");
|
||||
|
||||
// Calcola ordinato fornitori di questo articolo, suddividendo per periodi
|
||||
@ -894,14 +954,25 @@ void TExplode_distinta_form::set_explosion_rows(TArray& exp_array)
|
||||
const TString& liv = is_head ? _d->liv() : re.giacenza();
|
||||
|
||||
// Il fabbisogno e': nr. componenti di questo articolo per residuo da produrre del padre
|
||||
|
||||
if (_p->_fabbisogno)
|
||||
|
||||
if (_p->_fabbisogno && _p->_explosion == scalare)
|
||||
r = re.last_qta() * res2produce_by_father(re); // In UM locale...
|
||||
else
|
||||
r = re.val() * res2produce_by_father(re); // In UM locale...
|
||||
|
||||
if (r == ZERO)
|
||||
{
|
||||
if (_p->_fabbisogno) // Calcolo disponibilita'
|
||||
{
|
||||
// Compone la chiave da cercare nella cache: CODART|CODMAG|LIVELLO
|
||||
// ovvio che tutti i campi debbono essre paddati alla loro massima lunghezza
|
||||
// Al TArticolo_cache importa solo del CODART in ricerca... i campi seguenti vengono ignorati
|
||||
// anche se nel TAssoc_array interno vengono cmq memorizzati come chiave
|
||||
__key.format("%-20s|%-15s|%-5s", (const char*)re.articolo(), (const char*) liv, (const char*) codmag);
|
||||
_prodorder.add(__key, ZERO, TRUE);
|
||||
}
|
||||
continue; // Don't store in _exploded_tree if there's no need
|
||||
}
|
||||
|
||||
TRiga_esplosione2print* r2p = NULL;
|
||||
int pos = -1;
|
||||
@ -923,7 +994,7 @@ void TExplode_distinta_form::set_explosion_rows(TArray& exp_array)
|
||||
r2p = new TRiga_esplosione2print(re, codmag);
|
||||
_exploded_tree.add(r2p,pos);
|
||||
}
|
||||
|
||||
|
||||
r2p->set_fabbisogno(r + r2p->fabbisogno());
|
||||
|
||||
if (_p->_fabbisogno) // Calcolo disponibilita'
|
||||
@ -1067,6 +1138,7 @@ void TExplode_distinta_form::explode_and_print()
|
||||
_distinta.clear_globals();
|
||||
_distinta.set_global("_IMPIANTO", _d->imp());
|
||||
_distinta.set_global("_LINEA", _d->lin());
|
||||
_distinta.set_global( "_MAGDEP", _d->mag());
|
||||
|
||||
if (!_distinta.set_root(_d->cod(), _d->um(), 1.0, _d->liv()))
|
||||
return;
|
||||
@ -1704,6 +1776,15 @@ void TEsplosione_distinta_app::main_loop()
|
||||
_parameters._det_ord_for = _mask->get_bool(F_DETORDFOR);
|
||||
_parameters._separate_dist = _mask->get_bool(F_SEPARATE_DIST);
|
||||
_parameters._separate_giac = _mask->get_bool(F_SEPARATE_GIAC);
|
||||
_parameters._add_orc = _mask->get_bool(F_ORCLI4DISP);
|
||||
_parameters._add_orf = _mask->get_bool(F_ORFOR4DISP);
|
||||
_parameters._add_prf = _mask->get_bool(F_INPRF4DISP);
|
||||
_parameters._add_prc = _mask->get_bool(F_INPRC4DISP);
|
||||
_parameters._add_incl = _mask->get_bool(F_INCLV4DISP);
|
||||
_parameters._add_acl = _mask->get_bool(F_ACLV4DISP);
|
||||
_parameters._normal_disp = _parameters._add_orc && _parameters._add_orf &&
|
||||
_parameters._add_prf && _parameters._add_prc &&
|
||||
_parameters._add_acl && _parameters._add_acl;
|
||||
|
||||
// Credo che il seguente anno esercizio sia calcolato
|
||||
// in modo abbastanza schifoso, visto che si e' in possesso del solo anno solare
|
||||
|
||||
18
db/db1100a.h
18
db/db1100a.h
@ -39,14 +39,16 @@
|
||||
#define F_ORFOR4DISP 137
|
||||
#define F_INPRF4DISP 138
|
||||
#define F_INPRC4DISP 139
|
||||
#define F_CATVEN_LIST 140
|
||||
#define F_CODLIST 141
|
||||
#define F_NOIGNORE 142
|
||||
#define F_NOZEROORD 143
|
||||
#define F_IMPIANTO 144
|
||||
#define F_DESCIMP 145
|
||||
#define F_LINEA 146
|
||||
#define F_DESCLIN 147
|
||||
#define F_INCLV4DISP 140
|
||||
#define F_ACLV4DISP 141
|
||||
#define F_CATVEN_LIST 142
|
||||
#define F_CODLIST 143
|
||||
#define F_NOIGNORE 144
|
||||
#define F_NOZEROORD 145
|
||||
#define F_IMPIANTO 146
|
||||
#define F_DESCIMP 147
|
||||
#define F_LINEA 148
|
||||
#define F_DESCLIN 149
|
||||
|
||||
#define F_CODDIS 101
|
||||
#define F_LIV1 102
|
||||
|
||||
@ -286,19 +286,19 @@ PAGE "Disponibilita'" -1 -1 78 20
|
||||
|
||||
BOOLEAN F_FABBISOGNO
|
||||
BEGIN
|
||||
PROMPT 2 2 "Calcola disponibilita'"
|
||||
MESSAGE TRUE ENABLE,G_DISPONIB@|"X",F_ORCLI4DISP|"X",F_ORFOR4DISP|"X",F_INPRF4DISP|"X",F_INPRC4DISP
|
||||
PROMPT 2 1 "Calcola disponibilita'"
|
||||
MESSAGE TRUE ENABLE,G_DISPONIB@
|
||||
MESSAGE FALSE CLEAR,G_DISPONIB@|CLEAR,6@
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 50 9
|
||||
GROUPBOX DLG_NULL 50 11
|
||||
BEGIN
|
||||
PROMPT 2 2 ""
|
||||
PROMPT 2 1 ""
|
||||
END
|
||||
|
||||
LIST F_LIVATTENZ 26
|
||||
BEGIN
|
||||
PROMPT 3 3 "Segnala giacenza "
|
||||
PROMPT 3 2 "Segnala giacenza "
|
||||
ITEM " |sotto zero"
|
||||
ITEM "S|sotto scorta minima"
|
||||
// ITEM "R|sotto livello di riordino"
|
||||
@ -307,48 +307,60 @@ END
|
||||
|
||||
BOOLEAN F_FABBISOGNO_FIN
|
||||
BEGIN
|
||||
PROMPT 3 4 "Non calcolare disp. sui finiti"
|
||||
PROMPT 3 3 "Non calcolare disp. sui finiti"
|
||||
GROUP G_DISPONIB
|
||||
END
|
||||
|
||||
BOOLEAN F_NOZEROORD
|
||||
BEGIN
|
||||
PROMPT 3 5 "Non stampare righe con fabbisogno nullo"
|
||||
PROMPT 3 4 "Non stampare righe con fabbisogno nullo"
|
||||
GROUP G_DISPONIB
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_ORCLI4DISP
|
||||
BEGIN
|
||||
PROMPT 3 6 "Sottrai l'ordinato clienti"
|
||||
// GROUP G_DISPONIB
|
||||
PROMPT 3 5 "Sottrai l'ordinato clienti"
|
||||
GROUP G_DISPONIB
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_ORFOR4DISP
|
||||
BEGIN
|
||||
PROMPT 3 7 "Aggiungi l'ordinato fornitori"
|
||||
// GROUP G_DISPONIB
|
||||
PROMPT 3 6 "Aggiungi l'ordinato fornitori"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_INPRF4DISP
|
||||
BEGIN
|
||||
PROMPT 3 8 "Aggiungi i finiti in produzione"
|
||||
// GROUP G_DISPONIB
|
||||
PROMPT 3 7 "Aggiungi i finiti in produzione"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_INPRC4DISP
|
||||
BEGIN
|
||||
PROMPT 3 9 "Sottrai i componenti in produzione"
|
||||
// GROUP G_DISPONIB
|
||||
PROMPT 3 8 "Sottrai i componenti in produzione"
|
||||
GROUP G_DISPONIB
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_ACLV4DISP
|
||||
BEGIN
|
||||
PROMPT 3 9 "Aggiungi i componenti a conto lavorazione"
|
||||
GROUP G_DISPONIB
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_INCLV4DISP
|
||||
BEGIN
|
||||
PROMPT 3 10 "Sottrai i componenti in conto lavorazione"
|
||||
GROUP G_DISPONIB
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
LISTBOX F_VALORIZZAZIONE 32
|
||||
BEGIN
|
||||
PROMPT 3 11 ""
|
||||
PROMPT 3 12 ""
|
||||
ITEM "0|Non valorizzare"
|
||||
MESSAGE HIDE,G_LISTINO@
|
||||
ITEM "1|Valorizza Ultimo costo"
|
||||
@ -375,7 +387,7 @@ END
|
||||
|
||||
STRING F_CATVEN_LIST 2
|
||||
BEGIN
|
||||
PROMPT 3 12 "Cat.vendita "
|
||||
PROMPT 57 12 "Cat.vendita "
|
||||
USE CVE
|
||||
INPUT CODTAB F_CATVEN_LIST
|
||||
DISPLAY "Codice" CODTAB
|
||||
@ -389,7 +401,7 @@ END
|
||||
|
||||
STRING F_CODLIST 3
|
||||
BEGIN
|
||||
PROMPT 25 12 "Cod.listino "
|
||||
PROMPT 39 12 "Cod.listino "
|
||||
USE LF_CONDV SELECT TIPO=="L"
|
||||
INPUT TIPO "L"
|
||||
INPUT CATVEN F_CATVEN_LIST
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
#include <applicat.h>
|
||||
#include <defmask.h>
|
||||
#include <sheet.h>
|
||||
#include <automask.h>
|
||||
#include <printer.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <sheet.h>
|
||||
@ -22,7 +25,7 @@ protected:
|
||||
virtual const TRectype& find_head(const TCodice_articolo& art) const;
|
||||
virtual const TRectype* find_child(const TCodice_articolo& art, int child) const;
|
||||
|
||||
public:
|
||||
public:
|
||||
bool add_head(const TCodice_articolo& art);
|
||||
bool add_child(const TRectype& rec);
|
||||
|
||||
@ -32,6 +35,8 @@ public:
|
||||
virtual ~TXmas_tree();
|
||||
};
|
||||
|
||||
HIDDEN bool _ignore_zero = TRUE;
|
||||
|
||||
const TRectype& TXmas_tree::find_head(const TCodice_articolo& art) const
|
||||
{
|
||||
const TRectype& rec = _cache_dist->get(art);
|
||||
@ -73,7 +78,7 @@ void TXmas_tree::add_branch(TDistinta_tree& dt)
|
||||
while (dt.has_father())
|
||||
{
|
||||
const real qta = dt.last_qta();
|
||||
if (qta.is_zero())
|
||||
if (::_ignore_zero && qta.is_zero())
|
||||
break; // Inutile proseguire
|
||||
TCodice_um um; dt.curr_um(um);
|
||||
TCodice_articolo art; dt.curr_code(art);
|
||||
@ -114,7 +119,7 @@ void TXmas_tree::add_branch(TDistinta_tree& dt)
|
||||
}
|
||||
|
||||
TXmas_tree::TXmas_tree()
|
||||
{
|
||||
{
|
||||
_dist = new TIsamtempfile(LF_DIST, NULL, TRUE, TRUE);
|
||||
_cache_dist = new TRecord_cache(_dist);
|
||||
_cache_dist->test_file_changes(TRUE);
|
||||
@ -194,11 +199,69 @@ class TDisplay_mask : public TAutomask
|
||||
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
void print_tree(TXmas_tree& tree);
|
||||
|
||||
public:
|
||||
TDisplay_mask(TAssoc_array& xmas);
|
||||
virtual ~TDisplay_mask() { }
|
||||
};
|
||||
};
|
||||
|
||||
static bool print_node(TTree& t, void* p, word flags)
|
||||
{
|
||||
TXmas_tree& tree = (TXmas_tree&)t;
|
||||
TBit_array& righette = *(TBit_array*)p;
|
||||
const int depth = tree.curr_depth();
|
||||
const int tab = (depth-1)*3;
|
||||
|
||||
TString descr;
|
||||
tree.get_description(descr);
|
||||
|
||||
TPrintrow row;
|
||||
if (tab >= 0)
|
||||
row.put("+--", tab);
|
||||
row.put(descr);
|
||||
for (int d = 1; d < depth; d++)
|
||||
if (righette[d]) row.put("!", (d-1)*3);
|
||||
printer().print(row);
|
||||
|
||||
righette.set(depth, tree.has_rbrother());
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TDisplay_mask::print_tree(TXmas_tree& tree)
|
||||
{
|
||||
TPrinter& p = printer();
|
||||
p.resetheader();
|
||||
p.resetfooter();
|
||||
|
||||
TCodice_articolo art;
|
||||
TString descr;
|
||||
tree.goto_root();
|
||||
tree.curr_code(art);
|
||||
tree.describe(art, descr);
|
||||
|
||||
TPrintrow header;
|
||||
header.put("@bSTAMPA IMPLOSIONE ");
|
||||
header.put(art);
|
||||
header.put(" - ");
|
||||
header.put(descr);
|
||||
|
||||
p.setheaderline(0, header);
|
||||
p.setheaderline(1, NULL);
|
||||
|
||||
TPrintrow footer;
|
||||
footer.put("Pag.@#", 36);
|
||||
p.setfooterline(0, NULL);
|
||||
p.setfooterline(1, footer);
|
||||
p.setfooterline(2, NULL);
|
||||
|
||||
p.open();
|
||||
TBit_array righette;
|
||||
tree.scan_depth_first(print_node, &righette);
|
||||
p.formfeed();
|
||||
p.close();
|
||||
}
|
||||
|
||||
bool TDisplay_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
@ -259,6 +322,15 @@ bool TDisplay_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DLG_PRINT:
|
||||
if (e == fe_button)
|
||||
{
|
||||
TXmas_tree* t = (TXmas_tree*)tfield(F_TREE).tree();
|
||||
if (t)
|
||||
print_tree(*t);
|
||||
return FALSE; // Non chiudere la maschera!
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -656,6 +728,7 @@ void TImplosion_mask::implode()
|
||||
{
|
||||
_xmas.destroy();
|
||||
|
||||
_ignore_zero = !get_bool(F_DISPLAY_ZERO);
|
||||
if (get_bool(F_FASTIMPLODE))
|
||||
{
|
||||
if (get_bool(F_ONLYONE))
|
||||
|
||||
15
db/db1300a.h
15
db/db1300a.h
@ -18,11 +18,12 @@
|
||||
#define F_MAGAZZINO 103
|
||||
#define F_DEPOSITO 104
|
||||
|
||||
#define F_USECATMER 220
|
||||
#define F_DA_CATMER 221
|
||||
#define F_A_CATMER 222
|
||||
#define F_DA_ARTICOLO 225
|
||||
#define F_AD_ARTICOLO 226
|
||||
#define F_FASTIMPLODE 227
|
||||
#define F_ONLYONE 228
|
||||
#define F_USECATMER 220
|
||||
#define F_DA_CATMER 221
|
||||
#define F_A_CATMER 222
|
||||
#define F_DA_ARTICOLO 225
|
||||
#define F_AD_ARTICOLO 226
|
||||
#define F_FASTIMPLODE 227
|
||||
#define F_ONLYONE 228
|
||||
#define F_DISPLAY_ZERO 229
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ BEGIN
|
||||
PROMPT 1 8 "@bVariabili d'ambiente"
|
||||
END
|
||||
|
||||
SPREADSHEET F_VARS 78 8
|
||||
SPREADSHEET F_VARS 78 7
|
||||
BEGIN
|
||||
PROMPT 1 9 ""
|
||||
ITEM "Impianto"
|
||||
@ -51,21 +51,38 @@ BEGIN
|
||||
ITEM "Liv. 4@6"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 4
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 1 17 "@bProdotti Finiti"
|
||||
PROMPT 1 16 "@bProdotti Finiti"
|
||||
END
|
||||
|
||||
BOOLEAN F_FASTIMPLODE
|
||||
BEGIN
|
||||
PROMPT 2 17 "Implosione rapida (senza articoli virtuali)"
|
||||
MESSAGE FALSE HIDE,F_ONLYONE
|
||||
MESSAGE TRUE SHOW,F_ONLYONE
|
||||
END
|
||||
|
||||
BOOLEAN F_ONLYONE
|
||||
BEGIN
|
||||
PROMPT 50 17 "Solo primo livello"
|
||||
END
|
||||
|
||||
BOOLEAN F_DISPLAY_ZERO
|
||||
BEGIN
|
||||
PROMPT 2 18 "Visualizza le quantitá a zero"
|
||||
END
|
||||
|
||||
BOOLEAN F_USECATMER
|
||||
BEGIN
|
||||
PROMPT 2 18 "Per categoria merceologica"
|
||||
PROMPT 2 19 "Per categoria merceologica"
|
||||
MESSAGE FALSE HIDE,F_DA_CATMER|HIDE,F_A_CATMER
|
||||
MESSAGE TRUE SHOW,F_DA_CATMER|SHOW,F_A_CATMER
|
||||
END
|
||||
|
||||
STRING F_DA_CATMER 5
|
||||
BEGIN
|
||||
PROMPT 42 18 "Da "
|
||||
PROMPT 42 19 "Da "
|
||||
FLAG "U"
|
||||
USE GMC
|
||||
INPUT CODTAB F_DA_CATMER
|
||||
@ -77,7 +94,7 @@ END
|
||||
|
||||
STRING F_A_CATMER 5
|
||||
BEGIN
|
||||
PROMPT 58 18 "A "
|
||||
PROMPT 58 19 "A "
|
||||
FLAG "U"
|
||||
COPY USE F_DA_CATMER
|
||||
INPUT CODTAB F_A_CATMER
|
||||
@ -88,7 +105,7 @@ END
|
||||
|
||||
STRING F_DA_ARTICOLO 20
|
||||
BEGIN
|
||||
PROMPT 2 19 "Dal "
|
||||
PROMPT 2 20 "Dal "
|
||||
USE LF_ANAMAG
|
||||
INPUT CODART F_DA_ARTICOLO
|
||||
DISPLAY "Codice@20" CODART
|
||||
@ -101,7 +118,7 @@ END
|
||||
|
||||
STRING F_AD_ARTICOLO 20
|
||||
BEGIN
|
||||
PROMPT 42 19 "Al "
|
||||
PROMPT 42 20 "Al "
|
||||
COPY USE F_DA_ARTICOLO
|
||||
INPUT CODART F_AD_ARTICOLO
|
||||
COPY DISPLAY F_DA_ARTICOLO
|
||||
|
||||
@ -4,12 +4,17 @@ TOOLBAR "" 0 -3 0 3
|
||||
|
||||
BUTTON F_EXPLODE 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 "~Lista"
|
||||
PROMPT -13 -11 "~Lista"
|
||||
END
|
||||
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -23 -11 "~Stampa"
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
PROMPT -33 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
@ -3,8 +3,5 @@
|
||||
#define QFIRMNAME "A.G.A. Informatica Srl"
|
||||
|
||||
#include <default.url>
|
||||
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
@ -11,6 +11,9 @@ int main(int argc, char** argv)
|
||||
dbcv00(argc, argv); break;
|
||||
case 1:
|
||||
dbcv01(argc, argv); break;
|
||||
case 3:
|
||||
dbcv03(argc, argv); break;
|
||||
case 2:
|
||||
default:
|
||||
dbcv02(argc, argv); break;
|
||||
}
|
||||
|
||||
@ -4,5 +4,6 @@
|
||||
int dbcv00(int argc, char* argv[]);
|
||||
int dbcv01(int argc, char* argv[]);
|
||||
int dbcv02(int argc, char* argv[]);
|
||||
int dbcv03(int argc, char* argv[]);
|
||||
|
||||
#endif
|
||||
|
||||
@ -3,9 +3,6 @@
|
||||
#define QFIRMNAME "A.G.A. Informatica Srl"
|
||||
|
||||
#include <default.url>
|
||||
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
|
||||
233
db/dbcv00.cpp
233
db/dbcv00.cpp
@ -8,18 +8,21 @@
|
||||
#include <execp.h>
|
||||
#include "..\mg\anamag.h"
|
||||
#include "..\mg\mag.h"
|
||||
#include "..\mg\mglib.h"
|
||||
#include "..\include\doc.h"
|
||||
#include "..\include\rdoc.h"
|
||||
#include "..\ve\velib.h"
|
||||
|
||||
typedef void (*SET_DOC_FUN)(TImport_file & import,TConfig &trans);
|
||||
typedef int (*SET_BODYDOC_FUN)(TImport_file & import,TConfig &trans);
|
||||
typedef int (*SET_BODYDOC_FUN)(TImport_file & import,TConfig &trans, const bool dotrans);
|
||||
typedef const char *(*TIPOCF_FUN)(TImport_file & import);
|
||||
typedef bool (*FILTER_FUN)(TImport_file & import);
|
||||
typedef bool (*GROUPBRK_FUN)(TImport_file & import);
|
||||
|
||||
static TExternisamfile *_ithcheck=NULL;
|
||||
static bool _check=TRUE;
|
||||
|
||||
#include "dbcvlib.h"
|
||||
|
||||
class TImporta_mask : public TAutomask
|
||||
{
|
||||
@ -44,13 +47,14 @@ private:
|
||||
bool read_is_dist(const char *item_code);
|
||||
bool is_ghost(const char *item_code);
|
||||
const char * read_first_um(const char *item_code);
|
||||
|
||||
bool creadocs(const char * msg,
|
||||
long firm, TImport_file & imp_file,
|
||||
const char *FieldNumDoc, const char *FieldClifor, const char *FieldDataDoc,const char *FieldGroup1, const char *FieldGroup2, const char *FieldGroup3,
|
||||
SET_DOC_FUN set_header, SET_BODYDOC_FUN set_body, FILTER_FUN filter ,
|
||||
SET_DOC_FUN set_header, SET_BODYDOC_FUN set_body, FILTER_FUN filter ,GROUPBRK_FUN grp,
|
||||
TIPOCF_FUN tipocf, bool do_ve0=TRUE);
|
||||
|
||||
void clear_docs(long firm, const char * num, const TDate *fromdate=NULL, const TDate *todate=NULL);
|
||||
void clear_docs(long firm, const char * num, const TDate *fromdate=NULL, const TDate *todate=NULL, const long fromnum= 0,const long tonum=-1 );
|
||||
void change_docs_status(const char * num, const TDate *fromdate, const TDate *todate, int fromstatus, int tostatus);
|
||||
void newums();
|
||||
|
||||
@ -288,7 +292,7 @@ bool TImporta_BPCS ::importa_boms(TMask &m)
|
||||
}
|
||||
}
|
||||
// importa solo gli impianti SEgrate e TrieSte
|
||||
if (!skip && metodo == 99 && (impianto=="SE" || impianto=="TS" ))
|
||||
if (!skip && (impianto=="SE" || impianto=="TS" ) /* && metodo == 99 */)
|
||||
{
|
||||
main_imp=impianto;
|
||||
do {
|
||||
@ -524,17 +528,17 @@ bool TImporta_BPCS ::importa_arts(TMask & m, const bool erase, const bool solo
|
||||
_anamag->put( ANAMAG_CODART,item_code);
|
||||
_anamag->put( ANAMAG_DESCR,items.get("IDESC"));
|
||||
_anamag->put( ANAMAG_DESCRAGG,items.get("IDSCE"));
|
||||
_anamag->put( ANAMAG_CODFORN, items.get("IVEND"));
|
||||
_anamag->put( ANAMAG_CODFORN, items.get_long("IVEND"));
|
||||
_anamag->put( ANAMAG_UMP, "KG");
|
||||
_anamag->put( ANAMAG_PESO, items.get("IWGHT"));
|
||||
_anamag->put( ANAMAG_PESO, items.get_real("IWGHT"));
|
||||
// riordino
|
||||
_anamag->put( ANAMAG_RIORDINO , "F"); //_anamag->put( ANAMAG_RIORDINO , items.get("IMRP")=="M" ? "F" : "P" );
|
||||
_anamag->put( ANAMAG_GIORNIRIOR, items.get("ILEAD"));
|
||||
_anamag->put( ANAMAG_LOTTORIOR, items.get("ILOTS"));
|
||||
_anamag->put( ANAMAG_LOTTOIRIOR, items.get("IIOQ"));
|
||||
_anamag->put( ANAMAG_GIORNIRIOR, items.get_long("ILEAD"));
|
||||
_anamag->put( ANAMAG_LOTTORIOR, items.get_real("ILOTS"));
|
||||
_anamag->put( ANAMAG_LOTTOIRIOR, items.get_real("IIOQ"));
|
||||
//
|
||||
_anamag->put( ANAMAG_PPCONF , items.get("IFII"));
|
||||
_anamag->put( ANAMAG_PPCOLLO , items.get("IFII"));
|
||||
_anamag->put( ANAMAG_PPCONF , items.get_long("IFII"));
|
||||
_anamag->put( ANAMAG_PPCOLLO , items.get_long("IFII"));
|
||||
TString16 gmc=items.get("IITYP");
|
||||
switch (gmc[0])
|
||||
{
|
||||
@ -564,8 +568,8 @@ bool TImporta_BPCS ::importa_arts(TMask & m, const bool erase, const bool solo
|
||||
}
|
||||
}
|
||||
_anamag->put( ANAMAG_GRMERC,gmc);
|
||||
_anamag->put( ANAMAG_COSTSTD, items.get("ISCST"));
|
||||
_anamag->put( ANAMAG_ULTCOS1, items.get("IACST"));
|
||||
_anamag->put( ANAMAG_COSTSTD, items.get_real("ISCST"));
|
||||
_anamag->put( ANAMAG_ULTCOS1, items.get_real("IACST"));
|
||||
tmp=items.get("TAXC1");
|
||||
if (tmp.left(3)=="IVA")
|
||||
tmp=tmp.sub(3);
|
||||
@ -573,16 +577,16 @@ bool TImporta_BPCS ::importa_arts(TMask & m, const bool erase, const bool solo
|
||||
if (items_ext.get_codice("MSITE")==items.get_codice("IPROD"))
|
||||
{
|
||||
_anamag->put( ANAMAG_CLASSDOG , check_clasdog(items_ext.get_long("MSTDO")));
|
||||
_anamag->put( ANAMAG_USER1 , items_ext.get("MSIDR"));// idrati
|
||||
_anamag->put( ANAMAG_USER2 , items_ext.get("MSANI"));//anidri
|
||||
_anamag->put( ANAMAG_USER1 , items_ext.get_real("MSIDR"));// idrati
|
||||
_anamag->put( ANAMAG_USER2 , items_ext.get_real("MSANI"));//anidri
|
||||
_anamag->put( ANAMAG_USER3 , items_ext.get("MSTAL"));//alcool
|
||||
// dimensioni
|
||||
_anamag->put( ANAMAG_USER4, items_ext.get("MSPLU"));
|
||||
_anamag->put( ANAMAG_USER5, items_ext.get("MSPAL"));
|
||||
_anamag->put( ANAMAG_USER6, items_ext.get("MSPPR"));
|
||||
_anamag->put( ANAMAG_USER4, items_ext.get_long("MSSLU"));
|
||||
_anamag->put( ANAMAG_USER5, items_ext.get_long("MSSAL"));
|
||||
_anamag->put( ANAMAG_USER6, items_ext.get_long("MSCPR"));
|
||||
// composizione pallets
|
||||
_anamag->put( ANAMAG_USER7, items_ext.get("MSCST")); // casse per strato
|
||||
_anamag->put( ANAMAG_USER8, items_ext.get("MSSTP")); // strati per pallet
|
||||
_anamag->put( ANAMAG_USER7, items_ext.get_long("MSCST")); // casse per strato
|
||||
_anamag->put( ANAMAG_USER8, items_ext.get_long("MSSTP")); // strati per pallet
|
||||
}
|
||||
force_write(*_anamag);
|
||||
real smin(items.get("IMIN"));
|
||||
@ -795,7 +799,7 @@ void TImporta_BPCS ::change_docs_status(const char * num, const TDate *fromdate,
|
||||
TString codnum(num);
|
||||
TLocalisamfile doc(LF_DOC);
|
||||
TDocumento doc_record;
|
||||
TIndwin info(80,"Cambio stato documenti ",TRUE,FALSE);
|
||||
TIndwin info(80,"Cambio stato documenti ",TRUE,FALSE);
|
||||
|
||||
for (int anno=1998; anno<=2000; anno++)
|
||||
{
|
||||
@ -808,7 +812,6 @@ void TImporta_BPCS ::change_docs_status(const char * num, const TDate *fromdate,
|
||||
doc.get_int(DOC_ANNO) == anno &&
|
||||
(doc.get("CODNUM")==codnum || codnum.blank()))
|
||||
{
|
||||
info.set_text(format("Cambio stato %s n. %ld", num, doc.get_long(DOC_NDOC)));
|
||||
if (info.iscancelled())
|
||||
return;
|
||||
|
||||
@ -818,6 +821,7 @@ void TImporta_BPCS ::change_docs_status(const char * num, const TDate *fromdate,
|
||||
if (!todate || todate->empty() || doc.get_date("DATADOC")<=*todate)
|
||||
if (docstatus == fromstatus)
|
||||
{
|
||||
info.set_text(format("Cambio stato %s n. %ld", num, doc.get_long(DOC_NDOC)));
|
||||
doc_record = doc.curr();
|
||||
doc_record.read(_isequal, _lock);
|
||||
doc_record.put(DOC_STATO, tostatus);
|
||||
@ -828,7 +832,7 @@ void TImporta_BPCS ::change_docs_status(const char * num, const TDate *fromdate,
|
||||
}
|
||||
}
|
||||
|
||||
void TImporta_BPCS::clear_docs(long firm, const char * num, const TDate *fromdate, const TDate *todate)
|
||||
void TImporta_BPCS::clear_docs(long firm, const char * num, const TDate *fromdate, const TDate *todate, const long fromnum,const long tonum )
|
||||
{
|
||||
TConfig *trans=NULL;
|
||||
long ntransac=0;
|
||||
@ -839,7 +843,7 @@ void TImporta_BPCS::clear_docs(long firm, const char * num, const TDate *fromdat
|
||||
TString codnum(num);
|
||||
TLocalisamfile doc(LF_DOC);
|
||||
TLocalisamfile rdoc(LF_RIGHEDOC);
|
||||
for (int anno=1998; anno<=1999; anno++)
|
||||
for (int anno=1998; anno<=2002; anno++)
|
||||
{
|
||||
TDate docdate(doc.get_date("DATADOC"));
|
||||
doc.put(DOC_PROVV,"D");
|
||||
@ -852,6 +856,8 @@ void TImporta_BPCS::clear_docs(long firm, const char * num, const TDate *fromdat
|
||||
{
|
||||
if (!fromdate || fromdate->empty() || doc.get_date("DATADOC")>=*fromdate)
|
||||
if (!todate || todate->empty() || doc.get_date("DATADOC")<=*todate)
|
||||
if (fromnum<=0 || doc.get_long(DOC_NDOC)>=fromnum )
|
||||
if (tonum<=0 || doc.get_long(DOC_NDOC)<=tonum )
|
||||
{
|
||||
ntransac++;
|
||||
if (ntransac==nblock*100)
|
||||
@ -888,12 +894,14 @@ void TImporta_BPCS::clear_docs(long firm, const char * num, const TDate *fromdat
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool TImporta_BPCS::creadocs(const char * msg,
|
||||
long firm, // ditta
|
||||
TImport_file & imp_file,
|
||||
const char *FieldNumDoc, const char *FieldClifor, const char *FieldDataDoc,
|
||||
const char *FieldGroup1, const char *FieldGroup2, const char *FieldGroup3,
|
||||
SET_DOC_FUN set_header, SET_BODYDOC_FUN set_body, FILTER_FUN filter , TIPOCF_FUN tipocf,
|
||||
SET_DOC_FUN set_header, SET_BODYDOC_FUN set_body, FILTER_FUN filter ,
|
||||
GROUPBRK_FUN grpfun, TIPOCF_FUN tipocf,
|
||||
bool do_ve0)
|
||||
{
|
||||
|
||||
@ -902,7 +910,13 @@ bool TImporta_BPCS::creadocs(const char * msg,
|
||||
int nblock=1;
|
||||
long ntransac=0;
|
||||
int nrigadoc=0;
|
||||
|
||||
long starting_ndoc=0;
|
||||
// autonumerazione a partire da ...
|
||||
if (FieldNumDoc && *FieldNumDoc== '*' && *(FieldNumDoc+1)== '*' )
|
||||
{
|
||||
starting_ndoc = atol(FieldNumDoc+2);
|
||||
FieldNumDoc = NULL;
|
||||
}
|
||||
// rimuove le transazioni
|
||||
delete_files("ND_*.ini");
|
||||
|
||||
@ -924,6 +938,8 @@ bool TImporta_BPCS::creadocs(const char * msg,
|
||||
if (filter(imp_file))
|
||||
{
|
||||
long new_ndoc =FieldNumDoc ? imp_file.get_long(FieldNumDoc) : last_ndoc;
|
||||
if (new_ndoc <= 0 && starting_ndoc)
|
||||
new_ndoc = starting_ndoc++ ;
|
||||
long new_clifor=FieldClifor ? imp_file.get_long(FieldClifor) : last_clifor;
|
||||
if (new_clifor==0L && FieldClifor)
|
||||
new_clifor=9999; // cliente generico
|
||||
@ -931,8 +947,8 @@ bool TImporta_BPCS::creadocs(const char * msg,
|
||||
TString new_group1=FieldGroup1 ? imp_file.get(FieldGroup1) : last_group1;
|
||||
TString new_group2=FieldGroup2 ? imp_file.get(FieldGroup2) : last_group2;
|
||||
TString new_group3=FieldGroup3 ? imp_file.get(FieldGroup3) : last_group3;
|
||||
if (nrigadoc>99 || (last_ndoc != new_ndoc) || (last_date != new_date ) || (last_clifor != new_clifor )||
|
||||
(last_group1 != new_group1 )|| (last_group2 != new_group2 )|| (last_group3 != new_group3 ))
|
||||
if (nrigadoc>99 || (grpfun && grpfun(imp_file)) || (last_ndoc != new_ndoc) || (last_date != new_date ) || (last_clifor != new_clifor )||
|
||||
(last_group1 != new_group1 )|| (last_group2 != new_group2 )|| (last_group3 != new_group3 ))
|
||||
{
|
||||
if (ntransac==nblock*100)
|
||||
{
|
||||
@ -962,6 +978,8 @@ bool TImporta_BPCS::creadocs(const char * msg,
|
||||
trans->set(DOC_TIPOCF, tipocf(imp_file));
|
||||
if (new_clifor>0L)
|
||||
{
|
||||
if (tipocf(imp_file) == "F")
|
||||
new_clifor = trascode_for(new_clifor);
|
||||
trans->set(DOC_CODCF,new_clifor);
|
||||
// gestione condizione di pagamento
|
||||
|
||||
@ -973,11 +991,12 @@ bool TImporta_BPCS::creadocs(const char * msg,
|
||||
trans->set(DOC_PROVV,"D");
|
||||
set_header(imp_file, *trans);
|
||||
nrigadoc=0;
|
||||
ntransac++;
|
||||
last_ndoc=-1L;
|
||||
ntransac++;
|
||||
}
|
||||
// righe
|
||||
trans->set_paragraph(format("%d,%d",LF_RIGHEDOC, nrigadoc+1));
|
||||
nrigadoc += set_body(imp_file, *trans);
|
||||
nrigadoc += set_body(imp_file, *trans,do_ve0);
|
||||
}
|
||||
imp_file.next();
|
||||
}
|
||||
@ -988,10 +1007,14 @@ bool TImporta_BPCS::creadocs(const char * msg,
|
||||
// genera i documenti
|
||||
if (do_ve0)
|
||||
{
|
||||
|
||||
TExternal_app *_gestart=NULL;
|
||||
TString cmd("ve0.exe -1 -i");
|
||||
cmd << format("ND_%03d*.INI",nblock-1) ;
|
||||
TExternal_app gestdoc((const char *)cmd);
|
||||
gestdoc.run();
|
||||
if (_gestart==NULL)
|
||||
_gestart = new TExternal_app((const char *)cmd);
|
||||
while (_gestart->run()!=0 && yesno_box("Ritento l'esecuzione di ve0.exe ?"))
|
||||
;
|
||||
}
|
||||
nblock++;
|
||||
}
|
||||
@ -1015,7 +1038,7 @@ void set_head_F_ordcli(TImport_file & import, TConfig &trans)
|
||||
round_date(dc,28,TRUE);
|
||||
trans.set(DOC_DATACONS, dc);// stessa data del doc
|
||||
}
|
||||
int set_body_F_ordcli(TImport_file &import, TConfig &trans)
|
||||
int set_body_F_ordcli(TImport_file &import, TConfig &trans, const bool dotrans)
|
||||
{
|
||||
TToken_string tmp;
|
||||
trans.set(RDOC_TIPORIGA,"01");
|
||||
@ -1025,7 +1048,7 @@ int set_body_F_ordcli(TImport_file &import, TConfig &trans)
|
||||
tmp.add("1");
|
||||
trans.set(RDOC_PREZZO,cache().get(LF_UMART,tmp).get("PREZZO"));
|
||||
trans.set(RDOC_UMQTA,cache().get(LF_UMART,tmp).get("UM"));
|
||||
trans.set(RDOC_QTA,import.get_real("FQTY"));
|
||||
trans.set(RDOC_QTA,import.get("FQTY"));
|
||||
// gia' suddivisa su doc : trans.set(RDOC_DATACONS, import.get_date("FDATE"));
|
||||
tmp=import.get("FPFAC");
|
||||
tmp << 1;
|
||||
@ -1052,7 +1075,7 @@ void set_head_R_ordcli(TImport_file & import, TConfig &trans)
|
||||
round_date(dc,28,TRUE);
|
||||
trans.set(DOC_DATACONS, dc);// stessa data del doc
|
||||
}
|
||||
int set_body_R_ordcli(TImport_file &import, TConfig &trans)
|
||||
int set_body_R_ordcli(TImport_file &import, TConfig &trans, const bool dotrans)
|
||||
{
|
||||
TToken_string tmp;
|
||||
trans.set(RDOC_TIPORIGA,"01");
|
||||
@ -1062,8 +1085,8 @@ int set_body_R_ordcli(TImport_file &import, TConfig &trans)
|
||||
tmp.add("1");
|
||||
trans.set(RDOC_PREZZO,cache().get(LF_UMART,tmp).get("PREZZO"));
|
||||
trans.set(RDOC_UMQTA,cache().get(LF_UMART,tmp).get("UM"));
|
||||
trans.set(RDOC_QTA,import.get_real("SQREQ"));
|
||||
trans.set(RDOC_QTAEVASA,import.get_real("SQFIN"));
|
||||
trans.set(RDOC_QTA,import.get("SQREQ"));
|
||||
trans.set(RDOC_QTAEVASA,import.get("SQFIN"));
|
||||
|
||||
tmp=import.get("SOFAC");
|
||||
tmp << 1;
|
||||
@ -1081,7 +1104,7 @@ bool filter_R_ordcli(TImport_file & import)
|
||||
return ok;
|
||||
}
|
||||
|
||||
// ordini di produzione
|
||||
// ordini di produzione firm planned
|
||||
void set_head_F_ordprod(TImport_file & import, TConfig &trans)
|
||||
{
|
||||
trans.set(DOC_ANNO,import.get_date("FRDTE").year());
|
||||
@ -1093,15 +1116,15 @@ void set_head_F_ordprod(TImport_file & import, TConfig &trans)
|
||||
dc = rdt;
|
||||
|
||||
if (dc < today)
|
||||
if (1 || yesno_box("Data ordine di produzione per l'articolo %s inferiore a quella attuale: posticipo ?",(const char *) import.get("FPROD")))
|
||||
if (0 || yesno_box("Data ordine di produzione per l'articolo %s inferiore a quella attuale: posticipo a oggi?",(const char *) import.get("FPROD")))
|
||||
dc = today;
|
||||
round_date(dc,28,TRUE);
|
||||
//round_date(dc,28,TRUE);
|
||||
TDate dd(trans.get(DOC_DATADOC));
|
||||
if (dc < dd )
|
||||
trans.set(DOC_DATADOC, dc);
|
||||
trans.set(DOC_DATACONS, dc);
|
||||
}
|
||||
int set_body_F_ordprod(TImport_file &import, TConfig &trans)
|
||||
int set_body_F_ordprod(TImport_file &import, TConfig &trans, const bool dotrans)
|
||||
{
|
||||
TToken_string tmp,tmp2;
|
||||
trans.set(RDOC_TIPORIGA,"01");
|
||||
@ -1116,7 +1139,7 @@ int set_body_F_ordprod(TImport_file &import, TConfig &trans)
|
||||
codimp2codmagdep(tmp, atoi(import.get("FPBOMM")), tmp2);
|
||||
trans.set(RDOC_IMPIANTO,tmp);
|
||||
trans.set(RDOC_CODMAG,tmp2);
|
||||
trans.set(RDOC_QTA,import.get_real("FQTY"));
|
||||
trans.set(RDOC_QTA,import.get("FQTY"));
|
||||
trans.set(RDOC_QTAEVASA,"0");
|
||||
return 1;
|
||||
}
|
||||
@ -1142,20 +1165,21 @@ void set_head_R_ordprod(TImport_file & import, TConfig &trans)
|
||||
trans.set(DOC_ANNO,import.get_date("SRDTE").year());
|
||||
trans.set("CODNUM",(import.get("SOFAC")=="SE") ? "MSP": "TSMP");
|
||||
trans.set("TIPODOC","ORP");
|
||||
TDate today(TODAY),dc(import.get_date("SDDTE"));
|
||||
TDate rdt(import.get_date("SRSDT"));
|
||||
TDate today(TODAY),
|
||||
dc(import.get_date("SDDTE")); // due date : data di consegna
|
||||
TDate rdt(import.get_date("SRSDT")); // reschedule date
|
||||
if (rdt.ok() && rdt != 99999999L && rdt > dc)
|
||||
dc = rdt;
|
||||
if (dc < today)
|
||||
if (1 || yesno_box("Data ordine di produzione %ld per l'articolo %s inferiore a quella attuale: posticipo ?",import.get_long("SORD"),(const char *) import.get("SPROD")))
|
||||
if (0 || yesno_box("Data ordine di produzione %ld per l'articolo %s inferiore a quella attuale: posticipo a oggi?",import.get_long("SORD"),(const char *) import.get("SPROD")))
|
||||
dc = today;
|
||||
round_date(dc,28,TRUE);
|
||||
TDate dd(trans.get(DOC_DATADOC));
|
||||
//round_date(dc,28,TRUE);
|
||||
TDate dd(trans.get(DOC_DATADOC)); // data documento
|
||||
if (dc < dd )
|
||||
trans.set(DOC_DATADOC, dc);
|
||||
trans.set(DOC_DATACONS, dc);
|
||||
}
|
||||
int set_body_R_ordprod(TImport_file &import, TConfig &trans)
|
||||
int set_body_R_ordprod(TImport_file &import, TConfig &trans, const bool dotrans)
|
||||
{
|
||||
TToken_string tmp,tmp2;
|
||||
trans.set(RDOC_TIPORIGA,"01");
|
||||
@ -1186,8 +1210,8 @@ int set_body_R_ordprod(TImport_file &import, TConfig &trans)
|
||||
}
|
||||
real totale = import.get_real("SQREQ");
|
||||
real evasa = import.get_real("SQFIN");
|
||||
trans.set(RDOC_QTA,totale);
|
||||
trans.set(RDOC_QTAEVASA,evasa);
|
||||
trans.set(RDOC_QTA,totale.string());
|
||||
trans.set(RDOC_QTAEVASA,evasa.string());
|
||||
add_stdlabors(import.get_codice("SPROD"), import.get_long("SWRKC"), int(import.get_long("SOBOMM")));
|
||||
return 1;
|
||||
}
|
||||
@ -1232,12 +1256,12 @@ void set_head_ordacq(TImport_file & import, TConfig &trans)
|
||||
{
|
||||
real cambio=import.get_real("PEXRT");
|
||||
cambio_fisso(codval,cambio);
|
||||
trans.set(DOC_CAMBIO,cambio);
|
||||
trans.set(DOC_CAMBIO,cambio.string());
|
||||
trans.set(DOC_CODVAL,codval);
|
||||
}
|
||||
}
|
||||
|
||||
int set_body_ordacq(TImport_file &import, TConfig &trans)
|
||||
int set_body_ordacq(TImport_file &import, TConfig &trans, const bool dotrans)
|
||||
{
|
||||
TToken_string tmp,tmp2;
|
||||
trans.set(RDOC_TIPORIGA,"01");
|
||||
@ -1256,7 +1280,7 @@ int set_body_ordacq(TImport_file &import, TConfig &trans)
|
||||
trans.set(RDOC_QTAEVASA,import.get("PQREC"));
|
||||
// gestione codice IVA
|
||||
tmp = "F";
|
||||
tmp.add(import.get("TVEND"));
|
||||
tmp.add(import.get("PVEND"));
|
||||
TString8 codiva(cache().get(LF_CFVEN,tmp).get("ASSFIS"));
|
||||
if (codiva.blank())
|
||||
codiva = cache().get(LF_ANAMAG,tmp).get(ANAMAG_CODIVA);
|
||||
@ -1410,23 +1434,38 @@ void set_head_bolacq(TImport_file & import, TConfig &trans)
|
||||
trans.set(DOC_CAUSMAG,causmag);
|
||||
trans.set(DOC_NOTE,descrmov);
|
||||
trans.set(DOC_NDOC,numdoc);
|
||||
|
||||
codcli = trascode_for(codcli);
|
||||
|
||||
trans.set(DOC_CODCF,codcli == 0L ? "" : format("%ld",codcli));
|
||||
trans.set(DOC_ANNO,import.get_date("TTDTE").year());
|
||||
// riferimenti
|
||||
trans.set(DOC_DOC1,external_refnum(import));
|
||||
trans.set(DOC_NUMDOCRIF,import.get("TREF"));
|
||||
trans.set(DOC_DATADOCRIF,import.get_date("TSDTE"));
|
||||
trans.set(DOC_DOC1,import.get("TREF"));
|
||||
trans.set(DOC_NUMDOCRIF,external_refnum(import));
|
||||
trans.set(DOC_DATADOCRIF,external_refdate(import));
|
||||
TString codval = converti_codval(import.get("THCURR"));
|
||||
if (!codval.empty())
|
||||
{
|
||||
real cambio=import.get_real("THTEXR");
|
||||
cambio_fisso(codval,cambio);
|
||||
trans.set(DOC_CAMBIO,cambio);
|
||||
trans.set(DOC_CAMBIO,cambio.string());
|
||||
trans.set(DOC_CODVAL,codval);
|
||||
}
|
||||
}
|
||||
|
||||
int set_body_bolacq(TImport_file &import, TConfig &trans)
|
||||
bool set_group_movmag(TImport_file & import)
|
||||
{
|
||||
static TString _prev;
|
||||
TString newstr = external_refnum(import);
|
||||
if (_prev != newstr)
|
||||
{
|
||||
_prev = newstr;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int set_body_bolacq(TImport_file &import, TConfig &trans, const bool dotrans)
|
||||
{
|
||||
int extrarow=0;
|
||||
static long _last_ord = -1;
|
||||
@ -1519,6 +1558,7 @@ int set_body_bolacq(TImport_file &import, TConfig &trans)
|
||||
}
|
||||
trans.set(RDOC_CAUSMAG,causmag);
|
||||
trans.set(RDOC_QTA, qta.string());
|
||||
trans.set(RDOC_QTAEVASA, "0");
|
||||
real price = import.get_real("TPRIC");
|
||||
if (price.is_zero())
|
||||
{
|
||||
@ -1534,7 +1574,7 @@ int set_body_bolacq(TImport_file &import, TConfig &trans)
|
||||
}
|
||||
trans.set(RDOC_PREZZO, price.string());
|
||||
|
||||
if (_ithcheck)
|
||||
if (_ithcheck && dotrans)
|
||||
{
|
||||
_ithcheck->put("TPROD",import.get("TPROD"));
|
||||
_ithcheck->put("TSEQ",import.get("TSEQ"));
|
||||
@ -1576,7 +1616,8 @@ void set_head_movmag(TImport_file & import, TConfig &trans)
|
||||
else
|
||||
magno = 28;
|
||||
}
|
||||
if (import.get("TLOCT")=="CICCA")
|
||||
if ((import.get("TLOCT")=="CICCA")
|
||||
|| (import.get("TLOCT")=="CMINT"))
|
||||
{
|
||||
import.put("TTYPE", "_L");//conto lavoro
|
||||
cod0 = '_'; // codice fittizio per simulare IL CONTO LAVORO
|
||||
@ -1682,22 +1723,24 @@ void set_head_movmag(TImport_file & import, TConfig &trans)
|
||||
trans.set(DOC_CAUSMAG,causmag);
|
||||
trans.set(DOC_NOTE,descrmov);
|
||||
trans.set(DOC_NDOC,0L);
|
||||
if (trans.get(DOC_TIPOCF) == "F")
|
||||
codcli = trascode_for(codcli);
|
||||
trans.set(DOC_CODCF,codcli == 0L ? "" : format("%ld",codcli));
|
||||
trans.set(DOC_ANNO,import.get_date("TTDTE").year());
|
||||
// riferimenti
|
||||
trans.set(DOC_DOC1,external_refnum(import));
|
||||
trans.set(DOC_NUMDOCRIF,import.get("TREF"));
|
||||
trans.set(DOC_DATADOCRIF,import.get_date("TSDTE"));
|
||||
trans.set(DOC_DOC1,import.get("TREF"));
|
||||
// trans.set(DOC_NUMDOCRIF,external_refnum(import));
|
||||
// trans.set(DOC_DATADOCRIF,external_refdate(import));
|
||||
TString codval = converti_codval(import.get("THCURR"));
|
||||
if (!codval.empty())
|
||||
{
|
||||
real cambio=import.get_real("THTEXR");
|
||||
cambio_fisso(codval,cambio);
|
||||
trans.set(DOC_CAMBIO,cambio);
|
||||
trans.set(DOC_CAMBIO,cambio.string());
|
||||
trans.set(DOC_CODVAL,codval);
|
||||
}
|
||||
}
|
||||
int set_body_movmag(TImport_file &import, TConfig &trans)
|
||||
int set_body_movmag(TImport_file &import, TConfig &trans, const bool dotrans)
|
||||
{
|
||||
int extrarow=0;
|
||||
static long _last_ord = -1;
|
||||
@ -1725,9 +1768,9 @@ int set_body_movmag(TImport_file &import, TConfig &trans)
|
||||
int terzista = location2method(import.get_long("TLOCT"));
|
||||
if (terzista == 7)
|
||||
{
|
||||
if (import.get("TCOM").find("PD")>=0)
|
||||
if (codimp == "PD" || (import.get("TCOM").find("PD")>=0))
|
||||
codmag = "PD1PF";
|
||||
else if (import.get("TCOM").find("PR")>=0)
|
||||
else if (codimp == "PR" || (import.get("TCOM").find("PR")>=0))
|
||||
codmag = "PR1PF";
|
||||
}
|
||||
|
||||
@ -1800,7 +1843,7 @@ int set_body_movmag(TImport_file &import, TConfig &trans)
|
||||
if (codiva.blank())
|
||||
codiva = "20";
|
||||
trans.set(RDOC_CODIVA, codiva);
|
||||
if (_ithcheck)
|
||||
if (_ithcheck && dotrans)
|
||||
{
|
||||
_ithcheck->put("TPROD",import.get("TPROD"));
|
||||
_ithcheck->put("TSEQ",import.get("TSEQ"));
|
||||
@ -1816,12 +1859,22 @@ bool filter_bolacq(TImport_file & import)
|
||||
TFilename chkname(import.name());
|
||||
chkname = chkname.path();
|
||||
chkname.add("ithchk");
|
||||
if (chkname.exist())
|
||||
chkname.ext("dbf");
|
||||
if (!chkname.exist())
|
||||
_check = FALSE;
|
||||
else
|
||||
{
|
||||
_ithcheck = new TExternisamfile(chkname, TRUE, TRUE);
|
||||
_ithcheck->setkey(1);
|
||||
_ithcheck->first();
|
||||
/*TString tprod;
|
||||
int tseq ;
|
||||
while (_ithcheck->eof())
|
||||
{
|
||||
tprod = _ithcheck->get("TPROD");
|
||||
tseq = _ithcheck->get_int("TSEQ");
|
||||
|
||||
}*/
|
||||
}
|
||||
}
|
||||
if (_ithcheck)
|
||||
@ -1944,11 +1997,11 @@ bool TImporta_BPCS ::importa_ordacq(TMask & m)
|
||||
{
|
||||
long firm =get_firm();
|
||||
clear_docs(firm,"SEOF");
|
||||
clear_docs(firm,"TSOF");
|
||||
// clear_docs(firm,"TSOF");
|
||||
TImport_file ordacq(m.get(F_PATH),BPCS_ORDACQ);
|
||||
return creadocs("Importazione ordini di acquisto..",firm,ordacq,
|
||||
"PORD","PVEND",NULL,NULL,NULL,NULL,
|
||||
set_head_ordacq,set_body_ordacq,filter_ordacq, tipocf_for);
|
||||
set_head_ordacq,set_body_ordacq,filter_ordacq, NULL, tipocf_for);
|
||||
}
|
||||
|
||||
bool TImporta_BPCS ::importa_ordcli(TMask & m)
|
||||
@ -1959,12 +2012,12 @@ bool TImporta_BPCS ::importa_ordcli(TMask & m)
|
||||
TImport_file released_orders(m.get(F_PATH),BPCS_SHOPORDS);
|
||||
bool ok = creadocs("Importazione ordini cliente (1)..",firm,released_orders,
|
||||
NULL,"SCUST","SRDTE","SOFAC",NULL,NULL,
|
||||
set_head_R_ordcli,set_body_R_ordcli,filter_R_ordcli, tipocf_cli);
|
||||
set_head_R_ordcli,set_body_R_ordcli,filter_R_ordcli, NULL, tipocf_cli);
|
||||
|
||||
TImport_file firm_orders(m.get(F_PATH),BPCS_FIRMORD);
|
||||
ok = ok && creadocs("Importazione ordini cliente (2)..",firm,firm_orders,
|
||||
NULL,"FPPVND","FRDTE","FPFAC",NULL,NULL,
|
||||
set_head_F_ordcli,set_body_F_ordcli,filter_F_ordcli, tipocf_cli);
|
||||
set_head_F_ordcli,set_body_F_ordcli,filter_F_ordcli, NULL, tipocf_cli);
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -1972,17 +2025,25 @@ bool TImporta_BPCS ::importa_ordprod(TMask & m)
|
||||
{
|
||||
long firm =get_firm();
|
||||
if (yesno_box("Cancello gli ordini MSP?"))
|
||||
clear_docs(firm,"MSP");
|
||||
clear_docs(firm,"SEFA");
|
||||
if (noyes_box("Cancello solo gli MSP non confermati (n. >= 900000)?"))
|
||||
clear_docs(firm,"MSP", NULL, NULL, 900000L);
|
||||
else
|
||||
clear_docs(firm,"MSP");
|
||||
if (yesno_box("Cancello gli ordini SEFA?"))
|
||||
clear_docs(firm,"SEFA");
|
||||
|
||||
bool ok = TRUE;
|
||||
TImport_file released_orders(m.get(F_PATH),BPCS_SHOPORDS);
|
||||
bool ok = creadocs("Importazione ordini di produzione Segrate (Released)..",firm,released_orders,
|
||||
ok = ok && creadocs("Importazione ordini di produzione Segrate (Released)..",firm,released_orders,
|
||||
"SORD",NULL,"SRDTE","SOFAC",NULL,NULL,
|
||||
set_head_R_ordprod,set_body_R_ordprod,filterRordprodSE, tipocf_null);
|
||||
set_head_R_ordprod,set_body_R_ordprod,filterRordprodSE, NULL, tipocf_null);
|
||||
|
||||
TImport_file firm_orders(m.get(F_PATH),BPCS_FIRMORD);
|
||||
ok = ok && creadocs("Importazione ordini di produzione Segrate (Firm Planned)..",firm,firm_orders,
|
||||
NULL,NULL,"FRDTE","FPFAC",NULL,NULL,
|
||||
set_head_F_ordprod,set_body_F_ordprod,filterFordprodSE, tipocf_null);
|
||||
"**900000",NULL,"FRDTE","FPFAC",NULL,NULL,
|
||||
set_head_F_ordprod,set_body_F_ordprod,filterFordprodSE, NULL, tipocf_null);
|
||||
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -2017,7 +2078,7 @@ bool TImporta_BPCS::importa_bolacq(TImport_file &movmag, bool segrate, bool trie
|
||||
}
|
||||
ok &= creadocs("Importazione bolle di acquisto di Segrate..",firm, movmag,
|
||||
NULL,"TVEND","TTDTE", "THRNO","TTYPE","TREF",
|
||||
set_head_bolacq,set_body_bolacq,filter_bolacqSE, tipocf_for, !testonly);
|
||||
set_head_bolacq,set_body_bolacq,filter_bolacqSE, set_group_movmag, tipocf_for, !testonly);
|
||||
if (!testonly)
|
||||
{
|
||||
confirm_docs("SEBA",&fromdate,&todate);
|
||||
@ -2033,7 +2094,7 @@ bool TImporta_BPCS::importa_bolacq(TImport_file &movmag, bool segrate, bool trie
|
||||
}
|
||||
ok &= creadocs("Importazione bolle di acquisto di Trieste..",firm, movmag,
|
||||
NULL,"TVEND","TTDTE", "THRNO","TTYPE","TREF",
|
||||
set_head_bolacq,set_body_bolacq,filter_bolacqTS, tipocf_for, !testonly);
|
||||
set_head_bolacq,set_body_bolacq,filter_bolacqTS, set_group_movmag, tipocf_for, !testonly);
|
||||
if (!testonly)
|
||||
{
|
||||
confirm_docs("TSBA",&fromdate,&todate);
|
||||
@ -2078,8 +2139,8 @@ bool TImporta_BPCS::importa_movmag(TImport_file &movmag, bool segrate, bool trie
|
||||
clear_docs(firm, "SEMM",&fromdate,&todate);
|
||||
}
|
||||
ok &= creadocs("Importazione movimenti magazzino di Segrate..",firm, movmag,
|
||||
NULL,"TVEND","TTDTE","TTYPE","TREF",NULL,
|
||||
set_head_movmag,set_body_movmag,filter_movmagSE, tipocf_movmag, !testonly);
|
||||
NULL,"TVEND","TTDTE","TTYPE",NULL,NULL,
|
||||
set_head_movmag,set_body_movmag,filter_movmagSE, set_group_movmag, tipocf_movmag, !testonly);
|
||||
if (!testonly)
|
||||
{
|
||||
confirm_docs("SEBE",&fromdate,&todate);
|
||||
@ -2103,7 +2164,7 @@ bool TImporta_BPCS::importa_movmag(TImport_file &movmag, bool segrate, bool trie
|
||||
}
|
||||
ok &= creadocs("Importazione movimenti magazzino di Trieste..",firm, movmag,
|
||||
NULL,"TVEND","TTDTE","TTYPE","TREF",NULL,
|
||||
set_head_movmag,set_body_movmag,filter_movmagTS, tipocf_movmag, !testonly);
|
||||
set_head_movmag,set_body_movmag,filter_movmagTS, set_group_movmag, tipocf_movmag, !testonly);
|
||||
if (!testonly)
|
||||
{
|
||||
confirm_docs("TSBE",&fromdate,&todate);
|
||||
@ -2200,8 +2261,8 @@ void TImporta_automag_BPCS::main_loop()
|
||||
const TDate &fromdate=(m.get_date(F_MOVMAG_FROMD));
|
||||
const TDate &todate=(m.get_date(F_MOVMAG_TOD));
|
||||
|
||||
if (importa_bolacq(movmag, m.get_bool(F_MOVMAG_SE),m.get_bool(F_MOVMAG_TS), fromdate, todate, m.get_bool(F_TESTONLY),m.get_bool(F_NOCLEAR)))
|
||||
importa_movmag(movmag, m.get_bool(F_MOVMAG_SE),m.get_bool(F_MOVMAG_TS), fromdate, todate, m.get_bool(F_TESTONLY),m.get_bool(F_NOCLEAR));
|
||||
if (importa_movmag(movmag, m.get_bool(F_MOVMAG_SE),m.get_bool(F_MOVMAG_TS), fromdate, todate, m.get_bool(F_TESTONLY),m.get_bool(F_NOCLEAR)))
|
||||
importa_bolacq(movmag, m.get_bool(F_MOVMAG_SE),m.get_bool(F_MOVMAG_TS), fromdate, todate, m.get_bool(F_TESTONLY),m.get_bool(F_NOCLEAR));
|
||||
|
||||
message_box("Fine importazione");
|
||||
}
|
||||
|
||||
@ -44,4 +44,5 @@
|
||||
#define G_SERVICE_10 110
|
||||
#define G_SERVICE_11 114
|
||||
#define G_SERVICE_12 115
|
||||
#define G_SERVICE_13 116
|
||||
|
||||
|
||||
342
db/dbcv02.cpp
342
db/dbcv02.cpp
@ -336,29 +336,37 @@ bool find_wrongcycle()
|
||||
}
|
||||
class TMov_diff_inv : public TConfig
|
||||
{
|
||||
int _nriga;
|
||||
int _nriga;
|
||||
TDate _al;
|
||||
bool _use_giac_al;
|
||||
TArticolo_giacenza_data _art;
|
||||
public:
|
||||
void set_header(const char *imp_filter);
|
||||
int righe () {return _nriga;}
|
||||
bool max_righe () {return _nriga > 99 ;}
|
||||
void locate_bpcs_stock(const TString &codice , int mag , const TString &location, TImport_file &mag_bpcs, real &giac) ;
|
||||
int compare_stocks(TLocalisamfile &mag, const real & bpcs_stock, bool giac);
|
||||
TMov_diff_inv (int num);
|
||||
TMov_diff_inv (int num, const char * al, bool giac_al);
|
||||
~TMov_diff_inv() {}
|
||||
|
||||
} ;
|
||||
|
||||
TMov_diff_inv::TMov_diff_inv (int num) :
|
||||
TConfig (format("ND_%05d.ini",num)) , _nriga(0)
|
||||
TMov_diff_inv::TMov_diff_inv (int num, const char * al, bool giac_al) :
|
||||
TConfig (format("ND_%05d.ini",num)) , _nriga(0), _al(al),
|
||||
_use_giac_al(giac_al), _art()
|
||||
{}
|
||||
|
||||
void TMov_diff_inv::locate_bpcs_stock(const TString &codice , int mag , const TString &location, TImport_file &mag_bpcs, real & giac)
|
||||
{
|
||||
int direction = 0;
|
||||
long diff = 0;
|
||||
|
||||
/*
|
||||
int direction = 0;
|
||||
do {
|
||||
diff = codice.compare(mag_bpcs.get("CODICE"));
|
||||
if (diff == 0)
|
||||
diff = mag - mag_bpcs.get_int("MAG");
|
||||
if (diff == 0)
|
||||
diff = mag - mag_bpcs.get_int("MAG");
|
||||
if (diff == 0)
|
||||
diff = location.compare(mag_bpcs.get("LOC"));
|
||||
if (diff > 0 && direction != -1)
|
||||
{
|
||||
@ -373,15 +381,24 @@ void TMov_diff_inv::locate_bpcs_stock(const TString &codice , int mag , const TS
|
||||
direction = 0;
|
||||
}
|
||||
} while (diff*direction>0 && direction != 0 );
|
||||
*/
|
||||
mag_bpcs.zero();
|
||||
mag_bpcs.put("MAG", format("%d",mag));
|
||||
mag_bpcs.put("LOC", location);
|
||||
mag_bpcs.put("CODICE", codice);
|
||||
diff = mag_bpcs.read(_isequal);
|
||||
|
||||
if (diff != 0)
|
||||
giac = ZERO;
|
||||
else
|
||||
giac = mag_bpcs.get_real("QTY");
|
||||
}
|
||||
|
||||
int TMov_diff_inv::compare_stocks(TLocalisamfile &mag, const real & val_bpcs, bool giac)
|
||||
{
|
||||
if (!giac)
|
||||
return _nriga;
|
||||
/*
|
||||
TRectype newmag = mag.curr();
|
||||
if (mag.read() != NOERR)
|
||||
mag.curr() = newmag;
|
||||
@ -390,6 +407,33 @@ int TMov_diff_inv::compare_stocks(TLocalisamfile &mag, const real & val_bpcs, bo
|
||||
val = (mag.get_real("VEN"));
|
||||
real diff = (val_bpcs - val);
|
||||
diff.round(3);
|
||||
*/
|
||||
real val;
|
||||
if (_use_giac_al)
|
||||
{
|
||||
_art.read(mag.get("CODART"));
|
||||
TString16 codmag(mag.get("CODMAG"));
|
||||
TString16 annoes(mag.get("ANNOES"));
|
||||
_art.al(_al, codmag);
|
||||
const int i = _art.find_mag(annoes, codmag);
|
||||
TRectype & mag1 = _art.mag(annoes)[i];
|
||||
val = mag1.get_real("GIAC");
|
||||
if (!giac)
|
||||
val = (mag1.get_real("VEN"));
|
||||
}
|
||||
else
|
||||
{
|
||||
TRectype newmag = mag.curr();
|
||||
if (mag.read() != NOERR)
|
||||
mag.curr() = newmag;
|
||||
val = mag.get_real("GIAC");
|
||||
if (!giac)
|
||||
val = (mag.get_real("VEN"));
|
||||
}
|
||||
real diff = (val_bpcs - val);
|
||||
diff.round(3);
|
||||
|
||||
|
||||
const real piotta = "900000.0";
|
||||
while (diff >= 0.001 || diff <= -0.001)
|
||||
{
|
||||
@ -416,7 +460,7 @@ int TMov_diff_inv::compare_stocks(TLocalisamfile &mag, const real & val_bpcs, bo
|
||||
|
||||
void TMov_diff_inv::set_header(const char * imp_filter)
|
||||
{
|
||||
TDate today(TODAY);
|
||||
// TDate today(TODAY);
|
||||
set_paragraph("Transaction");
|
||||
set("Action","INSERT");
|
||||
set("Mode","AUTO");
|
||||
@ -426,14 +470,20 @@ void TMov_diff_inv::set_header(const char * imp_filter)
|
||||
set("CODNUM",codimp);
|
||||
set("CAUSMAG","");
|
||||
set("NOTE","\"Differenze inventariali rilevate per confronto con gli archivi di BPCS\"");
|
||||
set("DATADOC",today.string());
|
||||
//set("DATADOC",today.string());
|
||||
set("DATADOC",_al.string());
|
||||
}
|
||||
|
||||
void sinchro_stock(const TMask & m, const char * imp_filter)
|
||||
{
|
||||
if (!yesno_box(format("Confermi l'allineamento giacenze per %s dal file %s?", imp_filter, BPCS_STOCK)))
|
||||
return ;
|
||||
TDate today(TODAY);
|
||||
const bool launch_ve0 = yesno_box("Devo registrare immediatamente i documenti?");
|
||||
TDate day(TODAY);
|
||||
TString16 data(m.get(S_GIAC_AL));
|
||||
if (data.not_empty())
|
||||
day = data;
|
||||
const bool use_al = m.get_bool(S_USE_AL);
|
||||
TIndwin info(60,format("Allineamento giacenze per %s...",imp_filter),FALSE,FALSE);
|
||||
TImport_file mag_bpcs(m.get(F_PATH),BPCS_STOCK);
|
||||
TLocalisamfile mag(LF_MAG);
|
||||
@ -445,7 +495,7 @@ void sinchro_stock(const TMask & m, const char * imp_filter)
|
||||
|
||||
delete_files("ND_*.ini");
|
||||
TMov_diff_inv *action;
|
||||
action = new TMov_diff_inv(movimenti++);
|
||||
action = new TMov_diff_inv(movimenti++,day, use_al);
|
||||
action->set_header(imp_filter);
|
||||
|
||||
// Crea i mag di eurocampo eventualemnte mancanti
|
||||
@ -457,10 +507,11 @@ void sinchro_stock(const TMask & m, const char * imp_filter)
|
||||
nummag = mag_bpcs.get_int("MAG");
|
||||
num_mag2main_imp(nummag, codimp);
|
||||
if (codimp == imp_filter)
|
||||
{
|
||||
imploc2codmagdep(codimp, mag_bpcs.get("LOC"), codmag);
|
||||
{
|
||||
TString16 loc = mag_bpcs.get("LOC");
|
||||
imploc2codmagdep(codimp, loc, codmag);
|
||||
//num_mag2cod_imp(nummag, codmag);
|
||||
mag.put("ANNOES", today.year());
|
||||
mag.put("ANNOES", day.year());
|
||||
mag.put("CODART", codart);
|
||||
mag.put("CODMAG", codmag);
|
||||
if (mag.read()!=NOERR)
|
||||
@ -491,14 +542,14 @@ void sinchro_stock(const TMask & m, const char * imp_filter)
|
||||
if (!skip)
|
||||
{
|
||||
int nriga = 0;
|
||||
mag.put("ANNOES", today.year());
|
||||
mag.put("ANNOES", day.year());
|
||||
mag.put("CODART", codart);
|
||||
mag.put("NRIGA", ++nriga);
|
||||
mag.setkey(1);
|
||||
while (mag.read()==NOERR)
|
||||
mag.put("NRIGA", ++nriga);
|
||||
mag.zero(' ');
|
||||
mag.put("ANNOES", today.year());
|
||||
mag.put("ANNOES", day.year());
|
||||
mag.put("CODART", codart);
|
||||
mag.put("NRIGA", nriga);
|
||||
mag.put("CODMAG", codmag);
|
||||
@ -516,7 +567,7 @@ void sinchro_stock(const TMask & m, const char * imp_filter)
|
||||
mag_bpcs.first();
|
||||
mag.setkey(1);
|
||||
mag.zero();
|
||||
mag.put("ANNOES", today.year());
|
||||
mag.put("ANNOES", day.year());
|
||||
ok = mag.read(_isgteq)==NOERR;
|
||||
// magazzino Eurocampo vs mag BPCS
|
||||
while (ok)
|
||||
@ -555,13 +606,13 @@ void sinchro_stock(const TMask & m, const char * imp_filter)
|
||||
{
|
||||
if (err != NOERR)
|
||||
break;
|
||||
if ((/*codimp == "PR" || codimp == "PD" ||*/ codimp == imp_filter )&& nummag>0)
|
||||
if ((((codimp == "SE1" || codimp == "TS1") && coddep == "07") || codimp == imp_filter ) && nummag>0)
|
||||
{
|
||||
coddep2location(coddep, codlocation);
|
||||
/*if (codmag == "SE1" && coddep == "07")
|
||||
coddep2location(codmag, coddep, codlocation, nummag);
|
||||
if (codmag == "SE1" && coddep == "07")
|
||||
nummag = 91;
|
||||
if (codmag == "TS1" && coddep == "07")
|
||||
nummag = 92;*/
|
||||
nummag = 92;
|
||||
action->locate_bpcs_stock(codart, nummag, codlocation, mag_bpcs, bpcsstock);
|
||||
action->compare_stocks(mag, bpcsstock, TRUE);
|
||||
/*if (FALSE && nummag < 30) // elimina
|
||||
@ -570,7 +621,7 @@ void sinchro_stock(const TMask & m, const char * imp_filter)
|
||||
action->compare_stocks(mag, bpcsstock, FALSE);
|
||||
}*/
|
||||
}
|
||||
if (codmag == "SE3" || codmag == "TS3" || coddep == "07")
|
||||
if (codmag == "SE3" || codmag == "TS3" /*|| coddep == "07"*/)
|
||||
{
|
||||
// elimina vecchimagazzini SE3/TS3 e la vecchia codifica del magazzino di padova/parma
|
||||
bpcsstock = ZERO;
|
||||
@ -578,10 +629,14 @@ void sinchro_stock(const TMask & m, const char * imp_filter)
|
||||
}
|
||||
if (action->max_righe())
|
||||
{
|
||||
TExternal_app gestdoc(format("ve0.exe -1 -i%s",(const char *)action->name()));
|
||||
TString80 filename(action->name());
|
||||
delete action;
|
||||
gestdoc.run();
|
||||
action = new TMov_diff_inv(movimenti++);
|
||||
if (launch_ve0)
|
||||
{
|
||||
TExternal_app gestdoc(format("ve0.exe -1 -i%s",(const char *)filename));
|
||||
gestdoc.run();
|
||||
}
|
||||
action = new TMov_diff_inv(movimenti++, day, use_al);
|
||||
action->set_header(imp_filter);
|
||||
}
|
||||
}
|
||||
@ -593,9 +648,13 @@ void sinchro_stock(const TMask & m, const char * imp_filter)
|
||||
|
||||
if (action->righe())
|
||||
{
|
||||
TExternal_app gestdoc(format("ve0.exe -1 -i%s",(const char *)action->name()));
|
||||
TString80 filename(action->name());
|
||||
delete action;
|
||||
gestdoc.run();
|
||||
if (launch_ve0)
|
||||
{
|
||||
TExternal_app gestdoc(format("ve0.exe -1 -i%s",(const char *)filename));
|
||||
gestdoc.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -895,7 +954,7 @@ void unify_mags(const TMask & m)
|
||||
int err;
|
||||
TLocalisamfile mag(LF_MAG),
|
||||
rmovmag(LF_RMOVMAG), movmag(LF_MOVMAG);
|
||||
TProgind info(80,"",FALSE,TRUE);
|
||||
TProgind info(80,"",TRUE,TRUE);
|
||||
|
||||
unify_mags_reset_bar(info, "tabella causali mag", caumag.items());
|
||||
err = caumag.first();
|
||||
@ -904,6 +963,8 @@ void unify_mags(const TMask & m)
|
||||
unify_magcode("S10", caumag);
|
||||
err = caumag.next();
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
return;
|
||||
}
|
||||
message_box("Modificare a mano la tabella magazzini");
|
||||
unify_mags_reset_bar(info, "tabella impianti", impianti.items());
|
||||
@ -915,6 +976,8 @@ void unify_mags(const TMask & m)
|
||||
unify_magcode("S8", impianti);
|
||||
err = impianti.next();
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
return;
|
||||
}
|
||||
unify_mags_reset_bar(info, "tabella linee di produzione", linee.items());
|
||||
linee.setkey(2);
|
||||
@ -925,14 +988,18 @@ void unify_mags(const TMask & m)
|
||||
unify_magcode("S8", linee);
|
||||
err = linee.next();
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
return;
|
||||
}
|
||||
unify_mags_reset_bar(info, "giacenze", mag.items());
|
||||
err = mag.first();
|
||||
while (err==NOERR)
|
||||
{
|
||||
//unify_magcode("CODMAG", mag);
|
||||
unify_magcode("CODMAG", mag);
|
||||
err = mag.next();
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
return;
|
||||
}
|
||||
|
||||
unify_mags_reset_bar(info, "movimenti di magazzino", rmovmag.items());
|
||||
@ -943,6 +1010,8 @@ void unify_mags(const TMask & m)
|
||||
unify_magcode("CODMAG", rmovmag);
|
||||
err = rmovmag.next();
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
return;
|
||||
}
|
||||
TLocalisamfile doc(LF_DOC),rdoc(LF_RIGHEDOC);
|
||||
unify_mags_reset_bar(info, "righe documenti", rdoc.items());
|
||||
@ -976,6 +1045,8 @@ void unify_mags(const TMask & m)
|
||||
}
|
||||
err = rdoc.next();
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1200,30 +1271,64 @@ void find_wrong_um(const TMask & m)
|
||||
}
|
||||
}
|
||||
if (codeum.blank())
|
||||
error_box("Unità di misura nulla per %s", (const char *)coddist);
|
||||
if (yesno_box("Unità di misura nulla per %s. Aggiungo", (const char *)coddist))
|
||||
{
|
||||
umart.put("CODART",coddist);
|
||||
umart.put("NRIGA","2");
|
||||
umart.put("UM",dist.get("UM"));
|
||||
umart.put("FC",1);
|
||||
err = umart.write();
|
||||
if (err != NOERR)
|
||||
warning_box("Errore in scrittura UM");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (coddist.find("__")>=0)
|
||||
{
|
||||
// variante di prod, probabilmente da esprimere in batch di prod
|
||||
if (codeum != "BP")
|
||||
bool chk_ricetta = FALSE;
|
||||
bool chk_distinta = FALSE;
|
||||
real bp=ZERO;
|
||||
if (codeum != "BP") // oh, guarda, la UM non è uguale a batch, caso sospetto!
|
||||
{
|
||||
// oh, guarda, la UM non è uguale a batch, caso sospetto!
|
||||
real bp;
|
||||
umart.setkey(2);
|
||||
umart.put("CODART",coddist);
|
||||
umart.put("UM","BP");
|
||||
if ((err = umart.read())==NOERR)
|
||||
bp = umart.get_real("FC");
|
||||
umart.setkey(1);
|
||||
|
||||
if (bp.is_zero() || bp == 1.0)
|
||||
chk_distinta = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
umart.setkey(2);
|
||||
umart.put("CODART",coddist);
|
||||
umart.put("UM","BP");
|
||||
if ((err = umart.read())==NOERR)
|
||||
bp = umart.get_real("FC");
|
||||
umart.setkey(1);
|
||||
umart.put("CODART",coddist);
|
||||
umart.put("NRIGA","1");
|
||||
err = umart.read();
|
||||
if (err==NOERR)
|
||||
if (umart.get("UM")=="KG")
|
||||
chk_ricetta = TRUE;
|
||||
else
|
||||
if (bp == 1.0)
|
||||
chk_distinta = TRUE;
|
||||
}
|
||||
if (chk_distinta)
|
||||
{
|
||||
real total= ZERO;
|
||||
rdist.zero();
|
||||
rdist.put("CODDIST", coddist);
|
||||
if (bp.is_zero() && rdist.read())
|
||||
if (rdist.read())
|
||||
{
|
||||
int newbp=0;
|
||||
while (bp != 1.0 && coddist == rdist.get("CODDIST"))
|
||||
while (bp <= 1.0 && coddist == rdist.get("CODDIST") //
|
||||
&& (rdist.get("TIPO")!="V"))
|
||||
{
|
||||
code = rdist.get("CODCOMP");
|
||||
real expr = rdist.get_real("EXPR");
|
||||
@ -1292,7 +1397,7 @@ void find_wrong_um(const TMask & m)
|
||||
umart.put("FC",bp);
|
||||
if ((err = umart.write())!=NOERR)
|
||||
{
|
||||
//
|
||||
umart.rewrite();
|
||||
}
|
||||
dist.put("UM","BP");
|
||||
err = dist.rewrite();
|
||||
@ -1301,6 +1406,41 @@ void find_wrong_um(const TMask & m)
|
||||
warning_box("UM di distinta per %s %s", (const char *)coddist, (const char *)codeum);
|
||||
}
|
||||
}
|
||||
if (chk_ricetta)
|
||||
{
|
||||
real totale_ricetta = ZERO;
|
||||
rdist.zero();
|
||||
rdist.put("CODDIST", coddist);
|
||||
rdist.read(_isgteq+_nolock);
|
||||
while (coddist == rdist.get("CODDIST"))
|
||||
{
|
||||
code = rdist.get("CODCOMP");
|
||||
real expr = rdist.get_real("EXPR");
|
||||
if (rdist.get("UM") == "KG")
|
||||
totale_ricetta = totale_ricetta + expr;
|
||||
if (rdist.get("UM") == "GR")
|
||||
totale_ricetta = totale_ricetta + (expr/1000.0);
|
||||
rdist.next();
|
||||
}
|
||||
if (bp != totale_ricetta && (((bp-totale_ricetta) >0.001 ) ||
|
||||
((totale_ricetta-bp) >0.001 )) )
|
||||
{
|
||||
TString ts(totale_ricetta.string());
|
||||
if ((totale_ricetta == 10000.0 || totale_ricetta == 1000.0 ))
|
||||
{
|
||||
if (yesno_box("Batch di produzione per %s a %s; lo porto a %s",
|
||||
(const char *)coddist, (const char *)bp.string(), (const char *)ts))
|
||||
{
|
||||
umart.put("CODART",coddist);
|
||||
umart.put("UM","BP");
|
||||
umart.put("FC", totale_ricetta);
|
||||
umart.rewrite();
|
||||
}
|
||||
}// else
|
||||
// warning_box("Batch di produzione per %s a %s, totale componenti %s",
|
||||
// (const char *)coddist, (const char *)bp.string(), (const char *)ts);
|
||||
}
|
||||
}
|
||||
}
|
||||
info.addstatus(1);
|
||||
err = dist.prev();
|
||||
@ -1414,9 +1554,137 @@ bool TService_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void converti_magazzino(TLocalisamfile & file, const char *campo, const char *campovecchio , const char *camponuovo)
|
||||
{
|
||||
file.first();
|
||||
while (!file.eof())
|
||||
{
|
||||
if (file.get(campo) == campovecchio)
|
||||
{
|
||||
file.put(campo,camponuovo);
|
||||
file.rewrite();
|
||||
}
|
||||
file.next();
|
||||
do_events();
|
||||
}
|
||||
}
|
||||
void uniscimag(const char *campovecchio , const char *camponuovo)
|
||||
{
|
||||
TLocalisamfile file(LF_MAG), nfile(LF_MAG);;
|
||||
TString codart= "";
|
||||
real qentr, qusc, qacq, qven , qrimin, qgiac;
|
||||
real vqentr, vqusc, vqacq, vqven , vqrimin;
|
||||
int nriga = 1;
|
||||
int annoes;
|
||||
bool done=TRUE;
|
||||
|
||||
file.first();
|
||||
while (!file.eof())
|
||||
{
|
||||
if (codart == "")
|
||||
{
|
||||
codart = file.get("CODART");
|
||||
annoes= file.get_int("ANNOES");
|
||||
done = TRUE;
|
||||
}
|
||||
if (file.get("CODMAG") == campovecchio)
|
||||
{
|
||||
qentr = file.get_real("ENT");
|
||||
qusc = file.get_real("USC");
|
||||
qacq = file.get_real("ACQ");
|
||||
qven = file.get_real("VEN");
|
||||
qrimin = file.get_real("RIM");
|
||||
vqentr = file.get_real("VALENT");
|
||||
vqusc = file.get_real("VALUSC");
|
||||
vqacq = file.get_real("VALACQ");
|
||||
vqven = file.get_real("VALVEN");
|
||||
vqrimin = file.get_real("VALRIM");
|
||||
qgiac = file.get_real("GIAC");
|
||||
file.put("ENT", ZERO);
|
||||
file.put("USC", ZERO);
|
||||
file.put("ACQ",ZERO);
|
||||
file.put("VEN",ZERO);
|
||||
file.put("RIM",ZERO);
|
||||
file.put("VALENT",ZERO);
|
||||
file.put("VALUSC",ZERO);
|
||||
file.put("VALACQ",ZERO);
|
||||
file.put("VALVEN",ZERO);
|
||||
file.put("VALRIM",ZERO);
|
||||
file.put("GIAC",ZERO);
|
||||
// file.remove(); can' remove without renumbering
|
||||
//file.rewrite();
|
||||
done = FALSE;
|
||||
}
|
||||
else if (file.get("CODMAG") == camponuovo && !done)
|
||||
{
|
||||
qentr += file.get_real("ENT");
|
||||
qusc += file.get_real("USC");
|
||||
qacq += file.get_real("ACQ");
|
||||
qven += file.get_real("VEN");
|
||||
qrimin += file.get_real("RIM");
|
||||
vqentr += file.get_real("VALENT");
|
||||
vqusc += file.get_real("VALUSC");
|
||||
vqacq += file.get_real("VALACQ");
|
||||
vqven += file.get_real("VALVEN");
|
||||
vqrimin += file.get_real("VALRIM");
|
||||
qgiac += file.get_real("GIAC");
|
||||
file.put("ENT", qentr);
|
||||
file.put("USC", qusc);
|
||||
file.put("ACQ",qacq);
|
||||
file.put("VEN",qven);
|
||||
file.put("RIM",qrimin);
|
||||
file.put("VALENT",vqentr);
|
||||
file.put("VALUSC",vqusc);
|
||||
file.put("VALACQ",vqacq);
|
||||
file.put("VALVEN",vqven);
|
||||
file.put("VALRIM",vqrimin);
|
||||
file.put("GIAC",qgiac);
|
||||
file.put("CODMAG",camponuovo);
|
||||
//file.rewrite();
|
||||
done = TRUE;
|
||||
}
|
||||
nriga = file. get_int("NRIGA");
|
||||
file.next();
|
||||
if (file.eof() || codart != file.get("CODART"))
|
||||
{
|
||||
if (!done)
|
||||
{
|
||||
nfile.zero();
|
||||
nfile.put("ENT", qentr);
|
||||
nfile.put("USC", qusc);
|
||||
nfile.put("ACQ",qacq);
|
||||
nfile.put("VEN",qven);
|
||||
nfile.put("RIM",qrimin);
|
||||
nfile.put("VALENT",vqentr);
|
||||
nfile.put("VALUSC",vqusc);
|
||||
nfile.put("VALACQ",vqacq);
|
||||
nfile.put("VALVEN",vqven);
|
||||
nfile.put("VALRIM",vqrimin);
|
||||
nfile.put("GIAC",qgiac);
|
||||
nfile.put("CODMAG",camponuovo);
|
||||
nfile.put("CODART", codart);
|
||||
nfile.put("ANNOES", codart);
|
||||
nfile.put("NRIGA", nriga+1);
|
||||
//nfile.write();
|
||||
}
|
||||
codart = file.get("CODART");
|
||||
annoes= file.get_int("ANNOES");
|
||||
done = TRUE;
|
||||
qentr = qusc = qacq = qven = qrimin = vqentr = vqusc = vqacq = vqven = vqrimin = qgiac = ZERO;
|
||||
}
|
||||
do_events();
|
||||
}
|
||||
}
|
||||
void TCover_services::main_loop()
|
||||
{
|
||||
TLocalisamfile rdoc(LF_RIGHEDOC), rmovmag(LF_RMOVMAG), mag(LF_MAG);
|
||||
//converti_magazzino(rdoc, "CODMAG", "COMSE", "SE1X0");
|
||||
//converti_magazzino(rdoc, "CODMAGC", "COMSE", "SE1X0");
|
||||
//converti_magazzino(rmovmag, "CODMAG", "COMSE", "SE1X0");
|
||||
//uniscimag("COM", "SE1X0");
|
||||
TService_mask m;
|
||||
|
||||
while (m.run()!=K_QUIT);
|
||||
}
|
||||
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
#define S_LASTBOLLA 202
|
||||
#define S_MOVMAG_FROMD 203
|
||||
#define S_MOVMAG_TOD 204
|
||||
#define S_GIAC_AL 205
|
||||
#define S_USE_AL 206
|
||||
|
||||
#define G_ARTICOLI 10
|
||||
#define G_DISTINTE 20
|
||||
@ -24,7 +26,9 @@
|
||||
#define G_SERVICE_2 102
|
||||
#define G_SERVICE_3 103
|
||||
#define G_SERVICE_8 108
|
||||
#define G_SERVICE_9 109
|
||||
#define G_SERVICE_10 110
|
||||
#define G_SERVICE_11 114
|
||||
#define G_SERVICE_12 115
|
||||
#define G_SERVICE_13 116
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "dbcv00a.h"
|
||||
#include "dbcv02a.h"
|
||||
#define G_ARTICOLI 10
|
||||
#define G_DISTINTE 20
|
||||
#define G_MOVMAG 30
|
||||
@ -63,7 +63,7 @@ BEGIN
|
||||
ITEM "12|Ricerca errori nel ciclo di lavoro"
|
||||
MESSAGE HIDE, G_SERVICE@
|
||||
ITEM "13|Allineamento giacenze"
|
||||
MESSAGE HIDE, G_SERVICE@
|
||||
MESSAGE HIDE, G_SERVICE@ |SHOW, G_SERVICE_13@
|
||||
ITEM "14|Scollegamento mov.mag da documenti"
|
||||
MESSAGE HIDE, G_SERVICE@
|
||||
ITEM "16|Unifica magazzini terzisti"
|
||||
@ -104,6 +104,18 @@ BEGIN
|
||||
GROUP G_SERVICE G_SERVICE_10
|
||||
END
|
||||
|
||||
DATE S_GIAC_AL
|
||||
BEGIN
|
||||
PROMPT 3 5 "Giacenze al:"
|
||||
GROUP G_SERVICE G_SERVICE_13
|
||||
END
|
||||
|
||||
BOOLEAN S_USE_AL
|
||||
BEGIN
|
||||
PROMPT 43 5 "Calcolo le giacenze a questa data"
|
||||
GROUP G_SERVICE G_SERVICE_13
|
||||
END
|
||||
|
||||
NUM S_LASTBOLLA 5
|
||||
BEGIN
|
||||
PROMPT 3 6 "Ultima n.bolla BPCS Cover compresa nel pending "
|
||||
|
||||
884
db/dbcv03.cpp
Executable file
884
db/dbcv03.cpp
Executable file
@ -0,0 +1,884 @@
|
||||
#include "dbcv.h"
|
||||
#include "dbcv09.h"
|
||||
#include "dbcv00a.h"
|
||||
#include "dbcv01.h"
|
||||
#include "printer.h"
|
||||
|
||||
#include <automask.h>
|
||||
#include <applicat.h>
|
||||
#include <execp.h>
|
||||
#include "..\mg\anamag.h"
|
||||
#include "..\mg\mag.h"
|
||||
#include "..\include\doc.h"
|
||||
#include "..\include\rdoc.h"
|
||||
#include "..\ve\velib.h"
|
||||
|
||||
#include "dbcvlib.h"
|
||||
|
||||
class TImpchk_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
public:
|
||||
TImpchk_mask() :TAutomask("dbcv03a.msk"){}
|
||||
};
|
||||
bool TImpchk_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
class TImpchk_BPCS : public TSkeleton_application
|
||||
{
|
||||
TLocalisamfile * _dist, *_rdist, * _anamag, *_umart, *_codcorr,*_mag;
|
||||
private:
|
||||
void delete_ghosts();
|
||||
void delete_arts();
|
||||
bool delete_boms();
|
||||
int read_last_rdist(const char *item_code);
|
||||
bool read_is_dist(const char *item_code);
|
||||
bool is_ghost(const char *item_code);
|
||||
const char * read_first_um(const char *item_code);
|
||||
void clear_docs(long firm, const char * num, const TDate *fromdate=NULL, const TDate *todate=NULL);
|
||||
|
||||
protected:
|
||||
void add_log_row(TPrinter &prn, TPrintrow &oldrow, const char *m);
|
||||
bool compare_item(TPrinter &prn, TPrintrow &prow, const char * anafield, const TString & impfield);
|
||||
bool compare_item(TPrinter &prn, TPrintrow &prow, const char * anafield, const real & impfield);
|
||||
bool compare_item(TPrinter &prn, TPrintrow &prow, const char * anafield, const long impfield);
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
bool chkimp_boms(TMask &m);
|
||||
bool cambia_gmc(TMask & m);
|
||||
bool chkimp_arts(TMask &m);
|
||||
bool importa_ums_BP(TMask &m);
|
||||
protected:
|
||||
virtual void main_loop() ;
|
||||
};
|
||||
|
||||
bool TImpchk_BPCS::create()
|
||||
{
|
||||
open_files(LF_TAB, LF_TABCOM, LF_CLIFO, LF_CFVEN, LF_RIGHEDOC, LF_MOVMAG, LF_RMOVMAG, 0);
|
||||
_dist = new TLocalisamfile(LF_DIST);
|
||||
_rdist = new TLocalisamfile(LF_RDIST);
|
||||
_anamag = new TLocalisamfile(LF_ANAMAG);
|
||||
_umart = new TLocalisamfile(LF_UMART);
|
||||
_codcorr = new TLocalisamfile(LF_CODCORR);
|
||||
_mag = new TLocalisamfile(LF_MAG);
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
bool TImpchk_BPCS::destroy()
|
||||
{
|
||||
delete _dist;
|
||||
delete _rdist;
|
||||
delete _anamag;
|
||||
delete _umart;
|
||||
delete _codcorr;
|
||||
delete _mag;
|
||||
return TSkeleton_application::destroy();
|
||||
}
|
||||
|
||||
|
||||
int TImpchk_BPCS::read_last_rdist(const char *item_code)
|
||||
{
|
||||
static TString prevcode="";
|
||||
static int nrig=0;
|
||||
if (prevcode!=item_code)
|
||||
{
|
||||
prevcode=item_code;
|
||||
nrig=0;
|
||||
_rdist->put("CODDIST",item_code);
|
||||
int err=_rdist->read(_isgteq);
|
||||
while (err==NOERR && _rdist->get("CODDIST")==item_code)
|
||||
{
|
||||
nrig++;
|
||||
err=_rdist->next();
|
||||
}
|
||||
}
|
||||
return ++nrig;
|
||||
}
|
||||
|
||||
bool TImpchk_BPCS::read_is_dist(const char *item_code)
|
||||
{
|
||||
const TRectype & rec=cache().get(LF_DIST,item_code);
|
||||
if (!rec.empty())
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
bool TImpchk_BPCS::is_ghost(const char *item_code)
|
||||
{
|
||||
const TRectype & rec=cache().get(LF_DIST,item_code);
|
||||
if (!rec.empty())
|
||||
return rec.get_bool("VIRTUALE") && !rec.get_bool("ARTPROD")&& !rec.get_bool("ARTACQ") ;
|
||||
return FALSE;
|
||||
}
|
||||
const char * TImpchk_BPCS::read_first_um(const char *item_code)
|
||||
{
|
||||
TToken_string key(item_code);
|
||||
key.add(1);
|
||||
const TRectype & rec=cache().get(LF_UMART,key);
|
||||
if (rec.empty())
|
||||
error_box("Impossibile trovare l'item %s",item_code);
|
||||
return rec.get("UM");
|
||||
}
|
||||
|
||||
// cancella gli articoli
|
||||
void TImpchk_BPCS ::delete_arts()
|
||||
{
|
||||
message_box("- cancellazione articoli disabilitata -");
|
||||
}
|
||||
|
||||
// cancella le distinte che non sono lavorazioni
|
||||
bool TImpchk_BPCS ::delete_boms()
|
||||
{
|
||||
message_box("- cancellazione distinte disabilitata -");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// elimina i ghost "di servizio"
|
||||
void TImpchk_BPCS ::delete_ghosts()
|
||||
{
|
||||
message_box("- cancellazione distinte fantasma disabilitata -");
|
||||
}
|
||||
|
||||
bool TImpchk_BPCS::chkimp_boms(TMask &m)
|
||||
{
|
||||
return TRUE;
|
||||
TWait_cursor hourglass;
|
||||
cache().flush(LF_DIST);
|
||||
cache().flush(LF_ANAMAG);
|
||||
cache().flush(LF_UMART);
|
||||
|
||||
TSupport_file morti(LF_DIST, format("%s\\%s",(const char * ) m.get(F_PATH),ANAGRAFICA_MORTI));
|
||||
TImport_file boms(m.get(F_PATH), BPCS_DISTINTE);
|
||||
TProgind info(boms.items(),"Importazione distinte...",TRUE,TRUE);
|
||||
TToken_string imported_lcode,dead_lcode,skipped_lcode,current_lcode;
|
||||
TString old_code,item_code,last_code;
|
||||
TString8 impianto,main_imp;
|
||||
int bseq=0;
|
||||
|
||||
boms.first();
|
||||
while (!boms.eof())
|
||||
{
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
return FALSE;
|
||||
// converte ogni distinta ancora valida
|
||||
old_code=(boms.get_codice("BPROD"));
|
||||
impianto=(boms.get("BMWHS"));
|
||||
int metodo(int(boms.get_long("BMBOMM")));
|
||||
current_lcode.add(old_code,0);
|
||||
current_lcode.add(impianto,1);
|
||||
current_lcode.add(metodo,2);
|
||||
|
||||
const long ddis=boms.get_long("BDDIS");
|
||||
bool skip=!((ddis==99999999)||(ddis==9999999)||(ddis==999999)||(ddis==99999));
|
||||
if (skipped_lcode==current_lcode || dead_lcode==current_lcode)
|
||||
skip = TRUE;
|
||||
if (!skip && m.get_bool(F_CHECKDEADARTS))
|
||||
{
|
||||
morti.put("CODDIST",old_code);
|
||||
if (morti.read()==NOERR)
|
||||
{
|
||||
skip=TRUE;
|
||||
skipped_lcode=current_lcode;
|
||||
}
|
||||
}
|
||||
if (!skip && atol(boms.get("BDEFF"))<m.get_int(F_ANNO)*10000L)
|
||||
{
|
||||
if (skipped_lcode==current_lcode || dead_lcode==current_lcode)
|
||||
skip = TRUE;
|
||||
else
|
||||
{
|
||||
TTimed_skipbox bbox(format("La distinta %s (%s), di %s metodo '%02d', risale al %s; ignoro l'importazione ?",
|
||||
(const char *)old_code,
|
||||
(const char *)cache().get(LF_ANAMAG,old_code).get("DESCR"),
|
||||
(const char *)impianto,
|
||||
metodo,
|
||||
(const char *)boms.get("BDEFF")),60);
|
||||
if (skip=(bbox.run()==K_ESC))
|
||||
{
|
||||
if (noyes_box("Ignoro l'importazione di tutti i metodi del codice %s?",(const char *) old_code))
|
||||
{
|
||||
morti.put("CODDIST",old_code);
|
||||
morti.write();
|
||||
dead_lcode=current_lcode;
|
||||
}
|
||||
skipped_lcode=current_lcode;
|
||||
}
|
||||
}
|
||||
}
|
||||
// importa solo gli impianti SEgrate e TrieSte
|
||||
if (!skip && metodo == 99 && (impianto=="SE" || impianto=="TS" ))
|
||||
{
|
||||
main_imp=impianto;
|
||||
do {
|
||||
if (impianto == "PD")
|
||||
impianto = "PR";
|
||||
if (metodo==7)
|
||||
{
|
||||
impianto = "PD";
|
||||
metodo = 0;
|
||||
}
|
||||
const TString8 father_grmerc= cache().get(LF_ANAMAG,old_code).get("GRMERC");
|
||||
if (metodo!=0)
|
||||
{
|
||||
if (metodo==99)
|
||||
{
|
||||
if (cache().get(LF_ANAMAG,old_code ).get(ANAMAG_GRMERC)[0]!='F')
|
||||
message_box("Il codice %s con metodo 99 non e' un finito",(const char *)old_code);
|
||||
// sconfezionamento
|
||||
impianto=format("%s9%02d",(const char *)main_imp,metodo);
|
||||
if (cache().get("LNP",impianto).empty())
|
||||
{
|
||||
cache().discard("LNP",impianto);
|
||||
// inserisce la linea di sconfezionamento
|
||||
TTable imp("LNP");
|
||||
imp.put("CODTAB",impianto);
|
||||
imp.put("S0","Riconfezionamento/sconfezionamento");
|
||||
imp.put("S6",main_imp);
|
||||
imp.put("S7",format("%s1",(const char *) impianto));
|
||||
imp.put("B9","X");
|
||||
//imp.write();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// terzisti
|
||||
impianto=format("X%02d%s",metodo,(const char *)main_imp);
|
||||
if (cache().get("LNP",impianto).empty())
|
||||
{
|
||||
cache().discard("LNP",impianto);
|
||||
// inserisce il terzista come linea produttiva sull'impianto esterno
|
||||
TTable imp("LNP");
|
||||
imp.put("CODTAB",impianto);
|
||||
imp.put("S0",format("%s (%s)",descr_method(metodo),(const char *) impianto));
|
||||
imp.put("S6","XT");
|
||||
imp.put("S7",format("%s3%02d",(const char *) impianto,metodo));
|
||||
imp.put("B9","X");
|
||||
//imp.write();
|
||||
}
|
||||
}
|
||||
}
|
||||
// padre
|
||||
TString descr,um_f(read_first_um(old_code));
|
||||
TString item_code=old_code;
|
||||
item_code << "__" << impianto;
|
||||
const bool father_ghost= is_ghost(old_code);
|
||||
if (father_ghost)
|
||||
descr=cache().get(LF_DIST,old_code).get("DESCR");
|
||||
else
|
||||
descr=cache().get(LF_ANAMAG,old_code).get("DESCR");
|
||||
if (!father_ghost && item_code!=last_code)
|
||||
{
|
||||
// se non e' un fantasma lo definisce come variante (distinta contenente una riga di tipo variabile)
|
||||
if (cache().get(LF_DIST,old_code).empty())
|
||||
{
|
||||
cache().discard(LF_DIST,old_code);
|
||||
|
||||
_dist->zero();
|
||||
_dist->put("CODDIST", old_code);
|
||||
_dist->put("DESCR", descr);
|
||||
_dist->put("VIRTUALE", " ");
|
||||
_dist->put("MASTER", "X");
|
||||
_dist->put("ARTPROD", "X");
|
||||
_dist->put("UM", um_f);
|
||||
TString varvar("VARIANTE=");
|
||||
varvar << "_DISTINTA+\"__\"+IF(_IMPIANTO!=\"XT\",_IMPIANTO,_LINEA)" ;
|
||||
_dist->put("PARAMETRI",varvar);
|
||||
int err=_dist->write();
|
||||
if (err!=_isreinsert)
|
||||
{
|
||||
_rdist->zero();
|
||||
_rdist->put("CODDIST", old_code);
|
||||
_rdist->put("NRIG", 1 );
|
||||
_rdist->put("TIPO", "V" );
|
||||
_rdist->put("CODCOMP", "VARIANTE" );
|
||||
_rdist->put("UM", "");
|
||||
_rdist->put("EXPR", 1 );
|
||||
_rdist->write();
|
||||
}
|
||||
}
|
||||
}
|
||||
// figlio
|
||||
TString son_code=boms.get_codice("BCHLD");
|
||||
TString um_s=read_first_um(son_code) ;
|
||||
const bool son_ghost=is_ghost(son_code);
|
||||
if (son_ghost)
|
||||
son_code << "__" << impianto ;
|
||||
// scrivi la bom
|
||||
if (last_code!=item_code)
|
||||
{
|
||||
if (cache().get(LF_DIST,item_code).empty())
|
||||
{
|
||||
cache().discard(LF_DIST,item_code);
|
||||
descr << " (impianto " << main_imp << ")";
|
||||
_dist->zero(' ');
|
||||
_dist->put("CODDIST", item_code);
|
||||
_dist->put("DESCR", descr);
|
||||
_dist->put("VIRTUALE", "X" );
|
||||
_dist->put("ARTPROD", "");
|
||||
_dist->put("UM", "BP");
|
||||
|
||||
if (impianto.left(2)!= "XT")
|
||||
{
|
||||
// l'albero della distinte di un impianto e' su qyell'impianto
|
||||
// i terzisti seguono l'impianto di pianificazione
|
||||
TString varimp("_IMPIANTO=");
|
||||
varimp << '"'<< main_imp <<'"';
|
||||
_dist->put("PARAMETRI",varimp);
|
||||
}
|
||||
_dist->write(); // fallisce se esiste gia'
|
||||
|
||||
_umart->zero(' ');
|
||||
_umart->put("CODART",item_code);
|
||||
_umart->put("NRIGA",1);
|
||||
_umart->put("UM",um_f);
|
||||
_umart->put("FC","1");
|
||||
force_write(*_umart);
|
||||
}
|
||||
last_code=item_code;
|
||||
if (bseq>0 || (impianto != "PD" && impianto != "PR"))
|
||||
bseq=0;
|
||||
}
|
||||
if (impianto == "PD")
|
||||
bseq--;
|
||||
else if (impianto != "PR")
|
||||
bseq++;
|
||||
if (bseq==0) error_box("Numero riga 0 per %s / %s",(const char *)item_code,(const char *)son_code);
|
||||
_rdist->zero(' ');
|
||||
_rdist->put("CODDIST", item_code);
|
||||
_rdist->put("NRIG", bseq >0 ? bseq : -bseq);
|
||||
if (son_ghost)
|
||||
_rdist->put("TIPO", "D");
|
||||
else if (son_code=="ACQUA" || son_code=="ACQUADEION")
|
||||
_rdist->put("TIPO", "L");
|
||||
else
|
||||
_rdist->put("TIPO", "A");
|
||||
_rdist->put("CODCOMP", son_code );
|
||||
_rdist->put("UM", um_s);
|
||||
_rdist->put("EXPR", boms.get_real("BQREQ") );
|
||||
_rdist->write();
|
||||
|
||||
imported_lcode=current_lcode;
|
||||
} while (impianto == "PD");
|
||||
}
|
||||
boms.next();
|
||||
}
|
||||
delete_ghosts();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TImpchk_BPCS::add_log_row(TPrinter &prn, TPrintrow &oldrow, const char *m)
|
||||
{
|
||||
TString mm(m);
|
||||
if (oldrow.lastpos())
|
||||
prn.print(oldrow);
|
||||
oldrow.reset();
|
||||
oldrow.put(mm,4);
|
||||
prn.print(oldrow);
|
||||
oldrow.reset();
|
||||
}
|
||||
|
||||
bool TImpchk_BPCS::compare_item(TPrinter &prn, TPrintrow &prow, const char * anafield,
|
||||
const real & impfield)
|
||||
{
|
||||
real r_eurocampo(_anamag->get_real( anafield));
|
||||
if (r_eurocampo != impfield && !impfield.is_zero())
|
||||
{
|
||||
if (r_eurocampo.is_zero())
|
||||
{
|
||||
_anamag->put(anafield, impfield);
|
||||
return TRUE;
|
||||
} else {
|
||||
TString messaggio = format("Il campo %s manca dei decimali", anafield);
|
||||
messaggio << "(" << r_eurocampo << " invece di " << impfield << "\nAggiorno automaticamente?";
|
||||
real r_bpcs(impfield);
|
||||
if (r_bpcs.trunc() == r_eurocampo && yesno_box(messaggio))
|
||||
{
|
||||
_anamag->put(anafield, impfield);
|
||||
return TRUE;
|
||||
}
|
||||
messaggio = anafield;
|
||||
messaggio << "=" << _anamag->get_real( anafield) << " , " << impfield << " su BPCS";
|
||||
add_log_row(prn, prow, messaggio);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool TImpchk_BPCS::compare_item(TPrinter &prn, TPrintrow &prow, const char * anafield,
|
||||
const TString & impfield)
|
||||
{
|
||||
if (_anamag->get( anafield) != impfield && !impfield.blank())
|
||||
if (_anamag->get( anafield).blank())
|
||||
{
|
||||
_anamag->put( anafield, impfield);
|
||||
return TRUE;
|
||||
} else {
|
||||
add_log_row(prn, prow, format ("%s = '%s', '%s'su BPCS",
|
||||
(const char *) anafield,(const char *)_anamag->get( anafield), (const char *)impfield));
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool TImpchk_BPCS::compare_item(TPrinter &prn, TPrintrow &prow, const char * anafield,
|
||||
const long impfield)
|
||||
{
|
||||
if (_anamag->get_long( anafield) != impfield && impfield!=0L)
|
||||
if (_anamag->get_long( anafield) == 0L)
|
||||
{
|
||||
_anamag->put( anafield, impfield);
|
||||
return TRUE;
|
||||
} else {
|
||||
add_log_row(prn, prow, format ("%s = '%ld', '%ld'su BPCS",
|
||||
(const char *) anafield,_anamag->get_long( anafield), impfield));
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// importa le ums dal file di anagrafica
|
||||
bool TImpchk_BPCS ::chkimp_arts(TMask & m)
|
||||
{
|
||||
TPrinter prn;
|
||||
TPrintrow prow;
|
||||
TWait_cursor hourglass;
|
||||
cache().flush(LF_ANAMAG);
|
||||
cache().flush(LF_DIST);
|
||||
cache().flush(LF_UMART);
|
||||
|
||||
TSupport_file morti(LF_DIST, format("%%%s\\%s",(const char * ) m.get(F_PATH),ANAGRAFICA_MORTI));
|
||||
TImport_file items_ext(m.get(F_PATH),BPCS_IMPORTEX);
|
||||
TImport_file items(m.get(F_PATH),BPCS_ANAGRAFICA);
|
||||
TString item_code,item_type,tmp;
|
||||
bool skip;
|
||||
|
||||
TProgind info(items.items(),"Controllo articoli e distinte fantasma...",TRUE,TRUE);
|
||||
prn.open();
|
||||
|
||||
items_ext.first();
|
||||
items.first();
|
||||
while (!items.eof())
|
||||
{
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
break;
|
||||
item_type=items.get("IITYP");
|
||||
if (items.get("IID")=="IM" && atoi(item_type)!=6)
|
||||
{
|
||||
if (item_type!="0") // non fantasma
|
||||
{
|
||||
item_code=items.get_codice("IPROD");
|
||||
skip=FALSE;
|
||||
// sincronizza il file dell'anagrafica Importex
|
||||
while (items_ext.get_codice("MSITE")<item_code && !items_ext.eof())
|
||||
items_ext.next();
|
||||
morti.put("CODDIST",item_code);
|
||||
if (morti.read()!=NOERR)
|
||||
{
|
||||
// *******
|
||||
// anagrafica
|
||||
_anamag->zero();
|
||||
_anamag->put( ANAMAG_CODART,item_code);
|
||||
bool newart = (_anamag->read()==_iskeynotfound);
|
||||
if (newart && yesno_box("Articolo %s '%s'non trovato:\n lo metto tra gli articoli da ignorare?",
|
||||
(const char *)item_code,(const char *)items.get("IDESC")))
|
||||
{
|
||||
morti.put("CODDIST",item_code);
|
||||
morti.put("DESCR",items.get("IDESC"));
|
||||
morti.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
prow.reset();
|
||||
prow.put("Articolo ");
|
||||
prow.put(item_code);
|
||||
if (newart)
|
||||
{
|
||||
prow.put(" mancante: inserito in automatico");
|
||||
prn.print(prow);
|
||||
|
||||
_anamag->put( ANAMAG_DESCR,items.get("IDESC"));
|
||||
_anamag->put( ANAMAG_DESCRAGG,items.get("IDSCE"));
|
||||
_anamag->put( ANAMAG_CODFORN, items.get_long("IVEND"));
|
||||
_anamag->put( ANAMAG_UMP, "KG");
|
||||
_anamag->put( ANAMAG_PESO, items.get_real("IWGHT"));
|
||||
// riordino
|
||||
_anamag->put( ANAMAG_RIORDINO , "F"); //_anamag->put( ANAMAG_RIORDINO , items.get("IMRP")=="M" ? "F" : "P" );
|
||||
_anamag->put( ANAMAG_GIORNIRIOR, items.get_long("ILEAD"));
|
||||
_anamag->put( ANAMAG_LOTTORIOR, items.get_real("ILOTS"));
|
||||
_anamag->put( ANAMAG_LOTTOIRIOR, items.get_real("IIOQ"));
|
||||
//
|
||||
_anamag->put( ANAMAG_PPCONF , items.get_long("IFII"));
|
||||
_anamag->put( ANAMAG_PPCOLLO , items.get_long("IFII"));
|
||||
TString16 gmc=items.get("IITYP");
|
||||
switch (gmc[0])
|
||||
{
|
||||
case 'F':
|
||||
case 'E':
|
||||
case 'Z':
|
||||
case 'G':
|
||||
gmc[0]= 'F'; break;
|
||||
case 'M':
|
||||
gmc[0]= 'S'; break;
|
||||
case 'P':
|
||||
gmc[0]= 'C'; break;
|
||||
}
|
||||
TString16 iclas(items.get("ICLAS"));
|
||||
if (!iclas.blank())
|
||||
{
|
||||
switch (m.get(F_ICLAS)[0])
|
||||
{
|
||||
case 'S':
|
||||
complete_gmc(gmc, iclas);
|
||||
break;
|
||||
case 'C':
|
||||
gmc << iclas;
|
||||
break;
|
||||
case ' ':
|
||||
break;
|
||||
}
|
||||
}
|
||||
_anamag->put( ANAMAG_GRMERC,gmc);
|
||||
_anamag->put( ANAMAG_COSTSTD, items.get_real("ISCST"));
|
||||
_anamag->put( ANAMAG_ULTCOS1, items.get_real("IACST"));
|
||||
tmp=items.get("TAXC1");
|
||||
if (tmp.left(3)=="IVA")
|
||||
tmp=tmp.sub(3);
|
||||
_anamag->put( ANAMAG_CODIVA , tmp);
|
||||
if (items_ext.get_codice("MSITE")==items.get_codice("IPROD"))
|
||||
{
|
||||
_anamag->put( ANAMAG_CLASSDOG , check_clasdog(items_ext.get_long("MSTDO")));
|
||||
_anamag->put( ANAMAG_USER1 , items_ext.get_real("MSIDR"));// idrati
|
||||
_anamag->put( ANAMAG_USER2 , items_ext.get_real("MSANI"));//anidri
|
||||
_anamag->put( ANAMAG_USER3 , items_ext.get("MSTAL"));//alcool
|
||||
// dimensioni
|
||||
_anamag->put( ANAMAG_USER4, items_ext.get_long("MSPLU"));
|
||||
_anamag->put( ANAMAG_USER5, items_ext.get_long("MSPAL"));
|
||||
_anamag->put( ANAMAG_USER6, items_ext.get_long("MSPPR"));
|
||||
// composizione pallets
|
||||
_anamag->put( ANAMAG_USER7, items_ext.get_long("MSCST")); // casse per strato
|
||||
_anamag->put( ANAMAG_USER8, items_ext.get_long("MSSTP")); // strati per pallet
|
||||
}
|
||||
//_anamag.write();
|
||||
real smin(items.get("IMIN"));
|
||||
if (smin!=ZERO)
|
||||
{
|
||||
_mag->zero();
|
||||
_mag->put(MAG_SCORTAMIN,smin);
|
||||
_mag->put(MAG_ANNOES,"1999");
|
||||
_mag->put(MAG_CODART,item_code);
|
||||
_mag->put(MAG_NRIGA,1);
|
||||
_mag->put(MAG_CODMAG,"SE1PF");
|
||||
//force_write(*_mag);
|
||||
_mag->put(MAG_NRIGA,2);
|
||||
_mag->put(MAG_CODMAG,"TS1PF");
|
||||
//force_write(*_mag);
|
||||
}
|
||||
} else {
|
||||
bool changed=FALSE;
|
||||
bool different=FALSE;
|
||||
changed |= compare_item(prn, prow, ANAMAG_DESCR, items.get("IDESC"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_DESCRAGG, items.get("IDSCE"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_CODFORN, items.get_long("IVEND"));
|
||||
if (_anamag->get( ANAMAG_UMP).blank())
|
||||
{
|
||||
_anamag->put( ANAMAG_UMP,"KG");
|
||||
changed = TRUE;
|
||||
} else {
|
||||
if (_anamag->get( ANAMAG_UMP) != "KG")
|
||||
add_log_row(prn, prow, format("Unita' di misura del peso insolita: %s",(const char *)_anamag->get( ANAMAG_UMP)));
|
||||
}
|
||||
changed |= compare_item(prn, prow, ANAMAG_PESO, items.get_real("IWGHT"));
|
||||
// riordino
|
||||
if (_anamag->get( ANAMAG_RIORDINO).blank())
|
||||
{
|
||||
_anamag->put( ANAMAG_RIORDINO,"F");
|
||||
changed = TRUE;
|
||||
} else {
|
||||
if (_anamag->get( ANAMAG_RIORDINO) != "F")
|
||||
add_log_row(prn, prow, format("TIpo di riordino insolito: %s",(const char *)_anamag->get( ANAMAG_RIORDINO)));
|
||||
}
|
||||
changed |= compare_item(prn, prow, ANAMAG_GIORNIRIOR, items.get_long( "ILEAD"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_LOTTORIOR, items.get_real( "ILOTS"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_LOTTOIRIOR, items.get_real( "IIOQ"));
|
||||
//
|
||||
changed |= compare_item(prn, prow, ANAMAG_PPCONF, items.get_long("IFII"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_PPCOLLO, items.get_long("IFII"));
|
||||
TString8 gmc=items.get("IITYP");
|
||||
switch (gmc[0])
|
||||
{
|
||||
case 'F':
|
||||
case 'E':
|
||||
case 'Z':
|
||||
case 'G':
|
||||
gmc[0]= 'F'; break;
|
||||
case 'M':
|
||||
gmc[0]= 'S'; break;
|
||||
case 'P':
|
||||
gmc[0]= 'C'; break;
|
||||
}
|
||||
TString16 iclas(items.get("ICLAS"));
|
||||
if (!iclas.blank())
|
||||
{
|
||||
switch (m.get(F_ICLAS)[0])
|
||||
{
|
||||
case 'S':
|
||||
complete_gmc(gmc, iclas);
|
||||
break;
|
||||
case 'C':
|
||||
gmc << iclas;
|
||||
break;
|
||||
case ' ':
|
||||
break;
|
||||
}
|
||||
}
|
||||
changed |= compare_item(prn, prow, ANAMAG_GRMERC, gmc);
|
||||
changed |= compare_item(prn, prow, ANAMAG_COSTSTD, items.get_real("ISCST"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_ULTCOS1, items.get_real("IACST"));
|
||||
tmp=items.get("TAXC1");
|
||||
if (tmp.left(3)=="IVA")
|
||||
tmp=tmp.sub(3);
|
||||
changed |= compare_item(prn, prow, ANAMAG_CODIVA, tmp);
|
||||
|
||||
if (items_ext.get_codice("MSITE")==items.get_codice("IPROD"))
|
||||
{
|
||||
changed |= compare_item(prn, prow, ANAMAG_CLASSDOG, atol(check_clasdog(items_ext.get_long("MSTDO"))));
|
||||
changed |= compare_item(prn, prow, ANAMAG_USER1, items_ext.get_real("MSIDR"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_USER2, items_ext.get_real("MSANI"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_USER3, items_ext.get("MSTAL"));
|
||||
// dimensioni
|
||||
changed |= compare_item(prn, prow, ANAMAG_USER4, items_ext.get_long("MSPLU"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_USER5, items_ext.get_long("MSPAL"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_USER6, items_ext.get_long("MSPPR"));
|
||||
// composizione pallets
|
||||
changed |= compare_item(prn, prow, ANAMAG_USER7, items_ext.get_long("MSCST"));
|
||||
changed |= compare_item(prn, prow, ANAMAG_USER8, items_ext.get_long("MSSTP"));
|
||||
}
|
||||
//_anamag.write();
|
||||
real smin(items.get("IMIN"));
|
||||
if (smin!=ZERO)
|
||||
{
|
||||
_mag->zero();
|
||||
_mag->put(MAG_SCORTAMIN,smin);
|
||||
_mag->put(MAG_ANNOES,"1999");
|
||||
_mag->put(MAG_CODART,item_code);
|
||||
_mag->put(MAG_NRIGA,1);
|
||||
_mag->put(MAG_CODMAG,"SE1PF");
|
||||
//force_write(*_mag);
|
||||
_mag->put(MAG_NRIGA,2);
|
||||
_mag->put(MAG_CODMAG,"TS1PF");
|
||||
//force_write(*_mag);
|
||||
}
|
||||
if (changed)
|
||||
_anamag->rewrite();
|
||||
}
|
||||
} // inserisco - ignoro
|
||||
// *******
|
||||
// UMS
|
||||
TString4 um,ums(items.get("IUMS"));
|
||||
real fc;
|
||||
int nriga=1;
|
||||
for (int u=0; u<3; u++)
|
||||
{
|
||||
switch (u)
|
||||
{
|
||||
case 1:
|
||||
um=items.get("IUMP");
|
||||
fc=items.get_real("IUMCN");
|
||||
break;
|
||||
case 2:
|
||||
um=items.get("IUMR");
|
||||
fc=items.get_real("IUMRC");
|
||||
break;
|
||||
default:
|
||||
um=ums;
|
||||
fc=1.0;
|
||||
}
|
||||
if (!um.blank() && (u==0 || um!=ums))
|
||||
{
|
||||
_umart->zero();
|
||||
_umart->put("CODART",item_code);
|
||||
_umart->put("NRIGA",nriga);
|
||||
_umart->put("UM",um);
|
||||
if (nriga==1)
|
||||
_umart->put("PREZZO",items.get("ILIST"));
|
||||
_umart->put("FC",fc);
|
||||
//force_write(*_umart);
|
||||
nriga++;
|
||||
}
|
||||
} // fine ciclo unita' di misura
|
||||
long ean=items.get_long("IDRAW");
|
||||
if (!m.get(F_EAN).blank())
|
||||
{
|
||||
TString16 eancode=items.get("IDRAW");
|
||||
if (ean!=0L || (eancode[0]>='A' && eancode[0]<='Z' && atol(eancode.sub(1))!=0L))
|
||||
{
|
||||
_codcorr->zero();
|
||||
_codcorr->put("CODARTALT",eancode);
|
||||
_codcorr->put("NRIGA",1);
|
||||
_codcorr->put("TIPO",m.get(F_EAN));
|
||||
_codcorr->put("CODART",item_code);
|
||||
//force_write(*_codcorr);
|
||||
}
|
||||
}
|
||||
} // controllo morti
|
||||
} // articolo magazzino
|
||||
} // record type check
|
||||
items.next();
|
||||
} // while
|
||||
prn.close();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
bool TImpchk_BPCS ::cambia_gmc(TMask & m)
|
||||
{
|
||||
TWait_cursor hourglass;
|
||||
cache().flush(LF_ANAMAG);
|
||||
cache().flush(LF_DIST);
|
||||
cache().flush(LF_UMART);
|
||||
|
||||
TImport_file items_ext(m.get(F_PATH),BPCS_IMPORTEX);
|
||||
TImport_file items(m.get(F_PATH),BPCS_ANAGRAFICA);
|
||||
TString item_code,item_type,tmp;
|
||||
TProgind info(items.items(),"Importazione gruppi merceologici e classi doganali",TRUE,TRUE);
|
||||
items_ext.first();
|
||||
items.first();
|
||||
while (!items.eof())
|
||||
{
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
return FALSE;
|
||||
item_type=items.get("IITYP");
|
||||
if (items.get("IID")=="IM" && atoi(item_type)!=6)
|
||||
{
|
||||
item_code=items.get_codice("IPROD");
|
||||
if (item_type!="0") // fantasma
|
||||
{
|
||||
_anamag->zero();
|
||||
_anamag->put( ANAMAG_CODART,item_code);
|
||||
if (_anamag->read()==NOERR)
|
||||
{
|
||||
// sincronizza il file dell'anagrafica Importex
|
||||
while (items_ext.get_codice("MSITE")<item_code && !items_ext.eof())
|
||||
items_ext.next();
|
||||
if (items_ext.get_codice("MSITE")==items.get_codice("IPROD"))
|
||||
{
|
||||
TString cld=check_clasdog(items_ext.get_long("MSTDO"));
|
||||
if (!cld.blank())
|
||||
_anamag->put( ANAMAG_CLASSDOG , cld);
|
||||
}
|
||||
TString16 gmc=items.get("IITYP");
|
||||
switch (gmc[0])
|
||||
{
|
||||
case 'F':
|
||||
case 'E':
|
||||
case 'Z':
|
||||
case 'G':
|
||||
gmc[0]= 'F'; break; // finiti
|
||||
case 'M':
|
||||
gmc[0]= 'S'; break; // semilavorati ()
|
||||
case 'P':
|
||||
gmc[0]= 'C'; break; // componenti (parts)
|
||||
}
|
||||
TString16 iclas(items.get("ICLAS"));
|
||||
if (!iclas.blank())
|
||||
{
|
||||
switch (m.get(F_ICLAS)[0])
|
||||
{
|
||||
case 'S':
|
||||
complete_gmc(gmc, iclas);
|
||||
break;
|
||||
case 'C':
|
||||
gmc << iclas;
|
||||
break;
|
||||
case ' ':
|
||||
break;
|
||||
}
|
||||
}
|
||||
_anamag->put( ANAMAG_GRMERC,gmc);
|
||||
_anamag->rewrite();
|
||||
}
|
||||
}
|
||||
}
|
||||
items.next();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// importa le ums dal file dei divisori
|
||||
bool TImpchk_BPCS ::importa_ums_BP(TMask & m)
|
||||
{
|
||||
return TRUE;
|
||||
TWait_cursor hourglass;
|
||||
cache().flush(LF_UMART);
|
||||
|
||||
TImport_file divisori(m.get(F_PATH),BPCS_DIVISORI);
|
||||
TProgind info(divisori.items(),"Importazione divisori (batch di produzione)...",TRUE,TRUE);
|
||||
divisori.first();
|
||||
TString item_code,impianto;
|
||||
while (!divisori.eof())
|
||||
{
|
||||
info.addstatus(1);
|
||||
if (info.iscancelled())
|
||||
return FALSE;
|
||||
impianto=divisori.get("ICFAC");
|
||||
if (impianto=="SE" || impianto == "TS")
|
||||
{
|
||||
for (int falsi_terzisti=0;falsi_terzisti<3; falsi_terzisti++)
|
||||
{
|
||||
item_code=(divisori.get_codice("ICPROD"));
|
||||
item_code << "__";
|
||||
switch (falsi_terzisti)
|
||||
{
|
||||
case 1:
|
||||
item_code << "PD"; break;
|
||||
case 2:
|
||||
item_code << "PR"; break;
|
||||
default:
|
||||
item_code << impianto; break;
|
||||
}
|
||||
if (read_is_dist(item_code))
|
||||
{
|
||||
_umart->zero();
|
||||
_umart->put("CODART",item_code);
|
||||
_umart->put("NRIGA",2);
|
||||
_umart->put("UM","BP");
|
||||
_umart->put("FC",divisori.get("ICBTCH"));
|
||||
force_write(*_umart);
|
||||
}
|
||||
}
|
||||
}
|
||||
divisori.next();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TImpchk_BPCS ::main_loop()
|
||||
{
|
||||
TImpchk_mask m;
|
||||
while (m.run()!=K_QUIT)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
ok &= chkimp_arts(m); // articoli e distinte virtuali fantasma
|
||||
ok &= chkimp_boms(m); // distinte non fantasma
|
||||
ok &= importa_ums_BP(m);
|
||||
if (ok)
|
||||
message_box("Operazione conclusa");
|
||||
else
|
||||
message_box("Operazione interrotta");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int dbcv03(int argc, char* argv[])
|
||||
{
|
||||
int n = argc > 1 ? (argv[1][1] - '0') : 0;
|
||||
TImpchk_BPCS dt;
|
||||
dt.run(argc, argv, "Controllo archivi importati da BPCS");
|
||||
|
||||
return 0;
|
||||
}
|
||||
55
db/dbcv03a.uml
Executable file
55
db/dbcv03a.uml
Executable file
@ -0,0 +1,55 @@
|
||||
#include "dbcv00a.h"
|
||||
TOOLBAR "" 0 19 0 0
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 "~OK"
|
||||
PICTURE BMP_OK
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 "~Fine"
|
||||
MESSAGE EXIT,K_QUIT
|
||||
PICTURE BMP_QUIT
|
||||
PICTURE BMP_QUITDN
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Servizi" -1 -1 80 20
|
||||
|
||||
|
||||
STRING DLG_PROFILE 70
|
||||
BEGIN
|
||||
FLAGS "HG"
|
||||
PROMPT 1 1 ""
|
||||
PSELECT
|
||||
END
|
||||
|
||||
STRING F_PATH 40
|
||||
BEGIN
|
||||
PROMPT 1 1 "Percorso dei files DBF di BPCS "
|
||||
END
|
||||
|
||||
LIST F_ICLAS 35
|
||||
BEGIN
|
||||
PROMPT 3 6 ""
|
||||
ITEM " |Non caricare il campo ICLAS"
|
||||
ITEM "S|Carica ICLAS come sotto cat.merc."
|
||||
ITEM "C|Carica ICLAS come cat.merc."
|
||||
GROUP G_ARTICOLI
|
||||
END
|
||||
LIST F_EAN 30
|
||||
BEGIN
|
||||
PROMPT 3 8 ""
|
||||
ITEM " |Non caricare i codici EAN"
|
||||
ITEM "8|Carica codici EAN 8"
|
||||
ITEM "13|Carica codici EAN 13"
|
||||
GROUP G_ARTICOLI
|
||||
END
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
222
db/dbcv09.cpp
222
db/dbcv09.cpp
@ -1,9 +1,10 @@
|
||||
#include "dblib.h"
|
||||
#include "..\db\dblib.h"
|
||||
#include "dbcv09.h"
|
||||
#include "dbcv00a.h"
|
||||
#include <relation.h>
|
||||
#include <execp.h>
|
||||
#include "..\mg\anamag.h"
|
||||
#include "..\mg\mglib.h"
|
||||
|
||||
void delete_files(const char *wild)
|
||||
{
|
||||
@ -77,16 +78,6 @@ long method2location(int method)
|
||||
return -99; // terzista generico
|
||||
}
|
||||
|
||||
void coddep2location(const char * coddep, TString & codlocation)
|
||||
{
|
||||
codlocation.cut(0);
|
||||
if (coddep[0]>='0' && coddep[0]<='9')
|
||||
codlocation = format("%02d", method2location(atoi(coddep))) ;
|
||||
else if (coddep == "C0")
|
||||
codlocation = "CICCA";
|
||||
}
|
||||
|
||||
|
||||
int location2method(long location)
|
||||
{
|
||||
switch (location)
|
||||
@ -98,7 +89,7 @@ int location2method(long location)
|
||||
case 63: return 4;
|
||||
case 872: return 5;
|
||||
case 66: return 6;
|
||||
case 1700: return 7;
|
||||
case 1700: return 7; // Ex COVER
|
||||
case 115: return 8;
|
||||
case 935: return 9;
|
||||
case 911: return 10;
|
||||
@ -368,27 +359,39 @@ const char * check_clasdog(long stdo)
|
||||
|
||||
void imploc2codmagdep(TString &codimp,TString &location, TString &codmag)
|
||||
{
|
||||
|
||||
int terzista = 0;
|
||||
if (atoi(location))
|
||||
{
|
||||
terzista = location2method(atoi(location));
|
||||
if (terzista == 7)
|
||||
{
|
||||
if (codimp=="SE")
|
||||
codimp = "PR";
|
||||
else
|
||||
codimp = "PD";
|
||||
terzista = 0;
|
||||
}
|
||||
}
|
||||
codmag = codimp;
|
||||
codmag << 1;
|
||||
if (location == "CICCA")
|
||||
codmag << "C0";
|
||||
else if (terzista>0)
|
||||
if (!location.blank())
|
||||
{
|
||||
codmag << format("%02d",terzista);
|
||||
codimp = "XT";
|
||||
// must be a terzist....
|
||||
if (atoi(location))
|
||||
{
|
||||
terzista = location2method(atoi(location));
|
||||
if (terzista == 7)
|
||||
{
|
||||
if (codimp!="SE")
|
||||
{
|
||||
if (codimp=="SE3")
|
||||
codmag = "SE1";
|
||||
else
|
||||
codmag = "TS1";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (location == "CICCA")
|
||||
codmag << "C0";
|
||||
else if (location == "CMINT")
|
||||
codmag << "C1";
|
||||
else if (location == "COMMEX")
|
||||
codmag << "X0";
|
||||
else if (terzista>0)
|
||||
{
|
||||
codmag << format("%02d",terzista);
|
||||
codimp = "XT";
|
||||
} else if (!location.blank())
|
||||
error_box("Locazione sconosciuta '%s'",(const char *)location);
|
||||
} else {
|
||||
codmag << "PF";
|
||||
}
|
||||
@ -396,14 +399,6 @@ void imploc2codmagdep(TString &codimp,TString &location, TString &codmag)
|
||||
|
||||
void codimp2codmagdep(TString &codimp,int terzista, TString &codmag)
|
||||
{
|
||||
if (terzista == 7)
|
||||
{
|
||||
if (codimp=="SE")
|
||||
codimp = "PR";
|
||||
else
|
||||
codimp = "PD";
|
||||
terzista = 0;
|
||||
}
|
||||
codmag = codimp;
|
||||
codmag << 1;
|
||||
if (terzista>0)
|
||||
@ -413,6 +408,13 @@ void codimp2codmagdep(TString &codimp,int terzista, TString &codmag)
|
||||
} else {
|
||||
codmag << "PF";
|
||||
}
|
||||
if (terzista == 7)
|
||||
{
|
||||
if (codimp=="SE")
|
||||
codimp = "PR";
|
||||
else
|
||||
codimp = "PD";
|
||||
}
|
||||
}
|
||||
|
||||
void num_mag2cod_imp(int magno, TString & codimp)
|
||||
@ -442,8 +444,8 @@ void num_mag2cod_imp(int magno, TString & codimp)
|
||||
int cod_mag2num_mag(TString & codmagdep)
|
||||
{
|
||||
const int terzista = atoi(codmagdep.sub(3));
|
||||
if (terzista!=7)
|
||||
{
|
||||
// if (terzista!=7)
|
||||
// {
|
||||
TString codmag = codmagdep.left(3);
|
||||
if (codmag=="SE1")
|
||||
return terzista ? 91 : 26;
|
||||
@ -453,16 +455,32 @@ int cod_mag2num_mag(TString & codmagdep)
|
||||
if (codmag != "VGG" && codmag != "SE3" && codmag != "TS3")
|
||||
{
|
||||
codmagdep.overwrite("07",3);
|
||||
if (codmag == "COM")
|
||||
return 26;
|
||||
if (codmag == "PD1")
|
||||
return 92;
|
||||
if (codmag == "PR1")
|
||||
return 91;
|
||||
error_box("Che cazzo di magazzino è %s?", (const char *)codmag);
|
||||
error_box("Che minchia di magazzino è %s?", (const char *)codmag);
|
||||
}
|
||||
}
|
||||
// }
|
||||
return -1;
|
||||
}
|
||||
|
||||
void coddep2location(const char * codmag, const char * coddep, TString & codlocation, int & nummag)
|
||||
{
|
||||
codlocation.cut(0);
|
||||
if (coddep[0]>='0' && coddep[0]<='9')
|
||||
codlocation = format("%02d", method2location(atoi(coddep))) ;
|
||||
else if (coddep == "C0")
|
||||
codlocation = "CICCA";
|
||||
else if (coddep == "C1")
|
||||
codlocation = "CMINT";
|
||||
else if (coddep == "X0")
|
||||
codlocation = "COMMEX";
|
||||
}
|
||||
|
||||
|
||||
const TString & converti_codval(const TString & codval)
|
||||
{
|
||||
static TString4 _codval;
|
||||
@ -922,11 +940,13 @@ void setformulavar()
|
||||
// se non e' un fantasma lo definisce come variante (distinta contenente una riga di tipo variabile)
|
||||
// se e' un finito, anche varianti di sconfezionamento
|
||||
if (ana.get(ANAMAG_GRMERC)[0]=='F')
|
||||
//varvar << "IF(_IMPIANTO==\"XT\",_LINEA,IF(_LINEA?=\"??9??\",_LINEA,_IMPIANTO))" ;
|
||||
//varvar << "IF(_IMPIANTO==\"XT\",_LINEA,IF(_LINEA?=\"??9??\",_LINEA,_IMPIANTO))" ;
|
||||
varvar << "IF((_IMPIANTO==\"XT\")||(_LINEA?=\"??9??\"),_LINEA,_IMPIANTO)" ;
|
||||
else
|
||||
varvar << "IF(_IMPIANTO==\"XT\",_LINEA,_IMPIANTO)" ;
|
||||
if (varvar != dist.get("PARAMETRI"))
|
||||
if (dist.get("PARAMETRI").blank() ||
|
||||
(varvar != dist.get("PARAMETRI") &&
|
||||
yesno_box("Setto la formula di %s\nattuale:%s;\nnuova :%s",(const char *)cod,(const char *)dist.get("PARAMETRI") ,(const char *)varvar)))
|
||||
{
|
||||
dist.put("PARAMETRI",varvar);
|
||||
dist.rewrite();
|
||||
@ -1032,13 +1052,48 @@ int inserisci_articolo(const char * codart, const char * um)
|
||||
art_ini.set("Action","INSERT");
|
||||
if (um && *um)
|
||||
art_ini.set("Mode","AUTO");
|
||||
else
|
||||
{
|
||||
// cerca di capire la mejo unit' di misura
|
||||
switch (*codart)
|
||||
{
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
um = "PZ";
|
||||
break;
|
||||
case '5':
|
||||
um = "CA";
|
||||
break;
|
||||
case 'U':
|
||||
switch (*(codart+1))
|
||||
{
|
||||
case '0':
|
||||
um = "KG";
|
||||
break;
|
||||
case 'K':
|
||||
if ((*(codart+2)) <= '9')
|
||||
um = "CA";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
art_ini.set("Firm","1");
|
||||
art_ini.set_paragraph("47");
|
||||
art_ini.set("CODART",codart);
|
||||
art_ini.set("DESCR",format("--- descrizione art. %s ---", codart));
|
||||
art_ini.set("DESCR",format("*--- descrizione art. %s", codart));
|
||||
art_ini.set("CODIVA","20");
|
||||
art_ini.set_paragraph("49,1");
|
||||
art_ini.set("UM",um);
|
||||
art_ini.set("FC","1.0");
|
||||
if (um && *um)
|
||||
{
|
||||
art_ini.set("UM",um);
|
||||
if (strcmp(um,"KG")==0 || strcmp(um,"GR")== 0)
|
||||
art_ini.set("UMP",um); // unita' di misura del peso
|
||||
art_ini.set("FC","1.0");
|
||||
}
|
||||
}
|
||||
TExternal_app *_gestart=NULL;
|
||||
if (_gestart==NULL)
|
||||
@ -1066,16 +1121,21 @@ void TImport_file::put(const char *field, const char * val)
|
||||
{
|
||||
_f->put(field,val);
|
||||
}
|
||||
|
||||
TString & TImport_file::get(const char *field)
|
||||
{
|
||||
_sbuffer = _f->get(field);
|
||||
return _sbuffer.trim();
|
||||
}
|
||||
}
|
||||
|
||||
TString & TImport_file::get_codice(const char *field)
|
||||
{
|
||||
_sbuffer = _f->get(field);
|
||||
_sbuffer.trim();
|
||||
|
||||
// special computing....
|
||||
if (_sbuffer == "U00254G")
|
||||
_sbuffer = "U00254";
|
||||
|
||||
return _sbuffer;
|
||||
}
|
||||
const real & TImport_file::get_real(const char *field)
|
||||
@ -1118,9 +1178,9 @@ long TImport_file::items()
|
||||
}
|
||||
|
||||
|
||||
int TImport_file::read()
|
||||
int TImport_file::read(int mode)
|
||||
{
|
||||
int err = _f->read(_isgteq);
|
||||
int err = _f->read(mode);
|
||||
return err;
|
||||
}
|
||||
int TImport_file::write()
|
||||
@ -1175,20 +1235,7 @@ TSupport_file::~TSupport_file()
|
||||
delete _cache;
|
||||
}
|
||||
|
||||
// **************************************
|
||||
/*
|
||||
TTimed_skipbox:: TTimed_skipbox(const char * message,int seconds,int x,int y)
|
||||
: TTimed_breakbox(message,seconds,x,y)
|
||||
{
|
||||
hide(DLG_OK);
|
||||
hide(DLG_CANCEL);
|
||||
add_button(DLG_CANCEL, 0, "~Ignora", -22, -1, 12, 2,"",0);
|
||||
add_button(DLG_OK, 0, "Im~porta", -12, -1, 12, 2,"",0);
|
||||
}
|
||||
|
||||
TTimed_skipbox::~TTimed_skipbox()
|
||||
{}
|
||||
*/
|
||||
bool number_box(const char * prompt, real & v)
|
||||
{
|
||||
TMask m("Input",1,60,10);
|
||||
@ -1205,8 +1252,51 @@ const char * external_refnum(TImport_file &import)
|
||||
{
|
||||
static TString _wrk;
|
||||
_wrk=import.get("TCOM");
|
||||
while (_wrk[0]<'0' || _wrk[0]>'9')
|
||||
while (_wrk[0] && (_wrk[0]<'0' || _wrk[0]>'9' || _wrk[0]=='/'|| _wrk[0]=='-'|| _wrk[0]=='.'))
|
||||
_wrk = _wrk.mid(1);
|
||||
int lenextdoc=_wrk.len();
|
||||
return lenextdoc > 6 ? _wrk.left(lenextdoc-6): _wrk;
|
||||
}
|
||||
if (lenextdoc > 6)
|
||||
_wrk.cut(lenextdoc-6);
|
||||
_wrk.trim();
|
||||
if (_wrk.len()>7)
|
||||
_wrk = _wrk.right(7);
|
||||
if (atol(_wrk)==0L)
|
||||
return "";
|
||||
return _wrk;
|
||||
}
|
||||
const char * external_refdate(TImport_file &import)
|
||||
{
|
||||
static TString _wrk;
|
||||
_wrk=import.get("TCOM");
|
||||
while (_wrk[0] && (_wrk[0]<'0' || _wrk[0]>'9' || _wrk[0]=='/'|| _wrk[0]=='-'|| _wrk[0]=='.'))
|
||||
_wrk = _wrk.mid(1);
|
||||
if (_wrk.len() < 6)
|
||||
_wrk.cut(0);
|
||||
else
|
||||
{
|
||||
_wrk = _wrk.right(6);
|
||||
if (atol(_wrk)==0L)
|
||||
return "";
|
||||
if (_wrk[5]=='9')
|
||||
_wrk.insert("19",4);
|
||||
else
|
||||
_wrk.insert("20",4);
|
||||
_wrk.insert("-",4);
|
||||
_wrk.insert("-",2);
|
||||
}
|
||||
return _wrk;
|
||||
}
|
||||
long trascode_for(const long oldcod)
|
||||
{
|
||||
static TExternisamfile *_trascofor=NULL;
|
||||
if (_trascofor==NULL)
|
||||
_trascofor=new TExternisamfile("TRS_FORN",TRUE, TRUE);
|
||||
_trascofor->put("OLDCODE", oldcod);
|
||||
if (_trascofor->read()==NOERR)
|
||||
{
|
||||
long newcod = _trascofor->get_long("newcode");
|
||||
return newcod > 0 ? newcod : oldcod;
|
||||
}
|
||||
return oldcod;
|
||||
}
|
||||
|
||||
|
||||
14
db/dbcv09.h
14
db/dbcv09.h
@ -41,7 +41,7 @@ public:
|
||||
bool eof();
|
||||
long items();
|
||||
int write();
|
||||
int read();
|
||||
int read(int mode);
|
||||
void zap(bool pack=FALSE);
|
||||
const char *name() {return _f->name();}
|
||||
TImport_file(const char *path, const char * name);
|
||||
@ -63,23 +63,16 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class TTimed_skipbox: public TTimed_breakbox
|
||||
{
|
||||
public:
|
||||
TTimed_skipbox(const char * message,int seconds,int x=40,int y=10);
|
||||
~TTimed_skipbox();
|
||||
};
|
||||
|
||||
|
||||
bool number_box(const char * prompt, real & v);
|
||||
const char * external_refnum(TImport_file &import);
|
||||
const char * external_refdate(TImport_file &import);
|
||||
|
||||
void delete_files(const char *wildcard);
|
||||
bool force_write(TLocalisamfile & f);
|
||||
// individua il metodo a partire dalla locazione di magazzino (codice dep)
|
||||
int location2method(long location) ;
|
||||
long method2location(int method) ;
|
||||
void coddep2location(const char * coddep, TString & codlocation) ;
|
||||
void coddep2location(const char * codmag, const char * coddep, TString & codlocation, int & nummag) ;
|
||||
// codifica il nome del terzista
|
||||
const char * descr_method(int method) ;
|
||||
// aggiunge le lavorazioni standard
|
||||
@ -111,4 +104,5 @@ int cod_mag2num_mag(TString & codmag);
|
||||
const TString & converti_codval(const TString & codval);
|
||||
void cambio_fisso(const TString & codval, real & val);
|
||||
int inserisci_articolo(const char * codart, const char * um);
|
||||
long trascode_for(const long oldcod);
|
||||
|
||||
|
||||
17
db/dbcvlib.h
Executable file
17
db/dbcvlib.h
Executable file
@ -0,0 +1,17 @@
|
||||
#ifndef __DBCVLIB_H
|
||||
#define __DBCVLIB_H
|
||||
|
||||
#ifndef __MGLIB_H
|
||||
#include "../mg/mglib.h"
|
||||
#endif
|
||||
|
||||
// libreria per i movimenti
|
||||
class TTimed_skipbox: public TTimed_breakbox
|
||||
{
|
||||
public:
|
||||
TTimed_skipbox(const char * message,int seconds,int x=40,int y=10);
|
||||
~TTimed_skipbox();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
80
db/dblib.cpp
80
db/dblib.cpp
@ -498,11 +498,73 @@ const char* TDistinta_tree::curr_um(TCodice_um& code) const
|
||||
return code;
|
||||
}
|
||||
|
||||
real TDistinta_tree::last_qta() const
|
||||
real TDistinta_tree::last_qta(bool vis_ghost) const
|
||||
{
|
||||
_path.get(-2, _tmp);
|
||||
real val; _tmp.get(5, val);
|
||||
return val;
|
||||
const int last = _path.items()-1;
|
||||
int from = last - 1;
|
||||
TCodice_articolo art;
|
||||
TCodice_um um;
|
||||
real val;
|
||||
real tot = 1.0;
|
||||
TQuantita qta;
|
||||
|
||||
if (!vis_ghost)
|
||||
{
|
||||
for (int i = from ; i >= 0; i--)
|
||||
{
|
||||
_path.get(i, _tmp);
|
||||
if (_tmp.get_char(6) != 'G')
|
||||
{
|
||||
from = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (from < 0)
|
||||
from = 0;
|
||||
|
||||
for (int i = 0; i <= last; i++)
|
||||
{
|
||||
_path.get(i, _tmp);
|
||||
_tmp.get(5, val);
|
||||
_tmp.get(0, art);
|
||||
_tmp.get(4, um);
|
||||
if (i > 0)
|
||||
{
|
||||
qta.set_val(val);
|
||||
qta.convert2umdist();
|
||||
val = qta.val();
|
||||
}
|
||||
qta.set(art, um, ZERO);
|
||||
int tprec = tot.precision();
|
||||
int vprec = val.precision();
|
||||
if (tprec + vprec > 15)
|
||||
{
|
||||
while (tprec + vprec > 16)
|
||||
{
|
||||
if (tprec > vprec)
|
||||
--tprec;
|
||||
else
|
||||
--vprec;
|
||||
}
|
||||
tot.round(tprec);
|
||||
val.round(vprec);
|
||||
}
|
||||
#ifdef DBG
|
||||
TString s(tot.string());
|
||||
TString s1(val.string());
|
||||
#endif
|
||||
if (i >= from)
|
||||
tot *= val;
|
||||
#ifdef DBG
|
||||
s = tot.string();
|
||||
#endif
|
||||
if (tot.is_zero())
|
||||
break;
|
||||
}
|
||||
if (tot.precision() > 15)
|
||||
tot.round(15);
|
||||
return tot;
|
||||
}
|
||||
|
||||
real TDistinta_tree::curr_qta() const
|
||||
@ -1535,7 +1597,7 @@ static bool explode_callback(TTree& node, void* jolly, word when)
|
||||
if (ep._filter.find(type) < 0)
|
||||
return FALSE;
|
||||
|
||||
TRiga_esplosione* er = new TRiga_esplosione(tree);
|
||||
TRiga_esplosione* er = new TRiga_esplosione(tree, ep._filter.find('G') >= 0);
|
||||
er->set_mat_base(is_leaf);
|
||||
ep._array->add(er);
|
||||
}
|
||||
@ -1691,13 +1753,13 @@ TLavorazione *TDistinta_tree::find_labor(TRiga_esplosione *l)
|
||||
// TRiga_esplosione
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
void TRiga_esplosione::init(const TDistinta_tree& tree)
|
||||
void TRiga_esplosione::init(const TDistinta_tree& tree, bool vis_ghost)
|
||||
{
|
||||
TCodice_articolo art; tree.curr_code(art); art.trim();
|
||||
TCodice_um um; tree.curr_um(um);
|
||||
real val = tree.curr_qta();
|
||||
set(art, um, val);
|
||||
_last_qta = tree.last_qta(); // Puo' sempre servire anche questa
|
||||
_last_qta = tree.last_qta(vis_ghost); // Puo' sempre servire anche questa
|
||||
tree.curr_giaclev(_giac);
|
||||
_tipo = tree.curr_type();
|
||||
_sort = tree.curr_sort();
|
||||
@ -1727,9 +1789,9 @@ const char * TRiga_esplosione::father(const char * types)
|
||||
return _tmp_path;
|
||||
}
|
||||
|
||||
TRiga_esplosione::TRiga_esplosione(const TDistinta_tree& tree)
|
||||
TRiga_esplosione::TRiga_esplosione(const TDistinta_tree& tree, bool vis_ghost)
|
||||
{
|
||||
init(tree);
|
||||
init(tree, vis_ghost);
|
||||
}
|
||||
|
||||
TRiga_esplosione::TRiga_esplosione(const TRiga_esplosione& re)
|
||||
|
||||
@ -342,7 +342,7 @@ public:
|
||||
int curr_comp(TString& code) const;
|
||||
long curr_sort() const;
|
||||
const char* curr_um(TCodice_um& code) const;
|
||||
real last_qta() const;
|
||||
real last_qta(bool vis_ghost = FALSE) const;
|
||||
real curr_qta() const;
|
||||
int curr_depth() const { return path_depth(_path);}
|
||||
char curr_type() const { return path_type(_path);}
|
||||
@ -391,7 +391,7 @@ class TRiga_esplosione : public TQuantita
|
||||
|
||||
protected:
|
||||
virtual TObject* dup() const { return new TRiga_esplosione(*this); }
|
||||
void init(const TDistinta_tree& tree);
|
||||
void init(const TDistinta_tree& tree, bool vis_ghost = FALSE);
|
||||
|
||||
public:
|
||||
const TToken_string& path() const { return _path; }
|
||||
@ -410,7 +410,7 @@ public:
|
||||
const real& last_qta() const { return _last_qta; }
|
||||
|
||||
TRiga_esplosione();
|
||||
TRiga_esplosione(const TDistinta_tree& tree);
|
||||
TRiga_esplosione(const TDistinta_tree& tree, bool vis_ghost = FALSE);
|
||||
TRiga_esplosione(const TRiga_esplosione& re);
|
||||
virtual ~TRiga_esplosione() { }
|
||||
};
|
||||
|
||||
12
ef/dse.frm
12
ef/dse.frm
@ -203,6 +203,7 @@ BEGIN
|
||||
KEY "Codice valuta"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 31->CODVAL
|
||||
MESSAGE COPY,FL->4
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
@ -231,11 +232,18 @@ BEGIN
|
||||
PROMPT 5 2 "N. DOCUMENTI "
|
||||
END
|
||||
|
||||
NUMERO 3 18
|
||||
STRINGA 4 3
|
||||
BEGIN
|
||||
KEY "Codice valuta"
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
VALUTA 3 18
|
||||
BEGIN
|
||||
KEY "Totale"
|
||||
PROMPT 115 2 "TOTALE "
|
||||
PICTURE "###.###.###.###"
|
||||
DRIVENBY 4
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
@ -1,6 +1,2 @@
|
||||
#include <default.url>
|
||||
|
||||
/* ef0 -0 */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
#include <mainmenu.url>
|
||||
|
||||
@ -3,18 +3,19 @@
|
||||
|
||||
PAGE "Righe Effetto" -1 -1 76 16
|
||||
|
||||
NUMBER F_IMPEFF 16 2
|
||||
CURRENCY F_IMPEFF 16
|
||||
BEGIN
|
||||
PROMPT 2 1 "Importo effetto "
|
||||
PICTURE ".2"
|
||||
// PICTURE ".2"
|
||||
// PICTURE "###.###.###,@@"
|
||||
// NUM_EXPR #F_IMPFATT>=#F_IMPEFF
|
||||
// WARNING "L'importo dell'effetto non puo' superare l'importo della fattura"
|
||||
END
|
||||
|
||||
NUMBER F_IMPEFFVAL 15 3
|
||||
CURRENCY F_IMPEFFVAL 15
|
||||
BEGIN
|
||||
PROMPT 2 2 "Imp.effetto val. "
|
||||
DRIVENBY -F_CODVAL
|
||||
PICTURE ".3"
|
||||
// PICTURE "###.###.###,@@@"
|
||||
// NUM_EXPR #F_IMPFATTVAL>=#F_IMPEFFVAL
|
||||
@ -75,16 +76,17 @@ BEGIN
|
||||
PROMPT 2 7 "Data fattura "
|
||||
END
|
||||
|
||||
NUMBER F_IMPFATT 20 2
|
||||
CURRENCY F_IMPFATT 20
|
||||
BEGIN
|
||||
PROMPT 2 8 "Importo fattura "
|
||||
PICTURE "###.###.###.###,@@"
|
||||
// PICTURE "###.###.###.###,@@"
|
||||
END
|
||||
|
||||
NUMBER F_IMPFATTVAL 20 3
|
||||
CURRENCY F_IMPFATTVAL 20
|
||||
BEGIN
|
||||
PROMPT 2 9 "Imp. fatt. val "
|
||||
PICTURE "###.###.###.###,@@@"
|
||||
DRIVENBY -F_CODVAL
|
||||
// PICTURE "###.###.###.###,@@@"
|
||||
END
|
||||
|
||||
NUMBER F_ANNO 4
|
||||
|
||||
@ -229,45 +229,50 @@ bool TEffetto::fatt(long num)
|
||||
// restituisce i dati relativi alle fatture a cui si riferisce l'effetto
|
||||
// costruendo una TToken_string del tipo
|
||||
// "num_fatt0|data_fatt0|imp_fatt0|num_fatt1|data_fatt1|imp_fatt1|..."
|
||||
TToken_string* TEffetto::dati_fatt(long num, const bool valuta)
|
||||
TToken_string& TEffetto::dati_fatt(long num, const bool valuta, TToken_string& dati)
|
||||
{
|
||||
TToken_string* dati= new TToken_string;
|
||||
dati->cut(0);
|
||||
|
||||
TLocalisamfile righe_eff(LF_REFFETTI);
|
||||
righe_eff.put(REFF_NPROGTR, num);
|
||||
righe_eff.read();
|
||||
int items = rows_r(); // prende il numero delle righe dell'effetto
|
||||
for (int i = 1; i <= items; i++)// le legge tutte
|
||||
{
|
||||
dati->add(righe_eff.get(REFF_NFATT));//prende il numero
|
||||
dati->add(righe_eff.get(REFF_DATAFATT));//prende la data
|
||||
dati->add(righe_eff.get(valuta ? REFF_IMPFATTVAL : REFF_IMPFATT));//prende l' importo
|
||||
righe_eff.next();// passa alla riga successiva
|
||||
}
|
||||
return dati;
|
||||
dati.cut(0);
|
||||
|
||||
TLocalisamfile righe_eff(LF_REFFETTI);
|
||||
righe_eff.put(REFF_NPROGTR, num);
|
||||
righe_eff.read();
|
||||
const int items = rows_r(); // prende il numero delle righe dell'effetto
|
||||
for (int i = 1; i <= items; i++) // le legge tutte
|
||||
{
|
||||
dati.add(righe_eff.get(REFF_NFATT));//prende il numero
|
||||
dati.add(righe_eff.get(REFF_DATAFATT));//prende la data
|
||||
dati.add(righe_eff.get(valuta ? REFF_IMPFATTVAL : REFF_IMPFATT));//prende l'importo
|
||||
righe_eff.next();// passa alla riga successiva
|
||||
}
|
||||
return dati;
|
||||
}
|
||||
|
||||
// restituisce i dati relativi alle fatture a cui si riferisce l'effetto
|
||||
// costruendo una TToken_string del tipo
|
||||
// "codnum_fatt0|num_fatt0|anno_fatt0|codnum_fatt1|num_fatt1|anno_fatt1|..."
|
||||
TToken_string* TEffetto::altridati_fatt(long num)
|
||||
TToken_string& TEffetto::altridati_fatt(long num, TToken_string& dati)
|
||||
{
|
||||
TToken_string* dati= new TToken_string;
|
||||
dati->cut(0);
|
||||
|
||||
TLocalisamfile righe_eff(LF_REFFETTI);
|
||||
righe_eff.put(REFF_NPROGTR, num);
|
||||
righe_eff.read();
|
||||
int items = rows_r(); // prende il numero delle righe dell'effetto
|
||||
for (int i = 1; i <= items; i++)// le legge tutte
|
||||
{
|
||||
dati->add(righe_eff.get(REFF_CODNUM));//prende il codice numerazione
|
||||
dati->add(righe_eff.get(REFF_NFATT));//prende il numero
|
||||
dati->add(righe_eff.get(REFF_ANNODOC));//prende il numero
|
||||
righe_eff.next();// passa alla riga successiva
|
||||
}
|
||||
return dati;
|
||||
dati.cut(0);
|
||||
|
||||
TLocalisamfile righe_eff(LF_REFFETTI);
|
||||
righe_eff.put(REFF_NPROGTR, num);
|
||||
righe_eff.read();
|
||||
const int items = rows_r(); // prende il numero delle righe dell'effetto
|
||||
TString16 str;
|
||||
for (int i = 1; i <= items; i++)// le legge tutte
|
||||
{
|
||||
str = righe_eff.get(REFF_CODNUM); str.trim();
|
||||
dati.add(str);//prende il codice numerazione
|
||||
|
||||
str = righe_eff.get(REFF_NFATT); str.trim();
|
||||
dati.add(str);//prende il numero
|
||||
|
||||
str = righe_eff.get(REFF_ANNODOC); str.trim();
|
||||
dati.add(str);//prende il numero
|
||||
|
||||
righe_eff.next();// passa alla riga successiva
|
||||
}
|
||||
return dati;
|
||||
}
|
||||
|
||||
const bool TEffetto::in_valuta() const
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
#ifndef __RECARRAY_H
|
||||
#include <recarray.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <effetti.h>
|
||||
#include <reffetti.h>
|
||||
@ -88,9 +88,9 @@ public:
|
||||
// restituisce true se l'effetto si riferisce ad una sola fattura
|
||||
bool fatt(long num);
|
||||
// restituisce i dati relativi alle fatture a cui si riferisce l'effetto
|
||||
TToken_string* dati_fatt(long num, const bool valuta = FALSE);
|
||||
TToken_string& dati_fatt(long num, const bool valuta, TToken_string& dati);
|
||||
// restituisce i dati codnum, ndoc, anno relativi alle fatture a cui si riferisce l'effetto
|
||||
TToken_string* altridati_fatt(long num);
|
||||
TToken_string& altridati_fatt(long num, TToken_string& dati);
|
||||
// costruttore di default
|
||||
TEffetto();
|
||||
// costuisce l'effetto con il record passato
|
||||
|
||||
@ -229,8 +229,12 @@ int TVariazione_distinte::read(TMask& m)
|
||||
codice << eff.get_tipo(); codice << '|' << eff.get(EFF_CODCF);
|
||||
riga.add(cache().get(LF_CLIFO, codice, CLI_RAGSOC));
|
||||
|
||||
codice = eff.get(EFF_CODABIP); codice << eff.get(EFF_CODCABP);
|
||||
riga.add(cache().get("%BAN", codice, "S0"));
|
||||
codice = eff.get(EFF_CODABI);
|
||||
TString desc(cache().get("%BAN", codice, "S0"));
|
||||
codice << eff.get(EFF_CODCAB);
|
||||
desc << " " << cache().get("%BAN", codice, "S0");
|
||||
desc.cut(50);
|
||||
riga.add(desc);
|
||||
|
||||
if (eff.fatt(numero))// se l'effetto contiene solo una fattura
|
||||
{ // metto i riferimenti al documento ed al numero di rata
|
||||
@ -251,16 +255,16 @@ int TVariazione_distinte::read(TMask& m)
|
||||
//gestisco il controllo sulla presenza o meno di una valuta
|
||||
const TString16 codval(eff.get(EFF_CODVAL));
|
||||
if (i == 0)
|
||||
{
|
||||
const bool valuta = codval.not_empty() && codval != TCurrency::get_firm_val();
|
||||
{
|
||||
const bool valuta = ::is_true_value(codval);
|
||||
m.set(F_CODVAL, codval);
|
||||
m.enable(F_CODVAL, valuta);
|
||||
}
|
||||
riga.add(codval);
|
||||
TCurrency soldi(eff.get_real(EFF_IMPORTO));
|
||||
const real soldi = eff.get_real(EFF_IMPORTO);
|
||||
riga.add(soldi.string());
|
||||
TCurrency soldival(eff.get_real(EFF_IMPORTOVAL), codval);
|
||||
if (!soldival.get_num().is_zero())
|
||||
const real soldival = eff.get_real(EFF_IMPORTOVAL);
|
||||
if (!soldival.is_zero())
|
||||
riga.add(soldival.string());
|
||||
|
||||
shrighe.row(i) = riga;
|
||||
@ -458,7 +462,6 @@ void TVariazione_distinte::carica_riba(int tipopag, const bool reset)
|
||||
|
||||
TString16 codval = app()._msk->get(F_CODVAL);
|
||||
TString16 codtab;
|
||||
if (codval.empty()) codval = "LIT";
|
||||
|
||||
int err, i = 0;
|
||||
err = eff.read(f, tipodist, ndist, nrigadist);
|
||||
@ -476,10 +479,8 @@ void TVariazione_distinte::carica_riba(int tipopag, const bool reset)
|
||||
const char tipo = eff.get_tipo();
|
||||
|
||||
TString16 valuta = eff.get(EFF_CODVAL);
|
||||
if (valuta.empty())
|
||||
valuta = "LIT";
|
||||
|
||||
const bool valuta_ok = valuta == codval;
|
||||
const bool valuta_ok = ::same_values(valuta, codval);
|
||||
const long numero = eff.get_long(EFF_NPROGTR);
|
||||
|
||||
if (to_select && valuta_ok && !effetto_aggiunto(numero) && tipo == tipod)
|
||||
@ -493,8 +494,12 @@ void TVariazione_distinte::carica_riba(int tipopag, const bool reset)
|
||||
codice << tipo << '|' << eff.get(EFF_CODCF);
|
||||
riga.add(cache().get(LF_CLIFO, codice, CLI_RAGSOC));
|
||||
|
||||
codice = eff.get(EFF_CODABIP); codice << eff.get(EFF_CODCABP);
|
||||
riga.add(cache().get("%BAN", codice, "S0"));
|
||||
codice = eff.get(EFF_CODABI);
|
||||
TString desc(cache().get("%BAN", codice, "S0"));
|
||||
codice << eff.get(EFF_CODCAB);
|
||||
desc << " " << cache().get("%BAN", codice, "S0");
|
||||
desc.cut(50);
|
||||
riga.add(desc);
|
||||
|
||||
if (eff.fatt(numero))// se l'effetto contiene solo una fattura
|
||||
{ // metto i riferimenti al documento ed al numero di rata
|
||||
@ -514,11 +519,11 @@ void TVariazione_distinte::carica_riba(int tipopag, const bool reset)
|
||||
}
|
||||
riga.add(valuta);
|
||||
|
||||
TCurrency soldi(eff.get_real(EFF_IMPORTO), "_FIRM");
|
||||
const real soldi = eff.get_real(EFF_IMPORTO);
|
||||
riga.add(soldi.string());
|
||||
|
||||
TCurrency soldival(eff.get_real(EFF_IMPORTOVAL), codval);
|
||||
if (!soldival.get_num().is_zero())
|
||||
const real soldival = eff.get_real(EFF_IMPORTOVAL);
|
||||
if (!soldival.is_zero())
|
||||
riga.add(soldival.string());
|
||||
|
||||
sf.row(i) = riga;
|
||||
@ -582,9 +587,7 @@ bool TVariazione_distinte::imp_aut_handler(TMask_field& f, KEY k)
|
||||
real res = m2.get_real(F_TOTIMPDIST);
|
||||
if (res > ZERO)
|
||||
{ // se i due importi sono diversi da zero
|
||||
TString val = m->get(F_CODVAL);
|
||||
if (val == "LIT")
|
||||
val.cut(0);
|
||||
TString16 val = m->get(F_CODVAL);
|
||||
int items = sf.items();
|
||||
// cerca se esiste un effetto con importo uguale a quello
|
||||
// da caricare
|
||||
@ -592,13 +595,12 @@ bool TVariazione_distinte::imp_aut_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TToken_string& row = sf.row(i);
|
||||
TString16 codval = row.get(sf.cid2index(F_VALUTA));
|
||||
codval.trim();
|
||||
// se la valuta non appare o è lire faccio in modo che vengano
|
||||
// presi gli effetti con valuta inesistente
|
||||
if (codval == " " || codval == "LIT")
|
||||
codval.cut(0);
|
||||
const bool valuta = codval.not_empty();
|
||||
const real imp(real::ita2eng(row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO))));
|
||||
if (imp == res && codval == val)
|
||||
const bool valuta = ::is_true_value(codval);
|
||||
const real imp(row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO)));
|
||||
if (imp == res && ::same_values(codval, val))
|
||||
{
|
||||
row.add('X', 0);
|
||||
res = ZERO;
|
||||
@ -610,15 +612,14 @@ bool TVariazione_distinte::imp_aut_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TToken_string& row = sf.row(i);
|
||||
TString16 codval = row.get(sf.cid2index(F_VALUTA));
|
||||
if (codval == " " || codval == "LIT")
|
||||
codval.cut(0);
|
||||
const bool valuta = codval.not_empty();
|
||||
const real imp(real::ita2eng(row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO))));
|
||||
codval.trim();
|
||||
const bool valuta = ::is_true_value(codval) ;
|
||||
const real imp(row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO)));
|
||||
// se l'importo, della riga corrente dello sheet, è minore
|
||||
// dell 'importo che si deve caricare e se lo rimane anche
|
||||
// sommato all'importo già selezionato, si procede a rendere
|
||||
// la riga selezionata per il caricamento
|
||||
if (codval == val && imp <= res)
|
||||
if (::same_values(codval, val) && imp <= res)
|
||||
{
|
||||
row.add('X',0);
|
||||
res -= imp;
|
||||
@ -805,7 +806,8 @@ void TVariazione_distinte::calcola_totale()
|
||||
const int items = sf.items();
|
||||
real impdist;
|
||||
const TString16 codval = m->get(F_CODVAL);
|
||||
const bool valuta = codval.not_empty() && codval != "LIT";
|
||||
const bool valuta = ::is_true_value(codval);
|
||||
|
||||
for (int i = 0; i < items; i++)
|
||||
{
|
||||
TToken_string& row = sf.row(i);
|
||||
@ -814,7 +816,7 @@ void TVariazione_distinte::calcola_totale()
|
||||
|
||||
if (*row.get(0) != 'X') // valido (not to delete)
|
||||
{
|
||||
const real imp(row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO)));
|
||||
const real imp = row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO));
|
||||
impdist += imp;
|
||||
}
|
||||
}
|
||||
@ -832,7 +834,8 @@ void TVariazione_distinte::calcola()
|
||||
real impsel;
|
||||
const real imp_pres = m->get_real(F_TOTIMP);
|
||||
const TString16 codval = m->get(F_CODVAL);
|
||||
const bool valuta = codval.not_empty() && codval != "LIT";
|
||||
const bool valuta = ::is_true_value(codval);
|
||||
|
||||
for (int i = 0; i < items; i++)
|
||||
{
|
||||
TToken_string& row = sf.row(i);
|
||||
@ -840,7 +843,7 @@ void TVariazione_distinte::calcola()
|
||||
// selezionato
|
||||
if (*row.get(0) == 'X')
|
||||
{
|
||||
const real imp(real::ita2eng(row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO))));
|
||||
const real imp = row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO));
|
||||
impsel += imp;
|
||||
}
|
||||
}
|
||||
@ -870,6 +873,8 @@ void TVariazione_distinte::aggiungi()
|
||||
app().end_wait();
|
||||
m2->reset(F_TOTIMPDIST);
|
||||
m2->reset(F_IMPSEL);
|
||||
const TString16 codval = m->get(F_CODVAL);
|
||||
m2->set(F_CODVALS, codval);
|
||||
m2->run();
|
||||
calcola_totale();
|
||||
}
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#define F_SHEET 204
|
||||
#define F_TOTIMPDIST 205
|
||||
#define F_IMPSEL 206
|
||||
#define F_CODVALS 207
|
||||
|
||||
// Identificatori campi per lo spreadsheet Righe Distinta (ef0300b.uml ed ef0300d.uml)
|
||||
#define F_CHECK 101
|
||||
|
||||
@ -90,7 +90,7 @@ BEGIN
|
||||
OUTPUT F_CODABIP CODTAB[1,5]
|
||||
OUTPUT F_CODCABP CODTAB[6,10]
|
||||
OUTPUT F_DENBANP 100@->S0
|
||||
CHECKTYPE REQUIRED
|
||||
CHECKTYPE SEARCH
|
||||
END
|
||||
|
||||
NUMBER F_CODCABP 5 0
|
||||
@ -99,12 +99,14 @@ BEGIN
|
||||
FIELD LF_EFFETTI->CODCABP
|
||||
FLAGS "RZ"
|
||||
COPY ALL F_CODABIP
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_DENBANP 50
|
||||
BEGIN
|
||||
PROMPT 2 5 "Banca di Presentazione "
|
||||
USE %BAN KEY 2
|
||||
USE %BAN KEY 2 SELECT 100@->CODTAB!=""
|
||||
JOIN BNP ALIAS 100 INTO CODTAB==CODTAB
|
||||
INPUT S0 F_DENBANP
|
||||
DISPLAY "Denominazione@50" S0
|
||||
DISPLAY "Codice ABI" CODTAB[1,5]
|
||||
@ -112,7 +114,7 @@ BEGIN
|
||||
OUTPUT F_CODABIP CODTAB[1,5]
|
||||
OUTPUT F_CODCABP CODTAB[6,10]
|
||||
OUTPUT F_DENBANP S0
|
||||
CHECKTYPE REQUIRED
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
LIST F_TIPOPAG 24
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// DEFINIZIONE MASCHERE, PER RIGHE DISTINTA, PER LA GESTIONE DISTINTE
|
||||
#include "ef0300.h"
|
||||
|
||||
PAGE "Righe Distinta" -1 -1 63 14
|
||||
PAGE "Righe Distinta" -1 -1 73 14
|
||||
|
||||
BOOLEAN F_CHECK
|
||||
BEGIN
|
||||
@ -22,13 +22,13 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CLIENTE 50 40
|
||||
STRING F_CLIENTE 50
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cliente "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_BANCA 50 40
|
||||
STRING F_BANCA 50
|
||||
BEGIN
|
||||
PROMPT 2 5 "Banca d'appoggio "
|
||||
FLAGS "D"
|
||||
|
||||
@ -42,16 +42,22 @@ BEGIN
|
||||
ITEM "Importo Val."
|
||||
END
|
||||
|
||||
NUMBER F_TOTIMPDIST 18 2
|
||||
STRING F_CODVALS 3
|
||||
BEGIN
|
||||
PROMPT 2 17 "Importo "
|
||||
PICTURE "###.###.###.###,@@"
|
||||
PROMPT 2 17 ""
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER F_IMPSEL 18 2
|
||||
CURRENCY F_TOTIMPDIST 18
|
||||
BEGIN
|
||||
PROMPT 2 17 "Importo "
|
||||
DRIVENBY F_CODVALS
|
||||
END
|
||||
|
||||
CURRENCY F_IMPSEL 18
|
||||
BEGIN
|
||||
PROMPT 37 17 "Importo Selezionato "
|
||||
PICTURE "###.###.###.###,@@"
|
||||
DRIVENBY F_CODVALS
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// DEFINIZIONE MASCHERE, PER RIGHE DISTINTA, PER LA GESTIONE DISTINTE
|
||||
#include "ef0300.h"
|
||||
|
||||
PAGE "Righe Distinta" -1 -1 63 14
|
||||
PAGE "Righe Distinta" -1 -1 73 14
|
||||
|
||||
BOOLEAN F_CHECK
|
||||
BEGIN
|
||||
@ -22,13 +22,13 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CLIENTE 50 40
|
||||
STRING F_CLIENTE 50
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cliente "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_BANCA 50 40
|
||||
STRING F_BANCA 50
|
||||
BEGIN
|
||||
PROMPT 2 5 "Banca d'appoggio "
|
||||
FLAGS "D"
|
||||
@ -62,18 +62,19 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_IMPORTO 18
|
||||
CURRENCY F_IMPORTO 18
|
||||
BEGIN
|
||||
PROMPT 2 10 "Importo "
|
||||
FIELD LF_EFFETTI->IMPORTO
|
||||
FLAGS "DR"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_IMPORTOVAL 18
|
||||
CURRENCY F_IMPORTOVAL 18
|
||||
BEGIN
|
||||
PROMPT 2 11 "Importo Val. "
|
||||
FIELD LF_EFFETTI->IMPORTOVAL
|
||||
FLAGS "DR"
|
||||
FLAGS "D"
|
||||
DRIVENBY F_VALUTA
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
|
||||
101
ef/ef0500.cpp
101
ef/ef0500.cpp
@ -65,7 +65,7 @@ protected:
|
||||
static bool annulla_handler(TMask_field& f, KEY k);
|
||||
public:
|
||||
|
||||
int base_no() { return _base_page_no; }
|
||||
int base_no() const { return _base_page_no; }
|
||||
const TMask& msk() const { return *_msk; }
|
||||
const TRelation& firm_rel() const { return *_firmrel; }
|
||||
|
||||
@ -156,6 +156,7 @@ bool TEmissione::create()
|
||||
_rel->add("%BAN", "CODTAB=CODABI+CODCAB", 1, 0, 402);
|
||||
_rel->add(LF_COMUNI, "STATO=STATOCF|COM=COMCF",1,LF_CLIFO);
|
||||
_rel->add(LF_COMUNI, "STATO=STATO|COM=COM", 1, LF_INDSP, 213);
|
||||
_rel->add("BNP", "CODTAB=CODABIP+CODCABP", 1, 0, 403);
|
||||
_cur = NULL;
|
||||
_msk->set(F_NOMEFILE,RIBAFILENAME);
|
||||
// _trasfile = new TRiba_file(RIBAFILENAME, "riba.ini");
|
||||
@ -327,6 +328,16 @@ void TEmissione::footer_ef()
|
||||
TRecord_text rec;
|
||||
*_cur = 0;
|
||||
rec.set_type("EF");
|
||||
|
||||
if (!_trasfile->tracciato_setif())
|
||||
{
|
||||
TTracciato_record * trec = _trasfile->t_rec("EF");
|
||||
const int p1 = trec->get(7).position();
|
||||
const int p2 = trec->get(8).position();
|
||||
|
||||
trec->get(7).set_position(p2);
|
||||
trec->get(8).set_position(p1);
|
||||
}
|
||||
_trasfile->autoload(rec, *_cur);
|
||||
_trasfile->write(rec);
|
||||
_trasfile->write_file()->seekp(0, ios::end);
|
||||
@ -640,7 +651,7 @@ bool TRiba_form::validate(TForm_item &cf, TToken_string &s)
|
||||
long num = effetto.numero();
|
||||
const bool in_valuta = effetto.in_valuta();
|
||||
bool condition = (effetto.fatt(num));//TRUE se effetto non raggruppato
|
||||
TToken_string* dati = effetto.dati_fatt(num, in_valuta);
|
||||
TToken_string dati; effetto.dati_fatt(num, in_valuta, dati);
|
||||
TString in(s.get());
|
||||
if (in[0]=='!')
|
||||
{
|
||||
@ -656,13 +667,13 @@ bool TRiba_form::validate(TForm_item &cf, TToken_string &s)
|
||||
// "!DATIFATT" stampa numero e data fattura delle fatture a cui si riferisce l'effetto
|
||||
if (in == "DATIFATT")
|
||||
{
|
||||
int elem = dati->items();
|
||||
int elem = dati.items();
|
||||
TString descfatt;
|
||||
for (int i = 0; i < elem; i+=3)
|
||||
{
|
||||
descfatt << dati->get(i);
|
||||
descfatt << dati.get(i);
|
||||
descfatt << ' ';
|
||||
descfatt << dati->get(i+1);
|
||||
descfatt << dati.get(i+1);
|
||||
descfatt << '\n';
|
||||
}
|
||||
cf.set(descfatt);
|
||||
@ -672,7 +683,7 @@ bool TRiba_form::validate(TForm_item &cf, TToken_string &s)
|
||||
{
|
||||
if (condition)
|
||||
{
|
||||
real importo(dati->get(2));
|
||||
real importo(dati.get(2));
|
||||
cf.set(importo.string());
|
||||
}
|
||||
}
|
||||
@ -862,8 +873,8 @@ bool TDistinta_form::validate(TForm_item &cf, TToken_string &s)
|
||||
// "!DATI" numero e data fattura
|
||||
TEffetto effetto(cursor()->file().curr()); //= eff.curr();
|
||||
long num = effetto.numero();
|
||||
TToken_string* dati = effetto.dati_fatt(num);
|
||||
const int elem = dati->items();
|
||||
TToken_string dati; effetto.dati_fatt(num, FALSE, dati);
|
||||
const int elem = dati.items();
|
||||
TString80 in(s.get()); // prende il primo parametro, il codice del messaggio
|
||||
if (in[0]=='!')
|
||||
{
|
||||
@ -874,9 +885,9 @@ bool TDistinta_form::validate(TForm_item &cf, TToken_string &s)
|
||||
TString descfatt;
|
||||
for (int i = 0; i < elem; i+=3)
|
||||
{
|
||||
descfatt << dati->get(i);
|
||||
descfatt << dati.get(i);
|
||||
descfatt << ' ';
|
||||
descfatt << dati->get(i+1);
|
||||
descfatt << dati.get(i+1);
|
||||
descfatt << '\n';
|
||||
}
|
||||
cf.set(descfatt);
|
||||
@ -1082,49 +1093,51 @@ void TRiba_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TStr
|
||||
TString descfatt;
|
||||
if (tracciato_setif())
|
||||
{
|
||||
TToken_string* dati = effetto.dati_fatt(num);
|
||||
int elem = dati->items();
|
||||
for (int i = 0; i < elem; i+=3)
|
||||
{
|
||||
descfatt << dati->get(i);
|
||||
descfatt << " ";
|
||||
descfatt << dati->get(i+1);
|
||||
descfatt << " ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TToken_string* dati = effetto.altridati_fatt(num);
|
||||
int elem = dati->items();
|
||||
for (int i = 0; i < elem; i+=3)
|
||||
{
|
||||
if (i!=0)
|
||||
descfatt << "/";
|
||||
descfatt << dati->get(i); // codnum
|
||||
descfatt << " ";
|
||||
descfatt << dati->get(i+1); // numdoc
|
||||
descfatt << " ";
|
||||
TString16 anno = dati->get(i+2); // anno (2 cifre)
|
||||
anno.trim();
|
||||
if (anno.len() > 2)
|
||||
descfatt << anno.right(2);
|
||||
else
|
||||
descfatt << anno.rpad(2);
|
||||
}
|
||||
}
|
||||
int l = descfatt.len();
|
||||
TToken_string dati; effetto.dati_fatt(num, FALSE, dati);
|
||||
int elem = dati.items();
|
||||
for (int i = 0; i < elem; i+=3)
|
||||
{
|
||||
descfatt << dati.get(i);
|
||||
descfatt << " ";
|
||||
descfatt << dati.get(i+1);
|
||||
descfatt << " ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TToken_string dati; effetto.altridati_fatt(num, dati);
|
||||
int elem = dati.items();
|
||||
TString16 str;
|
||||
for (int i = 0; i < elem; i+=3)
|
||||
{
|
||||
if (i!=0)
|
||||
descfatt << "/";
|
||||
str = dati.get(i); str.trim(); // codnum
|
||||
if (str.not_empty()) descfatt << str << ' ';
|
||||
|
||||
str = dati.get(); str.trim(); // numdoc
|
||||
if (str.not_empty()) descfatt << str;
|
||||
|
||||
str = dati.get(i); // anno (2 cifre)
|
||||
str.trim();
|
||||
if (str.len() >= 2)
|
||||
descfatt << ' ' << str.right(2);
|
||||
}
|
||||
}
|
||||
const int l = descfatt.len();
|
||||
TString in(s.get());
|
||||
if (in[0]=='!')
|
||||
{
|
||||
in.ltrim(1);
|
||||
if (in == "1")
|
||||
{
|
||||
valore = descfatt.left(40);
|
||||
valore.trim();
|
||||
valore = descfatt.left(40);
|
||||
valore.trim();
|
||||
}
|
||||
if (in == "2")
|
||||
{
|
||||
valore = descfatt.mid(40, l);
|
||||
valore = descfatt.mid(40, l);
|
||||
valore.trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -560,17 +560,17 @@ bool TPrint_effetti_app::preprocess_page(int file, int counter)
|
||||
// prendo dall'effetto tutti i dati relativi alle fatture, che
|
||||
// vengono inseriti nella Token_String nell'ordine
|
||||
// NUMERO FATTURA|DATA FATTURA|IMPORTO FATTURA
|
||||
TToken_string* dati = effetto.dati_fatt(num);
|
||||
int elem = dati->items();
|
||||
TToken_string dati; effetto.dati_fatt(num, FALSE, dati);
|
||||
int elem = dati.items();
|
||||
if (elem > 3)
|
||||
{
|
||||
TString descfatt;
|
||||
int j=3;
|
||||
for (int i = 3; i < elem; i+=3)
|
||||
{
|
||||
descfatt = dati->get(i+1);// prendo la data della fattura
|
||||
descfatt = dati.get(i+1);// prendo la data della fattura
|
||||
descfatt << " ";
|
||||
descfatt << dati->get(i);// prendo il numero della fattura
|
||||
descfatt << dati.get(i);// prendo il numero della fattura
|
||||
_pr.reset();
|
||||
if (_pr_type == st_scadenza || _pr_type == st_cliente )
|
||||
_pr.put(descfatt, 111);
|
||||
|
||||
10
m770/770.url
10
m770/770.url
@ -1,12 +1,4 @@
|
||||
#include <default.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
|
||||
@ -782,6 +782,8 @@ bool TSchedaPercipienti::check_competenza(TMask_field& f, KEY k)
|
||||
//
|
||||
bool TSchedaPercipienti::check_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
const int fdec = TCurrency::get_firm_dec();
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
@ -831,8 +833,8 @@ bool TSchedaPercipienti::check_handler(TMask_field& f, KEY k)
|
||||
app()._tot_vers += versato;
|
||||
}
|
||||
|
||||
app()._tot_rit.round(0);
|
||||
app()._tot_vers.round(0);
|
||||
app()._tot_rit.round(fdec);
|
||||
app()._tot_vers.round(fdec);
|
||||
|
||||
// memorizzo i totali ritenute pagate/versate
|
||||
m.set(F_RITOPE, app()._tot_rit);
|
||||
@ -1778,19 +1780,20 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
|
||||
const real h_PercAssImpInps,
|
||||
const real h_PercCommitInps)
|
||||
{
|
||||
const int fdec = TCurrency::get_firm_dec();
|
||||
|
||||
// azzera struttura di valori calcolati
|
||||
clear_struct(c);
|
||||
|
||||
// calcolo CPA
|
||||
c.impcpa = (s.compenso * h_PercCassaPrev) / (100.00 + h_PercCassaPrev);
|
||||
c.impcpa.round();
|
||||
c.impcpa.round(fdec);
|
||||
if (s.impcpa == ZERO || force)
|
||||
s.impcpa = c.impcpa;
|
||||
|
||||
// calcolo imponibile
|
||||
c.imponibile = ((s.compenso - s.impcpa) * h_PercAssImp) / 100.00;
|
||||
c.imponibile.round();
|
||||
c.imponibile.round(fdec);
|
||||
if (s.imponibile == ZERO || force)
|
||||
s.imponibile = c.imponibile;
|
||||
|
||||
@ -1800,7 +1803,7 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
|
||||
|
||||
// calcolo ritenuta lorda
|
||||
c.ritlorda = (s.imponibile * s.perc) / 100.00;
|
||||
c.ritlorda.round();
|
||||
c.ritlorda.round(fdec);
|
||||
s.ritlorda = c.ritlorda;
|
||||
|
||||
// calcolo totale detrazioni
|
||||
@ -1820,7 +1823,7 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
|
||||
|
||||
// calcolo contributo Inps complessivo
|
||||
c.ctssncomp = (((s.compenso * s.alqimp10) / 100.00) * h_PercInps) / 100.00;
|
||||
c.ctssncomp.round();
|
||||
c.ctssncomp.round(fdec);
|
||||
if (s.ctssncomp == ZERO || force)
|
||||
s.ctssncomp = c.ctssncomp;
|
||||
|
||||
@ -1829,7 +1832,7 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
|
||||
c.ctssnperc = s.ctssncomp - ((s.ctssncomp * 2) / 3);
|
||||
else
|
||||
c.ctssnperc = s.ctssncomp - ((s.ctssncomp * h_PercCommitInps) / 100.00);
|
||||
c.ctssnperc.round();
|
||||
c.ctssnperc.round(fdec);
|
||||
if (s.ctssnperc == ZERO || force)
|
||||
s.ctssnperc = c.ctssnperc;
|
||||
|
||||
@ -1839,7 +1842,7 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
|
||||
|
||||
// calcolo ritenute utili pagati
|
||||
c.ritutpag = (s.utpagati * s.perc) / 100.00;
|
||||
c.ritutpag.round();
|
||||
c.ritutpag.round(fdec);
|
||||
if (s.ritutpag == ZERO || force)
|
||||
s.ritutpag = c.ritutpag;
|
||||
if (abs(s.ritutpag) > abs(s.ritenuta))
|
||||
@ -1875,40 +1878,6 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
|
||||
TSheet_field& TSchedaPercipienti::enable_pag_sheet(TMask& m, const TString& quadro) const
|
||||
{
|
||||
TSheet_field* s = NULL;
|
||||
// procedura originale
|
||||
/* TSheet_field& s_C = (TSheet_field&)m.field(F_PAGAMENTI_C);
|
||||
if (quadro == "C")
|
||||
{
|
||||
s_C.show();
|
||||
s = &s_C;
|
||||
}
|
||||
else s_C.hide();
|
||||
|
||||
TSheet_field& s_D = (TSheet_field&)m.field(F_PAGAMENTI_D);
|
||||
if (quadro == "D" || quadro == "D1" || quadro == "E" || quadro == "E1")
|
||||
{
|
||||
s_D.show();
|
||||
s = &s_D;
|
||||
}
|
||||
else s_D.hide();
|
||||
|
||||
TSheet_field& s_DB = (TSheet_field&)m.field(F_PAGAMENTI_DB);
|
||||
if (quadro == "DB")
|
||||
{
|
||||
s_DB.show();
|
||||
s = &s_DB;
|
||||
}
|
||||
else s_DB.hide();
|
||||
|
||||
TSheet_field& s_G = (TSheet_field&)m.field(F_PAGAMENTI_G);
|
||||
if (quadro == "G")
|
||||
{
|
||||
s_G.show();
|
||||
s = &s_G;
|
||||
}
|
||||
else s_G.hide();
|
||||
*/
|
||||
|
||||
TSheet_field& s_C = (TSheet_field&)m.field(F_PAGAMENTI_C);
|
||||
if (quadro == "SC" || quadro == "SE")
|
||||
{
|
||||
|
||||
@ -3,8 +3,6 @@
|
||||
#include "770102.h"
|
||||
#include <tabutil.h>
|
||||
|
||||
HIDDEN TString80 tmp1, tmp2;
|
||||
|
||||
void TSchedaPercipienti::init_mask(TMask& m)
|
||||
{
|
||||
update_lasts(m);
|
||||
@ -265,20 +263,28 @@ void TSchedaPercipienti::load_pag_sheet(const long numvers)
|
||||
continue;
|
||||
|
||||
const long npag = i;
|
||||
|
||||
const int LARGHEZZA_COL = 15;
|
||||
TString80 dep;
|
||||
|
||||
d->add(" "); // 0 spazio per la 'X' di selezione
|
||||
TString dep(riga.get(token_pos("DATAPAG")));
|
||||
|
||||
dep = riga.get(token_pos("DATAPAG"));
|
||||
d->add(dep); // 1 data pagamento
|
||||
|
||||
comp = riga.get(token_pos("COMPENSO"));
|
||||
dep = comp.string(".");
|
||||
const TCurrency soldi_compenso(comp);
|
||||
dep = soldi_compenso.string(TRUE);
|
||||
dep.right_just(LARGHEZZA_COL);
|
||||
d->add(dep); // 2 compenso
|
||||
|
||||
ritpag = riga.get(token_pos("RITENUTA"));
|
||||
dep = ritpag.string(".");
|
||||
const TCurrency soldi_ritenuta(ritpag);
|
||||
dep = soldi_ritenuta.string(TRUE);
|
||||
dep.right_just(LARGHEZZA_COL);
|
||||
d->add(dep); // 3 ritenuta
|
||||
|
||||
d->add(i); // 4 numero riga
|
||||
|
||||
d->add(nvers); // 5 numero versamento collegato
|
||||
|
||||
_pags->add(*d); // aggiungo la riga nell'array_sheet
|
||||
@ -847,8 +853,8 @@ bool TSchedaPercipienti::pag_standard_handler(TMask_field& f, KEY k)
|
||||
// controllo CPA
|
||||
if (name == "IMPCPA")
|
||||
{
|
||||
if ((d_codqua != "SF" && d_codqua != "SG") && s.impcpa != ZERO)
|
||||
return f.error_box("CPA valido solo per causali con quadro SF e SG");
|
||||
if ((d_codqua != "SC") && s.impcpa != ZERO)
|
||||
return f.error_box("CPA valido solo per causali con quadro SC");
|
||||
if (abs(s.impcpa) > abs(s.compenso))
|
||||
return f.error_box("CPA maggiore del compenso");
|
||||
}
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
|
||||
#include <applicat.h>
|
||||
#include <assoc.h>
|
||||
#include <relation.h>
|
||||
#include <progind.h>
|
||||
#include <urldefid.h>
|
||||
#include <sheet.h>
|
||||
#include <mask.h>
|
||||
#include <maskfld.h>
|
||||
#include <currency.h>
|
||||
#include <mailbox.h>
|
||||
#include <mask.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <sheet.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
#include "77lib.h"
|
||||
#include "770200a.h"
|
||||
@ -16,7 +16,7 @@
|
||||
class TVersa_rit : public TApplication
|
||||
{
|
||||
private:
|
||||
TLink770 _coll;
|
||||
TLink770 _coll;
|
||||
real _versato;
|
||||
TRelation* _rel;
|
||||
TCursor* _cur;
|
||||
@ -27,8 +27,8 @@ class TVersa_rit : public TApplication
|
||||
TLocalisamfile* _perc, *_scperc, *_rpag, *_rver;
|
||||
TAssoc_array _apags;
|
||||
// Estremi versamento
|
||||
TString16 _data, _serie, _numero;
|
||||
char _luogo, _tipo;
|
||||
TString16 _data, _serie, _numero;
|
||||
char _luogo, _tipo;
|
||||
|
||||
void add(const long codditta, char tipoa, const long codanagr,
|
||||
const int nprog, TToken_string& rriga);
|
||||
@ -64,8 +64,8 @@ class TVersa_rit : public TApplication
|
||||
char tipoa,const long codanagr,const int nprog);
|
||||
TCursor* meik_curs(TRelation* rel);
|
||||
bool do_all();
|
||||
void build_schede_sheet(const long codditta);
|
||||
void build_pagam_sheet(const long codditta);
|
||||
void build_schede_sheet(const long codditta);
|
||||
void build_pagam_sheet(const long codditta);
|
||||
|
||||
public:
|
||||
TVersa_rit() {}
|
||||
@ -90,10 +90,10 @@ bool TVersa_rit::create()
|
||||
// (lo lascio per eventuali prove)
|
||||
// real totdocla = ZERO;
|
||||
// real spesela = ZERO;
|
||||
// real compensola = ZERO;
|
||||
// real impostela = ZERO;
|
||||
// real ritenutela = 70000;
|
||||
// TToken_string s(80);
|
||||
// real compensola = ZERO;
|
||||
// real impostela = ZERO;
|
||||
// real ritenutela = 70000;
|
||||
// TToken_string s(80);
|
||||
// s.add(4);
|
||||
// s.add("M");
|
||||
// s.add("F");
|
||||
@ -138,16 +138,16 @@ bool TVersa_rit::create()
|
||||
|
||||
|
||||
_sheet_perc = new TCursor_sheet(_cur,
|
||||
" |TIPOA|CODANAGR|6->RAGSOC",
|
||||
"Selezione percipienti",
|
||||
" |TIPOA|CODANAGR|6->RAGSOC",
|
||||
"Selezione percipienti",
|
||||
"@1|Tipo|Codice|Ragione sociale@50",
|
||||
8, 3);
|
||||
_schede = new TArray_sheet(3, 3, -3, -3,
|
||||
"Selezione schede",
|
||||
"@1|T|Codice|Scheda n.|Data@10|Ragione@50");
|
||||
"Selezione schede",
|
||||
"@1|T|Codice|Scheda n.|Data@10|Ragione@50");
|
||||
_pagam = new TArray_sheet(3, 3, -3, -3,
|
||||
"Selezione ritenute da versare",
|
||||
"@1|T|Codice|Scheda n.|Riga n.|Ritenuta@15");
|
||||
"Selezione ritenute da versare",
|
||||
"@1|T|Codice|Scheda n.|Riga n.|Ritenuta@18R");
|
||||
|
||||
_apags.destroy();
|
||||
dispatch_e_menu (BAR_ITEM(1));
|
||||
@ -359,7 +359,8 @@ void TVersa_rit::build_pagam_sheet(const long codditta)
|
||||
|
||||
while ( (nriga = tpag->get_int()) != 0 ) // le righe partono da 1
|
||||
{
|
||||
real da_versare(tpag->get()); // leggo importo rimasto da versare
|
||||
const real da_versare = tpag->get(); // leggo importo rimasto da versare
|
||||
const TCurrency k(da_versare);
|
||||
|
||||
TToken_string rr(100);
|
||||
rr.add(" "); // Spazio per selezionare
|
||||
@ -368,7 +369,7 @@ void TVersa_rit::build_pagam_sheet(const long codditta)
|
||||
// rr.add(ragsoc);
|
||||
rr.add(nprog);
|
||||
rr.add(nriga);
|
||||
rr.add(da_versare.string());
|
||||
rr.add(k.string(TRUE));
|
||||
_pagam->add(rr);
|
||||
}
|
||||
}
|
||||
@ -424,9 +425,9 @@ void TVersa_rit::build_schede_sheet(const long codditta)
|
||||
bool TVersa_rit::do_all()
|
||||
{
|
||||
KEY kp;
|
||||
long items = 0L;
|
||||
long items = 0L;
|
||||
|
||||
// esecuzione prima maschera: richiesta estremi versamento
|
||||
// esecuzione prima maschera: richiesta estremi versamento
|
||||
kp = _msk->run();
|
||||
|
||||
if (kp != K_ENTER)
|
||||
|
||||
@ -162,7 +162,7 @@ BEGIN
|
||||
GROUP 1 2 3 4 5
|
||||
END
|
||||
|
||||
NUMBER F_VERSATO 15
|
||||
CURRENCY F_VERSATO 15
|
||||
BEGIN
|
||||
PROMPT 2 10 "Importo versato "
|
||||
PICTURE "."
|
||||
@ -171,12 +171,12 @@ BEGIN
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 9 2
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
@ -200,7 +200,7 @@ BEGIN
|
||||
PROMPT 2 14 "19 Somme assoggettate ai contributi previd.e assist."
|
||||
END
|
||||
|
||||
NUMBER F_QASACTRPA LENIMP
|
||||
CURRENCY F_QASACTRPA LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 14 ""
|
||||
FIELD LF_QUAA->QASACTRPA
|
||||
@ -212,7 +212,7 @@ BEGIN
|
||||
PROMPT 2 15 "20 Somme assoggettate a C.s.s.n."
|
||||
END
|
||||
|
||||
NUMBER F_AIFCSSN49 LENIMP
|
||||
CURRENCY F_AIFCSSN49 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 15 ""
|
||||
FIELD LF_QUAA->AIFCSSN
|
||||
@ -261,7 +261,7 @@ BEGIN
|
||||
PROMPT 2 4 "21 Contributi previdenz.ed assist.obblig.lav.dip."
|
||||
END
|
||||
|
||||
NUMBER F_COBBDIP21 LENIMP
|
||||
CURRENCY F_COBBDIP21 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 4 ""
|
||||
FIELD LF_QUAA->COBBDIP
|
||||
@ -273,7 +273,7 @@ BEGIN
|
||||
PROMPT 2 5 "22 Contributi previdenza complementare ex D.Lgs.124/93"
|
||||
END
|
||||
|
||||
NUMBER F_QAEXCTRPC LENIMP
|
||||
CURRENCY F_QAEXCTRPC LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 5 ""
|
||||
FIELD LF_QUAA->QAEXCTRPC
|
||||
@ -285,7 +285,7 @@ BEGIN
|
||||
PROMPT 2 6 "23 Contributi lavoratore dipendente ex D.Lgs.579/95"
|
||||
END
|
||||
|
||||
NUMBER F_QAEXCTRLD LENIMP
|
||||
CURRENCY F_QAEXCTRLD LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 6 ""
|
||||
FIELD LF_QUAA->QAEXCTRLD
|
||||
@ -297,7 +297,7 @@ BEGIN
|
||||
PROMPT 2 7 "24 Somme e valori non assoggettati a ritenuta"
|
||||
END
|
||||
|
||||
NUMBER QAF_SVNSOGRIT LENIMP
|
||||
CURRENCY QAF_SVNSOGRIT LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 7 ""
|
||||
FIELD LF_QUAA->NORIT
|
||||
@ -309,7 +309,7 @@ BEGIN
|
||||
PROMPT 2 8 "25 Erogazioni spese sanitarie (detrazioni importo interno)"
|
||||
END
|
||||
|
||||
NUMBER F_QAERGSAN LENIMP
|
||||
CURRENCY F_QAERGSAN LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 8 ""
|
||||
FIELD LF_QUAA->QAERGSAN
|
||||
@ -321,7 +321,7 @@ BEGIN
|
||||
PROMPT 2 9 "26 Erogazioni spese sanitarie (detrazioni importo parziale)"
|
||||
END
|
||||
|
||||
NUMBER F_ERSPSAN41 LENIMP
|
||||
CURRENCY F_ERSPSAN41 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 9 ""
|
||||
FIELD LF_QUAA->ERSPSAN
|
||||
@ -333,7 +333,7 @@ BEGIN
|
||||
PROMPT 2 10 "27 Premi di assicurazione vita e infortuni"
|
||||
END
|
||||
|
||||
NUMBER F_PRASSVI42 LENIMP
|
||||
CURRENCY F_PRASSVI42 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 10 ""
|
||||
FIELD LF_QUAA->PRASSVI
|
||||
@ -345,7 +345,7 @@ BEGIN
|
||||
PROMPT 2 11 "28 Contributi previd.complementare ex art.15,c.8,L.335/95"
|
||||
END
|
||||
|
||||
NUMBER F_CONPRECO43 LENIMP
|
||||
CURRENCY F_CONPRECO43 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 11 ""
|
||||
FIELD LF_QUAA->CONPRECO
|
||||
@ -357,7 +357,7 @@ BEGIN
|
||||
PROMPT 2 12 "29 Retribuzioni e pensioni"
|
||||
END
|
||||
|
||||
NUMBER F_DENARO LENIMP
|
||||
CURRENCY F_DENARO LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 12 ""
|
||||
FIELD LF_QUAA->DENARO
|
||||
@ -369,7 +369,7 @@ BEGIN
|
||||
PROMPT 2 13 "30 Assegni e indennità erogati da enti previdenz.e assist."
|
||||
END
|
||||
|
||||
NUMBER F_AIEREP23 LENIMP
|
||||
CURRENCY F_AIEREP23 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 13 ""
|
||||
FIELD LF_QUAA->AIENTIPREV
|
||||
@ -381,7 +381,7 @@ BEGIN
|
||||
PROMPT 2 14 "31 Compensi da terzi"
|
||||
END
|
||||
|
||||
NUMBER F_CCTAMMCONT LENIMP
|
||||
CURRENCY F_CCTAMMCONT LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 14 ""
|
||||
FIELD LF_QUAA->CCTAMMCONT
|
||||
@ -393,7 +393,7 @@ BEGIN
|
||||
PROMPT 2 15 "32 Imponibile"
|
||||
END
|
||||
|
||||
NUMBER F_QAIMPON LENIMP
|
||||
CURRENCY F_QAIMPON LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 15 ""
|
||||
FIELD LF_QUAA->QAIMPON
|
||||
@ -405,7 +405,7 @@ BEGIN
|
||||
PROMPT 2 16 "33 Imposta corrispondente al totale imponibile"
|
||||
END
|
||||
|
||||
NUMBER F_ICTOTIMP30 LENIMP
|
||||
CURRENCY F_ICTOTIMP30 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 16 ""
|
||||
FIELD LF_QUAA->ICTOTIMP
|
||||
@ -454,7 +454,7 @@ BEGIN
|
||||
PROMPT 2 4 "34 Detrazioni per coniuge a carico"
|
||||
END
|
||||
|
||||
NUMBER F_DETCC LENIMP
|
||||
CURRENCY F_DETCC LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 4 ""
|
||||
FIELD LF_QUAA->DETCC
|
||||
@ -466,7 +466,7 @@ BEGIN
|
||||
PROMPT 2 5 "35 Detrazioni per figli a carico"
|
||||
END
|
||||
|
||||
NUMBER F_DETFC LENIMP
|
||||
CURRENCY F_DETFC LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 5 ""
|
||||
FIELD LF_QUAA->DETFC
|
||||
@ -478,7 +478,7 @@ BEGIN
|
||||
PROMPT 2 6 "36 Detrazioni per altri familiari a carico"
|
||||
END
|
||||
|
||||
NUMBER F_DETAF LENIMP
|
||||
CURRENCY F_DETAF LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 6 ""
|
||||
FIELD LF_QUAA->DETAF
|
||||
@ -490,7 +490,7 @@ BEGIN
|
||||
PROMPT 2 7 "37 Detrazioni per lavoro dipendente"
|
||||
END
|
||||
|
||||
NUMBER F_DETLD LENIMP
|
||||
CURRENCY F_DETLD LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 7 ""
|
||||
FIELD LF_QUAA->DETLD
|
||||
@ -502,7 +502,7 @@ BEGIN
|
||||
PROMPT 2 8 "38 Detrazioni per oneri"
|
||||
END
|
||||
|
||||
NUMBER F_DETO LENIMP
|
||||
CURRENCY F_DETO LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 8 ""
|
||||
FIELD LF_QUAA->DETO
|
||||
@ -514,7 +514,7 @@ BEGIN
|
||||
PROMPT 2 9 "39 Totale detrazioni"
|
||||
END
|
||||
|
||||
NUMBER F_TOTDET36 LENIMP
|
||||
CURRENCY F_TOTDET36 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 9 ""
|
||||
FIELD LF_QUAA->TOTDET
|
||||
@ -526,7 +526,7 @@ BEGIN
|
||||
PROMPT 2 10 "40 Ammontare delle ritenute dovute"
|
||||
END
|
||||
|
||||
NUMBER F_AMMRITDOV LENIMP
|
||||
CURRENCY F_AMMRITDOV LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 10 ""
|
||||
FIELD LF_QUAA->AMMRITDOV
|
||||
@ -539,7 +539,7 @@ BEGIN
|
||||
PROMPT 2 11 "41 Ammontare delle ritenute operate da terzi"
|
||||
END
|
||||
|
||||
NUMBER F_AMRIOT37 LENIMP
|
||||
CURRENCY F_AMRIOT37 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 11 ""
|
||||
FIELD LF_QUAA->AMRIOT
|
||||
@ -551,7 +551,7 @@ BEGIN
|
||||
PROMPT 2 12 "42 Ammontare delle ritenute operate dal datore lavoro"
|
||||
END
|
||||
|
||||
NUMBER F_AMRIODL38 LENIMP
|
||||
CURRENCY F_AMRIODL38 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 12 ""
|
||||
FIELD LF_QUAA->AMRIODL
|
||||
@ -563,7 +563,7 @@ BEGIN
|
||||
PROMPT 2 13 "43 Eccedenza delle ritenute da rimborsare"
|
||||
END
|
||||
|
||||
NUMBER F_ECCRITRIMB LENIMP
|
||||
CURRENCY F_ECCRITRIMB LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 13 ""
|
||||
FIELD LF_QUAA->ECCRITRIMB
|
||||
@ -575,7 +575,7 @@ BEGIN
|
||||
PROMPT 2 14 "44 Contributo straordinario per l'Europa da trattenere"
|
||||
END
|
||||
|
||||
NUMBER F_QACTREURO LENIMP
|
||||
CURRENCY F_QACTREURO LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 14 ""
|
||||
FIELD LF_QUAA->QACTREURO
|
||||
@ -629,7 +629,7 @@ BEGIN
|
||||
PROMPT 2 4 "45 Contributi obbligatori a carico del dipendente"
|
||||
END
|
||||
|
||||
NUMBER F_COBBDIP44 LENIMP
|
||||
CURRENCY F_COBBDIP44 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 4 ""
|
||||
FIELD LF_QUAA->COBBDIP2
|
||||
@ -641,7 +641,7 @@ BEGIN
|
||||
PROMPT 2 5 "46 Imponibile"
|
||||
END
|
||||
|
||||
NUMBER F_AMMIMP45 LENIMP
|
||||
CURRENCY F_AMMIMP45 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 5 ""
|
||||
FIELD LF_QUAA->AMMIMP
|
||||
@ -653,7 +653,7 @@ BEGIN
|
||||
PROMPT 2 6 "47 Detrazioni d'imposta"
|
||||
END
|
||||
|
||||
NUMBER F_DETIMPOS46 LENIMP
|
||||
CURRENCY F_DETIMPOS46 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 6 ""
|
||||
FIELD LF_QUAA->DETIMPOS
|
||||
@ -665,7 +665,7 @@ BEGIN
|
||||
PROMPT 2 7 "48 Ritenuta eseguita"
|
||||
END
|
||||
|
||||
NUMBER F_RITESEG47 LENIMP
|
||||
CURRENCY F_RITESEG47 LENIMP
|
||||
BEGIN
|
||||
PROMPT STDIMP 7 ""
|
||||
FIELD LF_QUAA->RITESEG
|
||||
|
||||
@ -59,8 +59,8 @@ BEGIN
|
||||
INPUT QLAP F_QLANNOPAG
|
||||
DISPLAY "A.P." QLAP
|
||||
DISPLAY "M.P." QLMP
|
||||
DISPLAY "Ritenute@15" QLRITEFF
|
||||
DISPLAY "Importo versato" QLRITVER
|
||||
DISPLAY "Ritenute@15R" QLRITEFF
|
||||
DISPLAY "Importo versato@R" QLRITVER
|
||||
DISPLAY "L.V." QLLV
|
||||
DISPLAY "T.V." QLTV
|
||||
DISPLAY "C.T." QLCT
|
||||
|
||||
@ -1,41 +1,2 @@
|
||||
#include <default.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(5)
|
||||
|
||||
MENU MENU_BAR(5)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(6)
|
||||
|
||||
MENU MENU_BAR(6)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(7)
|
||||
|
||||
MENU MENU_BAR(7)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
#include <mainmenu.url>
|
||||
|
||||
@ -1,29 +1,2 @@
|
||||
#include <default.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(5)
|
||||
|
||||
MENU MENU_BAR(5)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
#include <mainmenu.url>
|
||||
|
||||
@ -1,26 +1,2 @@
|
||||
#include <default.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
#include <mainmenu.url>
|
||||
|
||||
13
m770/774.url
13
m770/774.url
@ -1,14 +1,3 @@
|
||||
#include <default.url>
|
||||
#include <mainmenu.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
@ -1,9 +1,3 @@
|
||||
#include <default.url>
|
||||
#include <mainmenu.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
@ -75,12 +75,10 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_FATTBIL 15
|
||||
CURRENCY F_FATTBIL 15
|
||||
BEGIN
|
||||
PROMPT 1 14 "Fatture da ricevere "
|
||||
PICTURE "."
|
||||
FIELD LF_PERC->FATTBIL
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
@ -1,30 +1,3 @@
|
||||
#include <default.url>
|
||||
#include <mainmenu.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(5)
|
||||
|
||||
MENU MENU_BAR(5)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#include <default.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
#include <default.url>
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ class TSchedaP;
|
||||
#define DITTA_770 "Ditta770"
|
||||
|
||||
// Arrotonda modificato { 1500 -> 1000 (e non 2000 come in round(-3)) }
|
||||
const real& round_770(const real& importo);
|
||||
real round_770(const real& importo);
|
||||
|
||||
// Cerca di stabilire se il titolare della ditta e' PF o PG
|
||||
char tipo_persona (long codditta);
|
||||
|
||||
211
m770/77lib01.cpp
211
m770/77lib01.cpp
@ -1,12 +1,15 @@
|
||||
// 77lib01.cpp
|
||||
#include <applicat.h>
|
||||
#include <config.h>
|
||||
#include <mask.h>
|
||||
#include <currency.h>
|
||||
#include <isam.h>
|
||||
#include <anagr.h>
|
||||
#include <mask.h>
|
||||
#include <tabutil.h>
|
||||
#include <comuni.h>
|
||||
#include <relation.h>
|
||||
|
||||
#include <anagr.h>
|
||||
#include <comuni.h>
|
||||
|
||||
#include "scperc.h"
|
||||
#include "perc.h"
|
||||
#include "rver.h"
|
||||
@ -15,8 +18,7 @@
|
||||
#include "dipend.h" // per is_erede
|
||||
#include "77lib.h"
|
||||
|
||||
HIDDEN real __dep;
|
||||
HIDDEN TString80 __tmp;
|
||||
HIDDEN TString __tmp;
|
||||
HIDDEN const char* _build_key(TVersamento& vers);
|
||||
HIDDEN long _codditta_770 = 0L; // La ditta corrente 770
|
||||
|
||||
@ -98,19 +100,32 @@ const char* get_desc_cau(const char* codcau)
|
||||
//
|
||||
// Round adattata per 770 - 1.12.95
|
||||
// Arrotonda cosi':
|
||||
// se importo >= 500 importo -> 1000
|
||||
// se importo < 500 importo -> 0
|
||||
// se importo > 500 importo -> 1000
|
||||
// se importo <= 500 importo -> 0
|
||||
// L'unica differenza con round(-3) e' il comportamento
|
||||
// alle 500 lire.
|
||||
//
|
||||
const real& round_770(const real& importo)
|
||||
real round_770(const real& importo)
|
||||
{
|
||||
__dep = ZERO;
|
||||
__dep = importo / 1000.00;
|
||||
__dep = __dep + 0.499;
|
||||
__dep.trunc();
|
||||
__dep *= 1000.00;
|
||||
return __dep;
|
||||
const int ndec = TCurrency::get_firm_dec();
|
||||
real imp;
|
||||
if (ndec == 0)
|
||||
{
|
||||
imp = importo / 1000.00;
|
||||
imp = imp + 0.499;
|
||||
imp.trunc();
|
||||
imp *= 1000.00;
|
||||
/* bel colpo, solo qualche logaritmo naturale in più e poi sarebbe perfetto: bastava
|
||||
imp = importo - 1.0;
|
||||
imp.round(-3);
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
imp = importo;
|
||||
imp.round(0);
|
||||
}
|
||||
return imp;
|
||||
}
|
||||
|
||||
int conta_tipiper(const long codit, TString& quadro, int* NumFisiche, int* NumNoFisiche)
|
||||
@ -362,7 +377,7 @@ bool esiste_pag_in_anno(TSchedaP& sch, const int annodic, const TDate& data_da,
|
||||
{
|
||||
int annopag = datapag.year();
|
||||
if (annocomp)
|
||||
annopag = annocomp;
|
||||
annopag = annocomp;
|
||||
if (annopag == annodic)
|
||||
return TRUE;
|
||||
}
|
||||
@ -561,13 +576,13 @@ int num_quadri_L_agg(const long codditta)
|
||||
// quadri esauriti sul modulo base
|
||||
righe -= rbase;
|
||||
if (righe <= 0)
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
|
||||
// calcola numero quadri aggiuntivi
|
||||
div_t div_result;
|
||||
div_result = div(righe, ragg);
|
||||
if (div_result.rem)
|
||||
div_result.quot++;
|
||||
div_result.quot++;
|
||||
return div_result.quot;
|
||||
}
|
||||
|
||||
@ -652,47 +667,47 @@ int num_quadri_N_agg(const long codditta)
|
||||
righes -= rbases;
|
||||
righet -= rbaset;
|
||||
if (righen<=0 && righep<=0 && righeq<=0 && righer<=0 && righes<=0 && righet<=0)
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
|
||||
// calcola numero quadri aggiuntivi
|
||||
int qagg = 0;
|
||||
div_t div_result;
|
||||
// quadri N
|
||||
div_result = div(righen, raggn);
|
||||
if (div_result.rem)
|
||||
div_result.quot++;
|
||||
div_result.quot++;
|
||||
if (div_result.quot > qagg)
|
||||
qagg = div_result.quot;
|
||||
qagg = div_result.quot;
|
||||
// quadri P
|
||||
div_result = div(righep, raggp);
|
||||
if (div_result.rem)
|
||||
div_result.quot++;
|
||||
div_result.quot++;
|
||||
if (div_result.quot > qagg)
|
||||
qagg = div_result.quot;
|
||||
qagg = div_result.quot;
|
||||
// quadri Q
|
||||
div_result = div(righeq, raggq);
|
||||
if (div_result.rem)
|
||||
div_result.quot++;
|
||||
div_result.quot++;
|
||||
if (div_result.quot > qagg)
|
||||
qagg = div_result.quot;
|
||||
qagg = div_result.quot;
|
||||
// quadri R
|
||||
div_result = div(righer, raggr);
|
||||
if (div_result.rem)
|
||||
div_result.quot++;
|
||||
div_result.quot++;
|
||||
if (div_result.quot > qagg)
|
||||
qagg = div_result.quot;
|
||||
qagg = div_result.quot;
|
||||
// quadri S
|
||||
div_result = div(righes, raggs);
|
||||
if (div_result.rem)
|
||||
div_result.quot++;
|
||||
div_result.quot++;
|
||||
if (div_result.quot > qagg)
|
||||
qagg = div_result.quot;
|
||||
qagg = div_result.quot;
|
||||
// quadri T
|
||||
div_result = div(righet, raggt);
|
||||
if (div_result.rem)
|
||||
div_result.quot++;
|
||||
div_result.quot++;
|
||||
if (div_result.quot > qagg)
|
||||
qagg = div_result.quot;
|
||||
qagg = div_result.quot;
|
||||
|
||||
return qagg;
|
||||
}
|
||||
@ -1096,68 +1111,68 @@ bool TVersamento_stampa::find(TVersamento& vers)
|
||||
int Pag_struct::operator==(Pag_struct& s)
|
||||
{
|
||||
if (this->datapag != s.datapag)
|
||||
return 0;
|
||||
if (this->imponibile != s.imponibile)
|
||||
return 0;
|
||||
if (this->perc != s.perc)
|
||||
return 0;
|
||||
if (this->ritenuta != s.ritenuta)
|
||||
return 0;
|
||||
if (this->compenso != s.compenso)
|
||||
return 0;
|
||||
if (this->netto != s.netto)
|
||||
return 0;
|
||||
if (this->numvers != s.numvers)
|
||||
return 0;
|
||||
if (this->spesa != s.spesa)
|
||||
return 0;
|
||||
if (this->ctssnperc != s.ctssnperc)
|
||||
return 0;
|
||||
if (this->ctssncomp != s.ctssncomp)
|
||||
return 0;
|
||||
if (this->ritlorda != s.ritlorda)
|
||||
return 0;
|
||||
if (this->controbb != s.controbb)
|
||||
return 0;
|
||||
if (this->detfamil != s.detfamil)
|
||||
return 0;
|
||||
if (this->detlavdip != s.detlavdip)
|
||||
return 0;
|
||||
if (this->totdet != s.totdet)
|
||||
return 0;
|
||||
if (this->giolavdip != s.giolavdip)
|
||||
return 0;
|
||||
if (this->impcpa != s.impcpa)
|
||||
return 0;
|
||||
if (this->somregconv != s.somregconv)
|
||||
return 0;
|
||||
if (this->alqimp10 != s.alqimp10)
|
||||
return 0;
|
||||
if (this->cod10 != s.cod10)
|
||||
return 0;
|
||||
if (this->utpagati != s.utpagati)
|
||||
return 0;
|
||||
if (this->utspett != s.utspett)
|
||||
return 0;
|
||||
if (this->ritutpag != s.ritutpag)
|
||||
return 0;
|
||||
if (this->ritutspe != s.ritutspe)
|
||||
return 0;
|
||||
if (this->nquote != s.nquote)
|
||||
return 0;
|
||||
if (this->somnsrit != s.somnsrit)
|
||||
return 0;
|
||||
if (this->ammlordo != s.ammlordo)
|
||||
return 0;
|
||||
if (this->quotaprov != s.quotaprov)
|
||||
return 0;
|
||||
if (this->impnetto != s.impnetto)
|
||||
return 0;
|
||||
if (this->comnetto != s.comnetto)
|
||||
return 0;
|
||||
|
||||
// strutture uguali
|
||||
return 1;
|
||||
return 0;
|
||||
if (this->imponibile != s.imponibile)
|
||||
return 0;
|
||||
if (this->perc != s.perc)
|
||||
return 0;
|
||||
if (this->ritenuta != s.ritenuta)
|
||||
return 0;
|
||||
if (this->compenso != s.compenso)
|
||||
return 0;
|
||||
if (this->netto != s.netto)
|
||||
return 0;
|
||||
if (this->numvers != s.numvers)
|
||||
return 0;
|
||||
if (this->spesa != s.spesa)
|
||||
return 0;
|
||||
if (this->ctssnperc != s.ctssnperc)
|
||||
return 0;
|
||||
if (this->ctssncomp != s.ctssncomp)
|
||||
return 0;
|
||||
if (this->ritlorda != s.ritlorda)
|
||||
return 0;
|
||||
if (this->controbb != s.controbb)
|
||||
return 0;
|
||||
if (this->detfamil != s.detfamil)
|
||||
return 0;
|
||||
if (this->detlavdip != s.detlavdip)
|
||||
return 0;
|
||||
if (this->totdet != s.totdet)
|
||||
return 0;
|
||||
if (this->giolavdip != s.giolavdip)
|
||||
return 0;
|
||||
if (this->impcpa != s.impcpa)
|
||||
return 0;
|
||||
if (this->somregconv != s.somregconv)
|
||||
return 0;
|
||||
if (this->alqimp10 != s.alqimp10)
|
||||
return 0;
|
||||
if (this->cod10 != s.cod10)
|
||||
return 0;
|
||||
if (this->utpagati != s.utpagati)
|
||||
return 0;
|
||||
if (this->utspett != s.utspett)
|
||||
return 0;
|
||||
if (this->ritutpag != s.ritutpag)
|
||||
return 0;
|
||||
if (this->ritutspe != s.ritutspe)
|
||||
return 0;
|
||||
if (this->nquote != s.nquote)
|
||||
return 0;
|
||||
if (this->somnsrit != s.somnsrit)
|
||||
return 0;
|
||||
if (this->ammlordo != s.ammlordo)
|
||||
return 0;
|
||||
if (this->quotaprov != s.quotaprov)
|
||||
return 0;
|
||||
if (this->impnetto != s.impnetto)
|
||||
return 0;
|
||||
if (this->comnetto != s.comnetto)
|
||||
return 0;
|
||||
|
||||
// strutture uguali
|
||||
return 1;
|
||||
}
|
||||
|
||||
// overloading operatore di assegnazione per la struct dei pagamenti
|
||||
@ -1195,8 +1210,8 @@ Pag_struct& Pag_struct::operator=(TRectype& rec)
|
||||
this->quotaprov = rec.get_real("QUOTAPROV");
|
||||
this->impnetto = rec.get_real("IMPNETTO");
|
||||
this->comnetto = rec.get_real("COMNETTO");
|
||||
|
||||
return *this;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// overloading operatore di assegnazione per la struct dei pagamenti
|
||||
@ -1227,6 +1242,6 @@ Pag_struct& Pag_struct::operator+=(Pag_struct& s)
|
||||
this->quotaprov += s.quotaprov;
|
||||
this->impnetto += s.impnetto;
|
||||
this->comnetto += s.comnetto;
|
||||
|
||||
return *this;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@ -48,11 +48,11 @@ bool TStampa_riepilogo::create()
|
||||
|
||||
{
|
||||
TConfig conf(CONFIG_USER, "77");
|
||||
_currfirm = conf.get_long(DITTA_770, "77");
|
||||
_currfirm = conf.get_long(DITTA_770);
|
||||
}
|
||||
{
|
||||
TConfig conf(CONFIG_STUDIO, "77");
|
||||
_curryear = conf.get_int(ANNO_SEL, "77");
|
||||
_curryear = conf.get_int(ANNO_SEL);
|
||||
}
|
||||
_msk->set(F_CODICE,_currfirm);
|
||||
_msk->set(F_ANNO,_curryear);
|
||||
|
||||
@ -70,7 +70,7 @@ BEGIN
|
||||
PROMPT 2 1 ""
|
||||
FIELD CAUSALE
|
||||
END
|
||||
NUMBER 3 14
|
||||
VALUTA 3 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@cTotale" "Tot."
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -80,7 +80,7 @@ BEGIN
|
||||
FIELD TOTALE
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 4 15
|
||||
VALUTA 4 15
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "Somme non sogg." "Somme non sogg."
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -90,7 +90,7 @@ BEGIN
|
||||
FIELD SOMME
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 5 15
|
||||
VALUTA 5 15
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "Som. Reg. Conv." "Som. Reg. Conv"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -100,7 +100,7 @@ BEGIN
|
||||
FIELD SOMREGCONV
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 6 14
|
||||
VALUTA 6 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@cImponibile" "Imponibile"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -110,7 +110,7 @@ BEGIN
|
||||
FIELD IMPONIBILE
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 7 14
|
||||
VALUTA 7 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@cImporto" "Importo"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
|
||||
@ -67,7 +67,7 @@ KEY "CAUSALE"
|
||||
PROMPT 2 1 ""
|
||||
FIELD CAUSALE
|
||||
END
|
||||
NUMBER 3 14
|
||||
VALUTA 3 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@CImponibile" "Imponibile"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -77,7 +77,7 @@ BEGIN
|
||||
FIELD IMPONIBILE
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 4 14
|
||||
NUMERO 4 6
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@CAliquota" "Aliquota"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -87,7 +87,7 @@ BEGIN
|
||||
FIELD PERC
|
||||
PICTURE "##@,@@"
|
||||
END
|
||||
NUMBER 5 14
|
||||
VALUTA 5 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@CImporto" "Importo"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -97,7 +97,7 @@ BEGIN
|
||||
FIELD IMPORTO
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 6 14
|
||||
VALUTA 6 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@CNetto" "Netto"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -107,7 +107,7 @@ BEGIN
|
||||
FIELD NETTO
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 7 14
|
||||
VALUTA 7 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@CSomme" "Somme"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
|
||||
@ -71,7 +71,7 @@ BEGIN
|
||||
PROMPT 2 1 ""
|
||||
FIELD CAUSALE
|
||||
END
|
||||
NUMBER 3 14
|
||||
VALUTA 3 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@CSomme" "Somme"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -81,7 +81,7 @@ BEGIN
|
||||
FIELD SOMME
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 4 14
|
||||
VALUTA 4 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@CAmmontare" "Ammontare"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -91,7 +91,7 @@ BEGIN
|
||||
FIELD AMMONTARE
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 5 14
|
||||
NUMERO 5 6
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@cAliquota" "Aliquota"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -101,7 +101,7 @@ BEGIN
|
||||
FIELD PERC
|
||||
PICTURE "##@,@@"
|
||||
END
|
||||
NUMBER 6 14
|
||||
VALUTA 6 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@CImporto" "Importo"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
@ -111,7 +111,7 @@ BEGIN
|
||||
FIELD IMPORTO
|
||||
PICTURE "###.###.###^^^"
|
||||
END
|
||||
NUMBER 7 14
|
||||
VALUTA 7 14
|
||||
BEGIN
|
||||
SPECIAL STRINGA INTESTAZIONE "@CNetto" "Netto"
|
||||
SPECIAL NUMERO OFFSET "0" "Offset iniziale campo"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
USE 42
|
||||
JOIN 9 INTO CODDITTA=CODDITTA
|
||||
JOIN 6 TO 9 ALIAS 106 INTO TIPOA=TIPOA CODANAGR=CODANAGR
|
||||
JOIN 9 INTO CODDITTA=CODDITTA
|
||||
JOIN 6 TO 9 ALIAS 106 INTO TIPOA=TIPOA CODANAGR=CODANAGR
|
||||
END
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
@ -13,13 +13,13 @@ IVA|4|18|2|Iva documento
|
||||
TOTALE|4|18|2|Totale documento
|
||||
FORZATURA|8|1|0|Flag di forzatura controlli
|
||||
TOTRIT|4|18|2|Totale ritenute (collegamento contabilità)
|
||||
RITSOC|4|18|0|Ritenute sociali (collegamento contabilità)
|
||||
RITSOC|4|18|2|Ritenute sociali (collegamento contabilità)
|
||||
MESEC|2|2|0|Mese competenza
|
||||
ANNOC|2|4|0|Anno competenza
|
||||
CAUSQUA|7|1|0|Causale quadro
|
||||
FLAGTS|7|1|0|Flag T.S.
|
||||
RITOPE|4|18|0|Ritenute operate
|
||||
RITVER|4|18|0|Ritenute versate
|
||||
RITOPE|4|18|2|Ritenute operate
|
||||
RITVER|4|18|2|Ritenute versate
|
||||
2
|
||||
CODDITTA+TIPOA+CODANAGR+NPROG|
|
||||
CODDITTA+TIPOA+CODANAGR+DATADOC+NPROG|
|
||||
|
||||
@ -8,7 +8,7 @@ NRIGA|2|4|0|Numero progressivo di versamento
|
||||
VERS1015|8|1|0|Versamento 1015
|
||||
DATAVERS|5|8|0|Data versamento
|
||||
TIPOVERS|1|1|0|Tipo versamento
|
||||
RITENUTA|4|18|0|Ritenuta versata
|
||||
RITENUTA|4|18|2|Ritenuta versata
|
||||
LUOVERS|1|1|0|Luogo versamento
|
||||
NUMERO|1|11|0|Numero versamento
|
||||
SERIE|1|5|0|Serie
|
||||
|
||||
46
m770/f41.trr
46
m770/f41.trr
@ -6,34 +6,34 @@ CODANAGR|3|5|0|Codice percipiente
|
||||
NPROG|2|4|0|Numero progressivo di scheda
|
||||
NRIGA|2|4|0|Numero progressivo di pagamento
|
||||
DATAPAG|5|8|0|Data pagamento
|
||||
IMPONIBILE|4|18|0|Imponibile
|
||||
IMPONIBILE|4|18|2|Imponibile
|
||||
PERC|4|6|2|Aliquota
|
||||
RITENUTA|4|18|0|Ritenuta
|
||||
COMPENSO|4|18|0|Compenso
|
||||
NETTO|4|18|0|Compenso netto
|
||||
RITENUTA|4|18|2|Ritenuta
|
||||
COMPENSO|4|18|2|Compenso
|
||||
NETTO|4|18|2|Compenso netto
|
||||
NUMVERS|3|5|0|Numero progressivo di versamento collegato
|
||||
SPESA|4|18|0|Spesa
|
||||
CTSSNPERC|4|18|0|Contributo 10% percipiente (Dbis)
|
||||
CTSSNCOMP|4|18|0|Contributo 10% complessivo (Dbis)
|
||||
RITLORDA|4|18|0|Ritenuta lorda (C)
|
||||
CONTROBB|4|18|0|Contributi obbligatori (C)
|
||||
DETFAMIL|4|18|0|Detrazioni familiari (C)
|
||||
DETLAVDIP|4|18|0|Detrazioni lavoro dipendente (C)
|
||||
TOTDET|4|18|0|Totale detrazioni (C)
|
||||
SPESA|4|18|2|Spesa
|
||||
CTSSNPERC|4|18|2|Contributo 10% percipiente (Dbis)
|
||||
CTSSNCOMP|4|18|2|Contributo 10% complessivo (Dbis)
|
||||
RITLORDA|4|18|2|Ritenuta lorda (C)
|
||||
CONTROBB|4|18|2|Contributi obbligatori (C)
|
||||
DETFAMIL|4|18|2|Detrazioni familiari (C)
|
||||
DETLAVDIP|4|18|2|Detrazioni lavoro dipendente (C)
|
||||
TOTDET|4|18|2|Totale detrazioni (C)
|
||||
GIOLAVDIP|2|3|0|Giorni lavoro dipendente (C)
|
||||
IMPCPA|4|18|0|Importo CPA (D)
|
||||
SOMREGCONV|4|18|0|Somme regime convenzionale (D,Dbis)
|
||||
IMPCPA|4|18|2|Importo CPA (D)
|
||||
SOMREGCONV|4|18|2|Somme regime convenzionale (D,Dbis)
|
||||
ALQIMP10|4|6|2|Aliquota imponibile contributo 10% (Dbis)
|
||||
COD10|1|1|0|Codice 10% (Dbis)
|
||||
UTPAGATI|4|18|0|Utili pagati (G)
|
||||
UTSPETT|4|18|0|Utili spettanti (G)
|
||||
RITUTPAG|4|18|0|Ritenute utili pagati (G)
|
||||
RITUTSPE|4|18|0|Ritenute utili spettanti (G)
|
||||
UTPAGATI|4|18|2|Utili pagati (G)
|
||||
UTSPETT|4|18|2|Utili spettanti (G)
|
||||
RITUTPAG|4|18|2|Ritenute utili pagati (G)
|
||||
RITUTSPE|4|18|2|Ritenute utili spettanti (G)
|
||||
NQUOTE|4|6|2|Numero quote (G)
|
||||
SOMNSRIT|4|18|0|Somme non soggette a ritenuta (calc)
|
||||
AMMLORDO|4|18|0|Ammontare lordo corrisposto (calc)
|
||||
QUOTAPROV|4|18|0|Quota provvigioni (calc)
|
||||
IMPNETTO|4|18|0|Imponibile al netto delle ritenute (calc)
|
||||
COMNETTO|4|18|0|Compenso al netto delle ritenute (calc)
|
||||
SOMNSRIT|4|18|2|Somme non soggette a ritenuta (calc)
|
||||
AMMLORDO|4|18|2|Ammontare lordo corrisposto (calc)
|
||||
QUOTAPROV|4|18|2|Quota provvigioni (calc)
|
||||
IMPNETTO|4|18|2|Imponibile al netto delle ritenute (calc)
|
||||
COMNETTO|4|18|2|Compenso al netto delle ritenute (calc)
|
||||
1
|
||||
CODDITTA+TIPOA+CODANAGR+NPROG+NRIGA|
|
||||
|
||||
@ -11,8 +11,8 @@ QLAB|2|2|0|
|
||||
QLSERIE|1|5|0|
|
||||
QLNUMERO|1|11|0|
|
||||
QLCODQUA|1|2|0|
|
||||
QLRITEFF|4|18|0|
|
||||
QLRITVER|4|18|0|
|
||||
QLRITEFF|4|18|2|
|
||||
QLRITVER|4|18|2|
|
||||
QLRSS|1|2|0|
|
||||
QLNOTE|1|20|0|
|
||||
2
|
||||
|
||||
10
m770/f62.trr
10
m770/f62.trr
@ -6,12 +6,12 @@ CODANAGR|3|5|0|Codice anagrafica
|
||||
NPROG|2|4|0|Numero progressivo di riga
|
||||
CODCAUS|9|2|0|Codice causale
|
||||
CAUSALE|1|1|0|15 - Causale
|
||||
TOTALE|4|18|0|16 - Ammontare lordo corrisposto
|
||||
SOMME|4|18|0|17 - Somme non soggette a ritenuta
|
||||
IMPONIBILE|4|18|0|19 - Imponibile
|
||||
TOTALE|4|18|2|16 - Ammontare lordo corrisposto
|
||||
SOMME|4|18|2|17 - Somme non soggette a ritenuta
|
||||
IMPONIBILE|4|18|2|19 - Imponibile
|
||||
PERC|4|6|2|Aliquota
|
||||
IMPORTO|4|18|0|20 - Ritenute operate
|
||||
SOMREGCONV|4|18|0|18 - Somme non soggette a ritenuta per reg. conv.
|
||||
IMPORTO|4|18|2|20 - Ritenute operate
|
||||
SOMREGCONV|4|18|2|18 - Somme non soggette a ritenuta per reg. conv.
|
||||
GENERATA|8|1|0|Riga generata dalle schede
|
||||
1
|
||||
CODDITTA+TIPOA+CODANAGR+NPROG|
|
||||
|
||||
10
m770/f63.trr
10
m770/f63.trr
@ -6,12 +6,12 @@ CODANAGR|3|5|0|Codice anagrafica
|
||||
NPROG|2|4|0|Numero progrssivo riga
|
||||
CODCAUS|9|2|0|Codice causale
|
||||
CAUSALE|7|1|0|11 - Causale
|
||||
TOTALE|4|18|0|12 - Ammontare lordo corrisposto
|
||||
QUOTAPRO|4|18|0|14 - Quota provvigioni
|
||||
SPESEANT|4|18|0|13 - Spese anticipate
|
||||
IMPONIBILE|4|18|0|15 - Imponibile
|
||||
TOTALE|4|18|2|12 - Ammontare lordo corrisposto
|
||||
QUOTAPRO|4|18|2|14 - Quota provvigioni
|
||||
SPESEANT|4|18|2|13 - Spese anticipate
|
||||
IMPONIBILE|4|18|2|15 - Imponibile
|
||||
PERC|4|6|2|Aliquota
|
||||
IMPORTO|4|18|0|16 - Ritenute operate
|
||||
IMPORTO|4|18|2|16 - Ritenute operate
|
||||
GENERATA|8|1|0|Riga generata dalle schede
|
||||
1
|
||||
CODDITTA+TIPOA+CODANAGR+NPROG|
|
||||
|
||||
@ -6,11 +6,11 @@ CODANAGR|3|5|0|Codice anagrafico
|
||||
NPROG|2|4|0|Numero progressivo di riga
|
||||
CODCAUS|9|2|0|Codice causale
|
||||
CAUSALE|7|1|0|11 - Causale quadro
|
||||
IMPONIBILE|4|18|0|12 - Imponibile corrisposto
|
||||
IMPONIBILE|4|18|2|12 - Imponibile corrisposto
|
||||
PERC|4|6|2|13 - Aliquota
|
||||
IMPORTO|4|18|0|14 - Ritenute operate
|
||||
NETTO|4|18|0|15 - Somme corrisposte al netto delle ritenute
|
||||
SOMME|4|18|0|16 - Somme corrisposte non assoggettate a ritenuta
|
||||
IMPORTO|4|18|2|14 - Ritenute operate
|
||||
NETTO|4|18|2|15 - Somme corrisposte al netto delle ritenute
|
||||
SOMME|4|18|2|16 - Somme corrisposte non assoggettate a ritenuta
|
||||
GENERATA|8|1|0|Riga generata dalle schede
|
||||
1
|
||||
CODDITTA+TIPOA+CODANAGR+NPROG|
|
||||
|
||||
@ -6,11 +6,11 @@ CODANAGR|3|5|0|Codice anagrafica
|
||||
NPROG|2|4|0|Numero progrssivo i riga
|
||||
CODCAUS|9|2|0|Codice causale
|
||||
CAUSALE|7|1|0|11 - Causale quadro
|
||||
SOMME|4|18|0|12 - Somme corrisposte
|
||||
AMMONTARE|4|18|0|13 - Ammontare complessivo dei premi riscossi
|
||||
SOMME|4|18|2|12 - Somme corrisposte
|
||||
AMMONTARE|4|18|2|13 - Ammontare complessivo dei premi riscossi
|
||||
PERC|4|6|2|14 - Aliquota
|
||||
IMPORTO|4|18|0|15 - Ritenute operate
|
||||
NETTO|4|18|0|16 - Netti corrisposto
|
||||
IMPORTO|4|18|2|15 - Ritenute operate
|
||||
NETTO|4|18|2|16 - Netti corrisposto
|
||||
GENERATA|8|1|0|Riga generata dalle schede
|
||||
1
|
||||
CODDITTA+TIPOA+CODANAGR+NPROG|
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
5
|
||||
CODDITTA|3|5|0|Codice ditta
|
||||
CODCAUS|1|2|0|Codice causale (Vale solo 'C' o 'D')
|
||||
COMPENSO|4|18|0|2 - Ammontare complessivo
|
||||
IMPONIBILE|4|18|0|3 - Ammontare somme soggette a ritenuta
|
||||
RITENUTA|4|18|0|4 - Ritenute operate
|
||||
COMPENSO|4|18|2|2 - Ammontare complessivo
|
||||
IMPONIBILE|4|18|2|3 - Ammontare somme soggette a ritenuta
|
||||
RITENUTA|4|18|2|4 - Ritenute operate
|
||||
1
|
||||
CODDITTA+CODCAUS|
|
||||
|
||||
@ -47,6 +47,8 @@
|
||||
#define ANAMAG_VALSTATUN "VALSTATUN"
|
||||
#define ANAMAG_PROV "PROV"
|
||||
#define ANAMAG_PAESE "PAESE"
|
||||
#define ANAMAG_COLLTYPE "COLLTYPE"
|
||||
#define ANAMAG_CODMAG "CODMAG"
|
||||
#define ANAMAG_USER1 "USER1"
|
||||
#define ANAMAG_USER2 "USER2"
|
||||
#define ANAMAG_USER3 "USER3"
|
||||
|
||||
@ -3,3 +3,5 @@
|
||||
#define QFIRMNAME "A.G.A. Informatica Srl"
|
||||
#include <default.url>
|
||||
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
@ -3,3 +3,4 @@
|
||||
#define QFIRMNAME "A.G.A. Informatica Srl"
|
||||
#include <default.url>
|
||||
|
||||
#include <mainmenu.url>
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
#include "../ve/veconf.h"
|
||||
|
||||
#include "mg1100.h"
|
||||
#include <cfven.h>
|
||||
|
||||
// maschera dell'applicazione "Gestione interattiva movimenti di magazzino"
|
||||
//
|
||||
@ -90,12 +91,17 @@ TMask_movmag::TMask_movmag(TMov_mag * m_m)
|
||||
ss.set_lines_record(m_m->body());
|
||||
// setta i campi della maschera
|
||||
// per la pagina giacenze
|
||||
TSheet_field &fld_righe= (TSheet_field &)field(F_RIGHE);
|
||||
TSheet_field &fld_righe = sfield(F_RIGHE);
|
||||
|
||||
// setta le colonne in base all'abilitazione dei livelli di giacenza
|
||||
/*
|
||||
livelli_giacenza().set_sheetcolumn(fld_righe,F_LIV1,1);
|
||||
livelli_giacenza().set_sheetcolumn(fld_righe,F_LIV2,2);
|
||||
livelli_giacenza().set_sheetcolumn(fld_righe,F_LIV3,3);
|
||||
livelli_giacenza().set_sheetcolumn(fld_righe,F_LIV4,4);
|
||||
*/
|
||||
livelli_giacenza().set_sheet_columns(fld_righe,F_LIV1);
|
||||
|
||||
// abilita i controlli
|
||||
for (int l=0; l<4; l++)
|
||||
if (livelli_giacenza().autoinsert(1+l))
|
||||
@ -322,7 +328,7 @@ bool TMask_movmag::handle_giacattuale(TMask_field &f, KEY k)
|
||||
{
|
||||
TMask & maskrighe =f.mask();
|
||||
TMask_movmag &maskmov=(TMask_movmag &)maskrighe.get_sheet()->mask();
|
||||
if (k==K_TAB && !maskmov.is_running())
|
||||
if (k==K_TAB && (!maskmov.is_running() || f.focusdirty()))
|
||||
{
|
||||
TString codliv;
|
||||
// codici livello
|
||||
@ -474,16 +480,18 @@ bool TMask_movmag::add_explrows(int r)
|
||||
if (cau.esplodente() && *sheet.cell(r,sheet.cid2index(F_ESPLOSA)) == ' ')
|
||||
{
|
||||
TDistinta_tree distinta;
|
||||
TArticolo articolo;
|
||||
TArray boom;
|
||||
// *******************************
|
||||
// c'e' una riga di movimento esplodente non ancora esplosa:
|
||||
// va sostituita con n righe esplose
|
||||
TString codmag;
|
||||
real prezzo,quant;
|
||||
const char tipo_costo = cau.get("S11")[0];
|
||||
const int livello = cau.get_int("I0");
|
||||
const TString codart = sheet.cell(r,sheet.cid2index(F_CODART));
|
||||
bool ok = distinta.set_root(codart);
|
||||
const int rigaprec = r - 1;
|
||||
const bool is_coll = rigaprec >= 0 && *sheet.cell(r, sheet.cid2index(F_AUTOMATICA)) == riga_automatica;
|
||||
if (ok)
|
||||
{
|
||||
distinta.explode(boom, TRUE, RAGGR_EXP_NONE, livello, "A");
|
||||
@ -498,10 +506,34 @@ bool TMask_movmag::add_explrows(int r)
|
||||
quant=sheet.row(r).get(sheet.cid2index(F_QUANT));
|
||||
quant*=riga_esp.val();
|
||||
nuova_riga.add(quant.string() , sheet.cid2index(F_QUANT));
|
||||
if (codmag.not_empty())
|
||||
{
|
||||
nuova_riga.add(codmag.sub(1,3) ,sheet.cid2index(F_CODMAG));
|
||||
nuova_riga.add(codmag.sub(4,5) ,sheet.cid2index(F_CODDEP));
|
||||
|
||||
articolo.read(riga_esp.articolo());
|
||||
char coll_type = articolo.get_char(ANAMAG_COLLTYPE);
|
||||
TString16 codmag;
|
||||
|
||||
if (coll_type == 'M')
|
||||
{
|
||||
if (is_coll)
|
||||
codmag = *sheet.cell(rigaprec, sheet.cid2index(F_CODMAG));
|
||||
}
|
||||
else
|
||||
if (coll_type == 'F')
|
||||
{
|
||||
TString key("F|");
|
||||
|
||||
key << articolo.get(ANAMAG_CODFORN);
|
||||
codmag = cache().get(LF_CFVEN, key, CFV_CODMAG);
|
||||
}
|
||||
else
|
||||
if (coll_type == 'A')
|
||||
codmag = articolo.get(ANAMAG_CODMAG);
|
||||
if (codmag.not_empty())
|
||||
{
|
||||
const TString16 mag(codmag.left(3));
|
||||
const TString16 dep(codmag.mid(3));
|
||||
|
||||
nuova_riga.add(mag ,sheet.cid2index(F_CODMAG));
|
||||
nuova_riga.add(dep ,sheet.cid2index(F_CODDEP));
|
||||
}
|
||||
articolo.read(riga_esp.articolo());
|
||||
if (tipo_costo == 'U')
|
||||
|
||||
@ -347,12 +347,12 @@ BEGIN
|
||||
FLAGS "AI"
|
||||
//USE LF_RMOVMAG KEY NRIG
|
||||
//INPUT NUMREG F_NUMREG
|
||||
ITEM "@1F"
|
||||
ITEM "CodArt@F"
|
||||
ITEM "Liv1@F10"
|
||||
ITEM "Liv2@F10"
|
||||
ITEM "Liv3@F10"
|
||||
ITEM "Liv4@F10"
|
||||
ITEM "@1"
|
||||
ITEM "CodArt"
|
||||
ITEM "Liv1@10"
|
||||
ITEM "Liv2@10"
|
||||
ITEM "Liv3@10"
|
||||
ITEM "Liv4@10"
|
||||
ITEM "Descrizione"
|
||||
ITEM "CodMag"
|
||||
ITEM "CodDep"
|
||||
|
||||
@ -30,8 +30,17 @@ bool TMask_buildmov::handle_annoes(TMask_field &fld, KEY k)
|
||||
if (esc!=0)
|
||||
fld.set(esc);
|
||||
}
|
||||
if (k == K_TAB && fld.focusdirty())
|
||||
if (fld.to_check(k) || k == K_ENTER)
|
||||
{
|
||||
TConfig prassid(CONFIG_DITTA, "Euro");
|
||||
TDate adozione = prassid.get("DataAdozione");
|
||||
if (adozione.ok())
|
||||
{
|
||||
TEsercizi_contabili esc;
|
||||
const int anno = esc.date2esc(adozione);
|
||||
if (mask.get_int(F_ANNOES) < anno)
|
||||
return fld.error_box("Impossibile effettuare la ricostruzione saldi su\n un esercizio precedente alla data adozione Euro") ;
|
||||
}
|
||||
if (mask.esercizi.exist(mask.get_int(F_ANNOES)))
|
||||
{
|
||||
const TEsercizio & e=mask.esercizi.esercizio(mask.get_int(F_ANNOES));
|
||||
@ -39,7 +48,7 @@ bool TMask_buildmov::handle_annoes(TMask_field &fld, KEY k)
|
||||
{
|
||||
fld.error_box("Il magazzino dell'esercizio indicato risulta chiuso \nImpossibile effettuare la ricostruzione saldi") ;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
@ -364,7 +364,7 @@ void TApp_openclose::compila_movimento(TMov_mag& currmov, TArticolo_giacenza& ar
|
||||
// Setta il prezzo al nr di decimali impostati per la valuta corrente
|
||||
currency.set_price(caus == CAUS_A_VAL ? FALSE : TRUE); // Se mov. solo valore (FIFO/LIFO) i decimali devono essere per gl'importi
|
||||
currency.set_num(prezzo);
|
||||
riga.put(RMOVMAG_PREZZO, currency.string());
|
||||
riga.put(RMOVMAG_PREZZO, currency);
|
||||
}
|
||||
}
|
||||
|
||||
@ -382,7 +382,7 @@ void TApp_openclose::chiudi_esercizio()
|
||||
TTable esc("ESC");
|
||||
TTable magazzini("MAG");
|
||||
|
||||
rebuild_balances(_es_to_close); // Cosi' ci assicuriamo che i saldi dell'esercizio vecchio siano a posto
|
||||
// rebuild_balances(_es_to_close); // Cosi' ci assicuriamo che i saldi dell'esercizio vecchio siano a posto
|
||||
descr1.format(_what == definitiva ? "Apertura esercizio %s" : "Aggiornamento saldi esercizio %s", (const char*) _es_to_open);
|
||||
descr2 << descr1 << " in corso...";
|
||||
|
||||
|
||||
@ -3,4 +3,5 @@
|
||||
#define QFIRMNAME "A.G.A. Informatica Srl"
|
||||
|
||||
#include <default.url>
|
||||
#include <mainmenu.url>
|
||||
|
||||
|
||||
@ -1189,7 +1189,7 @@ SECTION BODY ODD 0 COLUMNWISE
|
||||
VALUTA 484 12
|
||||
BEGIN
|
||||
KEY "VALven"
|
||||
PROMPT 9 1 ""
|
||||
PROMPT 9 1 ":-)"
|
||||
FLAGS "U"
|
||||
PICTURE "#######,@##"
|
||||
MESSAGE _NUMEXPR,#444/#443
|
||||
|
||||
@ -18,6 +18,9 @@ class TForm_schedemag : public TForm_stampemg
|
||||
bool _magazzino_chiuso;
|
||||
bool _sottocatmer;
|
||||
bool _sudd_mag;
|
||||
bool _no_valori;
|
||||
bool _no_ff;
|
||||
bool _sintetica;
|
||||
TDate _data_inizio, _data_fine;
|
||||
|
||||
TToken_string *_rmov_sortexp;
|
||||
@ -40,6 +43,7 @@ public:
|
||||
void setdett_percatmer(bool sottocat,int livart,int livgiac,bool sudd_mag,bool sudd_dep);
|
||||
void setdett_permag(bool sudd_dep, bool showdett,int livart,int livgiac);
|
||||
void set_date_limite(const int anno, const TDate& d, const TDate& e);
|
||||
void set_options(bool no_valori, bool no_ff, bool sintetica);
|
||||
const char* descr_tiposcheda() const;
|
||||
const char* nomecampo_scheda() const;
|
||||
|
||||
@ -333,9 +337,6 @@ bool TForm_schedemag::validate(TForm_item &cf, TToken_string &s)
|
||||
cf.set(currsaldo.string());
|
||||
}
|
||||
}
|
||||
#ifdef DBG
|
||||
real currsaldo = cf.get(); // Per conoscenza
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -431,10 +432,10 @@ void TForm_schedemag::setdett_percatmer(bool sottocat,int livart,int livgiac,boo
|
||||
h_c.enable();
|
||||
TForm_subsection &h_a=(TForm_subsection &)find_field('B',odd_page,"HEADER_ARTICOLO");
|
||||
h_a.enable();
|
||||
h_a.set_newpage(livart !=0 && livgiac ==0 && !sudd_mag);
|
||||
h_a.set_newpage(livart !=0 && livgiac ==0 && !sudd_mag && !_no_ff);
|
||||
TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_GRMOV");
|
||||
h_g.enable(livart ==0 || livgiac !=0 || sudd_mag);
|
||||
h_g.set_newpage(livart ==0 || livgiac !=0 || sudd_mag);
|
||||
h_g.set_newpage(livart ==0 || livgiac !=0 || sudd_mag && !_no_ff);
|
||||
TForm_subsection &h_l=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC");
|
||||
h_l.enable(livelli_giacenza().enabled() && (livgiac !=0 ||livart ==0));
|
||||
TForm_subsection &h_m=(TForm_subsection &)find_field('B',odd_page,"HEADER_MAG");
|
||||
@ -484,14 +485,14 @@ void TForm_schedemag::setdett_perart(bool percatmer,bool sottocatmer,int livart,
|
||||
|
||||
TForm_subsection &h_a=(TForm_subsection &)find_field('B',odd_page,"HEADER_ARTICOLO");
|
||||
h_a.enable (livart!=0 && !sudd_mag);
|
||||
h_a.set_newpage(livart!=0 && !sudd_mag);
|
||||
h_a.set_newpage(livart!=0 && !sudd_mag && !_no_ff);
|
||||
TForm_subsection &t_a=(TForm_subsection &)find_field('B',odd_page,"TOTALI_GRUPPIART");
|
||||
t_a.show( livart!=0 && !sudd_mag);
|
||||
|
||||
// raggruppamento MAX fino alla giacenza
|
||||
TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_GRMOV");
|
||||
h_g.enable(livart ==0 || livgiac !=0 || sudd_mag);
|
||||
h_g.set_newpage(livart ==0 || livgiac !=0 || sudd_mag);
|
||||
h_g.enable(livart ==0 || livgiac !=0 || sudd_mag);
|
||||
h_g.set_newpage(!_no_ff && (livart ==0 || livgiac !=0 || sudd_mag));
|
||||
TForm_subsection &h_l=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC");
|
||||
h_l.enable(livelli_giacenza().enabled() && (livart ==0 || livgiac !=0 ));
|
||||
TForm_subsection &h_m=(TForm_subsection &)find_field('B',odd_page,"HEADER_MAG");
|
||||
@ -561,6 +562,28 @@ void TForm_schedemag::set_tiposcheda(const char * tipo)
|
||||
}
|
||||
}
|
||||
|
||||
void TForm_schedemag::set_options(bool no_valori, bool no_ff, bool sintetica)
|
||||
{
|
||||
_no_valori = no_valori;
|
||||
if (_no_valori)
|
||||
{
|
||||
((TForm_item &)find_field('H',odd_page, 8)).hide();
|
||||
((TForm_item &)find_field('H',odd_page, 9)).hide();
|
||||
((TForm_item &)find_field('B',odd_page, 104)).hide();
|
||||
|
||||
((TForm_item &)find_field('B',odd_page, 105)).hide();
|
||||
((TForm_item &)find_field('B',odd_page, FF_VALORE_GART)).hide();
|
||||
|
||||
((TForm_item &)find_field('B',odd_page, FF_VALORE_MOV)).hide();
|
||||
((TForm_item &)find_field('B',odd_page, 190)).hide();
|
||||
|
||||
if (name().left(7) == "mg3300a")
|
||||
((TForm_item &)find_field('B',odd_page, FF_VALORE_GRMOV)).hide();
|
||||
}
|
||||
_no_ff = no_ff;
|
||||
_sintetica = sintetica;
|
||||
}
|
||||
|
||||
void TForm_schedemag::set_date_limite(const int anno, const TDate& d, const TDate& e)
|
||||
{
|
||||
TEsercizi_contabili ec;
|
||||
@ -665,6 +688,7 @@ void TStampa_schede_mag::setprint_permagazzini()
|
||||
{
|
||||
TDate d1(_mask->get(F_DADATA));
|
||||
TString cond;
|
||||
|
||||
cond << "ANSI(" << LF_MOVMAG << "->DATAREG)>=\"" << d1.string(ANSI) << '"';
|
||||
((TForm_subsection &)_form->find_field('B',odd_page,"MOVS_INTERESSATI")).setcondition(cond,_strexpr);
|
||||
((TForm_subsection &)_form->find_field('B',odd_page,"H_MOVS_INTERESSATI")).setcondition(cond,_strexpr);
|
||||
@ -685,9 +709,7 @@ void TStampa_schede_mag::setprint_permagazzini()
|
||||
|
||||
// filtering ONLY NEGATIVES
|
||||
if (_mask->get(F_FILTRO)[0]=='N')
|
||||
{
|
||||
_cur->set_filterfunction(negatives_only, TRUE);
|
||||
}
|
||||
|
||||
// prepare cursor to print....
|
||||
((TSorted_cursor *)_cur)->change_order(_form->rmov_sortexp());
|
||||
@ -697,7 +719,7 @@ void TStampa_schede_mag::setprint_permagazzini()
|
||||
TLocalisamfile *mag=new TLocalisamfile(LF_MAG);
|
||||
mag->setkey(2);
|
||||
TString mag_joinexp;
|
||||
mag_joinexp << "ANNOES==" << _mask->get(F_ANNOES) << "|CODMAG==CODMAG|CODART==CODART|LIVELLO==LIVGIAC";
|
||||
mag_joinexp << "ANNOES==" << _mask->get(F_ANNOES) << "|CODMAG==CODMAG|CODART==CODART|LIVELLO==LIVGIAC";
|
||||
_cur->relation()->replace(mag,1,mag_joinexp);
|
||||
_cur->setfilter(cfilter,TRUE);
|
||||
_cur->setregion(darec,arec,0x2);
|
||||
@ -739,9 +761,7 @@ void TStampa_schede_mag::setprint_perarticoli()
|
||||
|
||||
// filtering ONLY NEGATIVES
|
||||
if (_mask->get(F_FILTRO)[0]=='N')
|
||||
{
|
||||
_cur->set_filterfunction(negatives_only);
|
||||
}
|
||||
_cur->set_filterfunction(negatives_only);
|
||||
|
||||
// Imposta i livelli di dettaglio della scheda
|
||||
int tolivelloart=_mask->get_int(F_TOLIVELLOART);
|
||||
@ -820,22 +840,29 @@ void TStampa_schede_mag::main_loop()
|
||||
_mask->set(F_TOLIVELLOART,livelli_articolo().last_level());
|
||||
if (dettaglio=='G' && _mask->get_int(F_TOLIVELLOGIAC)==0)
|
||||
_mask->set(F_TOLIVELLOGIAC,livelli_giacenza().last_level());
|
||||
if (*_mask->get(F_ORDINE)=='A')
|
||||
{
|
||||
_form = new TForm_schedemag("mg3300a", "") ;
|
||||
// *_mask->get(F_FILTRO) == 'T' ?
|
||||
// new TForm_schedemag("mg3300aa", "") :
|
||||
// new TForm_schedemag("mg3300a", "") ;
|
||||
TString16 frmname;
|
||||
const bool per_articoli = (*_mask->get(F_ORDINE) == 'A');
|
||||
const bool sintetica = _mask->get_bool(F_SINTETICA);
|
||||
if (per_articoli)
|
||||
frmname = "mg3300a";
|
||||
else
|
||||
frmname = "mg3300b";
|
||||
if (sintetica)
|
||||
frmname << 's';
|
||||
_form = new TForm_schedemag(frmname, "") ;
|
||||
_form->set_options(_mask->get_bool(F_NO_VALORI), _mask->get_bool(F_NO_FF),
|
||||
sintetica);
|
||||
|
||||
if (per_articoli)
|
||||
setprint_perarticoli();
|
||||
} else if (*_mask->get(F_ORDINE)=='M') {
|
||||
_form = new TForm_schedemag("mg3300b", "");
|
||||
else
|
||||
setprint_permagazzini();
|
||||
}
|
||||
|
||||
_form->set_date_limite(_mask->get_int(F_ANNOES), _mask->get_date(F_DADATA), _mask->get_date(F_ADATA));
|
||||
|
||||
_form->print();
|
||||
delete _form;
|
||||
_form = NULL;
|
||||
}
|
||||
} // while true
|
||||
return ;
|
||||
|
||||
@ -24,6 +24,9 @@
|
||||
#define F_DETTAGLIODEP 126
|
||||
#define F_ENABLER 127
|
||||
#define F_FILTRO 130
|
||||
#define F_NO_VALORI 131
|
||||
#define F_NO_FF 132
|
||||
#define F_SINTETICA 133
|
||||
|
||||
#define G_CATMER 1
|
||||
#define G_CODART 2
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#include "mg3300.h"
|
||||
PAGE "Stampa Schede di magazzino" -1 -1 78 20
|
||||
PAGE "Stampa Schede di magazzino" -1 -1 78 21
|
||||
|
||||
LISTBOX F_SCHEDA 30
|
||||
BEGIN
|
||||
@ -248,10 +248,23 @@ END
|
||||
|
||||
BOOL F_SUDDIV_DEPOSITI
|
||||
BEGIN
|
||||
FLAGS "D"
|
||||
PROMPT 2 17 "Suddivido per depositi"
|
||||
PROMPT 2 17 "Suddivido per depositi"
|
||||
END
|
||||
|
||||
BOOL F_NO_VALORI
|
||||
BEGIN
|
||||
PROMPT 2 18 "Non stampare i valori"
|
||||
END
|
||||
|
||||
BOOL F_NO_FF
|
||||
BEGIN
|
||||
PROMPT 42 16 "Senza salto pagina"
|
||||
END
|
||||
|
||||
BOOL F_SINTETICA
|
||||
BEGIN
|
||||
PROMPT 42 17 "Stampa sintetica"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
|
||||
144
mg/mg3300a.frm
144
mg/mg3300a.frm
@ -34,8 +34,6 @@ END
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 1
|
||||
// FONT "Courier New"
|
||||
// SIZE 12
|
||||
END
|
||||
|
||||
SECTION GRAPHIC
|
||||
@ -53,14 +51,14 @@ SECTION HEADER ODD 5
|
||||
STRINGA 2 10
|
||||
BEGIN
|
||||
KEY "Data"
|
||||
PROMPT 120 1 "Data "
|
||||
PROMPT 65 1 "Data "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO 3 7
|
||||
BEGIN
|
||||
KEY "Nr. pagina"
|
||||
PROMPT 137 1 "Pagina "
|
||||
PROMPT 81 1 "Pagina "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
@ -85,37 +83,38 @@ SECTION HEADER ODD 5
|
||||
MESSAGE _USER,TIPOSCHEDA
|
||||
END
|
||||
|
||||
STRINGA 5 146
|
||||
STRINGA 5 95
|
||||
BEGIN
|
||||
KEY "Separatore (iniziale)"
|
||||
PROMPT 1 3 "------------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
END
|
||||
PROMPT 1 3 "-----------------------------------------------------------------------------------------------"
|
||||
END
|
||||
STRINGA 6 12
|
||||
BEGIN
|
||||
PROMPT 42 4 "UM"
|
||||
END
|
||||
NUMBER 7 12
|
||||
NUMERO 7 12
|
||||
BEGIN
|
||||
PROMPT 47 4 "Quantità"
|
||||
PROMPT 50 4 "Quantitŕ"
|
||||
END
|
||||
NUMBER 8 12
|
||||
VALUTA 8 12
|
||||
BEGIN
|
||||
PROMPT 62 4 "Prezzo"
|
||||
PROMPT 66 4 "Prezzo"
|
||||
FLAGS "U"
|
||||
END
|
||||
NUMBER 9 12
|
||||
VALUTA 9 12
|
||||
BEGIN
|
||||
PROMPT 78 4 "Valore"
|
||||
PROMPT 81 4 "Valore"
|
||||
END
|
||||
STRINGA 5 146
|
||||
STRINGA 5 95
|
||||
BEGIN
|
||||
KEY "Separatore (iniziale)"
|
||||
PROMPT 1 5 "------------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
PROMPT 1 5 "-----------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END
|
||||
|
||||
SECTION BODY ODD 0
|
||||
|
||||
NUMBER 100 1
|
||||
NUMERO 100 1
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,FF_SALDO_GART|RESET,FF_VALORE_GART
|
||||
@ -154,7 +153,7 @@ SECTION BODY ODD 0
|
||||
STRINGA 24 50 1
|
||||
BEGIN
|
||||
KEY "dep"
|
||||
PROMPT 1 2 "------------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
PROMPT 1 2 "-----------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END //HEADER articolo
|
||||
|
||||
@ -218,10 +217,10 @@ SECTION BODY ODD 0
|
||||
END
|
||||
END // HEADER deposito
|
||||
END // HEADER magazzino
|
||||
STRINGA 24 50 1
|
||||
STRINGA 24 95
|
||||
BEGIN
|
||||
KEY "dep"
|
||||
PROMPT 1 2 "------------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
PROMPT 1 2 "-----------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END // HEADER raggruppamenti di movimenti
|
||||
|
||||
@ -299,32 +298,32 @@ SECTION BODY ODD 0
|
||||
FLAGS "H"
|
||||
MESSAGE _USER,DESCRCAUSALE|COPY,FF_DESCRCAUSALE
|
||||
END
|
||||
NUMBER FF_QUANTRIGA 12
|
||||
NUMERO FF_QUANTRIGA 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->QUANT*349@->FC|_USER,*SEGNOCAUS,Q
|
||||
END
|
||||
SECTION MOVIMENTO_CAUSALE 1 0 0 FILE LF_RMOVMAG GROUP CAUS
|
||||
|
||||
NUMBER FF_QUANTRIGA 12
|
||||
NUMERO FF_QUANTRIGA 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->QUANT*349@->FC|_USER,*SEGNOCAUS,Q
|
||||
END
|
||||
|
||||
NUMBER FF_STAMPASALDOPREC 6
|
||||
NUMERO FF_STAMPASALDOPREC 6
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER FF_CANPRINTSALDOPREC 6
|
||||
NUMERO FF_CANPRINTSALDOPREC 6
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _USER,CANPRINTSALDOPREC
|
||||
END
|
||||
|
||||
SECTION MOVS_PRECEDENTI 1 0 0 STREXPR LF_MOVMAG->DATAREG<""
|
||||
NUMBER 103 30
|
||||
NUMERO 103 30
|
||||
BEGIN
|
||||
PROMPT 31 1 "Quantita' a saldo prec:"
|
||||
PICTURE "###.##@,@##"
|
||||
@ -346,39 +345,38 @@ SECTION BODY ODD 0
|
||||
FIELD LF_RMOVMAG->UM
|
||||
END
|
||||
|
||||
NUMBER 104 12
|
||||
VALUTA 104 12
|
||||
BEGIN
|
||||
PROMPT 42 1 ""
|
||||
PICTURE "###.###.###"
|
||||
FLAGS "U"
|
||||
FIELD LF_RMOVMAG->PREZZO
|
||||
END
|
||||
NUMBER 103 12
|
||||
NUMERO 103 12
|
||||
BEGIN
|
||||
PROMPT 31 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
MESSAGE _NUMEXPR,#FF_QUANTRIGA|ADD,FF_SALDO_MOV
|
||||
END
|
||||
NUMBER 105 12
|
||||
VALUTA 105 12
|
||||
BEGIN
|
||||
PROMPT 54 1 ""
|
||||
PICTURE "###.###.###"
|
||||
PROMPT 57 1 ""
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->QUANT*LF_RMOVMAG->PREZZO|_USER,*SEGNOCAUS,V|ADD,FF_VALORE_MOV
|
||||
END
|
||||
END // sezione movimenti di competenza
|
||||
END // SEZIONE righe movimento di competenza ragg. per causale
|
||||
|
||||
SECTION STAMPASALDOPREC 1 1 1 NUMEXPR (#FF_STAMPASALDOPREC==0)&&(#FF_CANPRINTSALDOPREC!=0)
|
||||
NUMBER 100 18
|
||||
NUMERO 100 18
|
||||
BEGIN
|
||||
PROMPT 8 1 "Saldo precedente :"
|
||||
END
|
||||
NUMBER FF_SALDOPREC 12
|
||||
NUMERO FF_SALDOPREC 15
|
||||
BEGIN
|
||||
PROMPT 46 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE _USER,SALDOPREC|ADD,FF_SALDO_GRMOV
|
||||
END
|
||||
NUMBER 101 12
|
||||
NUMERO 101 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,FF_SALDOPREC |INC,FF_STAMPASALDOPREC
|
||||
@ -392,7 +390,7 @@ SECTION BODY ODD 0
|
||||
SECTION TOTALI_MOV 1 1 1 NUMEXPR #FF_SALDO_MOV!=0
|
||||
|
||||
SECTION HEADER_MOV 1 1 1 NUMEXPR (#FF_NUMRIGHE==0)
|
||||
NUMBER FF_NUM_MOV 32
|
||||
NUMERO FF_NUM_MOV 32
|
||||
BEGIN
|
||||
PROMPT 2 1 "Mov. "
|
||||
END
|
||||
@ -406,16 +404,16 @@ SECTION BODY ODD 0
|
||||
END
|
||||
STRINGA FF_TIPOCF_MOV 1
|
||||
BEGIN
|
||||
PROMPT 60 1 ""
|
||||
PROMPT 63 1 ""
|
||||
END
|
||||
NUMERO FF_CODCF_MOV 6
|
||||
BEGIN
|
||||
PROMPT 62 1 ""
|
||||
PROMPT 65 1 ""
|
||||
PICTURE "######"
|
||||
END
|
||||
STRINGA FF_CLIFO_MOV 50
|
||||
BEGIN
|
||||
PROMPT 70 1 ""
|
||||
PROMPT 73 1 ""
|
||||
END
|
||||
END // header mov della scheda
|
||||
|
||||
@ -432,22 +430,20 @@ SECTION BODY ODD 0
|
||||
PROMPT 42 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
NUMBER FF_SALDO_MOV 12
|
||||
NUMERO FF_SALDO_MOV 15
|
||||
BEGIN
|
||||
PROMPT 46 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE _USER,ADDQTA,FF_SALDO_GRMOV
|
||||
END
|
||||
NUMBER FF_VALORE_MOV 15
|
||||
VALUTA FF_VALORE_MOV 15
|
||||
BEGIN
|
||||
PROMPT 69 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
PROMPT 72 1 ""
|
||||
MESSAGE _USER,ADDVAL,FF_VALORE_GRMOV
|
||||
END
|
||||
NUMBER 100 12
|
||||
VALUTA 190 12
|
||||
BEGIN
|
||||
PROMPT 57 1 ""
|
||||
PICTURE "###.###.##@"
|
||||
PROMPT 60 1 ""
|
||||
MESSAGE _NUMEXPR,#FF_VALORE_MOV/#FF_SALDO_MOV|INC,FF_NUMRIGHE
|
||||
END
|
||||
END // totali mov
|
||||
@ -466,58 +462,21 @@ SECTION BODY ODD 0
|
||||
FIELD LF_UMART->UM
|
||||
MESSAGE COPY,FF_UM_GART
|
||||
END
|
||||
NUMBER FF_SALDO_GRMOV 12
|
||||
NUMERO FF_SALDO_GRMOV 15
|
||||
BEGIN
|
||||
PROMPT 46 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE ADD,FF_SALDO_GART
|
||||
END
|
||||
NUMBER FF_VALORE_GRMOV 15
|
||||
VALUTA FF_VALORE_GRMOV 15
|
||||
BEGIN
|
||||
PROMPT 69 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
PROMPT 72 1 ""
|
||||
MESSAGE ADD,FF_VALORE_GART
|
||||
END
|
||||
END // TOTALI scheda per articolo
|
||||
END // loop RMOVMAG
|
||||
|
||||
SECTION TOTALI_MOV_ARTICOLO 1 0 0 GROUP // NUMEXPR #FF_SALDO_MOV!=0
|
||||
FLAGS "D"
|
||||
// da eliminare !!!!!!!!!!!
|
||||
/*
|
||||
NUMBER FF_NUM_MOVART 32
|
||||
BEGIN
|
||||
PROMPT 2 1 "Mov. "
|
||||
END
|
||||
STRINGA FF_DATA_MOVART 10
|
||||
BEGIN
|
||||
PROMPT 12 1 "del "
|
||||
END
|
||||
STRINGA 100 2
|
||||
BEGIN
|
||||
PROMPT 27 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
NUMBER FF_SALDO_MOVART 12
|
||||
BEGIN
|
||||
PROMPT 31 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
MESSAGE ADD,FF_SALDO_GRMOV
|
||||
END
|
||||
NUMBER 100 12
|
||||
BEGIN
|
||||
PROMPT 42 1 ""
|
||||
PICTURE "###.###.##@"
|
||||
MESSAGE _NUMEXPR,#FF_VALORE_MOV/#FF_SALDO_MOV
|
||||
END
|
||||
NUMBER FF_VALORE_MOVART 12
|
||||
BEGIN
|
||||
PROMPT 54 1 ""
|
||||
PICTURE "###.###.##@"
|
||||
MESSAGE ADD,FF_VALORE_GRMOV
|
||||
END
|
||||
*/
|
||||
END // totali mov
|
||||
|
||||
|
||||
END // ragg articolo (codice o catmer)
|
||||
SECTION TOTALI_GRUPPIART 1 1 3 GROUP //PG057 NUMEXPR #FF_SALDO_GART!=0
|
||||
@ -530,15 +489,14 @@ SECTION BODY ODD 0
|
||||
PROMPT 42 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
NUMBER FF_SALDO_GART 12
|
||||
NUMERO FF_SALDO_GART 15
|
||||
BEGIN
|
||||
PROMPT 46 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
PICTURE "##.###.##@,@##"
|
||||
END
|
||||
NUMBER FF_VALORE_GART 15
|
||||
VALUTA FF_VALORE_GART 15
|
||||
BEGIN
|
||||
PROMPT 69 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
PROMPT 72 1 ""
|
||||
END
|
||||
END // TOTALI scheda per articolo
|
||||
|
||||
|
||||
479
mg/mg3300as.frm
Executable file
479
mg/mg3300as.frm
Executable file
@ -0,0 +1,479 @@
|
||||
// form stampa schede per articolo
|
||||
#include "mg3300.h"
|
||||
USE LF_ANAMAG
|
||||
SORT LF_RMOVMAG BY CODART[1,2] NUMREG
|
||||
USING LF_MOVMAG INTO NUMREG==NUMREG
|
||||
JOIN TO LF_ANAMAG KEY 2 INTO CODART==CODART
|
||||
JOIN LF_MAG TO LF_RMOVMAG KEY 2 INTO ANNOES==1990 CODMAG==CODMAG CODART==CODART LIVELLO==LIVGIAC
|
||||
JOIN LF_MOVMAG TO LF_RMOVMAG INTO NUMREG==NUMREG
|
||||
//JOIN %CAU TO LF_RMOVMAG ALIAS ALIAS_CAU_RIGHE INTO CODTAB==CODCAUS
|
||||
//JOIN %CAU TO LF_MOVMAG ALIAS ALIAS_CAU_MOV INTO CODTAB==CODCAUS
|
||||
|
||||
JOIN MAG TO LF_RMOVMAG ALIAS ALIAS_MAG INTO CODTAB==CODMAG[1,3]
|
||||
JOIN MAG TO LF_RMOVMAG ALIAS ALIAS_DEP INTO CODTAB==CODMAG
|
||||
JOIN GMC TO LF_ANAMAG ALIAS ALIAS_CATMER INTO CODTAB==GRMERC[1,3]
|
||||
JOIN GMC TO LF_ANAMAG ALIAS ALIAS_SOTTOCATMER INTO CODTAB==GRMERC[1,5]
|
||||
|
||||
JOIN LF_UMART TO LF_ANAMAG INTO CODART==CODART
|
||||
JOIN LF_UMART TO LF_RMOVMAG KEY 2 ALIAS 349 INTO CODART==CODART UM==UM
|
||||
|
||||
JOIN LF_CLIFO TO LF_MOVMAG INTO TIPOCF==TIPOCF CODCF==CODCF
|
||||
|
||||
END
|
||||
|
||||
DESCRIPTION
|
||||
BEGIN
|
||||
47->* "Anagrafica articoli"
|
||||
109->* "Archivio Giacenze"
|
||||
MAG->* "Tabella magazzini"
|
||||
110->* "Movimenti di magazzino"
|
||||
111->* "Righe Movimenti di magazzino"
|
||||
49->* "Unità di misura articoli"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 1
|
||||
END
|
||||
|
||||
SECTION GRAPHIC
|
||||
BEGIN
|
||||
END
|
||||
|
||||
SECTION HEADER ODD 5
|
||||
STRINGA 1 40 1
|
||||
BEGIN
|
||||
KEY "nome ditta"
|
||||
PROMPT 1 1 "Ditta "
|
||||
MESSAGE _DITTA, !RAGSOC
|
||||
END
|
||||
|
||||
STRINGA 2 10
|
||||
BEGIN
|
||||
KEY "Data"
|
||||
PROMPT 85 1 "Data "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO 3 7
|
||||
BEGIN
|
||||
KEY "Nr. pagina"
|
||||
PROMPT 101 1 "Pagina "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
DATA 20
|
||||
BEGIN
|
||||
KEY "Data inizio"
|
||||
PROMPT 1 2 "Dal "
|
||||
MESSAGE _USER,DADATA
|
||||
END
|
||||
|
||||
DATA 21
|
||||
BEGIN
|
||||
KEY "Data fine"
|
||||
PROMPT 17 2 "Al "
|
||||
MESSAGE _USER,ADATA
|
||||
END
|
||||
|
||||
STRINGA 4 45
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 45 2 "Stampa schede di magazzino :"
|
||||
MESSAGE _USER,TIPOSCHEDA
|
||||
END
|
||||
|
||||
STRINGA 5 115
|
||||
BEGIN
|
||||
KEY "Separatore (iniziale)"
|
||||
PROMPT 1 3 "-------------------------------------------------------------------------------------------------------------------"
|
||||
END
|
||||
STRINGA 1 4
|
||||
BEGIN
|
||||
PROMPT 1 4 "Mov."
|
||||
END
|
||||
STRINGA 2 3
|
||||
BEGIN
|
||||
PROMPT 11 4 "Del"
|
||||
END
|
||||
STRINGA 3 11
|
||||
BEGIN
|
||||
PROMPT 20 4 "Descrizione"
|
||||
END
|
||||
STRINGA 6 3
|
||||
BEGIN
|
||||
PROMPT 62 4 "UM"
|
||||
END
|
||||
NUMERO 7 12
|
||||
BEGIN
|
||||
PROMPT 66 4 "Quantità"
|
||||
END
|
||||
VALUTA 8 12
|
||||
BEGIN
|
||||
PROMPT 82 4 "Prezzo"
|
||||
FLAGS "U"
|
||||
END
|
||||
VALUTA 9 12
|
||||
BEGIN
|
||||
PROMPT 96 4 "Valore"
|
||||
END
|
||||
STRINGA 10 5
|
||||
BEGIN
|
||||
PROMPT 110 4 "Caus."
|
||||
END
|
||||
STRINGA 5 115
|
||||
BEGIN
|
||||
KEY "Separatore (iniziale)"
|
||||
PROMPT 1 5 "-------------------------------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END
|
||||
|
||||
SECTION BODY ODD 0
|
||||
|
||||
NUMERO 100 1
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,FF_SALDO_GART|RESET,FF_VALORE_GART
|
||||
END
|
||||
|
||||
SECTION HEADER_ARTICOLO 1 2 2 NORMAL GROUP
|
||||
FLAGS "N"
|
||||
SECTION HEADER_CATMER 1 2 1 GROUP
|
||||
STRINGA 10 20 1
|
||||
BEGIN
|
||||
KEY "CODICE CATMER"
|
||||
PROMPT 1 1 "Gruppo merceologico "
|
||||
MESSAGE _USER,CODCATMER|RESET,FF_STAMPASALDOPREC
|
||||
END
|
||||
STRINGA 12 50 1
|
||||
BEGIN
|
||||
KEY "DESCR."
|
||||
PROMPT 30 1 ""
|
||||
MESSAGE _USER,CATMER
|
||||
END
|
||||
END //HEADER catmer
|
||||
|
||||
STRINGA 10 20 1
|
||||
BEGIN
|
||||
KEY "CODICE articolo"
|
||||
PROMPT 1 1 "Articolo "
|
||||
MESSAGE _USER,CODGRUPPOART|RESET,FF_STAMPASALDOPREC
|
||||
END
|
||||
|
||||
STRINGA 11 50 1
|
||||
BEGIN
|
||||
KEY "DESCR.articolo"
|
||||
PROMPT 30 1 ""
|
||||
MESSAGE _USER,GRUPPOART
|
||||
END
|
||||
STRINGA 24 115 1
|
||||
BEGIN
|
||||
KEY "dep"
|
||||
PROMPT 1 2 "-------------------------------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END //HEADER articolo
|
||||
|
||||
SECTION GRUPPI_ARTICOLO 1 0 0 FILE LF_ANAMAG BY CODART
|
||||
SECTION FILE_RMOVMAG 1 1 0 FILE LF_RMOVMAG
|
||||
SECTION HEADER_GRMOV 1 2 2 NORMAL GROUP
|
||||
SECTION HEADER_LIVGIACCATMER 1 1 1 GROUP
|
||||
STRINGA 10 20 1
|
||||
BEGIN
|
||||
KEY "CODICE CATMER"
|
||||
PROMPT 1 1 "Gruppo merceologico "
|
||||
MESSAGE _USER,CODCATMER|RESET,FF_STAMPASALDOPREC
|
||||
END
|
||||
STRINGA 12 50 1
|
||||
BEGIN
|
||||
KEY "DESCR."
|
||||
PROMPT 30 1 ""
|
||||
MESSAGE _USER,CATMER
|
||||
END
|
||||
END //HEADER catmer
|
||||
|
||||
STRINGA 10 20 1
|
||||
BEGIN
|
||||
KEY "CODICE articolo"
|
||||
PROMPT 1 1 "Gruppo "
|
||||
MESSAGE _USER,CODGRUPPOART|RESET,FF_STAMPASALDOPREC
|
||||
END
|
||||
STRINGA 11 50 1
|
||||
BEGIN
|
||||
KEY "DESCR.articolo"
|
||||
PROMPT 30 1 ""
|
||||
MESSAGE _USER,GRUPPOART
|
||||
END
|
||||
SECTION HEADER_LIVGIAC 2 1 1 GROUP
|
||||
STRINGA 20 20 1
|
||||
BEGIN
|
||||
KEY "CODICE livello"
|
||||
PROMPT 1 1 ""
|
||||
MESSAGE _USER,CODGRUPPOGIAC
|
||||
END
|
||||
STRINGA 21 50 1
|
||||
BEGIN
|
||||
KEY "Livello giac"
|
||||
PROMPT 23 1 ""
|
||||
MESSAGE _USER,GRUPPOGIAC
|
||||
END
|
||||
END
|
||||
SECTION HEADER_MAG 2 1 1 GROUP
|
||||
STRINGA 22 50 1
|
||||
BEGIN
|
||||
KEY "mag"
|
||||
PROMPT 3 1 "Magazzino "
|
||||
FIELD ALIAS_MAG@->S0
|
||||
END
|
||||
SECTION HEADER_DEP 2 1 1 STR_EXPR ALIAS_MAG@->B0=="X"
|
||||
STRINGA 23 50 1
|
||||
BEGIN
|
||||
KEY "dep"
|
||||
PROMPT 5 1 "Deposito "
|
||||
FIELD ALIAS_DEP@->S0
|
||||
END
|
||||
END // HEADER deposito
|
||||
END // HEADER magazzino
|
||||
STRINGA 24 115
|
||||
BEGIN
|
||||
KEY "dep"
|
||||
PROMPT 1 2 "-------------------------------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END // HEADER raggruppamenti di movimenti
|
||||
|
||||
STRINGA 10
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,FF_SALDO_GRMOV|RESET,FF_VALORE_GRMOV
|
||||
END
|
||||
|
||||
SECTION GRUPPI_RMOVMAG 1 0 0 FILE LF_RMOVMAG GROUP CODART
|
||||
|
||||
SECTION H_MOVS_INTERESSATI 1 0 0 STREXPR LF_MOVMAG->DATAREG>""
|
||||
NUMERO 10
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
FIELD LF_RMOVMAG->NUMREG
|
||||
MESSAGE COPY,FF_NUM_MOV
|
||||
END
|
||||
NUMERO 11
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
FIELD LF_MOVMAG->DATAREG
|
||||
MESSAGE COPY,FF_DATA_MOV
|
||||
END
|
||||
|
||||
STRINGA 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
FIELD LF_MOVMAG->DESCR
|
||||
MESSAGE COPY,FF_DESCR_MOV
|
||||
END
|
||||
|
||||
NUMERO 16
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,FF_NUMRIGHE
|
||||
END
|
||||
END // header mov
|
||||
|
||||
SECTION MOVIMENTO 1 0 0 FILE LF_RMOVMAG GROUP NUMREG
|
||||
|
||||
NUMERO FF_NUMRIGHE
|
||||
BEGIN
|
||||
KEY "Contatore del numero di righe raggruppate"
|
||||
END
|
||||
|
||||
NUMERO 13
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _USER,CAUSALERIGA|COPY,FF_CAUSALE_RIGA|RESET,FF_SALDO_MOV|RESET,FF_VALORE_MOV
|
||||
END
|
||||
NUMERO FF_QUANTRIGA 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->QUANT*349@->FC|_USER,*SEGNOCAUS,Q
|
||||
END
|
||||
SECTION MOVIMENTO_CAUSALE 1 0 0 FILE LF_RMOVMAG GROUP CAUS
|
||||
|
||||
NUMERO FF_QUANTRIGA 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->QUANT*349@->FC|_USER,*SEGNOCAUS,Q
|
||||
END
|
||||
|
||||
NUMERO FF_STAMPASALDOPREC 6
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMERO FF_CANPRINTSALDOPREC 6
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _USER,CANPRINTSALDOPREC
|
||||
END
|
||||
|
||||
SECTION MOVS_PRECEDENTI 1 0 0 STREXPR LF_MOVMAG->DATAREG<""
|
||||
NUMERO 103 30
|
||||
BEGIN
|
||||
PROMPT 31 1 "Quantita' a saldo prec:"
|
||||
PICTURE "###.##@,@##"
|
||||
MESSAGE _NUMEXPR,#FF_QUANTRIGA|ADD,FF_SALDOPREC
|
||||
END
|
||||
END
|
||||
|
||||
SECTION MOVS_INTERESSATI 1 0 0 STREXPR LF_MOVMAG->DATAREG>=""
|
||||
|
||||
STRINGA 100 30
|
||||
BEGIN
|
||||
PROMPT 1 1 ""
|
||||
MESSAGE _STREXPR,LF_RMOVMAG->CODART+"/"+LF_RMOVMAG->LIVGIAC+":"+LF_RMOVMAG->CODMAG
|
||||
END
|
||||
|
||||
STRINGA 101 12
|
||||
BEGIN
|
||||
PROMPT 27 1 ""
|
||||
FIELD LF_RMOVMAG->UM
|
||||
END
|
||||
|
||||
VALUTA 104 12
|
||||
BEGIN
|
||||
PROMPT 42 1 ""
|
||||
FLAGS "U"
|
||||
FIELD LF_RMOVMAG->PREZZO
|
||||
END
|
||||
NUMERO 103 12
|
||||
BEGIN
|
||||
PROMPT 31 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
MESSAGE _NUMEXPR,#FF_QUANTRIGA|ADD,FF_SALDO_MOV
|
||||
END
|
||||
VALUTA 105 12
|
||||
BEGIN
|
||||
PROMPT 57 1 ""
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->QUANT*LF_RMOVMAG->PREZZO|_USER,*SEGNOCAUS,V|ADD,FF_VALORE_MOV
|
||||
END
|
||||
END // sezione movimenti di competenza
|
||||
END // SEZIONE righe movimento di competenza ragg. per causale
|
||||
|
||||
SECTION STAMPASALDOPREC 1 1 1 NUMEXPR (#FF_STAMPASALDOPREC==0)&&(#FF_CANPRINTSALDOPREC!=0)
|
||||
NUMERO 100 18
|
||||
BEGIN
|
||||
PROMPT 20 1 "Saldo precedente :"
|
||||
END
|
||||
NUMERO FF_SALDOPREC 15
|
||||
BEGIN
|
||||
PROMPT 66 1 ""
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE _USER,SALDOPREC|ADD,FF_SALDO_GRMOV
|
||||
END
|
||||
NUMERO 101 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,FF_SALDOPREC |INC,FF_STAMPASALDOPREC
|
||||
END
|
||||
STRINGA 102 12
|
||||
BEGIN
|
||||
PROMPT 62 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
END // stampa saldo precedente
|
||||
SECTION TOTALI_MOV 1 1 1 NUMEXPR #FF_SALDO_MOV!=0
|
||||
|
||||
STRINGA FF_CAUSALE_RIGA 5
|
||||
BEGIN
|
||||
PROMPT 110 1 ""
|
||||
END
|
||||
NUMERO FF_NUM_MOV 6
|
||||
BEGIN
|
||||
PROMPT 1 1 ""
|
||||
END
|
||||
STRINGA FF_DATA_MOV 10
|
||||
BEGIN
|
||||
PROMPT 8 1 ""
|
||||
END
|
||||
STRINGA FF_DESCR_MOV 40
|
||||
BEGIN
|
||||
PROMPT 20 1 ""
|
||||
END
|
||||
|
||||
STRINGA 100 2
|
||||
BEGIN
|
||||
PROMPT 62 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
NUMERO FF_SALDO_MOV 15
|
||||
BEGIN
|
||||
PROMPT 66 1 ""
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE _USER,ADDQTA,FF_SALDO_GRMOV
|
||||
END
|
||||
VALUTA FF_VALORE_MOV 15
|
||||
BEGIN
|
||||
PROMPT 92 1 ""
|
||||
MESSAGE _USER,ADDVAL,FF_VALORE_GRMOV
|
||||
END
|
||||
VALUTA 190 12
|
||||
BEGIN
|
||||
PROMPT 80 1 ""
|
||||
MESSAGE _NUMEXPR,#FF_VALORE_MOV/#FF_SALDO_MOV|INC,FF_NUMRIGHE
|
||||
END
|
||||
END // totali mov
|
||||
|
||||
END // loop movimento
|
||||
END // loop scheda
|
||||
SECTION TOTALI_GRMOV 1 1 3 GROUP //PG057 NUMEXPR #FF_SALDO_GRMOV!=0
|
||||
|
||||
STRINGA 100 15
|
||||
BEGIN
|
||||
PROMPT 20 1 "Totale scheda"
|
||||
END
|
||||
STRINGA 100 2
|
||||
BEGIN
|
||||
PROMPT 62 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
MESSAGE COPY,FF_UM_GART
|
||||
END
|
||||
NUMERO FF_SALDO_GRMOV 15
|
||||
BEGIN
|
||||
PROMPT 66 1 ""
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE ADD,FF_SALDO_GART
|
||||
END
|
||||
VALUTA FF_VALORE_GRMOV 15
|
||||
BEGIN
|
||||
PROMPT 92 1 ""
|
||||
MESSAGE ADD,FF_VALORE_GART
|
||||
END
|
||||
END // TOTALI scheda per articolo
|
||||
END // loop RMOVMAG
|
||||
|
||||
|
||||
|
||||
END // ragg articolo (codice o catmer)
|
||||
SECTION TOTALI_GRUPPIART 1 1 3 GROUP //PG057 NUMEXPR #FF_SALDO_GART!=0
|
||||
STRINGA 100 15
|
||||
BEGIN
|
||||
PROMPT 20 1 "Totale scheda"
|
||||
END
|
||||
STRINGA FF_UM_GART 2
|
||||
BEGIN
|
||||
PROMPT 62 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
NUMERO FF_SALDO_GART 15
|
||||
BEGIN
|
||||
PROMPT 66 1 ""
|
||||
PICTURE "##.###.##@,@##"
|
||||
END
|
||||
VALUTA FF_VALORE_GART 15
|
||||
BEGIN
|
||||
PROMPT 92 1 ""
|
||||
END
|
||||
END // TOTALI scheda per articolo
|
||||
|
||||
END // *****
|
||||
|
||||
SECTION FOOTER ODD 2
|
||||
|
||||
END
|
||||
|
||||
@ -48,14 +48,14 @@ SECTION HEADER ODD 5
|
||||
STRINGA 2 10
|
||||
BEGIN
|
||||
KEY "Data"
|
||||
PROMPT 120 1 "Data "
|
||||
PROMPT 65 1 "Data "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO 3 7
|
||||
BEGIN
|
||||
KEY "Nr. pagina"
|
||||
PROMPT 137 1 "Pagina "
|
||||
PROMPT 81 1 "Pagina "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
@ -80,10 +80,10 @@ SECTION HEADER ODD 5
|
||||
MESSAGE _USER,TIPOSCHEDA
|
||||
END
|
||||
|
||||
STRINGA 5 146
|
||||
STRINGA 5 95
|
||||
BEGIN
|
||||
KEY "Separatore (iniziale)"
|
||||
PROMPT 1 3 "------------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
PROMPT 1 3 "-----------------------------------------------------------------------------------------------"
|
||||
END
|
||||
STRINGA 6 12
|
||||
BEGIN
|
||||
@ -91,20 +91,21 @@ SECTION HEADER ODD 5
|
||||
END
|
||||
NUMBER 7 12
|
||||
BEGIN
|
||||
PROMPT 46 4 "Quantità"
|
||||
PROMPT 50 4 "Quantitŕ"
|
||||
END
|
||||
NUMBER 8 12
|
||||
VALUTA 8 12
|
||||
BEGIN
|
||||
PROMPT 62 4 "Prezzo"
|
||||
PROMPT 66 4 "Prezzo"
|
||||
FLAGS "U"
|
||||
END
|
||||
NUMBER 9 15
|
||||
BEGIN
|
||||
PROMPT 78 4 "Valore"
|
||||
PROMPT 81 4 "Valore"
|
||||
END
|
||||
STRINGA 5 146
|
||||
STRINGA 5 95
|
||||
BEGIN
|
||||
KEY "Separatore (iniziale)"
|
||||
PROMPT 1 5 "------------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
PROMPT 1 5 "-----------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END
|
||||
|
||||
@ -191,10 +192,10 @@ SECTION BODY ODD 2
|
||||
END
|
||||
END // HEADER livgiac
|
||||
END //HEADER articolo
|
||||
STRINGA 24 50 1
|
||||
STRINGA 24 95
|
||||
BEGIN
|
||||
KEY "dep"
|
||||
PROMPT 1 2 "------------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
PROMPT 1 2 "-----------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END // HEADER magazzino
|
||||
|
||||
@ -279,11 +280,10 @@ SECTION BODY ODD 2
|
||||
PROMPT 27 1 ""
|
||||
FIELD LF_RMOVMAG->UM
|
||||
END
|
||||
|
||||
NUMBER 104 12
|
||||
VALUTA 104 12
|
||||
BEGIN
|
||||
PROMPT 42 1 ""
|
||||
PICTURE "###.###.###"
|
||||
FLAGS "U"
|
||||
FIELD LF_RMOVMAG->PREZZO
|
||||
END
|
||||
NUMBER 103 12
|
||||
@ -292,10 +292,9 @@ SECTION BODY ODD 2
|
||||
PICTURE "###.##@,@##"
|
||||
MESSAGE _NUMEXPR,#FF_QUANTRIGA|ADD,FF_SALDO_MOV
|
||||
END
|
||||
NUMBER 105 12
|
||||
VALUTA 105 12
|
||||
BEGIN
|
||||
PROMPT 54 1 ""
|
||||
PICTURE "###.###.###"
|
||||
PROMPT 57 1 ""
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->QUANT*LF_RMOVMAG->PREZZO|_USER,*SEGNOCAUS,V|ADD,FF_VALORE_MOV
|
||||
END
|
||||
END // sezione movimento di competenza
|
||||
@ -306,10 +305,10 @@ SECTION BODY ODD 2
|
||||
BEGIN
|
||||
PROMPT 8 1 "Saldo precedente :"
|
||||
END
|
||||
NUMBER FF_SALDOPREC 12
|
||||
NUMBER FF_SALDOPREC 15
|
||||
BEGIN
|
||||
PROMPT 31 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
PROMPT 46 1 ""
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE _USER,SALDOPREC|ADD,FF_SALDO_GART
|
||||
END
|
||||
NUMBER 101 12
|
||||
@ -319,7 +318,7 @@ SECTION BODY ODD 2
|
||||
END
|
||||
STRINGA 102 12
|
||||
BEGIN
|
||||
PROMPT 27 1 ""
|
||||
PROMPT 42 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
END // stampa saldo precedente
|
||||
@ -350,22 +349,21 @@ SECTION BODY ODD 2
|
||||
PROMPT 42 2 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
NUMBER FF_SALDO_MOV 12
|
||||
NUMBER FF_SALDO_MOV 15
|
||||
BEGIN
|
||||
PROMPT 46 2 ""
|
||||
PICTURE "###.##@,@##"
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE _USER,ADDQTA,FF_SALDO_GART
|
||||
END
|
||||
NUMBER FF_VALORE_MOV 15
|
||||
VALUTA FF_VALORE_MOV 15
|
||||
BEGIN
|
||||
PROMPT 69 2 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
PROMPT 72 2 ""
|
||||
MESSAGE _USER,ADDVAL,FF_VALORE_GART
|
||||
END
|
||||
NUMBER 100 12
|
||||
VALUTA 190 12
|
||||
BEGIN
|
||||
PROMPT 57 2 ""
|
||||
PICTURE "###.###.##@"
|
||||
PROMPT 60 2 ""
|
||||
FLAGS "U"
|
||||
MESSAGE _NUMEXPR,#FF_VALORE_MOV/#FF_SALDO_MOV
|
||||
END
|
||||
END // totali mov
|
||||
@ -382,15 +380,14 @@ SECTION BODY ODD 2
|
||||
PROMPT 42 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
NUMBER FF_SALDO_GART 12
|
||||
NUMBER FF_SALDO_GART 15
|
||||
BEGIN
|
||||
PROMPT 46 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
PICTURE "##.###.##@,@##"
|
||||
END
|
||||
NUMBER FF_VALORE_GART 15
|
||||
VALUTA FF_VALORE_GART 15
|
||||
BEGIN
|
||||
PROMPT 69 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
PROMPT 72 1 ""
|
||||
END
|
||||
END // TOTALI scheda per articolo
|
||||
END // loop RMOVMAG raggruppate
|
||||
|
||||
406
mg/mg3300bs.frm
Executable file
406
mg/mg3300bs.frm
Executable file
@ -0,0 +1,406 @@
|
||||
// form stampa schede per magazzino
|
||||
#include "mg3300.h"
|
||||
USE LF_RMOVMAG KEY 2 BY CODMAG CODART LIVGIAC LF_MOVMAG->DATAREG NUMREG
|
||||
JOIN LF_MAG TO LF_RMOVMAG KEY 2 INTO ANNOES==1996 CODMAG==CODMAG CODART==CODART LIVELLO==LIVGIAC
|
||||
JOIN LF_ANAMAG TO LF_RMOVMAG INTO CODART==CODART
|
||||
JOIN LF_MOVMAG TO LF_RMOVMAG INTO NUMREG==NUMREG
|
||||
JOIN %CAU TO LF_MOVMAG INTO CODTAB==CODCAUS
|
||||
|
||||
JOIN MAG TO LF_RMOVMAG ALIAS 500 INTO CODTAB==CODMAG[1,3]
|
||||
JOIN MAG TO LF_RMOVMAG ALIAS 501 INTO CODTAB==CODMAG
|
||||
|
||||
JOIN GMC TO LF_ANAMAG ALIAS ALIAS_CATMER INTO CODTAB==GRMERC[1,3]
|
||||
JOIN GMC TO LF_ANAMAG ALIAS ALIAS_SOTTOCATMER INTO CODTAB==GRMERC[1,5]
|
||||
|
||||
JOIN LF_UMART TO LF_ANAMAG INTO CODART==CODART
|
||||
JOIN LF_UMART TO LF_RMOVMAG KEY 2 ALIAS 349 INTO CODART==CODART UM==UM
|
||||
END
|
||||
|
||||
DESCRIPTION
|
||||
BEGIN
|
||||
47->* "Anagrafica articoli"
|
||||
109->* "Archivio Giacenze"
|
||||
MAG->* "Tabella magazzini"
|
||||
110->* "Movimenti di magazzino"
|
||||
111->* "Righe Movimenti di magazzino"
|
||||
49->* "Unità di misura articoli"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 1
|
||||
// FONT "Courier New"
|
||||
// SIZE 12
|
||||
END
|
||||
|
||||
SECTION GRAPHIC
|
||||
BEGIN
|
||||
END
|
||||
|
||||
SECTION HEADER ODD 5
|
||||
STRINGA 1 40 1
|
||||
BEGIN
|
||||
KEY "nome ditta"
|
||||
PROMPT 1 1 "Ditta "
|
||||
MESSAGE _DITTA, !RAGSOC
|
||||
END
|
||||
|
||||
STRINGA 2 10
|
||||
BEGIN
|
||||
KEY "Data"
|
||||
PROMPT 85 1 "Data "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO 3 7
|
||||
BEGIN
|
||||
KEY "Nr. pagina"
|
||||
PROMPT 101 1 "Pagina "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
DATA 20
|
||||
BEGIN
|
||||
KEY "Data inizio"
|
||||
PROMPT 1 2 "Dal "
|
||||
MESSAGE _USER,DADATA
|
||||
END
|
||||
|
||||
DATA 21
|
||||
BEGIN
|
||||
KEY "Data fine"
|
||||
PROMPT 17 2 "Al "
|
||||
MESSAGE _USER,ADATA
|
||||
END
|
||||
|
||||
STRINGA 4 45
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 45 2 "Stampa schede di magazzino :"
|
||||
MESSAGE _USER,TIPOSCHEDA
|
||||
END
|
||||
|
||||
STRINGA 5 115
|
||||
BEGIN
|
||||
KEY "Separatore (iniziale)"
|
||||
PROMPT 1 3 "-------------------------------------------------------------------------------------------------------------------"
|
||||
END
|
||||
STRINGA 1 4
|
||||
BEGIN
|
||||
PROMPT 1 4 "Mov."
|
||||
END
|
||||
STRINGA 2 3
|
||||
BEGIN
|
||||
PROMPT 11 4 "Del"
|
||||
END
|
||||
STRINGA 3 11
|
||||
BEGIN
|
||||
PROMPT 20 4 "Descrizione"
|
||||
END
|
||||
STRINGA 6 3
|
||||
BEGIN
|
||||
PROMPT 62 4 "UM"
|
||||
END
|
||||
NUMERO 7 12
|
||||
BEGIN
|
||||
PROMPT 66 4 "Quantità"
|
||||
END
|
||||
VALUTA 8 12
|
||||
BEGIN
|
||||
PROMPT 82 4 "Prezzo"
|
||||
FLAGS "U"
|
||||
END
|
||||
VALUTA 9 12
|
||||
BEGIN
|
||||
PROMPT 96 4 "Valore"
|
||||
END
|
||||
STRINGA 10 5
|
||||
BEGIN
|
||||
PROMPT 110 4 "Caus."
|
||||
END
|
||||
STRINGA 5 115
|
||||
BEGIN
|
||||
KEY "Separatore (iniziale)"
|
||||
PROMPT 1 5 "-------------------------------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END
|
||||
|
||||
SECTION BODY ODD 2
|
||||
|
||||
NUMBER 100 1
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,FF_SALDO_GART|RESET,FF_VALORE_GART
|
||||
END
|
||||
|
||||
SECTION HEADER_MAG 1 2 2 GROUP
|
||||
FLAGS "N"
|
||||
STRINGA 22 20 1
|
||||
BEGIN
|
||||
KEY "mag"
|
||||
PROMPT 1 1 "Magazzino "
|
||||
FIELD 500@->CODTAB[1,3]
|
||||
END
|
||||
STRINGA 22 50 1
|
||||
BEGIN
|
||||
KEY "mag"
|
||||
PROMPT 15 1 ""
|
||||
FIELD 500@->S0
|
||||
END
|
||||
SECTION HEADER_DEP 2 0 0 GROUP
|
||||
SECTION HEADER_DEP_VERO 1 1 1 STR_EXPR 500@->B0=="X"
|
||||
STRINGA 23 20 1
|
||||
BEGIN
|
||||
KEY "dep"
|
||||
PROMPT 3 1 "Deposito "
|
||||
FIELD 501@->CODTAB[4,5]
|
||||
END
|
||||
STRINGA 23 50 1
|
||||
BEGIN
|
||||
KEY "dep"
|
||||
PROMPT 15 1 ""
|
||||
FIELD 501@->S0
|
||||
END
|
||||
END
|
||||
END // HEADER deposito
|
||||
SECTION HEADER_CATMER 1 2 1 GROUP
|
||||
FLAGS "H"
|
||||
STRINGA 10 20 1
|
||||
BEGIN
|
||||
KEY "CODICE CATMER"
|
||||
PROMPT 1 1 "Gruppo merceologico "
|
||||
MESSAGE _USER,CODCATMER
|
||||
END
|
||||
STRINGA 12 50 1
|
||||
BEGIN
|
||||
KEY "DESCR."
|
||||
PROMPT 30 1 ""
|
||||
MESSAGE _USER,CATMER
|
||||
END
|
||||
END //HEADER catmer
|
||||
|
||||
SECTION HEADER_ARTICOLO 2 1 1 GROUP
|
||||
STRINGA 10 20 1
|
||||
BEGIN
|
||||
KEY "CODICE articolo"
|
||||
PROMPT 5 1 "Articolo "
|
||||
MESSAGE _USER,CODGRUPPOART
|
||||
END
|
||||
|
||||
STRINGA 11 50 1
|
||||
BEGIN
|
||||
KEY "DESCR.articolo"
|
||||
PROMPT 30 1 ""
|
||||
MESSAGE _USER,GRUPPOART
|
||||
END
|
||||
SECTION HEADER_LIVGIAC 2 1 1 GROUP
|
||||
STRINGA 20 20 1
|
||||
BEGIN
|
||||
KEY "CODICE livello"
|
||||
PROMPT 5 1 ""
|
||||
MESSAGE _USER,CODGRUPPOGIAC
|
||||
END
|
||||
STRINGA 21 50 1
|
||||
BEGIN
|
||||
KEY "Livello giac"
|
||||
PROMPT 23 1 ""
|
||||
MESSAGE _USER,GRUPPOGIAC
|
||||
END
|
||||
END // HEADER livgiac
|
||||
END //HEADER articolo
|
||||
STRINGA 24 115
|
||||
BEGIN
|
||||
KEY "dep"
|
||||
PROMPT 1 2 "-------------------------------------------------------------------------------------------------------------------"
|
||||
END
|
||||
END // HEADER magazzino
|
||||
|
||||
SECTION FILE_RMOVMAG 1 0 0 FILE LF_ANAMAG
|
||||
|
||||
STRINGA 10
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,FF_SALDO_GART|RESET,FF_VALORE_GART|RESET,FF_STAMPASALDOPREC
|
||||
END
|
||||
|
||||
SECTION GRUPPI_RMOVMAG 1 0 0 FILE LF_RMOVMAG GROUP CODMAG+CODART
|
||||
SECTION H_MOVS_INTERESSATI 1 0 0 STREXPR LF_MOVMAG->DATAREG>""
|
||||
|
||||
NUMERO 10
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
FIELD LF_RMOVMAG->NUMREG
|
||||
MESSAGE COPY,FF_NUM_MOV|RESET,FF_SALDO_MOV|RESET,FF_VALORE_MOV
|
||||
END
|
||||
NUMERO 11
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
FIELD LF_MOVMAG->DATAREG
|
||||
MESSAGE COPY,FF_DATA_MOV
|
||||
END
|
||||
NUMERO 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
FIELD LF_MOVMAG->DESCR
|
||||
MESSAGE COPY,FF_DESCR_MOV
|
||||
END
|
||||
NUMERO 13
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _USER,CAUSALERIGA|COPY,FF_CAUSALE_RIGA
|
||||
END
|
||||
END // header mov
|
||||
|
||||
SECTION MOVIMENTO 1 0 0 FILE LF_RMOVMAG GROUP NUMREG
|
||||
|
||||
NUMBER FF_QUANTRIGA 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->QUANT*349@->FC|_USER,*SEGNOCAUS,Q
|
||||
END
|
||||
|
||||
NUMBER FF_STAMPASALDOPREC 30
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER FF_CANPRINTSALDOPREC 6
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE _USER,CANPRINTSALDOPREC
|
||||
END
|
||||
|
||||
SECTION MOVS_PRECEDENTI 1 0 0 STREXPR LF_MOVMAG->DATAREG<""
|
||||
NUMBER 103 30
|
||||
BEGIN
|
||||
PROMPT 31 1 "Quantita' a saldo prec:"
|
||||
PICTURE "###.##@,@##"
|
||||
MESSAGE _NUMEXPR,#FF_QUANTRIGA|ADD,FF_SALDOPREC
|
||||
END
|
||||
END
|
||||
|
||||
SECTION MOVS_INTERESSATI 1 0 0 STREXPR LF_MOVMAG->DATAREG>=""
|
||||
STRINGA 100 30
|
||||
BEGIN
|
||||
PROMPT 1 1 ">>>"
|
||||
MESSAGE _STREXPR,LF_RMOVMAG->CODART+" "+LF_RMOVMAG->LIVGIAC+" "+LF_RMOVMAG->CODMAG
|
||||
END
|
||||
|
||||
STRINGA 101 12
|
||||
BEGIN
|
||||
PROMPT 27 1 ""
|
||||
FIELD LF_RMOVMAG->UM
|
||||
END
|
||||
VALUTA 104 12
|
||||
BEGIN
|
||||
PROMPT 42 1 ""
|
||||
FLAGS "U"
|
||||
FIELD LF_RMOVMAG->PREZZO
|
||||
END
|
||||
NUMBER 103 12
|
||||
BEGIN
|
||||
PROMPT 31 1 ""
|
||||
PICTURE "###.##@,@##"
|
||||
MESSAGE _NUMEXPR,#FF_QUANTRIGA|ADD,FF_SALDO_MOV
|
||||
END
|
||||
VALUTA 105 12
|
||||
BEGIN
|
||||
PROMPT 57 1 ""
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->QUANT*LF_RMOVMAG->PREZZO|_USER,*SEGNOCAUS,V|ADD,FF_VALORE_MOV
|
||||
END
|
||||
END // sezione movimento di competenza
|
||||
END // loop movimento
|
||||
|
||||
SECTION STAMPASALDOPREC 1 1 1 NUMEXPR (#FF_STAMPASALDOPREC==0)&&(#FF_CANPRINTSALDOPREC!=0)
|
||||
NUMBER 100 18
|
||||
BEGIN
|
||||
PROMPT 20 1 "Saldo precedente :"
|
||||
END
|
||||
NUMBER FF_SALDOPREC 15
|
||||
BEGIN
|
||||
PROMPT 66 1 ""
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE _USER,SALDOPREC|ADD,FF_SALDO_GART
|
||||
END
|
||||
NUMBER 101 12
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,FF_SALDOPREC |INC,FF_STAMPASALDOPREC
|
||||
END
|
||||
STRINGA 102 12
|
||||
BEGIN
|
||||
PROMPT 62 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
END // stampa saldo precedente
|
||||
|
||||
SECTION TOTALI_MOV 1 1 1 NUMEXPR #FF_SALDO_MOV!=0
|
||||
STRINGA FF_CAUSALE_RIGA 5
|
||||
BEGIN
|
||||
PROMPT 110 1 ""
|
||||
END
|
||||
NUMBER FF_NUM_MOV 6
|
||||
BEGIN
|
||||
PROMPT 1 1 ""
|
||||
END
|
||||
STRINGA FF_DATA_MOV 10
|
||||
BEGIN
|
||||
PROMPT 8 1 ""
|
||||
END
|
||||
STRINGA FF_DESCR_MOV 40
|
||||
BEGIN
|
||||
PROMPT 20 1 ""
|
||||
END
|
||||
STRINGA 100 2
|
||||
BEGIN
|
||||
PROMPT 62 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
NUMBER FF_SALDO_MOV 15
|
||||
BEGIN
|
||||
PROMPT 66 1 ""
|
||||
PICTURE "##.###.##@,@##"
|
||||
MESSAGE _USER,ADDQTA,FF_SALDO_GART
|
||||
END
|
||||
VALUTA FF_VALORE_MOV 15
|
||||
BEGIN
|
||||
PROMPT 92 1 ""
|
||||
MESSAGE _USER,ADDVAL,FF_VALORE_GART
|
||||
END
|
||||
VALUTA 190 12
|
||||
BEGIN
|
||||
PROMPT 80 1 ""
|
||||
FLAGS "U"
|
||||
MESSAGE _NUMEXPR,#FF_VALORE_MOV/#FF_SALDO_MOV
|
||||
END
|
||||
END // totali mov
|
||||
END // loop scheda
|
||||
|
||||
SECTION TOTALI_GART 1 1 3 GROUP
|
||||
|
||||
STRINGA 100 15
|
||||
BEGIN
|
||||
PROMPT 20 1 "Totale scheda"
|
||||
END
|
||||
STRINGA 100 2
|
||||
BEGIN
|
||||
PROMPT 62 1 ""
|
||||
FIELD LF_UMART->UM
|
||||
END
|
||||
NUMBER FF_SALDO_GART 15
|
||||
BEGIN
|
||||
PROMPT 66 1 ""
|
||||
PICTURE "##.###.##@,@##"
|
||||
END
|
||||
VALUTA FF_VALORE_GART 15
|
||||
BEGIN
|
||||
PROMPT 92 1 ""
|
||||
END
|
||||
END // TOTALI scheda per articolo
|
||||
END // loop RMOVMAG raggruppate
|
||||
END // *****
|
||||
|
||||
SECTION FOOTER ODD 2
|
||||
|
||||
END
|
||||
|
||||
@ -2,22 +2,12 @@
|
||||
|
||||
#include "mglib.h"
|
||||
#include "mg3500.h"
|
||||
#include "mg3500a.h"
|
||||
#include "mg3frm.h"
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
// mg3500 Stampa
|
||||
|
||||
class TForm_storgiac : public TForm_stampemg
|
||||
{
|
||||
TSorted_cursor * _sortcur;
|
||||
bool _use_alternate_cursor;
|
||||
public:
|
||||
void use_alternate_cursor(const bool b = TRUE) { _use_alternate_cursor = b; }
|
||||
virtual TCursor* cursor() const ;
|
||||
TForm_storgiac(const char *name,const char *code) ;
|
||||
virtual ~TForm_storgiac();
|
||||
};
|
||||
|
||||
TForm_storgiac::TForm_storgiac(const char *name,const char *code) :
|
||||
TForm_stampemg(name,code)
|
||||
{
|
||||
@ -40,23 +30,6 @@ TCursor* TForm_storgiac::cursor() const
|
||||
/////////////////////////////////////////////////////
|
||||
// Applicazione
|
||||
/////////////////////////////////////////////////////
|
||||
class TStampa_storgiac : public TSkeleton_application
|
||||
{
|
||||
TArray * _files;
|
||||
TStampemg_mask * _mask;
|
||||
TCursor * _cur;
|
||||
TForm_storgiac * _form; // to be moved into TPrint_application
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
|
||||
public:
|
||||
TStampa_storgiac() {}
|
||||
virtual ~TStampa_storgiac() {};
|
||||
};
|
||||
|
||||
bool TStampa_storgiac::create()
|
||||
{
|
||||
_mask = new TStampemg_mask("mg3500");
|
||||
@ -183,6 +156,7 @@ void TStampa_storgiac::main_loop()
|
||||
_cur->relation()->replace(new TLocalisamfile(LF_STOMAG),1,joinexp);
|
||||
_cur->setfilter(cfilter,TRUE);
|
||||
_cur->setregion(darec,arec);
|
||||
set_def_valuta(*_form);
|
||||
_form->print();
|
||||
delete _form;
|
||||
}
|
||||
|
||||
34
mg/mg3500a.h
Executable file
34
mg/mg3500a.h
Executable file
@ -0,0 +1,34 @@
|
||||
#ifndef __MG3500A_H
|
||||
#define __MG3500A_H
|
||||
|
||||
class TForm_storgiac : public TForm_stampemg
|
||||
{
|
||||
TSorted_cursor * _sortcur;
|
||||
bool _use_alternate_cursor;
|
||||
public:
|
||||
void use_alternate_cursor(const bool b = TRUE) { _use_alternate_cursor = b; }
|
||||
virtual TCursor* cursor() const ;
|
||||
TForm_storgiac(const char *name,const char *code) ;
|
||||
virtual ~TForm_storgiac();
|
||||
};
|
||||
|
||||
class TStampa_storgiac : public TSkeleton_application
|
||||
{
|
||||
TArray * _files;
|
||||
TStampemg_mask * _mask;
|
||||
TCursor * _cur;
|
||||
TForm_storgiac * _form; // to be moved into TPrint_application
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
virtual void set_def_valuta(TForm_storgiac & f) {}
|
||||
|
||||
public:
|
||||
TStampa_storgiac() {}
|
||||
virtual ~TStampa_storgiac() {};
|
||||
};
|
||||
|
||||
#endif //__MG3500A_H
|
||||
|
||||
@ -3,4 +3,4 @@
|
||||
#define QFIRMNAME "A.G.A. Informatica Srl"
|
||||
|
||||
#include <default.url>
|
||||
|
||||
#include <mainmenu.url>
|
||||
|
||||
@ -110,7 +110,7 @@ END
|
||||
VALUTA 108
|
||||
BEGIN
|
||||
KEY "valore"
|
||||
PROMPT 120 4 "Valore"
|
||||
PROMPT 122 4 "Valore"
|
||||
END
|
||||
|
||||
STRINGA 100 132
|
||||
@ -282,19 +282,19 @@ SECTION BODY ODD 1
|
||||
PICTURE "####.###,@##"
|
||||
END
|
||||
|
||||
VALUTA 107 11
|
||||
VALUTA 107 13
|
||||
BEGIN
|
||||
KEY "prezzo"
|
||||
PROMPT 99 1 ""
|
||||
FLAGS "U"
|
||||
FIELD LF_RMOVMAG->PREZZO
|
||||
PICTURE "###.###.##@"
|
||||
PICTURE "#.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 108 14
|
||||
BEGIN
|
||||
KEY "valore"
|
||||
PROMPT 112 1 ""
|
||||
PROMPT 114 1 ""
|
||||
MESSAGE _NUMEXPR,LF_RMOVMAG->PREZZO*LF_RMOVMAG->QUANT*349@->FC|ADD,15
|
||||
PICTURE "##.###.###.##@"
|
||||
END
|
||||
@ -310,7 +310,7 @@ SECTION BODY ODD 1
|
||||
VALUTA 15 17
|
||||
BEGIN
|
||||
KEY "totale mov"
|
||||
PROMPT 109 4 ""
|
||||
PROMPT 111 4 ""
|
||||
MESSAGE ADD,FL->215
|
||||
PICTURE "#.###.###.###.##@"
|
||||
END
|
||||
@ -330,7 +330,7 @@ SECTION FOOTER LAST 3
|
||||
VALUTA 215 17
|
||||
BEGIN
|
||||
KEY "totale mov"
|
||||
PROMPT 109 1 ""
|
||||
PROMPT 111 1 ""
|
||||
PICTURE "#.###.###.###.##@"
|
||||
END
|
||||
END
|
||||
|
||||
@ -9,7 +9,7 @@ BEGIN
|
||||
INPUT CODTAB F_ANNOES
|
||||
DISPLAY "Esercizio" CODTAB
|
||||
DISPLAY "Dal@12" D0
|
||||
DISPLAY "Al@12" D0
|
||||
DISPLAY "Al@12" D1
|
||||
OUTPUT F_ANNOES CODTAB
|
||||
ADD NONE
|
||||
CHECKTYPE NORMAL
|
||||
|
||||
336
mg/mg4200.cpp
336
mg/mg4200.cpp
@ -1,41 +1,15 @@
|
||||
#include <applicat.h>
|
||||
#include <currency.h>
|
||||
#include <progind.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
#include "../ve/veconf.h"
|
||||
#include "mglib.h"
|
||||
#include "mg4200.h"
|
||||
#include "mg4200a.h"
|
||||
#include "mg4frm.h"
|
||||
|
||||
#define MAX_VAL_COLUMNS 6
|
||||
class TForm_inventario : public TForm_stampemg
|
||||
{
|
||||
int _colonne;
|
||||
TSorted_cursor *_sortcur; // Cursore sortato: RAGGFIS+CODART usato in stampe per raggr. fisc.
|
||||
TConfig *conf_ditta;
|
||||
bool _use_alternate_cursor;
|
||||
TArticolo_giacenza_loadable * _curr_art;
|
||||
TString16 _codlist,_catven; // codici listino e cat vendita
|
||||
bool _giaceff, // flag inventario di giacenza
|
||||
_valcomp, // flag valorizzzione finiti o componenti
|
||||
_alladata; // flag di stampa inventario alla data, per utilizzare TArticolo_giacenza_loadable
|
||||
TTipo_valorizz _valorizz_scelte[MAX_VAL_COLUMNS]; // valorizzazioni delle varie colonne
|
||||
|
||||
TCurrency *_currency;
|
||||
TArticolo_giacenza_loadable &curr_art();
|
||||
public:
|
||||
virtual TCursor* cursor() const ;
|
||||
bool genera_intestazione_supplementare(pagetype p, short y);
|
||||
void set_parametri(const char * codcm,const char * cod,bool giaceff, bool valcomp, bool alladata);
|
||||
bool valorizzazione(TForm_item &cf, TTipo_valorizz t);
|
||||
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();
|
||||
};
|
||||
|
||||
TCursor* TForm_inventario::cursor() const
|
||||
{
|
||||
if (_use_alternate_cursor) // Se e' settata la stampa per ragg. fisc ritorna il cursore appropriato
|
||||
@ -48,55 +22,63 @@ bool TForm_inventario::validate(TForm_item &cf, TToken_string &s)
|
||||
const TString code(s.get(0)); // prende il primo parametro, il codice del messaggio
|
||||
TString subcode;
|
||||
|
||||
if (code=="_USER") {
|
||||
if (code=="_USER")
|
||||
{
|
||||
TLocalisamfile & magfile=relation()->lfile(LF_MAG);
|
||||
TRectype & magrec=magfile.curr();
|
||||
subcode=s.get();
|
||||
if (subcode=="GIAC") {
|
||||
real v=curr_art().giacenza_corretta(magrec,_giaceff,_valcomp);
|
||||
cf.set(v.string());
|
||||
}
|
||||
if (subcode=="VAL1") {
|
||||
valorizzazione(cf,_valorizz_scelte[0]);
|
||||
}
|
||||
if (subcode=="VAL2"&& _colonne >=2) {
|
||||
valorizzazione(cf,_valorizz_scelte[1]);
|
||||
}
|
||||
if (subcode=="VAL3" && _colonne >=3) {
|
||||
valorizzazione(cf,_valorizz_scelte[2]);
|
||||
}
|
||||
if (subcode=="VAL4" && _colonne >=4) {
|
||||
valorizzazione(cf,_valorizz_scelte[3]);
|
||||
}
|
||||
if (subcode=="VAL5"&& _colonne >=5) {
|
||||
valorizzazione(cf,_valorizz_scelte[4]);
|
||||
}
|
||||
if (subcode=="VAL6" && _colonne >=6) {
|
||||
valorizzazione(cf,_valorizz_scelte[5]);
|
||||
}
|
||||
if (subcode=="NAMEVAL1") {
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[0]]);
|
||||
}
|
||||
if (subcode=="NAMEVAL2"&& _colonne >=2) {
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[1]]);
|
||||
}
|
||||
if (subcode=="NAMEVAL3" && _colonne >=3) {
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[2]]);
|
||||
}
|
||||
if (subcode=="NAMEVAL4" && _colonne >=4) {
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[3]]);
|
||||
}
|
||||
if (subcode=="NAMEVAL5"&& _colonne >=5) {
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[4]]);
|
||||
}
|
||||
if (subcode=="NAMEVAL6" && _colonne >=6) {
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[5]]);
|
||||
}
|
||||
if (subcode=="LINEATOTALI") {
|
||||
TString l(29*_colonne+12,'-');
|
||||
cf.set(l);
|
||||
}
|
||||
if (subcode=="GIAC")
|
||||
{
|
||||
real v=curr_art().giacenza_corretta(magrec, FALSE,_valcomp);
|
||||
cf.set(v.string());
|
||||
}
|
||||
else
|
||||
if (subcode=="VAL1")
|
||||
valorizzazione(cf,_valorizz_scelte[0]);
|
||||
else
|
||||
if (subcode=="VAL2"&& _colonne >=2)
|
||||
valorizzazione(cf,_valorizz_scelte[1]);
|
||||
else
|
||||
if (subcode=="VAL3" && _colonne >=3)
|
||||
valorizzazione(cf,_valorizz_scelte[2]);
|
||||
else
|
||||
if (subcode=="VAL4" && _colonne >=4)
|
||||
valorizzazione(cf,_valorizz_scelte[3]);
|
||||
else
|
||||
if (subcode=="VAL5"&& _colonne >=5)
|
||||
valorizzazione(cf,_valorizz_scelte[4]);
|
||||
else
|
||||
if (subcode=="VAL6" && _colonne >=6)
|
||||
valorizzazione(cf,_valorizz_scelte[5]);
|
||||
/* else
|
||||
if (subcode=="NAMEVAL1")
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[0]]);
|
||||
else
|
||||
if (subcode=="NAMEVAL2"&& _colonne >=2)
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[1]]);
|
||||
else
|
||||
if (subcode=="NAMEVAL3" && _colonne >=3)
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[2]]);
|
||||
else
|
||||
if (subcode=="NAMEVAL4" && _colonne >=4)
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[3]]);
|
||||
else
|
||||
if (subcode=="NAMEVAL5"&& _colonne >=5)
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[4]]);
|
||||
else
|
||||
if (subcode=="NAMEVAL6" && _colonne >=6)
|
||||
cf.set(Nome_valorizz[_valorizz_scelte[5]]); */
|
||||
else
|
||||
if (subcode=="LINEATOTALI")
|
||||
{
|
||||
TString l(29*_colonne+12,'-');
|
||||
cf.set(l);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (code == "_ANNO")
|
||||
cf.set(format("%d", _annoes));
|
||||
|
||||
return TForm_stampemg::validate(cf, s);
|
||||
}
|
||||
|
||||
@ -171,33 +153,33 @@ bool TForm_inventario::valorizzazione(TForm_item &cf, TTipo_valorizz t)
|
||||
// arrotonda le valorizzazioni a costo unitario
|
||||
_currency->set_price(TRUE);
|
||||
_currency->set_num(v);
|
||||
v = _currency->string();
|
||||
v = _currency->get_num();
|
||||
|
||||
if (t==valorizz_LIFO) {
|
||||
TString codmag(magrec.get(MAG_CODMAG));codmag.left(3);
|
||||
const TString livello(magrec.get(MAG_LIVELLO));
|
||||
v=curr_art().LIFO(annoes,codmag,livello, _giaceff,_valcomp);
|
||||
v=curr_art().LIFO(annoes,codmag,livello, FALSE,_valcomp);
|
||||
}
|
||||
if (t==valorizz_FIFO) {
|
||||
TString codmag(magrec.get(MAG_CODMAG));codmag.left(3);
|
||||
const TString livello(magrec.get(MAG_LIVELLO));
|
||||
v=curr_art().FIFO(annoes,codmag,livello, _giaceff,_valcomp);
|
||||
v=curr_art().FIFO(annoes,codmag,livello, FALSE,_valcomp);
|
||||
}
|
||||
if (t==valorizz_LIFOa) {
|
||||
TString codmag(magrec.get(MAG_CODMAG));codmag.left(3);
|
||||
const TString livello(magrec.get(MAG_LIVELLO));
|
||||
v=curr_art().LIFO_annuale(annoes,codmag,livello, _giaceff,_valcomp);
|
||||
v=curr_art().LIFO_annuale(annoes,codmag,livello, FALSE,_valcomp);
|
||||
}
|
||||
if (t==valorizz_FIFOa) {
|
||||
TString codmag(magrec.get(MAG_CODMAG));codmag.left(3);
|
||||
const TString livello(magrec.get(MAG_LIVELLO));
|
||||
v=curr_art().FIFO_annuale(annoes,codmag,livello, _giaceff,_valcomp);
|
||||
v=curr_art().FIFO_annuale(annoes,codmag,livello, FALSE,_valcomp);
|
||||
}
|
||||
const real giac_corretta = curr_art().giacenza_corretta(magrec,_giaceff,_valcomp);
|
||||
const real giac_corretta = curr_art().giacenza_corretta(magrec, FALSE,_valcomp);
|
||||
v= v * giac_corretta ;
|
||||
_currency->set_price(FALSE);
|
||||
_currency->set_num(v);
|
||||
cf.set(_currency->string());
|
||||
cf.set(_currency->get_num().string());
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -234,13 +216,14 @@ bool TForm_inventario::genera_intestazione_supplementare(pagetype p, short y)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TForm_inventario::set_parametri(const char * codcatv,const char * codlist,bool giaceff, bool valcomp, bool alladata)
|
||||
void TForm_inventario::set_parametri(const char * codcatv,const char * codlist,bool giaceff, bool valcomp, bool alladata, int annoes)
|
||||
{
|
||||
_catven=codcatv;
|
||||
_codlist=codlist;
|
||||
_giaceff=giaceff;
|
||||
_valcomp=valcomp;
|
||||
_alladata=alladata;
|
||||
_alladata=alladata;
|
||||
_annoes = annoes;
|
||||
}
|
||||
|
||||
TForm_inventario::TForm_inventario(const char *name,const char *code) :
|
||||
@ -408,27 +391,6 @@ bool TStampainv_mask::handle_codlist(TMask_field &fld, KEY k)
|
||||
|
||||
|
||||
// STAMPA anagrafiche
|
||||
class TStampa_inventario : public TSkeleton_application
|
||||
{
|
||||
TArray * _files;
|
||||
TStampemg_mask * _mask;
|
||||
TCursor * _cur;
|
||||
TForm_inventario * _form; // to be moved into TPrint_application
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
virtual void on_firm_change();
|
||||
|
||||
void setprint_permagazzini();
|
||||
void setprint_perarticoli();
|
||||
void setprint_perarticoli_all();
|
||||
bool calcola_giacenze(const bool b = TRUE);
|
||||
|
||||
public:
|
||||
TStampa_inventario() {}
|
||||
};
|
||||
|
||||
void TStampa_inventario ::on_firm_change()
|
||||
{
|
||||
@ -460,8 +422,69 @@ bool TStampa_inventario::destroy()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
TRectype darec(LF_ANAMAG), arec(LF_ANAMAG);
|
||||
darec.put(ANAMAG_CODART, _mask->get(F_DAART));
|
||||
arec.put(ANAMAG_CODART, _mask->get(F_AART));
|
||||
|
||||
TRelation ana_rel(LF_ANAMAG);
|
||||
TCursor ana_cur(&ana_rel, "", 1, &darec, &arec);
|
||||
const TRecnotype items = ana_cur.items();
|
||||
ana_cur.freeze();
|
||||
|
||||
const TDate data_limite(_mask->get_date(F_DATALIM));
|
||||
TArticolo_giacenza art_giac;
|
||||
TString16 annoes(_mask->get(F_ANNOES));
|
||||
|
||||
TString msg;
|
||||
msg << "Creazione giacenze temporanee anno " << annoes;
|
||||
|
||||
TProgind pi(items, msg, FALSE, TRUE);
|
||||
|
||||
for (ana_cur = 0L; ana_cur.pos() < items; ++ana_cur)
|
||||
{
|
||||
art_giac.read(ana_cur.curr());
|
||||
|
||||
// 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);
|
||||
|
||||
real v=art_giac.giacenza_corretta(magrec, TRUE, valcomp);
|
||||
magrec.put(MAG_GIAC, v);
|
||||
temp_mag->write(magrec);
|
||||
}
|
||||
pi.addstatus(1L);
|
||||
}
|
||||
|
||||
// Se il file è ok lo sostituisce all'interno della relazione del form
|
||||
const bool rt = temp_mag->good();
|
||||
if (!rt)
|
||||
{
|
||||
error_box("Errore %d in creazione file temporaneo per saldi di magazzino alla data indicata.", temp_mag->status());
|
||||
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;
|
||||
}
|
||||
|
||||
bool TStampa_inventario::calcola_giacenze(const bool b)
|
||||
{
|
||||
const bool giaceff = *_mask->get(F_REALE_GIAC)=='R';
|
||||
const bool valcomp = *_mask->get(F_FIN_COMP)=='C';
|
||||
|
||||
//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);
|
||||
@ -494,7 +517,16 @@ bool TStampa_inventario::calcola_giacenze(const bool b)
|
||||
// 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))
|
||||
temp_mag->write(mag.row(i));
|
||||
{
|
||||
TRectype & magrec = (TRectype &) mag.row(i);
|
||||
|
||||
if (giaceff)
|
||||
{
|
||||
real v=art_giac.giacenza_corretta(magrec, TRUE,valcomp);
|
||||
magrec.put(MAG_GIAC, v);
|
||||
}
|
||||
temp_mag->write(magrec);
|
||||
}
|
||||
pi.addstatus(1L);
|
||||
}
|
||||
|
||||
@ -521,7 +553,7 @@ void TStampa_inventario::setprint_permagazzini()
|
||||
TRectype darec(LF_MAG),arec(LF_MAG);
|
||||
TString cfilter, espr1, espr2;
|
||||
_cur = _form->cursor();
|
||||
// setta il filtro sul cursore
|
||||
// setta il filtro sul cursore
|
||||
if (*_mask->get(F_FILTRO)=='N')
|
||||
cfilter << "(STR(GIAC!=\"0\"))&&" ;
|
||||
if (*_mask->get(F_FILTRO)=='+')
|
||||
@ -532,6 +564,10 @@ void TStampa_inventario::setprint_permagazzini()
|
||||
cfilter << "(CODART<=" << '"' << _mask->get(F_AART)<< "\")&&" ;
|
||||
if (cfilter.not_empty())
|
||||
cfilter.cut(cfilter.len()-2);
|
||||
if (!totdep)
|
||||
_form->find_field('B',odd_page,"GRUPPI_DEPOSITO").setcondition("CODMAG[1,3]",_strexpr);
|
||||
else
|
||||
_form->find_field('B',odd_page,"GRUPPI_DEPOSITO").setcondition("CODMAG[1,5]",_strexpr);
|
||||
switch (subordine)
|
||||
{
|
||||
case 'C':
|
||||
@ -559,30 +595,34 @@ void TStampa_inventario::setprint_permagazzini()
|
||||
else
|
||||
espr1.format("ANNOES|CODMAG|%d->GRMERC|CODART|LIVELLO", LF_ANAMAG);
|
||||
_form->set_ordering(mg_cat_merc);
|
||||
espr2.format("CODMAG[1,3]+CODMAG[1,5]+%d->GRMERC[1,3]", LF_ANAMAG);
|
||||
// espr2.format("CODMAG[1,3]+CODMAG[1,5]+%d->GRMERC[1,3]", LF_ANAMAG);
|
||||
espr2.format("%d->GRMERC[1,3]", LF_ANAMAG);
|
||||
_form->find_field('B',odd_page,"GRUPPI_CATMER").setcondition(espr2,_strexpr);
|
||||
if (subordine == 'S')
|
||||
{
|
||||
_form->find_field('B',odd_page,"H_SCATMER").show();
|
||||
_form->find_field('B',odd_page,"TOT_SCATMER").show();
|
||||
m1 << _mask->get(F_DASCATMER); if (m1.len() > 3) m1.left_just(5);
|
||||
m2 << _mask->get(F_ASCATMER); if (m2.len() > 3) m2.left_just(5);
|
||||
m1 << _mask->get(F_DASCATMER);
|
||||
m2 << _mask->get(F_ASCATMER);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
_form->find_field('B',odd_page,"H_SCATMER").hide();
|
||||
_form->find_field('B',odd_page,"TOT_SCATMER").hide();
|
||||
}
|
||||
if (m1.not_empty())
|
||||
{
|
||||
espr2.format("&&(%d->GRMERC[1,%d]>=\"%s\")", LF_ANAMAG, m1.len(), (const char*)m1);
|
||||
espr2.format("&&(%d->GRMERC >= \"%s\")", LF_ANAMAG, (const char*)m1);
|
||||
cfilter << espr2;
|
||||
}
|
||||
if (m2.not_empty())
|
||||
{
|
||||
espr2.format("&&(%d->GRMERC[1,%d]<=\"%s\")", LF_ANAMAG, m2.len(), (const char*)m2);
|
||||
espr2.format("&&(%d->GRMERC <= \"%s\")", LF_ANAMAG, (const char*)m2);
|
||||
cfilter << espr2;
|
||||
}
|
||||
// espr2.format("CODMAG[1,3]+CODMAG[1,5]+%d->GRMERC", LF_ANAMAG);
|
||||
espr2.format("%d->GRMERC", LF_ANAMAG);
|
||||
_form->find_field('B',odd_page,"GRUPPI_SCATMER").setcondition(espr2,_strexpr);
|
||||
}
|
||||
break;
|
||||
case 'R':
|
||||
@ -620,17 +660,13 @@ void TStampa_inventario::setprint_permagazzini()
|
||||
TRUE,_mask->get_bool(F_TOTALIDEPOSITI),_mask->get_bool(F_DETTAGLIODEP));
|
||||
|
||||
((TSorted_cursor *)_cur)->change_order(espr1);
|
||||
if (!totdep)
|
||||
_form->find_field('B',odd_page,"GRUPPI_DEPOSITO").setcondition("CODMAG[1,3]",_strexpr);
|
||||
else
|
||||
_form->find_field('B',odd_page,"GRUPPI_DEPOSITO").setcondition("CODMAG[1,5]",_strexpr);
|
||||
|
||||
darec.put("ANNOES",_mask->get(F_ANNOES));
|
||||
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->setregion(darec,arec,0x2);
|
||||
_cur->setregion(darec,arec);
|
||||
}
|
||||
|
||||
// ORDINAMENTO
|
||||
@ -692,6 +728,8 @@ void TStampa_inventario::setprint_perarticoli()
|
||||
espr2.format("&&(%d->GRMERC<=\"%s\")", LF_ANAMAG, (const char*)m2);
|
||||
cfilter << espr2;
|
||||
}
|
||||
espr2.format("%d->GRMERC", LF_ANAMAG);
|
||||
_form->find_field('B',odd_page,"GRUPPI_SCATMER").setcondition(espr2,_strexpr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -758,10 +796,10 @@ void TStampa_inventario::setprint_perarticoli()
|
||||
if (*_mask->get(F_AART))
|
||||
cfilter << "&&(CODART<=\"" << _mask->get(F_AART) << "\")";
|
||||
}
|
||||
arec.put("ANNOES",_mask->get(F_ANNOES));
|
||||
arec.put("CODMAG",_mask->get(F_AMAG));
|
||||
arec.put("ANNOES",_mask->get(F_ANNOES));
|
||||
arec.put("CODMAG", _mask->get(F_AMAG));
|
||||
_cur->setfilter(cfilter, subordine != 'C');
|
||||
_cur->setregion(darec,arec,0x2);
|
||||
_cur->setregion(darec,arec);
|
||||
}
|
||||
|
||||
void TStampa_inventario::setprint_perarticoli_all()
|
||||
@ -772,7 +810,7 @@ void TStampa_inventario::setprint_perarticoli_all()
|
||||
|
||||
char subordine=*_mask->get(F_ORDINEART);
|
||||
|
||||
_cur = _form->cursor();
|
||||
_cur = _form->cursor();
|
||||
if (*_mask->get(F_FILTRO)=='N')
|
||||
filter << "(STR(" << LF_MAG <<"->GIAC!=\"0\"))&&";
|
||||
if (*_mask->get(F_FILTRO)=='+')
|
||||
@ -817,10 +855,10 @@ void TStampa_inventario::setprint_perarticoli_all()
|
||||
m2 = _mask->get(F_ACATMER);
|
||||
if (subordine == 'S')
|
||||
{
|
||||
m1 << _mask->get(F_DASCATMER);
|
||||
m2 << _mask->get(F_ASCATMER);
|
||||
m1.trim();
|
||||
m2.trim();
|
||||
m1.left_just(3) << _mask->get(F_DASCATMER);
|
||||
m2.left_just(3) << _mask->get(F_ASCATMER);
|
||||
// m1.trim();
|
||||
// m2.trim();
|
||||
}
|
||||
// Siccome GRMERC e' il primo campo della chiave, se e' settato l'articolo di fine intervallo
|
||||
// ed esso non e' vuoto, mentre la categoria merc. lo e'... la setregion() del cursore non ha effetti,
|
||||
@ -832,21 +870,25 @@ void TStampa_inventario::setprint_perarticoli_all()
|
||||
darec.put("GRMERC", m1);
|
||||
darec.put("CODART",_mask->get(F_DAART));
|
||||
arec.put("GRMERC", m2);
|
||||
arec.put("CODART",_mask->get(F_AART));
|
||||
const TString80 aart(_mask->get(F_AART));
|
||||
if (aart.not_empty())
|
||||
arec.put("CODART", aart);
|
||||
_form->find_field('B',odd_page,"H_CATMER").show();
|
||||
_form->find_field('B',odd_page,"TOT_CATMER").show();
|
||||
_form->set_ordering(mg_cat_merc);
|
||||
if (subordine == 'S')
|
||||
{
|
||||
_form->find_field('B',odd_page,"H_SCATMER").show();
|
||||
_form->find_field('B',odd_page,"TOT_SCATMER").show();
|
||||
}
|
||||
TString16 espr ; espr.format("%d->GRMERC", LF_ANAMAG);
|
||||
_form->find_field('B',odd_page,"GRUPPI_SCATMER").setcondition(espr,_strexpr);
|
||||
}
|
||||
else
|
||||
{
|
||||
_form->find_field('B',odd_page,"H_SCATMER").hide();
|
||||
_form->find_field('B',odd_page,"TOT_SCATMER").hide();
|
||||
_form->find_field('B',odd_page,"GRUPPI_SCATMER").setcondition("CODART",_strexpr);
|
||||
}
|
||||
_form->set_ordering(mg_cat_merc);
|
||||
}
|
||||
break;
|
||||
case 'R':
|
||||
@ -893,7 +935,7 @@ void TStampa_inventario::setprint_perarticoli_all()
|
||||
TSortedfile *mag;
|
||||
TRelation *rel = NULL;
|
||||
|
||||
if (_mask->get_bool(F_ALLADATA))
|
||||
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
|
||||
rel = new TRelation(temp_mag);
|
||||
@ -929,6 +971,8 @@ void TStampa_inventario::main_loop()
|
||||
}
|
||||
|
||||
const bool b = _mask->get_bool(F_ALLADATA);
|
||||
const bool r = *_mask->get(F_REALE_GIAC)=='R';
|
||||
|
||||
|
||||
if (*_mask->get(F_ORDINE)=='A')
|
||||
{
|
||||
@ -940,6 +984,12 @@ void TStampa_inventario::main_loop()
|
||||
delete _form;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if (!b && r && !crea_tempmag(FALSE))
|
||||
{
|
||||
delete _form;
|
||||
continue;
|
||||
}
|
||||
setprint_perarticoli_all();
|
||||
}
|
||||
else
|
||||
@ -950,6 +1000,12 @@ void TStampa_inventario::main_loop()
|
||||
delete _form;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if (!b && r && !crea_tempmag())
|
||||
{
|
||||
delete _form;
|
||||
continue;
|
||||
}
|
||||
setprint_perarticoli();
|
||||
}
|
||||
}
|
||||
@ -961,12 +1017,19 @@ void TStampa_inventario::main_loop()
|
||||
delete _form;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if (!b && r && !crea_tempmag())
|
||||
{
|
||||
delete _form;
|
||||
continue;
|
||||
}
|
||||
setprint_permagazzini();
|
||||
}
|
||||
_form->set_parametri(_mask->get(F_CATVENLISTINO),
|
||||
_mask->get(F_CODLISTINO),
|
||||
*_mask->get(F_REALE_GIAC)=='R',
|
||||
*_mask->get(F_FIN_COMP)=='C', b);
|
||||
_mask->get(F_CODLISTINO),
|
||||
*_mask->get(F_REALE_GIAC)=='R',
|
||||
*_mask->get(F_FIN_COMP)=='C', b,
|
||||
_mask->get_int(F_ANNOES));
|
||||
_form->add_colval(_mask->get_int(F_VAL1)-1);
|
||||
_form->add_colval(_mask->get_int(F_VAL2)-1);
|
||||
_form->add_colval(_mask->get_int(F_VAL3)-1);
|
||||
@ -976,7 +1039,16 @@ void TStampa_inventario::main_loop()
|
||||
|
||||
_form->genera_intestazioni(odd_page, 5);
|
||||
_form->genera_intestazione_supplementare(odd_page, 4); // Nomi valorizzazioni applicate per colonna
|
||||
|
||||
|
||||
set_def_valuta(*_form);
|
||||
const TDate data_limite(_mask->get_date(F_DATALIM));
|
||||
if (data_limite.ok())
|
||||
{
|
||||
TForm_item & f = _form->find_field('H',odd_page,4);
|
||||
TString prompt = f.prompt();
|
||||
prompt << " al " << data_limite.string();
|
||||
f.set_prompt(prompt);
|
||||
}
|
||||
_form->print();
|
||||
delete _form;
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ BEGIN
|
||||
INPUT CODTAB F_ANNOES
|
||||
DISPLAY "Esercizio" CODTAB
|
||||
DISPLAY "Dal@12" D0
|
||||
DISPLAY "Al@12" D0
|
||||
DISPLAY "Al@12" D1
|
||||
OUTPUT F_ANNOES CODTAB
|
||||
ADD NONE
|
||||
CHECKTYPE NORMAL
|
||||
|
||||
@ -20,9 +20,6 @@ END
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 1
|
||||
// Let the user be free to choose the font&size:
|
||||
// FONT "Courier New"
|
||||
// SIZE 10
|
||||
END
|
||||
|
||||
|
||||
@ -55,8 +52,9 @@ END
|
||||
|
||||
NUMERO 4 32
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 45 2 "Stampa inventario"
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 45 2 "Stampa inventario esercizio "
|
||||
MESSAGE _ANNO
|
||||
END
|
||||
|
||||
STRINGA 5 255
|
||||
@ -1161,7 +1159,6 @@ SECTION BODY ODD 0 COLUMNWISE
|
||||
BEGIN
|
||||
KEY "COL6"
|
||||
PROMPT 17 1 ""
|
||||
FLAGS "U"
|
||||
PICTURE "##.###.###.##@"
|
||||
MESSAGE ADD,447
|
||||
GROUP 3 FG_COL6
|
||||
|
||||
61
mg/mg4200a.h
Executable file
61
mg/mg4200a.h
Executable file
@ -0,0 +1,61 @@
|
||||
#ifndef __MG4200A_H
|
||||
#define __MG4200A_H
|
||||
|
||||
#define MAX_VAL_COLUMNS 6
|
||||
|
||||
class TForm_inventario : public TForm_stampemg
|
||||
{
|
||||
int _colonne;
|
||||
TSorted_cursor *_sortcur; // Cursore sortato: RAGGFIS+CODART usato in stampe per raggr. fisc.
|
||||
TConfig *conf_ditta;
|
||||
bool _use_alternate_cursor;
|
||||
TArticolo_giacenza_loadable * _curr_art;
|
||||
TString16 _codlist,_catven; // codici listino e cat vendita
|
||||
bool _giaceff, // flag inventario di giacenza
|
||||
_valcomp, // flag valorizzzione finiti o componenti
|
||||
_alladata, // flag di stampa inventario alla data, per utilizzare TArticolo_giacenza_loadable
|
||||
_pos, // flag di stampa inventario positivi
|
||||
_notzero; // flag di stampa inventario non zero
|
||||
int _annoes;
|
||||
TTipo_valorizz _valorizz_scelte[MAX_VAL_COLUMNS]; // valorizzazioni delle varie colonne
|
||||
|
||||
TCurrency *_currency;
|
||||
TArticolo_giacenza_loadable &curr_art();
|
||||
public:
|
||||
virtual TCursor* cursor() const ;
|
||||
|
||||
bool genera_intestazione_supplementare(pagetype p, short y);
|
||||
void set_parametri(const char * codcm,const char * cod,bool giaceff, bool valcomp, bool alladata, int annoes);
|
||||
bool valorizzazione(TForm_item &cf, TTipo_valorizz t);
|
||||
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();
|
||||
};
|
||||
|
||||
class TStampa_inventario : public TSkeleton_application
|
||||
{
|
||||
TArray * _files;
|
||||
TStampemg_mask * _mask;
|
||||
TCursor * _cur;
|
||||
TForm_inventario * _form; // to be moved into TPrint_application
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
virtual void on_firm_change();
|
||||
|
||||
void setprint_permagazzini();
|
||||
void setprint_perarticoli();
|
||||
void setprint_perarticoli_all();
|
||||
bool crea_tempmag(const bool b = TRUE);
|
||||
bool calcola_giacenze(const bool b = TRUE);
|
||||
virtual void set_def_valuta(TForm_inventario & f) {}
|
||||
|
||||
public:
|
||||
TStampa_inventario() {}
|
||||
};
|
||||
|
||||
#endif //__MG4200A_H
|
||||
@ -20,9 +20,6 @@ END
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 1
|
||||
// Let the user be free to choose the font&size:
|
||||
// FONT "Courier New"
|
||||
// SIZE 10
|
||||
END
|
||||
|
||||
|
||||
@ -55,8 +52,9 @@ END
|
||||
|
||||
NUMERO 4 32
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 45 2 "Stampa inventario"
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 45 2 "Stampa inventario esercizio "
|
||||
MESSAGE _ANNO
|
||||
END
|
||||
|
||||
STRINGA 5 255
|
||||
|
||||
@ -20,9 +20,6 @@ END
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 1
|
||||
// FONT "Courier New"
|
||||
// Let the user be free to choose the font size:
|
||||
// SIZE 10
|
||||
END
|
||||
|
||||
SECTION GRAPHIC
|
||||
@ -53,8 +50,9 @@ END
|
||||
|
||||
NUMERO 4 32
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 45 2 "Stampa inventario"
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 45 2 "Stampa inventario esercizio "
|
||||
MESSAGE _ANNO
|
||||
END
|
||||
|
||||
STRINGA 5 146
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user