Modifiche dalla versione Linux sulla 2.1
git-svn-id: svn://10.65.10.50/trunk@12019 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d355c40138
commit
524ee0a1d6
@ -782,7 +782,8 @@ int TPrimanota_application::read(TMask& m)
|
||||
_saldi.set_data_ulmov((TDate)m.get(F_DATAREG));
|
||||
_saldi.set_movimentato(TRUE);
|
||||
|
||||
for (int i = 0; i < _rel->cg_items(); i++)
|
||||
int i;
|
||||
for (i = 0; i < _rel->cg_items(); i++)
|
||||
{
|
||||
const TRectype& r = _rel->cg(i);
|
||||
TToken_string& riga = cgs().row(i); // Vuota la riga
|
||||
@ -971,7 +972,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
||||
int mese_liq = 0;
|
||||
if (m.get_bool(F_DIFFERITA))
|
||||
{
|
||||
TDate data_liq = m.get(F_DATAREG);
|
||||
TDate data_liq(m.get(F_DATAREG));
|
||||
const int curr_liq = _rel->date2liq(data_liq);
|
||||
data_liq.set_day(1); // Evita problemi coi mesi corti!
|
||||
for (mese_liq = curr_liq-1; mese_liq > 0; mese_liq--)
|
||||
@ -1016,7 +1017,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
||||
const bool to_swap = test_swap(FALSE);
|
||||
if (to_swap)
|
||||
{
|
||||
real totale = rec.get("TOTDOC");
|
||||
real totale = rec.get_real("TOTDOC");
|
||||
totale = -totale;
|
||||
rec.put("TOTDOC", totale);
|
||||
}
|
||||
@ -1305,7 +1306,9 @@ long TPrimanota_application::calcola_m770(int tipo_coll, real& spese, real& comp
|
||||
{
|
||||
TString_array& riva = ivas().rows_array();
|
||||
TCodiceIVA codiva;
|
||||
for (int i = 0; i < riva.items(); i++)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < riva.items(); i++)
|
||||
{
|
||||
TToken_string& row = riva.row(i);
|
||||
codiva.read(row.get(1));
|
||||
@ -1729,7 +1732,9 @@ bool TPrimanota_application::link_cesp(const TMask& msk, const char* action)
|
||||
return FALSE;
|
||||
|
||||
// Cerca una riga con tipo costo/ricavo 2,3,4,8
|
||||
for (int i = _rel->cg_items()-1; i >= 0; i--)
|
||||
int i;
|
||||
|
||||
for (i = _rel->cg_items()-1; i >= 0; i--)
|
||||
{
|
||||
const TRectype& rec = _rel->cg(i);
|
||||
const TBill zio(rec);
|
||||
@ -1820,7 +1825,7 @@ bool TPrimanota_application::link_intra(const TMask& m, const char* action)
|
||||
// Inserisci il totale documento solo in inserimento!
|
||||
if (action == "Insert")
|
||||
{
|
||||
real totdoc = m.get(valintra ? F_CORRISPETTIVO : F_IMPONIBILI);
|
||||
real totdoc = m.get_real(valintra ? F_CORRISPETTIVO : F_IMPONIBILI);
|
||||
if (test_swap(FALSE))
|
||||
totdoc = -totdoc;
|
||||
intro.set("TOTDOC", totdoc.string());
|
||||
@ -1875,4 +1880,4 @@ int cg2100 (int argc, char** argv)
|
||||
a->run(argc, argv, TR("Prima nota"));
|
||||
delete a;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -385,7 +385,9 @@ void TMovimentoPN::adjust_rowtypes()
|
||||
const TCausale causale(mov.get(MOV_CODCAUS), annoiva);
|
||||
|
||||
TConti_array conti;
|
||||
for (int r = 0; r < _iva.rows(); r++)
|
||||
int r;
|
||||
|
||||
for (r = 0; r < _iva.rows(); r++)
|
||||
{
|
||||
const TRectype& row = iva(r);
|
||||
const TBill bill(row);
|
||||
|
@ -901,8 +901,10 @@ void TPrimanota_application::generazione_righe_cg(int r)
|
||||
|
||||
if (causale_ok)
|
||||
{
|
||||
int first_not_empty = 0;
|
||||
for (int i = 0; i < r; i++)
|
||||
int first_not_empty = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < r; i++)
|
||||
{
|
||||
TToken_string& row = cg.row(i);
|
||||
if (!can_remove(row))
|
||||
@ -1157,7 +1159,7 @@ bool TPrimanota_application::cg_notify(TSheet_field& cg, int r, KEY k)
|
||||
TBill conto; a.causale().bill(k, conto);
|
||||
const TString desc(a.causale().desc_agg(k));
|
||||
const char sez = a.causale().sezione(k);
|
||||
const real imp = cg.mask().get(K_RESIDUO);
|
||||
const real imp = cg.mask().get_real(K_RESIDUO);
|
||||
TImporto importo(sez, imp); importo.normalize();
|
||||
|
||||
if (tipo == 'G')
|
||||
@ -2692,7 +2694,7 @@ bool TPrimanota_application::main_codiva_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
TToken_string& row = a.ivas().row(0);
|
||||
|
||||
TMask& m = f.mask();
|
||||
// TMask& m = f.mask();
|
||||
iva_notify(a.ivas(), 0, K_SPACE);
|
||||
|
||||
const TCodiceIVA iva(f.get());
|
||||
@ -2742,9 +2744,9 @@ void TPrimanota_application::gioca_cambi(int force)
|
||||
if (m.get(SK_VALUTA).empty())
|
||||
return;
|
||||
|
||||
const real totale = m.get(F_TOTALE);
|
||||
const real totval = m.get(SK_TOTDOCVAL);
|
||||
const real cambio = m.get(SK_CAMBIO);
|
||||
const real totale = m.get_real(F_TOTALE);
|
||||
const real totval = m.get_real(SK_TOTDOCVAL);
|
||||
const real cambio = m.get_real(SK_CAMBIO);
|
||||
|
||||
if ( (force == 0x1 || totale.is_zero()) && !(totval.is_zero() || cambio.is_zero()) )
|
||||
{
|
||||
@ -3177,4 +3179,4 @@ bool TPrimanota_application::solaiva_handler(TMask_field& f, KEY key)
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
13
cg/cg2102.h
13
cg/cg2102.h
@ -50,9 +50,6 @@ class TPrimanota_application : public TRelation_application
|
||||
|
||||
TPagamento* _pag;
|
||||
|
||||
TCausale* _causale; // Causale corrente
|
||||
TLibro_giornale* _giornale; // Libro giornale corrente
|
||||
TipoIVA _iva; // Tipo di IVA corrente
|
||||
bool _ges_val, _ges_sal; // Gestione valuta e saldaconto
|
||||
bool _num_cli, _num_for; // Riferimento partita allineato a destra
|
||||
bool _npart_is_prot; // Riferimento partita = n. prot. IVA anziche' doc
|
||||
@ -68,19 +65,23 @@ class TPrimanota_application : public TRelation_application
|
||||
bool _is_saldaconto; // saldaconto si/no (vede parametri e causale)
|
||||
bool _scad_free; // posso variare liberamente le rate della fattura
|
||||
|
||||
TDati_incasso* _incasso; // Dati per gestire incasso immediato
|
||||
|
||||
TSaldo_agg _saldi; // Saldi da aggiornare
|
||||
TPartite_array _partite; // Partite coinvolte
|
||||
|
||||
TMask* _msk[4]; // Maschere di query, cg, iva, occasionali
|
||||
long _lastreg; // Numero ultima registrazione
|
||||
int _mode; // Modo maschera corrente
|
||||
bool _as400; // Movimento trasferito da as400?
|
||||
|
||||
TipoIVA _iva; // Tipo di IVA corrente
|
||||
TCausale* _causale; // Causale corrente
|
||||
TLibro_giornale* _giornale; // Libro giornale corrente
|
||||
long _lastreg; // Numero ultima registrazione
|
||||
|
||||
TDate _last_dreg; // Ultima data registrazione inserita
|
||||
TDate _last_dcom; // Ultima data competenza inserita
|
||||
|
||||
TDati_incasso* _incasso; // Dati per gestire incasso immediato
|
||||
|
||||
TBill _conto_ricavo; // Conto di ricavo del clifo
|
||||
|
||||
TToken_string _tmp; // Stringa temporanea da ritornare
|
||||
|
@ -32,14 +32,14 @@ bool TPrimanota_application::pag_notify(TSheet_field& ps, int r, KEY k)
|
||||
|
||||
const int rdiff = msk->get_int(FS_RDIFFER);
|
||||
const bool in_valuta = pag.in_valuta();
|
||||
const int impos = in_valuta ? 2 : 1;
|
||||
// const int impos = in_valuta ? 2 : 1;
|
||||
|
||||
// ts contiene la vecchia riga, ns la nuova
|
||||
TToken_string ts(128), ns(128);
|
||||
TString16 banca;
|
||||
|
||||
bool doit = TRUE, m_impl = FALSE, m_impv = FALSE, m_perc = FALSE, m_pag = FALSE;
|
||||
bool m_scad = FALSE, m_tipo = FALSE, m_ulc = FALSE, mod = FALSE, m_implit = FALSE;
|
||||
bool doit = TRUE, m_impl = FALSE, m_impv = FALSE, m_perc = FALSE;
|
||||
bool m_scad = FALSE, m_tipo = FALSE, m_ulc = FALSE, mod = FALSE;
|
||||
word ahiahi = P_OK;
|
||||
|
||||
TString news(10), newl(15), newv(15), newp(15), newt(1), newu(1);
|
||||
@ -243,7 +243,7 @@ bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key)
|
||||
|
||||
if (key == K_ENTER)
|
||||
{
|
||||
real tot = m.get(in_valuta ? SK_TOTDOCVAL : F_TOTALE);
|
||||
real tot = m.get_real(in_valuta ? SK_TOTDOCVAL : F_TOTALE);
|
||||
for (int r = pag.n_rate()-1; r >= 0; r--)
|
||||
imp += in_valuta ? pag.tval_rata(r) : pag.tlit_rata(r);
|
||||
|
||||
@ -265,7 +265,7 @@ bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key)
|
||||
|
||||
if (key == K_ENTER && in_valuta)
|
||||
{
|
||||
const real totlit = m.get(F_TOTALE);
|
||||
const real totlit = m.get_real(F_TOTALE);
|
||||
imp = ZERO;
|
||||
for (int r = pag.n_rate()-1; r >= 0; r--)
|
||||
imp += pag.tlit_rata(r);
|
||||
@ -393,7 +393,7 @@ bool TPrimanota_application::numrif_handler(TMask_field& f, KEY key)
|
||||
clifo.on_hit();
|
||||
}
|
||||
|
||||
TMask_field& anno = m.field(F_ANNORIF);
|
||||
// TMask_field& anno = m.field(F_ANNORIF);
|
||||
if (m.get(F_ANNORIF).empty())
|
||||
m.set(F_ANNORIF, m.get(F_DATADOC).right(4));
|
||||
|
||||
@ -819,7 +819,7 @@ bool TPrimanota_application::read_scadenze(TMask& m)
|
||||
|
||||
const bool in_valuta = m.get(SK_VALUTA).not_empty();
|
||||
|
||||
const real totale = m.get(in_valuta ? SK_TOTDOCVAL : F_TOTALE);
|
||||
const real totale = m.get_real(in_valuta ? SK_TOTDOCVAL : F_TOTALE);
|
||||
if (totale != partita.importo(in_valuta).valore())
|
||||
{
|
||||
const TCurrency totdoc_c(totale, m.get(SK_VALUTA));
|
||||
@ -852,8 +852,8 @@ bool TPrimanota_application::read_scadenze(TMask& m)
|
||||
for (int i = 1; i <= partita.rate(); i++) // E' necessario andare in avanti!!!
|
||||
{
|
||||
const TRiga_scadenze& scadenza = partita.rata(i);
|
||||
real importo = scadenza.get(SCAD_IMPORTO);
|
||||
const TDate scad = scadenza.get(SCAD_DATASCAD);
|
||||
real importo = scadenza.get_real(SCAD_IMPORTO);
|
||||
const TDate scad = scadenza.get_date(SCAD_DATASCAD);
|
||||
const int tipop = scadenza.get_int(SCAD_TIPOPAG);
|
||||
const bool prot = i <= protette; // Non cancellabile
|
||||
const TString16 ulc = scadenza.get(SCAD_ULTCLASS);
|
||||
@ -987,8 +987,10 @@ void TPrimanota_application::write_scadenze(const TMask& m)
|
||||
if (in_valuta)
|
||||
partita.put(PART_IMPTOTVAL, m.get(SK_TOTDOCVAL));
|
||||
|
||||
real imponibile, imponibile_val;
|
||||
for (int i = pag.n_rate()-1; i >= 0; i--)
|
||||
real imponibile, imponibile_val;
|
||||
int i;
|
||||
|
||||
for (i = pag.n_rate()-1; i >= 0; i--)
|
||||
{
|
||||
if (in_valuta)
|
||||
imponibile_val += pag.tval_rata(i);
|
||||
@ -1213,7 +1215,7 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
||||
if (old_ritenute != new_ritenute)
|
||||
{
|
||||
const TImporto grow_ritenute(controsez, new_ritenute-old_ritenute);
|
||||
const riga = type2pos('F');
|
||||
const int riga = type2pos('F');
|
||||
if (riga < 0)
|
||||
{
|
||||
TBill conto_rit; causale().bill(RIGA_RITENUTE, conto_rit);
|
||||
@ -1255,7 +1257,7 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
||||
}
|
||||
if (new_ap != ' ') // Se ci sono abbuoni
|
||||
{
|
||||
const riga_abb = type2pos(new_ap);
|
||||
const int riga_abb = type2pos(new_ap);
|
||||
|
||||
new_abbuono.swap_section();
|
||||
new_abbuono.normalize();
|
||||
@ -1315,9 +1317,10 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
||||
bool TPrimanota_application::notify_cgline_deletion(TPartita& partita, long nreg, int numrig)
|
||||
{
|
||||
bool found = FALSE;
|
||||
int p;
|
||||
|
||||
// Al primo "giro" elimino i pagamenti dalla rate
|
||||
for (int p = partita.last(); p > 0; p = partita.pred(p))
|
||||
for (p = partita.last(); p > 0; p = partita.pred(p))
|
||||
{
|
||||
TRiga_partite& part = partita.riga(p);
|
||||
if (part.is_fattura())
|
||||
@ -1399,4 +1402,4 @@ bool TPrimanota_application::notify_cgline_deletion(int numrig)
|
||||
found |= notify_cgline_deletion(*game, nreg, numrig);
|
||||
|
||||
return found;
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@
|
||||
#include <msksheet.h>
|
||||
#include <colors.h> // Colori righe
|
||||
|
||||
#include "cg2100p.h" // Campi maschere partite e pagamenti
|
||||
#include "../cg/cg2100p.h" // Campi maschere partite e pagamenti
|
||||
|
||||
#ifdef __EXTRA__
|
||||
#include "cgsaldac.h"
|
||||
#include "../cg/cgsaldac.h"
|
||||
#include "sc0100p.h"
|
||||
#else
|
||||
#include "cg2100.h" // Campi maschere prima nota
|
||||
@ -380,8 +380,8 @@ void TPay_mask::get_pag(TRectype& newpag, TRectype& sum) const
|
||||
// Riempie i campi valuta a zero in base agli altri
|
||||
void TPay_mask::gioca_cambi(int force)
|
||||
{
|
||||
const real totale = get(S_IMPORTO);
|
||||
const real totval = get(S_IMPORTOVAL);
|
||||
const real totale = get_real(S_IMPORTO);
|
||||
const real totval = get_real(S_IMPORTOVAL);
|
||||
|
||||
#ifdef __EXTRA__
|
||||
const TValuta cambio(*this, E_VALUTA, E_DATACAMBIO, E_CAMBIO, E_CONTROEURO);
|
||||
@ -1629,7 +1629,7 @@ int TGame_mask::update_partita(const TRectype& riga, int prow)
|
||||
TImporto saldo, doc, pag, imp;
|
||||
|
||||
TRectype rec = riga;
|
||||
const int err = TPartita::read_saldo(rec, saldo, doc, pag, imp);
|
||||
TPartita::read_saldo(rec, saldo, doc, pag, imp);
|
||||
return update_partita(rec, saldo, doc, pag, imp, prow);
|
||||
}
|
||||
|
||||
@ -1638,7 +1638,9 @@ void TGame_mask::update_saldo_clifo()
|
||||
TString_array& s = partite().rows_array();
|
||||
|
||||
TImporto sal, doc, pag, imp;
|
||||
for (int i = 0; i < s.items(); i++)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < s.items(); i++)
|
||||
{
|
||||
TToken_string& r = s.row(i);
|
||||
if (r.get_int(0) > 0)
|
||||
|
@ -19,9 +19,9 @@ class TProvvisori_msk : public TAutomask
|
||||
TString16 _from_caus, _to_caus; // Causali movimenti da considerare
|
||||
long _from_numreg, _to_numreg; // Range movimenti da considerare
|
||||
|
||||
TCursor_sheet* _sheet;
|
||||
TRelation* _rel;
|
||||
TCursor* _cur;
|
||||
TCursor_sheet* _sheet;
|
||||
|
||||
bool _update_cursor;
|
||||
|
||||
@ -371,7 +371,8 @@ bool TProvvisori_app::delete_provv(TCursor& cur, TProgind& pi, TCursor_sheet* sh
|
||||
|
||||
inizia_saldi(mov.curr());
|
||||
|
||||
for (int rig = 1; err == NOERR; rig++)
|
||||
int rig;
|
||||
for (rig = 1; err == NOERR; rig++)
|
||||
{
|
||||
rmov.put(RMV_NUMREG, numreg);
|
||||
rmov.put(RMV_NUMRIG, rig);
|
||||
|
Loading…
x
Reference in New Issue
Block a user