Patch level : 12.0 860
Files correlati : lv0.exe lv0300a.msk Commento : Aggiunto dettaglio consegne alla fatturazione Nella configurazione prima pagina c'è il flag dettaglio consegne
This commit is contained in:
parent
316a511fe7
commit
c30f6d57a9
@ -101,6 +101,8 @@
|
|||||||
|
|
||||||
#define F_DOTSTO 278
|
#define F_DOTSTO 278
|
||||||
|
|
||||||
|
#define F_DETTCONS 279
|
||||||
|
|
||||||
#define F_BACKUP 300
|
#define F_BACKUP 300
|
||||||
|
|
||||||
#define S_CODNUM_RIT 101
|
#define S_CODNUM_RIT 101
|
||||||
|
@ -166,7 +166,7 @@ BEGIN
|
|||||||
FLAGS "UP"
|
FLAGS "UP"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DESTIPODOC_FAT 50
|
STRING F_DESTIPODOC_FAT 50 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 24 5 ""
|
PROMPT 24 5 ""
|
||||||
HELP "Descrizione tipo documento"
|
HELP "Descrizione tipo documento"
|
||||||
@ -177,6 +177,14 @@ BEGIN
|
|||||||
COPY OUTPUT F_TIPODOC_FAT
|
COPY OUTPUT F_TIPODOC_FAT
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_DETTCONS
|
||||||
|
BEGIN
|
||||||
|
PROMPT 60 5 "Dettaglio consegne"
|
||||||
|
FIELD DettCons
|
||||||
|
MESSAGE TRUE CLEAR,F_RIFTEST
|
||||||
|
MESSAGE FALSE ENABLE,F_RIFTEST
|
||||||
|
END
|
||||||
|
|
||||||
BOOLEAN F_RIFTEST
|
BOOLEAN F_RIFTEST
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 6 "Scrivi riferimenti in testata documento"
|
PROMPT 2 6 "Scrivi riferimenti in testata documento"
|
||||||
|
@ -124,8 +124,8 @@ protected:
|
|||||||
virtual bool doc_raggruppabili(const TDocumento& doc_in, const TDocumento& doc_out, TToken_string& campi) const ;
|
virtual bool doc_raggruppabili(const TDocumento& doc_in, const TDocumento& doc_out, TToken_string& campi) const ;
|
||||||
virtual bool doc_raggruppabile(const TDocumento & doc) const { return true; }
|
virtual bool doc_raggruppabile(const TDocumento & doc) const { return true; }
|
||||||
virtual void campi_raggruppamento_righe(TToken_string& campi_riga) const;
|
virtual void campi_raggruppamento_righe(TToken_string& campi_riga) const;
|
||||||
virtual bool gestione_riferimenti() const { return true; }
|
// virtual bool gestione_riferimenti() const { return true; }
|
||||||
virtual bool riferimenti_in_testa() const { return true; }
|
// virtual bool riferimenti_in_testa() const { return true; }
|
||||||
virtual TRiga_documento& find_or_create_row(TDocumento& doc_out, const TRiga_documento & rin,const char lavtype);
|
virtual TRiga_documento& find_or_create_row(TDocumento& doc_out, const TRiga_documento & rin,const char lavtype);
|
||||||
virtual bool get_num_tip_out(const TDocumento& doc_out, TString& codnum, TString& tipodoc) const;
|
virtual bool get_num_tip_out(const TDocumento& doc_out, TString& codnum, TString& tipodoc) const;
|
||||||
|
|
||||||
@ -511,24 +511,26 @@ int TFatturazione_lavanderie::write_fatt_ragg(const bool solotot)
|
|||||||
void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_documenti& doc_in)
|
void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_documenti& doc_in)
|
||||||
{
|
{
|
||||||
const bool use_indsp = ini_get_bool(CONFIG_DITTA, "mg", "MOV_INDSPED");
|
const bool use_indsp = ini_get_bool(CONFIG_DITTA, "mg", "MOV_INDSPED");
|
||||||
const bool riftest = ini_get_bool(CONFIG_DITTA, "lv", "RifTest");
|
|
||||||
const bool zero_note = ini_get_bool(CONFIG_DITTA, "lv", "ZeroNote");
|
const bool zero_note = ini_get_bool(CONFIG_DITTA, "lv", "ZeroNote");
|
||||||
|
const bool dett_cons = ini_get_bool(CONFIG_DITTA, "lv", "DettCons");
|
||||||
|
const bool riftest = !dett_cons && ini_get_bool(CONFIG_DITTA, "lv", "RifTest");
|
||||||
|
|
||||||
//scorro tutti i documenti di output generati precedentemente
|
//scorro tutti i documenti di output generati precedentemente
|
||||||
for (int id = 0; id < doc_out.items(); id++)
|
for (int id = 0; id < doc_out.items(); id++)
|
||||||
{
|
{
|
||||||
//instanzio il documento e recupero le variabili di interesse per recuperare
|
//instanzio il documento e recupero le variabili di interesse per recuperare
|
||||||
//il contratto del cliente in questione
|
//il contratto del cliente in questione
|
||||||
TDocumento& doc = doc_out[id];
|
TDocumento& doc = doc_out[id];
|
||||||
const long clifo = doc.get_long(DOC_CODCF);
|
TRecord_array original_rows = doc.body();
|
||||||
|
const long clifo = doc.get_long(DOC_CODCF);
|
||||||
|
|
||||||
const int indsped = doc.get_int(DOC_CODINDSP);
|
const int indsped = doc.get_int(DOC_CODINDSP);
|
||||||
TLaundry_contract contr(clifo,indsped,_data_elab);
|
TLaundry_contract contr(clifo,indsped,_data_elab);
|
||||||
//flag per il calcolo sul valore convenzionale e sul fisso per dotazione iniziale
|
//flag per il calcolo sul valore convenzionale e sul fisso per dotazione iniziale
|
||||||
bool valconvcli = false;
|
bool valconvcli = false;
|
||||||
bool fixdotin = false;
|
// bool fixdotin = false;
|
||||||
bool elcons = contr.get_bool(LVCONDV_ELCONS);
|
bool elcons = contr.get_bool(LVCONDV_ELCONS);
|
||||||
bool rifbol = contr.get_bool(LVCONDV_RIFBOL);
|
bool rifbol = !dett_cons && contr.get_bool(LVCONDV_RIFBOL);
|
||||||
|
|
||||||
const bool splitpay = doc.anno() > 2015 && doc.clifor().get_bool(CLI_SPLITPAY);
|
const bool splitpay = doc.anno() > 2015 && doc.clifor().get_bool(CLI_SPLITPAY);
|
||||||
real consvconv;
|
real consvconv;
|
||||||
@ -556,6 +558,8 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do
|
|||||||
|
|
||||||
if (doc.physical_rows() > 0 && doc[1].is_descrizione())
|
if (doc.physical_rows() > 0 && doc[1].is_descrizione())
|
||||||
{
|
{
|
||||||
|
const TString desc = doc[1].get(RDOC_DESCR);
|
||||||
|
|
||||||
if (elcons)
|
if (elcons)
|
||||||
{
|
{
|
||||||
TRiga_documento& rout = doc[1];
|
TRiga_documento& rout = doc[1];
|
||||||
@ -564,7 +568,7 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do
|
|||||||
rout.put(RDOC_DESCEST, "");
|
rout.put(RDOC_DESCEST, "");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (!rifbol)
|
if (!rifbol || dett_cons)
|
||||||
doc.destroy_row(1, true);
|
doc.destroy_row(1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -739,7 +743,9 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do
|
|||||||
else // se il tipo canone è impostato a nessuno o % sul valore convenzionale per cliente vado in ambedue i casi ad eseguire il ciclo che analizza i tipi forfait
|
else // se il tipo canone è impostato a nessuno o % sul valore convenzionale per cliente vado in ambedue i casi ad eseguire il ciclo che analizza i tipi forfait
|
||||||
{
|
{
|
||||||
//per ogni documento, scorro tutte le sue righe
|
//per ogni documento, scorro tutte le sue righe
|
||||||
for (int i = 1; i <= doc.physical_rows() ; i++)
|
const int rigamerce = doc.physical_rows() > 0 && doc[1].is_descrizione() ? 2 : 1;
|
||||||
|
|
||||||
|
for (int i = rigamerce; i <= doc.physical_rows() ; i++)
|
||||||
{
|
{
|
||||||
TRiga_documento& rout = doc[i];
|
TRiga_documento& rout = doc[i];
|
||||||
|
|
||||||
@ -1340,12 +1346,25 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(int h = doc.physical_rows(); h > 0; h--)
|
const int rigamerce = doc.physical_rows() > 0 && doc[1].is_descrizione() ? 2 : 1;
|
||||||
|
|
||||||
|
for(int h = doc.physical_rows(); h >= rigamerce; h--)
|
||||||
{
|
{
|
||||||
TRiga_documento& rdoc = doc[h];
|
TRiga_documento& rdoc = doc[h];
|
||||||
if (rdoc.get(RDOC_DESCR).empty() || ((rdoc.imponibile().is_zero() && rdoc.get_real(RDOC_QTA).is_zero())))
|
if (rdoc.get(RDOC_DESCR).empty() || ((rdoc.imponibile().is_zero() && rdoc.get_real(RDOC_QTA).is_zero())))
|
||||||
doc.destroy_row(h, true);
|
doc.destroy_row(h, true);
|
||||||
}
|
}
|
||||||
|
if (dett_cons)
|
||||||
|
{
|
||||||
|
for (int i = 1; i <= original_rows.rows(); i++)
|
||||||
|
{
|
||||||
|
TRiga_documento & r =doc.new_row(original_rows[i].get(RDOC_TIPORIGA));
|
||||||
|
|
||||||
|
doc.copy_data(r, original_rows[i]);
|
||||||
|
r.zero(RDOC_PREZZO);
|
||||||
|
r.zero(RDOC_CODIVA);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int id = doc_out.items() - 1; id >= 0 ; id--)
|
for (int id = doc_out.items() - 1; id >= 0 ; id--)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user