Patch level : 4.0 911

Files correlati     :
Ricompilazione Demo : [ ]
Commento           :

Riportata la versione 3.2 1010


git-svn-id: svn://10.65.10.50/trunk@16378 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2008-03-26 12:44:04 +00:00
parent c13654bc84
commit 87d96f2733
5 changed files with 41 additions and 29 deletions

View File

@ -309,20 +309,16 @@ int TMotore_application::read( TMask& m )
bool TMotore_application::menu(MENU_TAG mt)
{
bool ok = TRUE;
bool ok = true;
if (mt == MENU_ITEM(1))
{
_sel_color->run();
COLOR high_back_color = _sel_color->get_back_color(_link_pos);
COLOR high_color = _sel_color->get_fore_color(_link_pos);
if (!query_mask().is_running())
{
TDocumento_mask * m = (TDocumento_mask * ) &edit_mask();
if (m != NULL)
m->highlight(high_back_color, high_color);
}
if (_sel_color->run() != K_ESC && _docmsk != NULL)
{
COLOR high_back_color = _sel_color->get_back_color(_link_pos);
COLOR high_color = _sel_color->get_fore_color(_link_pos);
_docmsk->highlight(high_back_color, high_color);
}
}
else
ok = TRelation_application::menu(mt);
@ -395,7 +391,8 @@ bool TMotore_application::user_create( )
TConfig utente( CONFIG_USER );
_codnum = utente.get("CODNUM");
_tipodoc = utente.get("TIPODOC");
_docmsk = NULL;
return TRUE;
}

View File

@ -562,13 +562,13 @@ real TRiga_documento::importo(bool scontato, bool lordo, int ndec) const
else
importo = -prezzo(false, lordo, ALL_DECIMALS);
TGeneric_distrib d(importo, ALL_DECIMALS);
TAssoc_array & table = ((TDocumento &) doc()).tabella_iva(true);
TRiepilogo_iva * aliquota;
if (doc_al_lordo)
{
if (!lordo)
{
TAssoc_array & table = ((TDocumento &) doc()).tabella_iva(true);
importo = ZERO;
table.restart();
for (aliquota = (TRiepilogo_iva *) table.get(); aliquota != NULL;
@ -590,6 +590,7 @@ real TRiga_documento::importo(bool scontato, bool lordo, int ndec) const
{
if (lordo)
{
TAssoc_array & table = ((TDocumento &) doc()).tabella_iva(true);
importo = ZERO;
table.restart();
for (aliquota = (TRiepilogo_iva *) table.get(); aliquota != NULL;

View File

@ -2191,17 +2191,17 @@ void TDocumento::put_str(const char* fieldname, const char* val)
if (strcmp(fieldname, DOC_CODCF) == 0)
{
const TString16 v(val);
put("SPESEUPD", TRectype::get(DOC_CODCF) == v);
put(DOC_SPESEUPD, TRectype::get(DOC_CODCF) == v);
TAuto_variable_rectype::put_str(fieldname, v);
dirty_fields();
}
else
{
TAuto_variable_rectype::put_str(fieldname, val);
dirty_fields();
if (strcmp(fieldname, "SCONTOPERC") == 0)
set_riga_sconto();
}
{
TAuto_variable_rectype::put_str(fieldname, val);
dirty_fields();
if (strcmp(fieldname, DOC_SCONTOPERC) == 0)
set_riga_sconto();
}
}
const TString& TDocumento::get_str(const char* fieldname) const
@ -2330,7 +2330,7 @@ void TDocumento::update_raee()
const TString & r_cod = tipo().raee_cod();
const TString & r_fld = tipo().raee_fld();
if (r_cod.full() && r_fld.full())
if (r_cod.full() && r_fld.full() && tipo().stati_iniziali_modifica().find(stato()) >= 0)
{
TSpesa_prest sp(r_cod);
TString4 cod_iva_cli;
@ -2417,7 +2417,7 @@ void TDocumento::update_raee()
void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, TSheet_field * sh)
{
const bool updated = get_bool("SPESEUPD");
const bool updated = get_bool(DOC_SPESEUPD);
if (updated)
return;
@ -2521,11 +2521,11 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old,
}
}
}
put("SPESEUPD", true);
put(DOC_SPESEUPD, true);
}
real TDocumento::calc_conai_qta(int type)
{
{
real qta;
for (int i = physical_rows(); i > 0; i--)
@ -2533,8 +2533,8 @@ real TDocumento::calc_conai_qta(int type)
const TRiga_documento& r = row(i);
if (r.is_merce())
{
const real row_qta = r.calc_conai_qta(type);
const real row_qta = r.calc_conai_qta(type);
qta += row_qta;
}
}
@ -2543,7 +2543,7 @@ real TDocumento::calc_conai_qta(int type)
void TDocumento::update_conai()
{
if (tipo().add_conai())
if (tipo().add_conai() && tipo().stati_iniziali_modifica().find(stato()) >= 0)
{
const TRectype& cfven = clifor().vendite();
const bool cli_add_conai = cfven.get_bool("ADDCONAI");

View File

@ -1089,7 +1089,21 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
}
numdoc.upper(); // Il numero documento e' uppercase!
// Istanzia la causale del documento corrente...
const TTipo_documento& tipo = doc.tipo();
TString4 codcaus = tipo.causale();
TToken_string key;
key.add(doc.get(DOC_TIPOCF));
key.add(doc.get(DOC_CODCF));
const TRectype& cfven = cache().get(LF_CFVEN, key);
const TString& caus_cli = cfven.get(doc.is_nota_credito() ? CFV_CODCAUSNC : CFV_CODCAUS);
if (caus_cli.not_empty())
codcaus = caus_cli; // La causale del cliente prevale su quella del tipo documento
_caus = get_caus(doc, data_reg.year());
_righe_iva->set_caus(_caus);
if (_caus == NULL || !_caus->ok())
{
_error = caus_error;

View File

@ -580,7 +580,7 @@ bool TConsegna_ordini::elabora(TLista_documenti& doc_in, TLista_documenti& doc_o
outrec.put(RDOC_QTA, UNO);
}
aggiorna_ncolli_tara_pnetto(outrec);
if (kill_descrizione_estesa()) // Cancello eventualmente la descrizione estesa
if (outrec.tipo().tipo() != RIGA_DESCRIZIONI && kill_descrizione_estesa()) // Cancello eventualmente la descrizione estesa
{
outrec.zero(RDOC_DESCLUNGA);
outrec.zero(RDOC_DESCEST);