Patch level : 2.1 102

Files correlati     : ve0.exe ve6.exe
Ricompilazione Demo : [ ]
Commento            :
 Aggiungere la causale per le note di credito sul cliente


git-svn-id: svn://10.65.10.50/trunk@12281 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2004-09-03 13:39:04 +00:00
parent 3ebbbbad8b
commit 2f54cc7611

View File

@ -1114,14 +1114,6 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
TRectype& mov_rec = _movimento->curr();
const bool acquisto = doc.get_char(DOC_TIPOCF) == 'F';
/* Richiesta ritirata il 13-01-2000
if (acquisto)
{
TDate datarif(doc.get(DOC_DATADOCRIF));
if (datarif.ok())
datadoc = datarif;
}
*/
// Reperisce la data documento
const TDate datadoc(doc.data());
if (!datadoc.ok())
@ -1201,16 +1193,14 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
const TTipo_documento& tipo = doc.tipo();
TString4 codcaus = tipo.causale();
if (!doc.is_nota_credito()) // Non usare la causale del cliente per le NC!
{
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(CFV_CODCAUS);
if (caus_cli.not_empty())
codcaus = caus_cli; // La causale del cliente prevale su quella del tipo documento
}
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 = new TCausale(codcaus,data_reg.year());
_righe_iva->set_caus(_caus);