Migliorata gestion epartite chiuse in alberi saldaconto
Corretta stampa acuisti per cassa in liquidazione git-svn-id: svn://10.65.10.50/branches/R_10_00@22838 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7ad2a3d6d6
commit
43042b134a
@ -136,8 +136,7 @@ bool TElimina_zoppi::test_row_file(int lf_rmov, TString_array& arr)
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (lf_rmov == LF_PARTITE)
|
||||
reg = row.get_long(PART_NREG);
|
||||
else
|
||||
|
@ -2495,7 +2495,6 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TToken_string tt(d._s0);
|
||||
real iva_vend(tt.get(0));
|
||||
real iva_acq(tt.get(1));
|
||||
@ -2517,31 +2516,33 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw)
|
||||
real& crediti_speciali = d._r19;
|
||||
|
||||
if (rettifiche.sign() > 0) rett_debt = rettifiche;
|
||||
if (rettifiche.sign() < 0) rett_cred = -rettifiche;
|
||||
if (rettifiche.sign() < 0) rett_cred =-rettifiche;
|
||||
|
||||
set_row(rw++,FR(" @66gCredito@84gDebito")); set_row(rw++,"");
|
||||
|
||||
// Se sono in visualizzazione stampo i due importi separati, altrimenti li sommo
|
||||
if (!_is_visliq)
|
||||
iva_vend += rett_debt;
|
||||
set_row(rw++,FR("@11gIVA esigibile per il periodo@75g%r"), &iva_vend);
|
||||
set_row(rw++, FR("@11g@bIVA esigibile@r per il periodo@75g%r"), &iva_vend);
|
||||
if (!diffinc_iva.is_zero())
|
||||
set_row(rw++,FR("@11gIVA a liquidazione differita incassata@75g%r"), &diffinc_iva);
|
||||
set_row(rw++,FR("@11g a liquidazione differita@75g%r"), &diffinc_iva);
|
||||
if (!xcasinc_iva.is_zero())
|
||||
set_row(rw++,FR("@11gIVA per cassa incassata@75g%r"), &xcasinc_iva);
|
||||
set_row(rw++,FR("@11g per cassa@75g%r"), &xcasinc_iva);
|
||||
if (_is_visliq)
|
||||
set_row(rw++,FR("@11g$[r]Rettifiche IVA a debito$[n]@75g%r"), &rett_debt); // Rettifiche modificabili
|
||||
|
||||
// Se sono in visualizzazione stampo i due importi separati, altrimenti li sommo
|
||||
if (!_is_visliq)
|
||||
iva_acq += rett_cred;
|
||||
set_row(rw++,FR("@11gIva che si detrae per il periodo@58g%r"), &iva_acq);
|
||||
set_row(rw++, FR("@11g@bIVA detraibile@r per il periodo@58g%r"), &iva_acq);
|
||||
if (!diffinc_iva_acq.is_zero())
|
||||
set_row(rw++,FR("@11gIVA a liquidazione differita pagata@58g%r"), &diffinc_iva_acq);
|
||||
set_row(rw++,FR("@11g a liquidazione differita@58g%r"), &diffinc_iva_acq);
|
||||
if (!xcasinc_iva_acq.is_zero())
|
||||
set_row(rw++,FR("@11g per cassa@58g%r"), &xcasinc_iva_acq);
|
||||
if (_is_visliq)
|
||||
set_row(rw++,FR("@11g$[r]Rettifiche IVA a credito$[n]@58g%r"), &rett_cred);
|
||||
|
||||
real iva_deb_cred = iva_vend - iva_acq + diffinc_iva - diffinc_iva_acq;
|
||||
real iva_deb_cred = iva_vend - iva_acq + diffinc_iva - diffinc_iva_acq + xcasinc_iva - xcasinc_iva_acq;
|
||||
if (_is_visliq)
|
||||
iva_deb_cred += rett_debt - rett_cred;
|
||||
|
||||
@ -2551,7 +2552,6 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw)
|
||||
print_importo(rw++, TR("Variazioni d'imposta"), variazioni_imposta, _is_visliq);
|
||||
print_importo(rw++, TR("Imposta non versata"), imposta_non_versata, _is_visliq);
|
||||
|
||||
// debito liq. precedente < 50000
|
||||
if (debt_prec > ZERO)
|
||||
set_row(rw++,FR("@11gDebito o credito da liquidazione precedente@75g%r"), &debt_prec);
|
||||
else
|
||||
@ -2852,7 +2852,7 @@ bool TLiquidazione_app::set_annual(_DescrItem& d)
|
||||
set_row(row++,FR("C1A - Operazioni esenti di cui all'art.10 n. 27 quinquies @69g%r"), &(d._r7));
|
||||
set_row(row++,FR("@6gdi cui cessione beni ammortizzabili @69g%r"), &(d._r9));
|
||||
set_row(row++,FR("Volume d'affari @69g%r"), &(d._r0));
|
||||
set_row(row++,FR("Detraibilita' @69g%r%%"), &perc_det);
|
||||
set_row(row++,FR("Detraibilità@69g%r%%"), &perc_det);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2862,7 +2862,7 @@ bool TLiquidazione_app::set_annual(_DescrItem& d)
|
||||
set_row(row++,FR("B2 - Operazioni esenti, di cui nr. 11 art. 10 @69g%r"), &(d._r4));
|
||||
set_row(row++,FR("B3 - Operazioni esenti da nr. 1 a 9 art. 10 @69g%r"), &(d._r5));
|
||||
set_row(row++,FR("Volume d'affari - B3 @69g%r"), &(d._r0));
|
||||
set_row(row++,FR("Indetraibilita'@69g%r%%"), &(d._r2));
|
||||
set_row(row++,FR("Indetraibilità@69g%r%%"), &(d._r2));
|
||||
}
|
||||
set_print_zero(FALSE);
|
||||
}
|
||||
|
@ -1190,7 +1190,8 @@ messaggio TStampa_registri_app::controlla_liquidazione()
|
||||
}
|
||||
if (mesi_cal.not_empty())
|
||||
{
|
||||
warning_box (FR("Ditta %s: la liquidazione da stampare sul registro %s relativa ai mesi di \n %s non e' stata ancora calcolata"), (const char*)ditta, (const char*) _codreg, (const char *)mesi_cal);
|
||||
warning_box (FR("Ditta %s: la liquidazione da stampare sul registro %s relativa ai mesi di \n %s non e' stata ancora calcolata"),
|
||||
(const char*)ditta, (const char*) _codreg, (const char *)mesi_cal);
|
||||
continua = yesno_box(TR("Si desidera ugualmente proseguire?"));
|
||||
if (!continua) return non_proseguire;
|
||||
continua = yesno_box(TR("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa liquidazione)"));
|
||||
@ -1906,6 +1907,9 @@ bool TStampa_registri_app::some_IVAxCassa(int da_mese, int a_mese) const
|
||||
if (_tipo_reg != vendita && _tipo_reg != acquisto)
|
||||
return false;
|
||||
|
||||
if (ini_get_bool(CONFIG_STUDIO, "cg", "NoIdRg"))
|
||||
return false;
|
||||
|
||||
TString query;
|
||||
query = "USE IVADIFF KEY 2 SELECT (TIPOMOV>2)";
|
||||
query << "\nFROM ANNOLIQ=" << _data_da.year() << " MESELIQ=" << da_mese;
|
||||
@ -1919,6 +1923,12 @@ bool TStampa_registri_app::print_IVAxCassa(int da_month, int a_month)
|
||||
if (_tipo_reg != vendita && _tipo_reg != acquisto)
|
||||
return false;
|
||||
|
||||
if (ini_get_bool(CONFIG_STUDIO, "cg", "NoIdRg"))
|
||||
{
|
||||
_riga_prospettoXcassa.destroy();
|
||||
return false;
|
||||
}
|
||||
|
||||
TPrinter& pr = printer();
|
||||
TPrintrow riga;
|
||||
const TString linea(_stampa_width, '-');
|
||||
|
@ -17,4 +17,5 @@
|
||||
#define CHK_21SAVENEW 117
|
||||
#define CHK_02SAVENEW 118
|
||||
#define FLD_DESAGV 119
|
||||
#define CHK_RICACQ 120
|
||||
#define CHK_RICACQ 120
|
||||
#define CHK_NOIDRG 121
|
||||
|
@ -4,11 +4,11 @@ TOOLBAR "topbar" 0 0 0 2
|
||||
#include <stdbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Parametri contabilita' studio" 0 0 0 2
|
||||
PAGE "Parametri contabilità" 0 0 0 2
|
||||
|
||||
GROUPBOX DLG_NULL 74 10
|
||||
BEGIN
|
||||
PROMPT 1 1 "Parametri IVA"
|
||||
PROMPT 1 1 "@bParametri IVA"
|
||||
END
|
||||
|
||||
NUMBER FLD_CODABI 5
|
||||
@ -98,9 +98,9 @@ BEGIN
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 74 4
|
||||
GROUPBOX DLG_NULL 74 5
|
||||
BEGIN
|
||||
PROMPT 1 13 "Stampa registri"
|
||||
PROMPT 1 13 "@bStampa registri"
|
||||
END
|
||||
|
||||
BOOLEAN CHK_STIREG
|
||||
@ -112,14 +112,22 @@ END
|
||||
|
||||
BOOLEAN CHK_NODTRG
|
||||
BEGIN
|
||||
PROMPT 3 15 "Non stampare la data di operazione sui registri IVA"
|
||||
HELP "Indicare se non stampoare la data dell'operazione sui registri IVA"
|
||||
PROMPT 3 15 "Non stampare la data di operazione"
|
||||
HELP "Indicare se non stampare la data dell'operazione sui registri IVA"
|
||||
FIELD NoDtRg
|
||||
END
|
||||
|
||||
BOOLEAN CHK_NOIDRG
|
||||
BEGIN
|
||||
PROMPT 3 16 "Non stampare il prospetto IVA differita o per cassa"
|
||||
HELP "Indicare se non stampare il prospetto dell'IVA differita o per cassa"
|
||||
FIELD NoIdRg
|
||||
END
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Parametri contabilita' studio" -1 -1 76 17
|
||||
PAGE "Parametri contabilità" -1 -1 76 17
|
||||
|
||||
GROUPBOX DLG_NULL 74 4
|
||||
BEGIN
|
||||
|
@ -1166,8 +1166,7 @@ void TTransfer_file::write_tmp_tabelle(TString& record, bool create)
|
||||
if (fname == "TIPOCF")
|
||||
{
|
||||
if (field == "1")
|
||||
field = "C";
|
||||
|
||||
field = "C";
|
||||
if (field == "2")
|
||||
field = "F";
|
||||
}
|
||||
@ -2816,38 +2815,28 @@ void TTransfer_file::pagsca(TString& record)
|
||||
}
|
||||
|
||||
if (fname == "TIPOC")
|
||||
field = tipoc;
|
||||
|
||||
field = tipoc; else
|
||||
if (fname == "GRUPPO" || fname == "CONTO")
|
||||
{
|
||||
int app = atoi(field);
|
||||
const int app = atoi(field);
|
||||
field.format("%3d", app);
|
||||
}
|
||||
} else
|
||||
if (fname == "SOTTOCONTO")
|
||||
{
|
||||
long sottoc = atol(field);
|
||||
const long sottoc = atol(field);
|
||||
field.format("%6ld", sottoc);
|
||||
}
|
||||
} else
|
||||
if (fname == "ANNO")
|
||||
{
|
||||
TString app = field;
|
||||
int anno = atoi(field);
|
||||
if (anno < 80)
|
||||
{
|
||||
field = "20";
|
||||
field << app;
|
||||
}
|
||||
if (atoi(field) < 80)
|
||||
field.insert("20");
|
||||
else
|
||||
{
|
||||
field = "19";
|
||||
field << app;
|
||||
}
|
||||
}
|
||||
field.insert("19");
|
||||
} else
|
||||
if (fname == "NRIGA")
|
||||
{
|
||||
TString app (format("%4d", _nrigaSCA));
|
||||
field = app;
|
||||
}
|
||||
field.format("%4d", _nrigaSCA);
|
||||
} else
|
||||
if (fname == "NRATA")
|
||||
{
|
||||
TString nrata (format("%4d", _nrataSCA));
|
||||
@ -2855,7 +2844,7 @@ void TTransfer_file::pagsca(TString& record)
|
||||
TString app (format("%4d", _nrigaSC));
|
||||
_deppagsca->put("NRIGP", app);
|
||||
}
|
||||
|
||||
|
||||
if (fname == "IMPORTO")
|
||||
{
|
||||
real appoggio (field);
|
||||
@ -2904,13 +2893,13 @@ void TTransfer_file::pagsca(TString& record)
|
||||
if (abbuoni != ZERO)
|
||||
{
|
||||
if (sez != sezione)
|
||||
abbuoni = abbuoni * -1;
|
||||
abbuoni -= abbuoni;
|
||||
_deppagsca->put(PAGSCA_ABBUONI, abbuoni);
|
||||
}
|
||||
if (diffcam != ZERO)
|
||||
{
|
||||
if (sez != sezione)
|
||||
diffcam = diffcam * -1;
|
||||
diffcam = -diffcam;
|
||||
_deppagsca->put(PAGSCA_DIFFCAM, diffcam);
|
||||
}
|
||||
if (_nrigaSCA == 9999 && _nrataSCA == 9999)
|
||||
|
@ -45,17 +45,17 @@ void TPartite_cache::set_bill(TPartite_array& games, const TBill& conto, long nu
|
||||
rec.put(PART_SOTTOCONTO, conto.sottoconto());
|
||||
}
|
||||
|
||||
flags = TSolder_tree_flags(flags & sct_all_games); // Ignora eventuale flag di valuta
|
||||
_flags = TSolder_tree_flags(flags & sct_all_games); // Ignora eventuale flag di valuta
|
||||
|
||||
TString filter;
|
||||
if (flags != sct_all_games && numreg > 0 && numreg < 999999)
|
||||
if (_flags != sct_all_games && numreg > 0 && numreg < 999999)
|
||||
filter << '(' << PART_NREG << "==\"" << numreg << "\")";
|
||||
|
||||
if (flags == sct_open_games || flags == sct_closed_games)
|
||||
if (_flags == sct_open_games || _flags == sct_closed_games)
|
||||
{
|
||||
if (filter.full())
|
||||
filter << "||";
|
||||
filter << "(" << PART_CHIUSA << ((flags & sct_open_games)!=0 ? "!=" : "==") << "\"X\")";
|
||||
filter << "(" << PART_CHIUSA << ((_flags & sct_open_games)!=0 ? "!=" : "==") << "\"X\")";
|
||||
}
|
||||
|
||||
TCursor cur(&partite, filter, 1, &rec, &rec);
|
||||
@ -95,10 +95,19 @@ int TPartite_cache::game_id(int anno, const char* numpart) const
|
||||
|
||||
bool TPartite_cache::add_game(int anno, const char* partita)
|
||||
{
|
||||
const TString& key = build_key(anno, partita);
|
||||
const bool can_add = TString_array::find(key) < 0;
|
||||
const TString16 key = build_key(anno, partita);
|
||||
bool can_add = TString_array::find(key) < 0;
|
||||
if (can_add)
|
||||
add(key);
|
||||
{
|
||||
if (_flags == sct_open_games || _flags == sct_closed_games)
|
||||
{
|
||||
const TPartita game(_bill, anno, partita);
|
||||
const bool chiusa = game.chiusa(true);
|
||||
can_add = (_flags == sct_closed_games) == chiusa;
|
||||
}
|
||||
if (can_add)
|
||||
add(key);
|
||||
}
|
||||
return can_add;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@ class TPartite_cache : public TString_array
|
||||
TBill _bill; // Cliente corrente
|
||||
long _numreg; // Numero di registrazione corrente
|
||||
TString4 _codval; // Valuta corrente
|
||||
TSolder_tree_flags _flags;
|
||||
|
||||
protected:
|
||||
const TString& build_key(int anno, const char* partita) const;
|
||||
|
@ -362,15 +362,11 @@ TImporto TPartita::importo_pagsca(const TRectype& pag, bool val, int mode) const
|
||||
return totale;
|
||||
}
|
||||
|
||||
/* Funzione chiamata esclusivamente da altra funzione commentata
|
||||
|
||||
// Calcola il totale dei pagamenti alla data (eventualmente in valuta)
|
||||
TImporto TRiga_scadenze::importo_pagato_al(bool val, const TDate& al, int mode) const
|
||||
{
|
||||
CHECKD(mode > 0x0 && mode <= 0xFF, "Bad importo_pagato mode ", mode);
|
||||
const TPartita& game = partita();
|
||||
const bool in_val = in_valuta();
|
||||
const char* imp_field = (val && in_val) ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO;
|
||||
|
||||
TImporto totale;
|
||||
for (int p = last(); p > 0; p = pred(p))
|
||||
@ -379,14 +375,12 @@ TImporto TRiga_scadenze::importo_pagato_al(bool val, const TDate& al, int mode)
|
||||
const TRiga_partite& sum = game.riga(p); // Riga partite
|
||||
const TDate datapag = sum.get_date(PART_DATAPAG);
|
||||
if (datapag <= al)
|
||||
totale += extract_importo(pag, sum, val, mode);
|
||||
totale += game.importo_pagsca(pag, val, mode);
|
||||
}
|
||||
|
||||
return totale.normalize();
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Calcola il totale dei pagamenti (eventualmente in valuta)
|
||||
TImporto TRiga_scadenze::importo_pagato(bool val, int mode) const
|
||||
{
|
||||
@ -1400,6 +1394,8 @@ bool TPartita::read(const TBill& clifo, int year, const char* num)
|
||||
unas->put(PART_NRIGA, (int)UNASSIGNED);
|
||||
unas->put(SCAD_NRATA, (int)UNASSIGNED);
|
||||
_unassigned.read(unas);
|
||||
if (_unassigned.rows() > 0 &&_part.rows() <= 0) // non assegnati orfani!
|
||||
_unassigned.destroy_rows();
|
||||
|
||||
return ok();
|
||||
}
|
||||
|
@ -136,7 +136,6 @@ protected:
|
||||
|
||||
protected: // TRecord_tree
|
||||
virtual TObject* dup() const;
|
||||
// TImporto importo_pagato_al(bool val, const TDate & al, int mode = 0xF) const;
|
||||
|
||||
public:
|
||||
bool chiusa(bool update = false) const;
|
||||
@ -148,6 +147,7 @@ public:
|
||||
TRiga_partite& riga() const { return *_riga; } // Riga partite
|
||||
|
||||
TImporto importo_pagato(bool val, int mode = 0xF) const;
|
||||
TImporto importo_pagato_al(bool val, const TDate& al, int mode = 0xF) const;
|
||||
TImporto importo(bool val) const;
|
||||
TImporto residuo(bool val, int mode = 0xF) const; // Differenza delle due funzioni precedenti
|
||||
TImporto esposto_al(bool valuta, const TDate & al, const TDate & data_scad, const TDate & data_rischio, bool & sbf) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user