Patch level : 2.0 642
Files correlati : ve0.exe Ricompilazione Demo : [ ] Commento : AO20123 E' stato rilevato che avendo delle fatture già contabilizzate (quindi a stato 5), se provo ad aprirle da Documenti Interattivi e a rilanciare una contabilizzazione col tasto "Elabora", senza cambiare lo stato del documento, me lo ricontabilizza andando quindi a toccare anche l'IVA. Questo non deve assolutamente succedere e deve essere quindi sistemato. git-svn-id: svn://10.65.10.50/trunk@11598 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f7b99b82f3
commit
ad08cf4ab6
@ -506,15 +506,15 @@ void TMotore_application::print()
|
|||||||
{
|
{
|
||||||
if (save(TRUE)) // Registra il record corrente
|
if (save(TRUE)) // Registra il record corrente
|
||||||
{
|
{
|
||||||
TDocumento_mask& m = edit_mask();
|
const TDocumento& doc = (const TDocumento&)get_relation()->curr();
|
||||||
const TTipo_documento& tipo = m.doc().tipo();
|
const bool da_stampare = doc.stampabile();
|
||||||
const bool da_stampare = m.doc().stampabile();
|
|
||||||
|
|
||||||
TString commandline("ve1 -0 ");
|
TString commandline("ve1 -0 ");
|
||||||
commandline << m.get(F_CODNUM) << ' ' << m.get(F_ANNO) << ' ';
|
commandline << doc.get(DOC_CODNUM) << ' ' << doc.get(DOC_ANNO) << ' ';
|
||||||
commandline << m.get(F_PROVV) << ' ' << m.get(F_NDOC) << ' ' << m.get(F_NDOC);
|
commandline << doc.get(DOC_PROVV) << ' ' << doc.get(DOC_NDOC) << ' ' << doc.get(DOC_NDOC);
|
||||||
commandline << ' ' << (da_stampare ? 'D' : 'P');
|
commandline << ' ' << (da_stampare ? 'D' : 'P');
|
||||||
|
|
||||||
|
const TTipo_documento& tipo = doc.tipo();
|
||||||
const int ncopie = tipo.ncopie();
|
const int ncopie = tipo.ncopie();
|
||||||
if (ncopie > 0)
|
if (ncopie > 0)
|
||||||
commandline << ' ' << ncopie;
|
commandline << ' ' << ncopie;
|
||||||
@ -522,10 +522,10 @@ void TMotore_application::print()
|
|||||||
TExternal_app interattivo( commandline );
|
TExternal_app interattivo( commandline );
|
||||||
if (interattivo.run() == NOERR)
|
if (interattivo.run() == NOERR)
|
||||||
{
|
{
|
||||||
if (da_stampare)
|
if (da_stampare) // Aggiorna stato documento se necessario
|
||||||
{
|
{
|
||||||
const char s[2] = { tipo.stato_finale_stampa(), '\0'};
|
const char s[2] = { tipo.stato_finale_stampa(), '\0'};
|
||||||
m.set(F_STATO, s, TRUE);
|
edit_mask().set(F_STATO, s, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
#include <prefix.h>
|
|
||||||
#include <postman.h>
|
|
||||||
|
|
||||||
#include <relation.h>
|
|
||||||
#include <tabutil.h>
|
|
||||||
|
|
||||||
#include "velib.h"
|
|
||||||
#include "ve0100b.h"
|
|
||||||
|
|
||||||
#include <doc.h>
|
|
||||||
|
|
||||||
int numerazione_definitiva(TDocumento& doc)
|
|
||||||
{
|
|
||||||
int err = NOERR;
|
|
||||||
if (doc.get_char(DOC_PROVV) == 'D') // Se e' una numerazione definitiva
|
|
||||||
{
|
|
||||||
if (doc.stampabile()) // Controlla se non e' gia' nello stato si stampato in definitiva
|
|
||||||
{
|
|
||||||
doc.stato(doc.tipo().stato_finale_stampa()); // Se e' gia' in definitiva aggiorna solo lo stato
|
|
||||||
err = doc.rewrite();
|
|
||||||
|
|
||||||
// Invia la transazione di cambio stato se necessario
|
|
||||||
if (::can_dispatch_transaction(doc))
|
|
||||||
{
|
|
||||||
TFilename tmpname; tmpname.temp();
|
|
||||||
{ // Parentesi strategiche
|
|
||||||
TConfig ini(tmpname, "Transaction");
|
|
||||||
ini.set("Action", "MODIFY");
|
|
||||||
ini.set("Firm", prefix().get_codditta());
|
|
||||||
ini.set("Mode", "A");
|
|
||||||
TString8 paradoc; paradoc.format("%d", LF_DOC);
|
|
||||||
ini.set_paragraph(paradoc);
|
|
||||||
ini.set(DOC_PROVV, doc.get(DOC_PROVV));
|
|
||||||
ini.set(DOC_ANNO, doc.get(DOC_ANNO));
|
|
||||||
ini.set(DOC_CODNUM, doc.get(DOC_CODNUM));
|
|
||||||
ini.set(DOC_NDOC, doc.get(DOC_NDOC));
|
|
||||||
ini.set(DOC_STATO, doc.stato());
|
|
||||||
}
|
|
||||||
::dispatch_transaction(doc, tmpname);
|
|
||||||
::remove(tmpname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // Se e' una numerazione provvisoria
|
|
||||||
{
|
|
||||||
// Scrive il nuovo documento con lo stato, numero e flag di definitiva
|
|
||||||
TDocumento bak_doc;
|
|
||||||
bak_doc = doc; // Setta il flag di nuovo documento
|
|
||||||
bak_doc.put(DOC_STATO,doc.tipo().stato_finale_stampa());
|
|
||||||
bak_doc.put(DOC_PROVV,"D");
|
|
||||||
bak_doc.put(DOC_NDOC,-1L);
|
|
||||||
const int pr = bak_doc.physical_rows();
|
|
||||||
for (int i=1;i<=pr;i++)
|
|
||||||
bak_doc[i].put(DOC_PROVV,"D");
|
|
||||||
err = bak_doc.write(); // Esegue automagicamente rinumerazione di testata e righe nel caso di reinsert
|
|
||||||
if (err == NOERR) // Cancella il vecchio documento
|
|
||||||
doc.remove();
|
|
||||||
}
|
|
||||||
return err;
|
|
||||||
}
|
|
10
ve/ve0100b.h
10
ve/ve0100b.h
@ -1,10 +0,0 @@
|
|||||||
#ifndef __VE0100B_H
|
|
||||||
#define __VE0100B_H
|
|
||||||
|
|
||||||
#ifndef __VELIB_H
|
|
||||||
class TDocumento;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int numerazione_definitiva(TDocumento &); // prototipo della funzione di rinumerazione definitiva dei documenti
|
|
||||||
|
|
||||||
#endif // __VE0100B_H
|
|
@ -1,40 +0,0 @@
|
|||||||
#ifndef __VE0100D_H
|
|
||||||
#include "ve0100d.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// IMPORTO NETTO
|
|
||||||
real f100( TRectype& r )
|
|
||||||
{
|
|
||||||
return( r.get_real( "PREZZO" ) * r.get_real( "QTA" ) );
|
|
||||||
};
|
|
||||||
|
|
||||||
// IMPORTO NETTO PROVVIGIONI
|
|
||||||
real f200( TRectype& r )
|
|
||||||
{
|
|
||||||
return( f100(r) * r.get_real( "PERCPROV" ) );
|
|
||||||
};
|
|
||||||
|
|
||||||
// ARTICOLI
|
|
||||||
real f300( TRectype& r )
|
|
||||||
{
|
|
||||||
return( 1 );
|
|
||||||
};
|
|
||||||
|
|
||||||
// QUANTITA'
|
|
||||||
real f400( TRectype& r )
|
|
||||||
{
|
|
||||||
return( r.get_real( "QTA" ) );
|
|
||||||
};
|
|
||||||
|
|
||||||
// PREZZO
|
|
||||||
real f500( TRectype& r )
|
|
||||||
{
|
|
||||||
return( r.get_real( "PREZZO" ) );
|
|
||||||
};
|
|
||||||
|
|
||||||
// SCONTO ***
|
|
||||||
real f600( TRectype& r )
|
|
||||||
{
|
|
||||||
return( 13 );
|
|
||||||
};
|
|
||||||
|
|
17
ve/ve0100d.h
17
ve/ve0100d.h
@ -1,17 +0,0 @@
|
|||||||
#define __VE0100D_H
|
|
||||||
|
|
||||||
#ifndef __REAL_H
|
|
||||||
#include "real.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ISAM_H
|
|
||||||
#include "isam.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
real f100( TRectype& r );
|
|
||||||
real f200( TRectype& r );
|
|
||||||
real f300( TRectype& r );
|
|
||||||
real f400( TRectype& r );
|
|
||||||
real f500( TRectype& r );
|
|
||||||
real f600( TRectype& r );
|
|
@ -7,6 +7,7 @@
|
|||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
|
#include <postman.h>
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
@ -14,7 +15,8 @@
|
|||||||
#include "velib.h"
|
#include "velib.h"
|
||||||
#include "sconti.h"
|
#include "sconti.h"
|
||||||
#include "ve1100.h"
|
#include "ve1100.h"
|
||||||
#include "ve0100b.h"
|
|
||||||
|
#include <comuni.h>
|
||||||
|
|
||||||
#define LISTADOC "listadoc"
|
#define LISTADOC "listadoc"
|
||||||
#define FAKETOTFLD 9999
|
#define FAKETOTFLD 9999
|
||||||
@ -838,13 +840,13 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
|
|||||||
TLocalisamfile com(LF_COMUNI);
|
TLocalisamfile com(LF_COMUNI);
|
||||||
if (nascita)
|
if (nascita)
|
||||||
{
|
{
|
||||||
com.put("STATO", occasionale ? cli_occ.get(OCC_STATONASC) : cli_for.get(CLI_STATONASC));
|
com.put(COM_STATO, occasionale ? cli_occ.get(OCC_STATONASC) : cli_for.get(CLI_STATONASC));
|
||||||
com.put("COM", occasionale ? cli_occ.get(OCC_COMNASC) : cli_for.get(CLI_COMNASC));
|
com.put(COM_COM, occasionale ? cli_occ.get(OCC_COMNASC) : cli_for.get(CLI_COMNASC));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
com.put("STATO", occasionale ? cli_occ.get(OCC_STATO): cli_for.get(CLI_STATOCF));
|
com.put(COM_STATO, occasionale ? cli_occ.get(OCC_STATO): cli_for.get(CLI_STATOCF));
|
||||||
com.put("COM", occasionale ? cli_occ.get(OCC_COM): cli_for.get(CLI_COMCF));
|
com.put(COM_COM, occasionale ? cli_occ.get(OCC_COM): cli_for.get(CLI_COMCF));
|
||||||
}
|
}
|
||||||
if (com.read() == NOERR)
|
if (com.read() == NOERR)
|
||||||
cf.set(com.get(in));
|
cf.set(com.get(in));
|
||||||
@ -1216,10 +1218,11 @@ protected:
|
|||||||
static bool reset_button (TMask_field& f, KEY k);
|
static bool reset_button (TMask_field& f, KEY k);
|
||||||
static bool tipodoc_handler (TMask_field& f, KEY k);
|
static bool tipodoc_handler (TMask_field& f, KEY k);
|
||||||
static bool filter_clifo(const TRelation* r);
|
static bool filter_clifo(const TRelation* r);
|
||||||
long select_cod_range(long from, long to);
|
long select_cod_range(long from, long to);
|
||||||
void reset_choices(TMask& m);
|
void reset_choices(TMask& m);
|
||||||
void set_choice_limits(TMask& m);
|
void set_choice_limits(TMask& m);
|
||||||
void build_clifo_list(const char c='C');
|
void build_clifo_list(const char c='C');
|
||||||
|
int numerazione_definitiva(TDocumento& doc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void print_documento(TDocumento_form& frm);
|
void print_documento(TDocumento_form& frm);
|
||||||
@ -1230,6 +1233,56 @@ public:
|
|||||||
|
|
||||||
inline TStampaDoc_application& app() { return (TStampaDoc_application&) main_app(); }
|
inline TStampaDoc_application& app() { return (TStampaDoc_application&) main_app(); }
|
||||||
|
|
||||||
|
int TStampaDoc_application::numerazione_definitiva(TDocumento& doc) const
|
||||||
|
{
|
||||||
|
int err = NOERR;
|
||||||
|
if (doc.get_char(DOC_PROVV) == 'D') // Se e' una numerazione definitiva
|
||||||
|
{
|
||||||
|
if (doc.stampabile()) // Controlla se non e' gia' nello stato si stampato in definitiva
|
||||||
|
{
|
||||||
|
doc.stato(doc.tipo().stato_finale_stampa()); // Se e' gia' in definitiva aggiorna solo lo stato
|
||||||
|
err = doc.rewrite();
|
||||||
|
|
||||||
|
// Invia la transazione di cambio stato se necessario
|
||||||
|
if (::can_dispatch_transaction(doc))
|
||||||
|
{
|
||||||
|
TFilename tmpname; tmpname.temp();
|
||||||
|
{ // Parentesi strategiche
|
||||||
|
TConfig ini(tmpname, "Transaction");
|
||||||
|
ini.set("Action", "MODIFY");
|
||||||
|
ini.set("Firm", prefix().get_codditta());
|
||||||
|
ini.set("Mode", "A");
|
||||||
|
TString8 paradoc; paradoc.format("%d", LF_DOC);
|
||||||
|
ini.set_paragraph(paradoc);
|
||||||
|
ini.set(DOC_PROVV, doc.get(DOC_PROVV));
|
||||||
|
ini.set(DOC_ANNO, doc.get(DOC_ANNO));
|
||||||
|
ini.set(DOC_CODNUM, doc.get(DOC_CODNUM));
|
||||||
|
ini.set(DOC_NDOC, doc.get(DOC_NDOC));
|
||||||
|
ini.set(DOC_STATO, doc.stato());
|
||||||
|
}
|
||||||
|
::dispatch_transaction(doc, tmpname);
|
||||||
|
::remove(tmpname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Se e' una numerazione provvisoria
|
||||||
|
{
|
||||||
|
// Scrive il nuovo documento con lo stato, numero e flag di definitiva
|
||||||
|
TDocumento bak_doc;
|
||||||
|
bak_doc = doc; // Setta il flag di nuovo documento
|
||||||
|
bak_doc.put(DOC_STATO,doc.tipo().stato_finale_stampa());
|
||||||
|
bak_doc.put(DOC_PROVV,"D");
|
||||||
|
bak_doc.put(DOC_NDOC,-1L);
|
||||||
|
const int pr = bak_doc.physical_rows();
|
||||||
|
for (int i=1;i<=pr;i++)
|
||||||
|
bak_doc[i].put(DOC_PROVV,"D");
|
||||||
|
err = bak_doc.write(); // Esegue automagicamente rinumerazione di testata e righe nel caso di reinsert
|
||||||
|
if (err == NOERR) // Cancella il vecchio documento
|
||||||
|
doc.remove();
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
void TStampaDoc_application::print_selected()
|
void TStampaDoc_application::print_selected()
|
||||||
{
|
{
|
||||||
TRelation rel(LF_DOC);
|
TRelation rel(LF_DOC);
|
||||||
|
@ -14,12 +14,16 @@
|
|||||||
|
|
||||||
class TIndustriosa_app : public TSkeleton_application
|
class TIndustriosa_app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
|
int _len_commessa;
|
||||||
|
int _len_fase;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const TString& conto_industriale(const TRiga_documento& row) const;
|
const TString& conto_industriale(const TRiga_documento& row) const;
|
||||||
|
void trim_and_cut(TString& val, int len) const;
|
||||||
void get_field(const TDocumento& doc, const TRectype& mov, const TRectype& rec, const char* field, TString& val) const;
|
void get_field(const TDocumento& doc, const TRectype& mov, const TRectype& rec, const char* field, TString& val) const;
|
||||||
bool filerr(const char* name) const;
|
bool filerr(const char* name) const;
|
||||||
bool get_mci_path(TFilename& shell) const;
|
bool get_mci_path(TFilename& shell) const;
|
||||||
bool call_mci(TDocumento& doc, const TRectype& movimento) const;
|
bool call_mci(TDocumento& doc, const TRectype& movimento);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
@ -43,6 +47,17 @@ const TString& TIndustriosa_app::conto_industriale(const TRiga_documento& row) c
|
|||||||
return EMPTY_STRING;
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TIndustriosa_app::trim_and_cut(TString& val, int len) const
|
||||||
|
{
|
||||||
|
if (len > 0)
|
||||||
|
{
|
||||||
|
val.ltrim('0');
|
||||||
|
val.cut(len);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
val.cut(0);
|
||||||
|
}
|
||||||
|
|
||||||
void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, const TRectype& rec, const char* field, TString& val) const
|
void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, const TRectype& rec, const char* field, TString& val) const
|
||||||
{
|
{
|
||||||
if (field[0] == '"' || field[0] == '\'')
|
if (field[0] == '"' || field[0] == '\'')
|
||||||
@ -55,16 +70,19 @@ void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, con
|
|||||||
{
|
{
|
||||||
val.cut(0);
|
val.cut(0);
|
||||||
if (stricmp(field, "_CANTIERE") == 0)
|
if (stricmp(field, "_CANTIERE") == 0)
|
||||||
|
|
||||||
{
|
{
|
||||||
val = rec.get(RDOC_CODCMS).left(4);
|
TString cms, fas;
|
||||||
if (val.empty())
|
cms = rec.get(RDOC_CODCMS);
|
||||||
|
if (cms.blank())
|
||||||
{
|
{
|
||||||
val = doc.get(DOC_CODCMS).left(4);
|
cms = doc.get(DOC_CODCMS);
|
||||||
val << doc.get(DOC_FASCMS);
|
fas = doc.get(DOC_FASCMS);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
val << rec.get(RDOC_FASCMS);
|
fas = rec.get(RDOC_FASCMS);
|
||||||
|
trim_and_cut(cms, _len_commessa);
|
||||||
|
trim_and_cut(fas, _len_fase);
|
||||||
|
val << cms << fas;
|
||||||
} else
|
} else
|
||||||
if (stricmp(field, "_CONINDU") == 0)
|
if (stricmp(field, "_CONINDU") == 0)
|
||||||
{
|
{
|
||||||
@ -134,7 +152,7 @@ void TIndustriosa_app::get_field(const TDocumento& doc, const TRectype& mov, con
|
|||||||
const TFieldtypes ft = r->type(field);
|
const TFieldtypes ft = r->type(field);
|
||||||
switch (ft)
|
switch (ft)
|
||||||
{
|
{
|
||||||
case _nullfld: break;
|
case _nullfld: val.cut(0); break;
|
||||||
case _realfld: val = r->get_real(field).string(); break;
|
case _realfld: val = r->get_real(field).string(); break;
|
||||||
default: val = r->get(field); break;
|
default: val = r->get(field); break;
|
||||||
}
|
}
|
||||||
@ -190,12 +208,18 @@ bool TIndustriosa_app::get_mci_path(TFilename& shell) const
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TIndustriosa_app::call_mci(TDocumento& doc, const TRectype& movimento) const
|
bool TIndustriosa_app::call_mci(TDocumento& doc, const TRectype& movimento)
|
||||||
{
|
{
|
||||||
TConfig mci("ve6600.ini");
|
TConfig mci("ve6600.ini");
|
||||||
TString_array para;
|
TString_array para;
|
||||||
mci.list_paragraphs(para);
|
mci.list_paragraphs(para);
|
||||||
|
|
||||||
|
_len_commessa = mci.get_int("LCommessa", "General", -1, 10);
|
||||||
|
_len_fase = mci.get_int("LFase", "General", -1, 10);
|
||||||
|
|
||||||
|
int pos =para.find("General");
|
||||||
|
if (pos >= 0)
|
||||||
|
para.destroy(pos, TRUE);
|
||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
|
|
||||||
TFilename ininame; ininame.temp();
|
TFilename ininame; ininame.temp();
|
||||||
@ -215,14 +239,22 @@ bool TIndustriosa_app::call_mci(TDocumento& doc, const TRectype& movimento) cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
TAssoc_array& rvar = mci.list_variables(para.row(1));
|
TAssoc_array& rvar = mci.list_variables(para.row(1));
|
||||||
|
int i = 1;
|
||||||
|
|
||||||
for (int r = 1; r <= doc.physical_rows(); r++)
|
for (int r = 1; r <= doc.physical_rows(); r++)
|
||||||
{
|
{
|
||||||
TString16 pr; pr.format("%s_%d", (const char*)para.row(1), r); // Paragrafo riga contabile
|
const TRiga_documento& rdoc = doc[r];
|
||||||
ini.set_paragraph(pr);
|
|
||||||
FOR_EACH_ASSOC_STRING(rvar, obj, key, field)
|
if (conto_industriale(rdoc).not_empty())
|
||||||
{
|
{
|
||||||
get_field(doc, movimento, doc[r], field, val);
|
TString16 pr; pr.format("%s_%d", (const char*)para.row(1), i++); // Paragrafo riga contabile
|
||||||
ini.set(key, val);
|
|
||||||
|
ini.set_paragraph(pr);
|
||||||
|
FOR_EACH_ASSOC_STRING(rvar, obj, key, field)
|
||||||
|
{
|
||||||
|
get_field(doc, movimento, doc[r], field, val);
|
||||||
|
ini.set(key, val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
[General]
|
||||||
|
LCommessa = 10
|
||||||
|
LFase = 10
|
||||||
|
|
||||||
[Testata]
|
[Testata]
|
||||||
DataReg = 23->DATAREG
|
DataReg = 23->DATAREG
|
||||||
NumReg = 33->NUMREGIND
|
NumReg = 33->NUMREGIND
|
||||||
@ -12,11 +16,11 @@ CodVal = 33->CODVAL
|
|||||||
Cambio = 33->CAMBIO
|
Cambio = 33->CAMBIO
|
||||||
BolFat = "-1"
|
BolFat = "-1"
|
||||||
FlagCF = 33->TIPOCF
|
FlagCF = 33->TIPOCF
|
||||||
Tcaus = 33->CODCAUS
|
Tcaus = 23->CODCAUS
|
||||||
CodPag = 33->CODPAG
|
CodPag = 33->CODPAG
|
||||||
TotDoc = _TOTDOC
|
TotDoc = _TOTDOC
|
||||||
Descr = 23->DESCR
|
Descr = 23->DESCR
|
||||||
DataCam = 33->DATACAM
|
DataCam = 33->DATACAMBIO
|
||||||
Imposta = _IMPOSTADOC
|
Imposta = _IMPOSTADOC
|
||||||
|
|
||||||
[Riga]
|
[Riga]
|
||||||
@ -27,7 +31,7 @@ DareAvere = _SEZIONE
|
|||||||
Importo = _IMPORTO
|
Importo = _IMPORTO
|
||||||
ImpVal = _IMPORTOVAL
|
ImpVal = _IMPORTOVAL
|
||||||
Descri = DESCR
|
Descri = DESCR
|
||||||
Codiva = 34->CODIVA
|
Codiva = CODIVA
|
||||||
TipoDet = "0"
|
TipoDet = "0"
|
||||||
FlagProvv = "0"
|
FlagProvv = "0"
|
||||||
Impodet = "0"
|
Impodet = "0"
|
||||||
|
@ -80,7 +80,7 @@ bool dummy_hndl(TMask_field& field, KEY key);
|
|||||||
bool condpag_hndl(TMask_field& field, KEY key);
|
bool condpag_hndl(TMask_field& field, KEY key);
|
||||||
bool note_hndl(TMask_field& field, KEY key);
|
bool note_hndl(TMask_field& field, KEY key);
|
||||||
bool data_hndl(TMask_field& field, KEY key);
|
bool data_hndl(TMask_field& field, KEY key);
|
||||||
void set_curr_um(const TMask & m);
|
void set_curr_um(const TString& um);
|
||||||
|
|
||||||
|
|
||||||
class TDocumento_variable_field : public TVariable_field
|
class TDocumento_variable_field : public TVariable_field
|
||||||
|
@ -988,11 +988,11 @@ bool TDocumento_mask::ss_notify( TSheet_field& ss, int r, KEY key )
|
|||||||
else
|
else
|
||||||
if ( key == K_TAB ) // ingresso nella riga
|
if ( key == K_TAB ) // ingresso nella riga
|
||||||
{
|
{
|
||||||
TMask & sm = ss.sheet_mask();
|
|
||||||
set_curr_um(sm);
|
|
||||||
m.update_giacenza();
|
m.update_giacenza();
|
||||||
const bool on = doc[r + 1].get(RDOC_DACODNUM).not_empty();
|
const TRectype& rdoc = doc[r + 1];
|
||||||
sm.enable(DLG_USER, on);
|
set_curr_um(rdoc.get(RDOC_UMQTA));
|
||||||
|
const bool on = rdoc.get(RDOC_DACODNUM).not_empty();
|
||||||
|
ss.sheet_mask().enable(DLG_USER, on);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1647,12 +1647,6 @@ bool TElabora_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
|||||||
case F_NDOC_ELAB:
|
case F_NDOC_ELAB:
|
||||||
if ((e == fe_modify || e == fe_close) && o.check_type() == CHECK_SEARCH && !o.empty())
|
if ((e == fe_modify || e == fe_close) && o.check_type() == CHECK_SEARCH && !o.empty())
|
||||||
{
|
{
|
||||||
/* Metodo inaffidabile in assenza di codice clifo
|
|
||||||
o.check_type(CHECK_REQUIRED);
|
|
||||||
const bool ok = o.on_key (K_ENTER);
|
|
||||||
o.check_type(CHECK_SEARCH);
|
|
||||||
return ok;
|
|
||||||
*/
|
|
||||||
TToken_string key;
|
TToken_string key;
|
||||||
key.add("D"); key.add(get(F_ANNO_ELAB));
|
key.add("D"); key.add(get(F_ANNO_ELAB));
|
||||||
key.add(get(F_CODNUM_ELAB)); key.add(o.get());
|
key.add(get(F_CODNUM_ELAB)); key.add(o.get());
|
||||||
@ -1701,7 +1695,7 @@ int TElabora_mask::update_list()
|
|||||||
|
|
||||||
bool agg_test = FALSE;
|
bool agg_test = FALSE;
|
||||||
if (from_elab)
|
if (from_elab)
|
||||||
items = _elab.select(elabs, tipo, stato,"",""/*tipo_elab, stato_elab*/) ;
|
items = _elab.select(elabs, tipo, stato,"","") ;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
items = _elab.select(elabs, tipo_elab, stato_elab, tipo, stato);
|
items = _elab.select(elabs, tipo_elab, stato_elab, tipo, stato);
|
||||||
@ -1709,24 +1703,33 @@ int TElabora_mask::update_list()
|
|||||||
}
|
}
|
||||||
set(F_UPDATE_HEADER, agg_test ? "X" : "");
|
set(F_UPDATE_HEADER, agg_test ? "X" : "");
|
||||||
|
|
||||||
|
TList_field & f = (TList_field &) field(F_ELAB);
|
||||||
|
TToken_string codes;
|
||||||
|
TToken_string descrs;
|
||||||
|
for (int i = 0; i < items; i++)
|
||||||
|
{
|
||||||
|
const TElaborazione& e = _elab[elabs.row(i)];
|
||||||
|
|
||||||
|
if (!from_elab)
|
||||||
|
{
|
||||||
|
// AO20123: Impedire contabilizzazione all'indietro!
|
||||||
|
if (e.tipo() == _contabilizzazione || e.tipo() == _generazione_effetti)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
codes.add(e.codice());
|
||||||
|
descrs.add(e.descrizione());
|
||||||
|
}
|
||||||
|
|
||||||
|
items = codes.items(); // Conta elementi veramente aggiunti
|
||||||
const bool ok = items > 0;
|
const bool ok = items > 0;
|
||||||
enable(DLG_OK, ok);
|
enable(DLG_OK, ok);
|
||||||
enable(F_ELAB, ok);
|
enable(F_ELAB, ok);
|
||||||
|
|
||||||
TList_field & f = (TList_field &) field(F_ELAB);
|
|
||||||
TToken_string codes;
|
|
||||||
TToken_string descrs;
|
|
||||||
|
|
||||||
for (int i = 0; i < items; i++)
|
|
||||||
{
|
|
||||||
const TElaborazione& e = _elab[elabs.row(i)];
|
|
||||||
codes.add(e.codice());
|
|
||||||
descrs.add(e.descrizione());
|
|
||||||
}
|
|
||||||
if (codes != f.get_codes())
|
if (codes != f.get_codes())
|
||||||
f.replace_items(codes, descrs);
|
f.replace_items(codes, descrs);
|
||||||
const TElaborazione * e = curr_elab();
|
const TElaborazione * e = curr_elab();
|
||||||
if (e && e->tipo() == _consegna_ordini)
|
if (e != NULL && e->tipo() == _consegna_ordini)
|
||||||
show(-GRP_ART);
|
show(-GRP_ART);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -827,9 +827,9 @@ bool liv_handler( TMask_field& f, KEY key )
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_curr_um(const TMask & m)
|
void set_curr_um(const TString & um)
|
||||||
{
|
{
|
||||||
curr_um = m.get(FR_UMQTA);
|
curr_um = um;
|
||||||
curr_fc = -1.0;
|
curr_fc = -1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user