Patch level : 2.2 mah
Files correlati : ve0 Ricompilazione Demo : [ ] Commento : Migliorata generazione campi analitici sulle righe documento: vengono ignorate le righe descrizione, sconto ed omaggio. git-svn-id: svn://10.65.10.50/trunk@13068 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c913f3ed12
commit
190e16c53f
@ -81,7 +81,7 @@ public:
|
||||
TCodart_livelli * get_livelli_art() const { return livelli_art; }
|
||||
|
||||
TString& generated_code() { return _generated_code; }
|
||||
TString16 &um_principale() {return _um_principale;}
|
||||
TString& um_principale() { return _um_principale; }
|
||||
TMagazzini& magazzini() { return *_magazzini; }
|
||||
TEsercizi_contabili &esercizi_contabili() {return *_esercizi_contabili;}
|
||||
|
||||
|
@ -451,15 +451,15 @@ public:
|
||||
virtual ~TConsuntivazione_produzione() { }
|
||||
};
|
||||
|
||||
class TContabilizzazione_analitica : public TElaborazione // velib04e
|
||||
class TContabilizzazione_analitica : public TContabilizzazione // velib04b
|
||||
{
|
||||
public:
|
||||
virtual bool elabora(TLista_documenti& doc_in, TLista_documenti& doc_out,
|
||||
const TDate& data_elab, bool interattivo = FALSE);
|
||||
bool elabora(const TDocumento& doc_in, const TImporto& totdoc);
|
||||
|
||||
TContabilizzazione_analitica(const char* cod) : TElaborazione(cod) { }
|
||||
TContabilizzazione_analitica(const TRectype& rec) : TElaborazione(rec) { }
|
||||
TContabilizzazione_analitica(const char* cod) : TContabilizzazione(cod) { }
|
||||
TContabilizzazione_analitica(const TRectype& rec) : TContabilizzazione(rec) { }
|
||||
virtual ~TContabilizzazione_analitica() { }
|
||||
};
|
||||
|
||||
|
@ -15,18 +15,8 @@
|
||||
#include "../in/inlib01.h"
|
||||
#include "../mg/anamag.h"
|
||||
|
||||
#include <mov.h>
|
||||
#include <rmov.h>
|
||||
#include <rmoviva.h>
|
||||
#include <clifo.h>
|
||||
#include <cfven.h>
|
||||
#include <comuni.h>
|
||||
#include <nditte.h>
|
||||
#include <occas.h>
|
||||
#include <unloc.h>
|
||||
#include <doc.h>
|
||||
#include <rdoc.h>
|
||||
|
||||
|
||||
void TMovimentoPN_VE::destroy_iva_row(int i)
|
||||
{
|
||||
@ -118,9 +108,7 @@ void TMovimentoPN_VE::set_cg_imp(int n, const TImporto& imp)
|
||||
TImporto TMovimentoPN_VE::get_cg_imp(int n)
|
||||
{
|
||||
const TRectype& rec = cg(n);
|
||||
const char sez = rec.get_char(RMV_SEZIONE);
|
||||
const real valore(rec.get_real(RMV_IMPORTO));
|
||||
TImporto importo(sez,valore);
|
||||
const TImporto importo(rec.get_char(RMV_SEZIONE), rec.get_real(RMV_IMPORTO));
|
||||
return importo;
|
||||
}
|
||||
|
||||
@ -141,7 +129,7 @@ int TMovimentoPN_VE::set_cg_rec(int n, const TImporto& imp, const TBill& conto,
|
||||
|
||||
if (insert)
|
||||
{
|
||||
TRectype& head = lfile().curr();
|
||||
TRectype& head = curr();
|
||||
const int annoes = head.get_int(MOV_ANNOES);
|
||||
const long numreg = head.get_long(MOV_NUMREG);
|
||||
TDate datareg(head.get_date(MOV_DATAREG));
|
||||
@ -151,25 +139,15 @@ int TMovimentoPN_VE::set_cg_rec(int n, const TImporto& imp, const TBill& conto,
|
||||
}
|
||||
rec.put(RMV_SEZIONE,imp.sezione());
|
||||
rec.put(RMV_IMPORTO,imp.valore());
|
||||
rec.put(RMV_TIPOC,conto.tipo());
|
||||
rec.put(RMV_GRUPPO,conto.gruppo());
|
||||
rec.put(RMV_CONTO,conto.conto());
|
||||
rec.put(RMV_SOTTOCONTO,conto.sottoconto());
|
||||
conto.put(rec);
|
||||
rec.put(RMV_DESCR, desc);
|
||||
|
||||
if (tipo != ' ')
|
||||
{
|
||||
if (tipo == 'T') // Calcolo contropartita
|
||||
{
|
||||
TRectype& irec = iva(0);
|
||||
const char t = irec.get_char(RMI_TIPOC);
|
||||
const int gr = irec.get_int(RMI_GRUPPO);
|
||||
const int co = irec.get_int(RMI_CONTO);
|
||||
const long so = irec.get_long(RMI_SOTTOCONTO);
|
||||
rec.put(RMV_TIPOCC,t);
|
||||
rec.put(RMV_GRUPPOC,gr);
|
||||
rec.put(RMV_CONTOC,co);
|
||||
rec.put(RMV_SOTTOCONTOC,so);
|
||||
const TBill zio(iva(0));
|
||||
zio.put(rec, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -184,15 +162,8 @@ int TMovimentoPN_VE::set_cg_rec(int n, const TImporto& imp, const TBill& conto,
|
||||
pos = type2pos('T');
|
||||
if (pos >= 0)
|
||||
{
|
||||
TRectype& crec = cg(pos);
|
||||
const char t = crec.get_char(RMV_TIPOC);
|
||||
const int gr = crec.get_int(RMV_GRUPPO);
|
||||
const int co = crec.get_int(RMV_CONTO);
|
||||
const long so = crec.get_long(RMV_SOTTOCONTO);
|
||||
rec.put(RMV_TIPOCC,t);
|
||||
rec.put(RMV_GRUPPOC,gr);
|
||||
rec.put(RMV_CONTOC,co);
|
||||
rec.put(RMV_SOTTOCONTOC,so);
|
||||
const TBill zio(cg(pos));
|
||||
zio.put(rec, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -254,16 +225,12 @@ void TMovimentoPN_VE::create_row(int i, const TString & descr_cr)
|
||||
}
|
||||
}
|
||||
|
||||
const int gr = cur.get_int(RMI_GRUPPO);
|
||||
const int co = cur.get_int(RMI_CONTO);
|
||||
const long so = cur.get_long(RMI_SOTTOCONTO);
|
||||
const TBill oldconto(gr,co,so);
|
||||
const TBill oldconto(cur);
|
||||
if (oldconto.ok())
|
||||
{
|
||||
if (bill2pos(oldconto, 'I') < 0)
|
||||
{
|
||||
const TString d(_caus->desc_agg(2));
|
||||
|
||||
const TString80 d(_caus->desc_agg(2));
|
||||
set_cg_rec(-1, real2imp(ZERO, 'I'), oldconto, d.empty() ? descr_cr: d, 'I');
|
||||
}
|
||||
}
|
||||
@ -325,7 +292,7 @@ void TMovimentoPN_VE::enter_row(int i, const TString & descr_cr)
|
||||
if (!imposta.is_zero()) // Se c'e' imposta ...
|
||||
{ // ... crea nuova riga per l'IVA
|
||||
const TImporto val(real2imp(imposta, 'I'));
|
||||
const TString d(_caus->desc_agg(ri));
|
||||
const TString80 d(_caus->desc_agg(ri));
|
||||
newposiva = set_cg_rec(-1, val, contoiva, d, tipod);
|
||||
}
|
||||
}
|
||||
@ -355,7 +322,6 @@ void TMovimentoPN_VE::add_row_re(int i)
|
||||
ivapos= set_cg_rec(-1, real2imp(ZERO, 'I'), c, "", 'I');
|
||||
|
||||
const TImporto val(real2imp(oldiva, 'I'));
|
||||
|
||||
add_cg_rec(ivapos, val);
|
||||
}
|
||||
else
|
||||
@ -369,12 +335,10 @@ void TMovimentoPN_VE::add_row_re(int i)
|
||||
if (c.ok())
|
||||
{
|
||||
int poscg = bill2pos(c, ' ');
|
||||
|
||||
if (poscg < 0)
|
||||
poscg = set_cg_rec(-1, real2imp(ZERO, 'I'), c, _caus->desc_agg(2), ' ');
|
||||
|
||||
TImporto val(real2imp(oldimp, 'I'));
|
||||
|
||||
const TImporto val(real2imp(oldimp, 'I'));
|
||||
add_cg_rec(poscg, val);
|
||||
}
|
||||
}
|
||||
@ -404,10 +368,10 @@ bool TMovimentoPN_VE::add_row_cp_re(int i)
|
||||
|
||||
void TMovimentoPN_VE::map_conto_re(TBill& c)
|
||||
{
|
||||
TString key;
|
||||
|
||||
TString16 key;
|
||||
key.format("%3d%3d%6ld",c.gruppo(), c.conto(), c.sottoconto());
|
||||
TRectype & rs = (TRectype &) cache().get("MRE", key);
|
||||
|
||||
TRectype rs = cache().get("MRE", key);
|
||||
if (rs.empty())
|
||||
{
|
||||
key.cut(6);
|
||||
@ -3916,6 +3880,7 @@ bool TContabilizzazione::elabora(TLista_documenti& doc_in, TLista_documenti& doc
|
||||
_caus = NULL;
|
||||
}
|
||||
delete _movimento;
|
||||
_movimento = NULL;
|
||||
|
||||
// Let's free some valuable space
|
||||
if (!interattivo)
|
||||
|
@ -1,9 +1,21 @@
|
||||
#include "velib04.h"
|
||||
#include <doc.h>
|
||||
|
||||
bool TContabilizzazione_analitica::elabora(const TDocumento& doc_in, const TImporto& totdoc)
|
||||
bool TContabilizzazione_analitica::elabora(const TDocumento& doc, const TImporto& totdoc)
|
||||
{
|
||||
return false;
|
||||
// Scandisco le righe, saltando descrizioni e sconti
|
||||
for (int i = 1; i <= doc.physical_rows(); i++)
|
||||
{
|
||||
const TRiga_documento& riga = doc[i];
|
||||
if (riga.is_descrizione() || riga.is_sconto() || riga.is_omaggio())
|
||||
continue;
|
||||
|
||||
const TRectype& anamag = cache().get(LF_ANAMAG, riga.get(RDOC_CODARTMAG));
|
||||
|
||||
TBill bill;
|
||||
if (search_costo_ricavo(bill, riga) != no_error)
|
||||
break;
|
||||
}
|
||||
return good();
|
||||
}
|
||||
|
||||
bool TContabilizzazione_analitica::elabora(TLista_documenti& doc_in, TLista_documenti& doc_out,
|
||||
@ -13,7 +25,7 @@ bool TContabilizzazione_analitica::elabora(TLista_documenti& doc_in, TLista_docu
|
||||
for (int i = 0; doc_in.items(); i++)
|
||||
{
|
||||
if (!elabora(doc_in[i], zero))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
return good();
|
||||
}
|
@ -58,7 +58,7 @@ TDocumento_mask::TDocumento_mask(const char* td)
|
||||
listbox.replace_items(keys, descrs);
|
||||
|
||||
// Controlla se deve generare la pagina di analitica
|
||||
if (dongle().active(CAAUT))
|
||||
if (dongle().active(CAAUT) || dongle().active(CMAUT))
|
||||
insert_anal_page();
|
||||
|
||||
configura_sheet(*_sheet);
|
||||
@ -1049,9 +1049,12 @@ TVariable_mask* TDocumento_mask::riga_mask(int numriga)
|
||||
m->set_handler(DLG_USER, link_handler);
|
||||
}
|
||||
|
||||
const bool ca_active = dongle().active(CMAUT) || dongle().active(CAAUT);
|
||||
if (ca_active && m->win(2) != NULL_WIN)
|
||||
bool ca_active = dongle().active(CMAUT) || dongle().active(CAAUT); // Qualsiasi cosa analitica va bene
|
||||
ca_active &= !(riga.is_descrizione() || riga.is_omaggio() || riga.is_sconto()); // Ignora 'ste righe
|
||||
if (ca_active)
|
||||
{
|
||||
const int page = m->win2page(m->fld(m->fields()-1).parent()); // Calcolo bastardo dell'ultima pagina
|
||||
|
||||
TConfig_anal ini;
|
||||
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
||||
const bool use_fsc = fasinfo.levels() > 0;
|
||||
@ -1066,20 +1069,20 @@ TVariable_mask* TDocumento_mask::riga_mask(int numriga)
|
||||
if (level == "CDC") // Crea centro di costo
|
||||
{
|
||||
if (use_fsc && fasinfo.parent() == LF_CDC)
|
||||
insert_anal_fields(*m, 2, LF_FASI, y, dlg, dlgd, false);
|
||||
insert_anal_fields(*m, page, LF_FASI, y, dlg, dlgd, false);
|
||||
else
|
||||
insert_anal_fields(*m, 2, LF_CDC, y, dlg, dlgd, false);
|
||||
insert_anal_fields(*m, page, LF_CDC, y, dlg, dlgd, false);
|
||||
} else
|
||||
if (level == "CMS") // Crea commessa
|
||||
{
|
||||
if (use_fsc && fasinfo.parent() == LF_COMMESSE)
|
||||
insert_anal_fields(*m, 2, LF_FASI, y, dlg, dlgd, false);
|
||||
insert_anal_fields(*m, page, LF_FASI, y, dlg, dlgd, false);
|
||||
else
|
||||
insert_anal_fields(*m, 2, LF_COMMESSE, y, dlg, dlgd, false);
|
||||
insert_anal_fields(*m, page, LF_COMMESSE, y, dlg, dlgd, false);
|
||||
}
|
||||
}
|
||||
if (use_fsc && fasinfo.parent() <= 0)
|
||||
insert_anal_fields(*m, 2, LF_FASI, y, dlg, dlgd, false);
|
||||
insert_anal_fields(*m, page, LF_FASI, y, dlg, dlgd, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user