Aggiornato tracciato record documenti
Ottimizzate put_str Finita la sistemazione della stampa per gli stati TOlta l'aliquota IVA dalle righe di sconto git-svn-id: svn://10.65.10.50/trunk@5103 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
74687059d9
commit
3103a7a6e4
@ -1,3 +1,3 @@
|
|||||||
33
|
33
|
||||||
0
|
0
|
||||||
$doc|0|0|391|31|Documenti di vendita|NDOC||
|
$doc|0|0|395|31|Documenti di vendita|NDOC||
|
||||||
|
@ -30,13 +30,13 @@ SCONTOPERC|1|25|0|Sconto testata documento
|
|||||||
CODINDSP|1|3|0|Codice indirizzo di spedizione
|
CODINDSP|1|3|0|Codice indirizzo di spedizione
|
||||||
DATADOCRIF|5|8|0|Data documento di riferimento
|
DATADOCRIF|5|8|0|Data documento di riferimento
|
||||||
NUMDOCRIF|1|7|0|Numero documento di riferimento
|
NUMDOCRIF|1|7|0|Numero documento di riferimento
|
||||||
ZONA|1|2|0|Zona
|
ZONA|1|3|0|Zona
|
||||||
CODAG|1|5|0|Codice agente
|
CODAG|1|5|0|Codice agente
|
||||||
CODAGVIS|1|5|0|Codice agente visitante
|
CODAGVIS|1|5|0|Codice agente visitante
|
||||||
CODSPMEZZO|1|2|0|Codice mezzo di spedizione
|
CODSPMEZZO|1|3|0|Codice mezzo di spedizione
|
||||||
CODPORTO|1|3|0|Codice porto
|
CODPORTO|1|3|0|Codice porto
|
||||||
CODNOTESP1|1|2|0|Codice note di spedizione 1
|
CODNOTESP1|1|3|0|Codice note di spedizione 1
|
||||||
CODNOTESP2|1|2|0|Codice note di spedizione 2
|
CODNOTESP2|1|3|0|Codice note di spedizione 2
|
||||||
CAUSTRASP|1|3|0|Causale di trasporto
|
CAUSTRASP|1|3|0|Causale di trasporto
|
||||||
CODVETT1|1|5|0|Codice vettore 1
|
CODVETT1|1|5|0|Codice vettore 1
|
||||||
CODVETT2|1|5|0|Codice vettore 2
|
CODVETT2|1|5|0|Codice vettore 2
|
||||||
|
@ -266,12 +266,18 @@ bool TMotore_application::print_handler( TMask_field& f, KEY key )
|
|||||||
{
|
{
|
||||||
TString commandline("ve1 -0 ");
|
TString commandline("ve1 -0 ");
|
||||||
|
|
||||||
commandline << m.get( F_CODNUM ) << " " << m.get( F_ANNO ) << " ";
|
commandline << m.get(F_CODNUM) << " " << m.get(F_ANNO) << " ";
|
||||||
commandline << m.get( F_PROVV )<< " " << m.get( F_NDOC );
|
commandline << m.get(F_PROVV) << " " << m.get(F_NDOC);
|
||||||
|
|
||||||
TExternal_app interattivo( commandline );
|
TExternal_app interattivo( commandline );
|
||||||
|
|
||||||
interattivo.run( );
|
interattivo.run();
|
||||||
|
if (app().doc().stampabile())
|
||||||
|
{
|
||||||
|
const char s[2] = {app().doc().tipo().stato_finale_stampa(), '\0'};
|
||||||
|
|
||||||
|
m.set(F_STATO, s, TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -333,6 +333,7 @@ public:
|
|||||||
class TRiga_documento : public TAuto_variable_rectype // velib02
|
class TRiga_documento : public TAuto_variable_rectype // velib02
|
||||||
{
|
{
|
||||||
TDocumento * _doc;
|
TDocumento * _doc;
|
||||||
|
static long _firm;
|
||||||
static TAssoc_array _tipi;
|
static TAssoc_array _tipi;
|
||||||
static TAssoc_array _spese;
|
static TAssoc_array _spese;
|
||||||
static TAssoc_array _ive;
|
static TAssoc_array _ive;
|
||||||
@ -345,6 +346,8 @@ protected:
|
|||||||
virtual TRiga_documento & copy(const TRiga_documento & r);
|
virtual TRiga_documento & copy(const TRiga_documento & r);
|
||||||
TObject* dup() const { return new TRiga_documento(*this); }
|
TObject* dup() const { return new TRiga_documento(*this); }
|
||||||
|
|
||||||
|
static void test_firm();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void dirty_fields(bool dirty_document = TRUE);
|
void dirty_fields(bool dirty_document = TRUE);
|
||||||
bool doc_dependent() const;
|
bool doc_dependent() const;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include "velib.h"
|
#include "velib.h"
|
||||||
#include "vepriv.h"
|
#include "vepriv.h"
|
||||||
|
|
||||||
#ifndef __APPLICAT_H
|
#ifndef __PREFIX_H
|
||||||
#include <applicat.h>
|
#include <prefix.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __TABUTIL_H
|
#ifndef __TABUTIL_H
|
||||||
@ -174,6 +174,7 @@ TVariable_mask * TTipo_riga_documento::mask()
|
|||||||
// Riga documento per vendite
|
// Riga documento per vendite
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
long TRiga_documento::_firm = -1;
|
||||||
TAssoc_array TRiga_documento::_tipi;
|
TAssoc_array TRiga_documento::_tipi;
|
||||||
TAssoc_array TRiga_documento::_spese;
|
TAssoc_array TRiga_documento::_spese;
|
||||||
TAssoc_array TRiga_documento::_ive;
|
TAssoc_array TRiga_documento::_ive;
|
||||||
@ -231,14 +232,8 @@ const TSpesa_prest & TRiga_documento::spesa() const
|
|||||||
const char tipor = tipo().tipo();
|
const char tipor = tipo().tipo();
|
||||||
|
|
||||||
CHECK(tipor == RIGA_SPESEDOC || tipor == RIGA_PRESTAZIONI, "Tipo riga incompatibile con le spese");
|
CHECK(tipor == RIGA_SPESEDOC || tipor == RIGA_PRESTAZIONI, "Tipo riga incompatibile con le spese");
|
||||||
static long firm = -1;
|
|
||||||
long new_firm = main_app().get_firm();
|
|
||||||
|
|
||||||
if (firm != new_firm)
|
test_firm();
|
||||||
{
|
|
||||||
_spese.destroy();
|
|
||||||
firm = new_firm;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TString16 codice(get("CODART"));
|
const TString16 codice(get("CODART"));
|
||||||
TString16 index; index << tipor << codice;
|
TString16 index; index << tipor << codice;
|
||||||
@ -298,6 +293,17 @@ TRiga_documento & TRiga_documento::copy(const TRiga_documento & r)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TRiga_documento::test_firm()
|
||||||
|
{
|
||||||
|
const long new_firm = prefix().get_codditta();
|
||||||
|
|
||||||
|
if (_firm != new_firm)
|
||||||
|
{
|
||||||
|
_spese.destroy();
|
||||||
|
_firm = new_firm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TRectype & TRiga_documento::operator =(const TRectype & r)
|
TRectype & TRiga_documento::operator =(const TRectype & r)
|
||||||
{
|
{
|
||||||
TRectype::operator=(r);
|
TRectype::operator=(r);
|
||||||
@ -394,8 +400,7 @@ real TRiga_documento::importo(bool scontato, bool lordo, int ndec) const
|
|||||||
TTipo_calcolo c = _nessun_calcolo;
|
TTipo_calcolo c = _nessun_calcolo;
|
||||||
const char tipor = tipo().tipo();
|
const char tipor = tipo().tipo();
|
||||||
const real qta = get_real("QTA");
|
const real qta = get_real("QTA");
|
||||||
TString16 field_perc;
|
real r1;
|
||||||
TCond_vendita cv;
|
|
||||||
|
|
||||||
switch (tipor)
|
switch (tipor)
|
||||||
{
|
{
|
||||||
@ -416,8 +421,12 @@ real TRiga_documento::importo(bool scontato, bool lordo, int ndec) const
|
|||||||
c = _valore;
|
c = _valore;
|
||||||
break;
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
c = _percentuale;
|
{
|
||||||
field_perc = s.field_perc();
|
const TString16 field_perc(s.field_perc());
|
||||||
|
|
||||||
|
c = _percentuale;
|
||||||
|
r1 = doc().get_real(field_perc);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -425,12 +434,15 @@ real TRiga_documento::importo(bool scontato, bool lordo, int ndec) const
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RIGA_SCONTI:
|
case RIGA_SCONTI:
|
||||||
cv.set_sconto(get("SCONTO"));
|
{
|
||||||
|
TCond_vendita cv ; cv.set_sconto(get("SCONTO"));
|
||||||
|
|
||||||
if (cv.get_sconto().not_empty())
|
if (cv.get_sconto().not_empty())
|
||||||
c = _scontoperc;
|
c = _scontoperc;
|
||||||
else
|
else
|
||||||
c = _scontoimp;
|
c = _scontoimp;
|
||||||
|
r1 = cv.sconto_val();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case RIGA_OMAGGI:
|
case RIGA_OMAGGI:
|
||||||
if (_iva_calc && get_bool("ADDIVA"))
|
if (_iva_calc && get_bool("ADDIVA"))
|
||||||
@ -447,13 +459,13 @@ real TRiga_documento::importo(bool scontato, bool lordo, int ndec) const
|
|||||||
importo = prezzo(scontato, lordo, ndec);
|
importo = prezzo(scontato, lordo, ndec);
|
||||||
break;
|
break;
|
||||||
case _percentuale:
|
case _percentuale:
|
||||||
importo = doc().get_real(field_perc) * get_real(RDOC_QTA) / 100;
|
importo = r1 * get_real(RDOC_QTA) / 100;
|
||||||
break;
|
break;
|
||||||
case _scontoimp:
|
case _scontoimp:
|
||||||
importo = -prezzo(FALSE, lordo, ndec);
|
importo = -prezzo(FALSE, lordo, ndec);
|
||||||
break;
|
break;
|
||||||
case _scontoperc:
|
case _scontoperc:
|
||||||
importo = doc().basesconto() * (cv.sconto_val() - 1.0);
|
importo = doc().basesconto() * (r1 - 1.0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -528,16 +540,22 @@ bool TRiga_documento::doc_dependent() const
|
|||||||
|
|
||||||
void TRiga_documento::put_str(const char* fieldname, const char* val)
|
void TRiga_documento::put_str(const char* fieldname, const char* val)
|
||||||
{
|
{
|
||||||
const TString v(val);
|
if (strcmp(fieldname, "TIPORIGA") == 0)
|
||||||
if (strcmp(fieldname, "TIPORIGA") == 0 && TRectype::get("TIPORIGA") != v)
|
|
||||||
{
|
{
|
||||||
TAuto_variable_rectype::put_str(fieldname, v);
|
const TString v(val);
|
||||||
reset_fields(*this);
|
|
||||||
set_fields(*this);
|
if (TRectype::get("TIPORIGA") != v)
|
||||||
|
{
|
||||||
|
TAuto_variable_rectype::put_str(fieldname, v);
|
||||||
|
reset_fields(*this);
|
||||||
|
set_fields(*this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dirty_fields();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TAuto_variable_rectype::put_str(fieldname, v);
|
TAuto_variable_rectype::put_str(fieldname, val);
|
||||||
dirty_fields();
|
dirty_fields();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -606,9 +624,6 @@ void TRiga_documento::autosave(TSheet_field & f)
|
|||||||
put( "UMQTA", row.get( f.cid2index(FR_UMQTA )) );
|
put( "UMQTA", row.get( f.cid2index(FR_UMQTA )) );
|
||||||
TMask * m = ((TTipo_riga_documento &)tipo()).mask();
|
TMask * m = ((TTipo_riga_documento &)tipo()).mask();
|
||||||
const int pos = m->id2pos(FR_QTA);
|
const int pos = m->id2pos(FR_QTA);
|
||||||
// if (pos >= 0 && m->fld(pos).field()->name() == "PSPESA")
|
|
||||||
// put( "PSPESA", row.get( f.cid2index(FR_QTA )) );
|
|
||||||
// else
|
|
||||||
put( "QTA", row.get( f.cid2index(FR_QTA )) );
|
put( "QTA", row.get( f.cid2index(FR_QTA )) );
|
||||||
put( "QTAEVASA", row.get( f.cid2index(FR_QTAEVASA )) );
|
put( "QTAEVASA", row.get( f.cid2index(FR_QTAEVASA )) );
|
||||||
put( "RIGAEVASA", row.get( f.cid2index(FR_RIGAEVASA )) );
|
put( "RIGAEVASA", row.get( f.cid2index(FR_RIGAEVASA )) );
|
||||||
@ -680,9 +695,6 @@ void TRiga_documento::autoload(TSheet_field & f)
|
|||||||
row.add( get( "PREZZO" ), f.cid2index(FR_PREZZO ));
|
row.add( get( "PREZZO" ), f.cid2index(FR_PREZZO ));
|
||||||
TMask * m = ((TTipo_riga_documento &)tipo()).mask();
|
TMask * m = ((TTipo_riga_documento &)tipo()).mask();
|
||||||
const int pos = m->id2pos(FR_QTA);
|
const int pos = m->id2pos(FR_QTA);
|
||||||
// if (pos >= 0 && m->fld(pos).field()->name() == "PSPESA")
|
|
||||||
// row.add( get( "PSPESA" ), f.cid2index(FR_QTA ));
|
|
||||||
// else
|
|
||||||
row.add( get( "QTA" ), f.cid2index(FR_QTA ));
|
row.add( get( "QTA" ), f.cid2index(FR_QTA ));
|
||||||
row.add( get( "QTAEVASA" ), f.cid2index(FR_QTAEVASA ));
|
row.add( get( "QTAEVASA" ), f.cid2index(FR_QTAEVASA ));
|
||||||
row.add( get( "RIGAEVASA" ), f.cid2index(FR_RIGAEVASA ));
|
row.add( get( "RIGAEVASA" ), f.cid2index(FR_RIGAEVASA ));
|
||||||
|
@ -225,9 +225,9 @@ TRiepilogo_iva::TRiepilogo_iva(const TIVA & codiva) : _codiva(codiva)
|
|||||||
// Documento per vendite
|
// Documento per vendite
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
long TDocumento::_firm = -1;
|
||||||
TAssoc_array TDocumento::_tipi;
|
TAssoc_array TDocumento::_tipi;
|
||||||
TAssoc_array TDocumento::_numerazioni;
|
TAssoc_array TDocumento::_numerazioni;
|
||||||
long TDocumento::_firm = -1;
|
|
||||||
TString16 TDocumento::_codiva_spese;
|
TString16 TDocumento::_codiva_spese;
|
||||||
TString16 TDocumento::_codiva_bolli;
|
TString16 TDocumento::_codiva_bolli;
|
||||||
|
|
||||||
@ -310,6 +310,7 @@ void TDocumento::test_firm()
|
|||||||
_firm = new_firm;
|
_firm = new_firm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
real TDocumento::spese_incasso(real & imp, int ndec, TTipo_importo t) const
|
real TDocumento::spese_incasso(real & imp, int ndec, TTipo_importo t) const
|
||||||
{
|
{
|
||||||
real imp_spese;
|
real imp_spese;
|
||||||
@ -847,6 +848,9 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
|
|||||||
((TDocumento *)this)->zero("MOVMAG");
|
((TDocumento *)this)->zero("MOVMAG");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
TLocalisamfile anamag(LF_ANAMAG);
|
TLocalisamfile anamag(LF_ANAMAG);
|
||||||
TLocalisamfile codalt(LF_CODCORR);
|
TLocalisamfile codalt(LF_CODCORR);
|
||||||
codalt.setkey(2);
|
codalt.setkey(2);
|
||||||
@ -1170,7 +1174,7 @@ void TDocumento::update_tabella_iva()
|
|||||||
|
|
||||||
real TDocumento::imposta(bool spese, int ndec) const
|
real TDocumento::imposta(bool spese, int ndec) const
|
||||||
{
|
{
|
||||||
TAssoc_array table = ((TDocumento *)this)->tabella_iva();
|
TAssoc_array & table = ((TDocumento *)this)->tabella_iva();
|
||||||
real val;
|
real val;
|
||||||
|
|
||||||
if (ndec == AUTO_DECIMALS)
|
if (ndec == AUTO_DECIMALS)
|
||||||
@ -1248,22 +1252,35 @@ TPagamento & TDocumento::pagamento()
|
|||||||
|
|
||||||
void TDocumento::put_str(const char* fieldname, const char* val)
|
void TDocumento::put_str(const char* fieldname, const char* val)
|
||||||
{
|
{
|
||||||
TString v(val);
|
if (strcmp(fieldname, "TIPODOC") == 0)
|
||||||
if (strcmp(fieldname, "TIPODOC") == 0 && TRectype::get("TIPODOC") != v)
|
|
||||||
{
|
{
|
||||||
TAuto_variable_rectype::put_str(fieldname, v);
|
const TString v(val);
|
||||||
reset_fields(*this);
|
|
||||||
set_fields(*this);
|
if (TRectype::get("TIPODOC") != v)
|
||||||
|
{
|
||||||
|
TAuto_variable_rectype::put_str(fieldname, v);
|
||||||
|
reset_fields(*this);
|
||||||
|
set_fields(*this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dirty_fields();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
if (strcmp(fieldname, "CODCF") == 0)
|
if (strcmp(fieldname, "CODCF") == 0)
|
||||||
|
{
|
||||||
|
const TString v(val);
|
||||||
|
|
||||||
put("SPESEUPD", TRectype::get("CODCF") == v);
|
put("SPESEUPD", TRectype::get("CODCF") == v);
|
||||||
TAuto_variable_rectype::put_str(fieldname, v);
|
TAuto_variable_rectype::put_str(fieldname, v);
|
||||||
dirty_fields();
|
dirty_fields();
|
||||||
if (strcmp(fieldname, "SCONTOPERC") == 0)
|
}
|
||||||
set_riga_sconto();
|
else
|
||||||
}
|
{
|
||||||
|
TAuto_variable_rectype::put_str(fieldname, val);
|
||||||
|
dirty_fields();
|
||||||
|
if (strcmp(fieldname, "SCONTOPERC") == 0)
|
||||||
|
set_riga_sconto();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TDocumento::zero(const char * fieldname)
|
void TDocumento::zero(const char * fieldname)
|
||||||
|
@ -1,17 +1,32 @@
|
|||||||
#include "verigdef.h"
|
#include "verigdef.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define FULL_SCREEN
|
#define FULL_SCREEN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MASK_TITLE1 "Sconto ad importo"
|
#define MASK_TITLE1 "Sconto ad importo"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DEFINE_FIELD(DESCR)
|
DEFINE_FIELD(DESCR)
|
||||||
|
|
||||||
DEFINE_FIELD(VALORE)
|
DEFINE_FIELD(VALORE)
|
||||||
|
|
||||||
F_POS(VALORE, 2, 9,"Importo " )
|
F_POS(VALORE, 2, 9,"Importo " )
|
||||||
DEFINE_FIELD(CODIVA)
|
|
||||||
F_POS(CODIVA, 2, 11,"Cod. IVA " )
|
// DEFINE_FIELD(CODIVA)
|
||||||
DEFINE_FIELD(DESIVA)
|
|
||||||
F_POS(DESIVA, 22, 11,"" )
|
// F_POS(CODIVA, 2, 11,"Cod. IVA " )
|
||||||
|
|
||||||
|
// DEFINE_FIELD(DESIVA)
|
||||||
|
|
||||||
|
// F_POS(DESIVA, 22, 11,"" )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "verig.uml"
|
#include "verig.uml"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,17 +1,32 @@
|
|||||||
#include "verigdef.h"
|
#include "verigdef.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define FULL_SCREEN
|
#define FULL_SCREEN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MASK_TITLE1 "Sconto percentuale"
|
#define MASK_TITLE1 "Sconto percentuale"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DEFINE_FIELD(DESCR)
|
DEFINE_FIELD(DESCR)
|
||||||
|
|
||||||
DEFINE_FIELD(SCONTO)
|
DEFINE_FIELD(SCONTO)
|
||||||
|
|
||||||
F_POS(SCONTO, 2, 9,"Sconto " )
|
F_POS(SCONTO, 2, 9,"Sconto " )
|
||||||
DEFINE_FIELD(CODIVA)
|
|
||||||
F_POS(CODIVA, 2, 11,"Cod. IVA " )
|
// DEFINE_FIELD(CODIVA)
|
||||||
DEFINE_FIELD(DESIVA)
|
|
||||||
F_POS(DESIVA, 22, 11,"" )
|
// F_POS(CODIVA, 2, 11,"Cod. IVA " )
|
||||||
|
|
||||||
|
// DEFINE_FIELD(DESIVA)
|
||||||
|
|
||||||
|
// F_POS(DESIVA, 22, 11,"" )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "verig.uml"
|
#include "verig.uml"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user