ggiunti controlli alle righe di prima nota
git-svn-id: svn://10.65.10.50/trunk@326 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ff085e9cc4
commit
987c5ce882
@ -582,6 +582,7 @@ bool CG0500_application::conto_hndl (TMask_field& f, KEY k)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// 1. Se specifico il sottoconto devono essere non vuoti gruppo e conto
|
||||
// 2. g-c-s devono esistere
|
||||
bool CG0500_application::sottoconto_hndl (TMask_field& f, KEY k)
|
||||
@ -597,13 +598,16 @@ bool CG0500_application::sottoconto_hndl (TMask_field& f, KEY k)
|
||||
if (g == 0 || c == 0)
|
||||
return f.warning_box("Non accetto un sottoconto con gruppo o conto vuoti");
|
||||
|
||||
TConto tc(g,c,s);
|
||||
if (!tc.read(app()->conti().curr()))
|
||||
return f.warning_box("Conto inesistente");
|
||||
/* A che cavolo serve CHECKTYPE NORMAL ????????????????????????????????????????
|
||||
TConto tc(g,c,s);
|
||||
if (!tc.read(app()->conti().curr()))
|
||||
return f.warning_box("Conto inesistente");
|
||||
*/
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Handler del campo tipocf della maschera di edit dello sheet
|
||||
// Abilita 109 e 110 (rigaiva e codiva) SOLO SE registro 1 o 2
|
||||
bool CG0500_application::tipocf_hndl (TMask_field& f, KEY k)
|
||||
|
@ -84,7 +84,7 @@ BEGIN
|
||||
HELP "Inserire il codice registro"
|
||||
WARNING "Non trovo il registro"
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "DUZ"
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
// Questo rimane sempre nascosto
|
||||
|
@ -22,7 +22,7 @@ NUMBER 103 3
|
||||
BEGIN
|
||||
PROMPT 1 3 "Gruppo "
|
||||
FIELD LF_RCAUSALI->GRUPPO
|
||||
USE LF_PCON KEY 1 SELECT (CONTO="") && (SOTTOCONTO="")
|
||||
USE LF_PCON KEY 1 SELECT (CONTO="")
|
||||
INPUT GRUPPO 103
|
||||
DISPLAY "Gruppo" GRUPPO
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
@ -170,7 +170,6 @@ BEGIN
|
||||
OUTPUT 205 CODCF
|
||||
OUTPUT 207 RAGSOC
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
// Descrizione FORNITORE
|
||||
@ -189,7 +188,6 @@ BEGIN
|
||||
OUTPUT 305 CODCF
|
||||
OUTPUT 307 RAGSOC
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING 108 3
|
||||
|
32
cg/cg2.cpp
32
cg/cg2.cpp
@ -1,16 +1,16 @@
|
||||
#include <xvt.h>
|
||||
|
||||
#include "cg2.h"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
const int n = (argc > 1) ? (argv[1][1]-'0') : 0;
|
||||
switch(n)
|
||||
{
|
||||
case 1:
|
||||
cg2200(argc, argv); break;
|
||||
default:
|
||||
cg2100(argc,argv); break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#include <xvt.h>
|
||||
|
||||
#include "cg2.h"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
const int n = (argc > 1) ? (argv[1][1]-'0') : 0;
|
||||
switch(n)
|
||||
{
|
||||
case 1:
|
||||
cg2200(argc, argv); break;
|
||||
default:
|
||||
cg2100(argc,argv); break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -300,7 +300,12 @@ void TPrimanota_application::init_mask(TMask& m)
|
||||
|
||||
void TPrimanota_application::init_query_mode(TMask& m)
|
||||
{
|
||||
m.enable(DLG_NEWREC);
|
||||
<<<<<<< cg2100.cpp
|
||||
read_firm_params();
|
||||
enable_menu_item(M_FILE_PRINT);
|
||||
=======
|
||||
>>>>>>> 1.25
|
||||
m.enable(DLG_NEWREC);
|
||||
}
|
||||
|
||||
|
||||
@ -360,7 +365,6 @@ void TPrimanota_application::init_insert_mode(TMask& m)
|
||||
|
||||
if (m.get(F_CODCAUS).empty()) return;
|
||||
|
||||
TString80 desc;
|
||||
for (int i = 1; i < _causale.size(); i++)
|
||||
{
|
||||
const TRectype* rcaus = (TRectype*)_causale.objptr(i);
|
||||
@ -374,9 +378,9 @@ void TPrimanota_application::init_insert_mode(TMask& m)
|
||||
|
||||
char sezione = rcaus->get_char(RCA_SEZIONE);
|
||||
if (sezione != 'A') sezione = 'D';
|
||||
const TImporto zero(sezione, ZERO);
|
||||
|
||||
desc = rcaus->get(RCA_DESC);
|
||||
const TImporto zero(sezione, ZERO);
|
||||
const TString80 desc(_causale.desc_agg(i));
|
||||
|
||||
if (nriga == 1) m.set(F_DESCR, desc);
|
||||
|
||||
@ -603,9 +607,14 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
||||
r.put("DESCR", row.get()); // Descrizione riga
|
||||
|
||||
int rcontr = 0; // Riga contropartita
|
||||
const TBill contro(row, -1, 0x3); // Conto contropartita
|
||||
const TBill contro(row, -1, 0x3); // Conto contropartita
|
||||
|
||||
const char tipo = row.get_char();
|
||||
r.put("ROWTYPE", tipo); // Tipo riga
|
||||
|
||||
if (contro.ok())
|
||||
{
|
||||
if (tipo == 'F' || tipo == 'S') n.swap_section();
|
||||
rcontr = bill2contr(contro, n.sezione())+1;
|
||||
if (rcontr < 1)
|
||||
{
|
||||
@ -615,8 +624,6 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
||||
}
|
||||
r.put("RCONTR", rcontr); // Contropartita
|
||||
|
||||
const char tipo = row.get_char();
|
||||
r.put("ROWTYPE", tipo);
|
||||
|
||||
cur++;
|
||||
}
|
||||
@ -715,7 +722,8 @@ int TPrimanota_application::write(const TMask& m)
|
||||
const TString16 causimm(_causale.causale_inc_imm());
|
||||
if (causimm.not_empty())
|
||||
genera_incasso(causimm);
|
||||
if (TRUE) // TBI controlla pagamento da scadenzare
|
||||
|
||||
if (gestione_saldaconto() && _causale.saldaconto())
|
||||
aggiorna_scadenzario(m);
|
||||
}
|
||||
return err;
|
||||
@ -728,8 +736,7 @@ int TPrimanota_application::rewrite(const TMask& m)
|
||||
const int err = _rel->rewrite(TRUE);
|
||||
if (err == NOERR)
|
||||
_saldi.registra();
|
||||
if (TRUE) // TBI controlla pagamento da scadenzare e/o variazione che ne implichi
|
||||
// la modifica
|
||||
if (gestione_saldaconto() && _causale.saldaconto())
|
||||
aggiorna_scadenzario(m);
|
||||
return err;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ END
|
||||
|
||||
STRING F_TIPODOC 2
|
||||
BEGIN
|
||||
PROMPT 27 3 "Tipo documento "
|
||||
PROMPT 24 3 "Tipo documento "
|
||||
FIELD LF_MOV->TIPODOC
|
||||
FLAGS "D"
|
||||
END
|
||||
@ -173,7 +173,8 @@ END
|
||||
|
||||
BUTTON DLG_SAVEREC 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
PROMPT -12 -1 "~Registra"
|
||||
MESSAGE EXIT,K_SAVEREC
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 9 2
|
||||
|
@ -348,8 +348,8 @@ int TPrimanota_application::set_cgs_row(int n, const TImporto& imp,
|
||||
row = "";
|
||||
imp.add_to(row);
|
||||
row.add(conto.string(0x3));
|
||||
row.add("");
|
||||
row.add(desc);
|
||||
row.add(""); // Codice decrizione
|
||||
row.add(desc); // Descrizione aggiuntiva
|
||||
|
||||
switch(tipo) // Calcolo contropartita
|
||||
{
|
||||
@ -422,7 +422,7 @@ void TPrimanota_application::cgs_pack()
|
||||
real TPrimanota_application::calcola_saldo() const
|
||||
{
|
||||
TArray& rows = cgs().rows_array();
|
||||
const int max = rows.items();
|
||||
const int max = rows.size();
|
||||
|
||||
real tdare, tavere;
|
||||
for (int i = 0; i < max; i++)
|
||||
@ -470,8 +470,23 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
|
||||
return f.error_box("Il movimento e' sbilanciato di %s lire.", ss);
|
||||
}
|
||||
else
|
||||
if (app().get_cgs_imp(0).valore() == ZERO)
|
||||
if (app().get_cgs_imp(0).valore().is_zero())
|
||||
return f.error_box("Il movimento non ha una prima riga contabile valida!");
|
||||
|
||||
const int max = cg.items();
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
const TImporto im(get_cgs_imp(i));
|
||||
if (!im.valore().is_zero())
|
||||
{
|
||||
const TBill c(cg.row(i), 3, 0x0);
|
||||
if (!c.ok())
|
||||
return error_box("Il conto della riga %d non e' completo", i+1);
|
||||
const TBill co(cg.row(i), 9, 0x0);
|
||||
if (!co.ok())
|
||||
return error_box("La contropartita della riga %d non e' completa", i+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
@ -665,6 +680,7 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
|
||||
|
||||
TSheet_field& iva = app().ivas();
|
||||
TToken_string& row = iva.row(r);
|
||||
const TCausale& cau = app().causale();
|
||||
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
@ -681,14 +697,15 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
|
||||
oldposiva = type2pos(tipod);
|
||||
if (oldposiva < 0 && oldiva != ZERO)
|
||||
{
|
||||
TBill c; app().causale().bill(tipod == 'D' ? 3 : 4, c);
|
||||
oldposiva = app().set_cgs_row(-1, app().real2imp(ZERO, 'I'), c, "", tipod);
|
||||
const int r = tipod == 'D' ? 3 : 4;
|
||||
TBill c; cau.bill(r, c);
|
||||
oldposiva = app().set_cgs_row(-1, app().real2imp(ZERO, 'I'), c, cau.desc_agg(r), tipod);
|
||||
}
|
||||
|
||||
TBill oldconto(row, 6, 0x0); // g/c/s 6 7 8
|
||||
oldpos = bill2pos(oldconto, 'I');
|
||||
if (oldpos < 0 && oldconto.ok())
|
||||
oldpos = app().set_cgs_row(-1, app().real2imp(ZERO, 'I'), oldconto, "", 'I');
|
||||
oldpos = app().set_cgs_row(-1, app().real2imp(ZERO, 'I'), oldconto, cau.desc_agg(2), 'I');
|
||||
}
|
||||
if (k == K_DEL)
|
||||
{
|
||||
@ -724,7 +741,7 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
|
||||
{
|
||||
const TImporto val(app().real2imp(imp, 'I'));
|
||||
if (val.valore() != ZERO)
|
||||
app().set_cgs_row(-1, val, conto, app().causale().descr(2), 'I');
|
||||
app().set_cgs_row(-1, val, conto, cau.desc_agg(2), 'I');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -742,7 +759,8 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
|
||||
// Aggiorna conto IVA sulla riga contabile
|
||||
|
||||
const bool detrarre = detraibile(row); // Determina se IVA detraibile
|
||||
app().causale().bill(detrarre ? 3 : 4, conto);
|
||||
const int r = detrarre ? 3 : 4;
|
||||
app().causale().bill(r, conto);
|
||||
const char tipod = detrarre ? 'D' : 'N';
|
||||
int newposiva = type2pos(tipod);
|
||||
|
||||
@ -750,7 +768,7 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
|
||||
{
|
||||
const TImporto val(app().real2imp(imposta, 'I'));
|
||||
if (val.valore() != ZERO)
|
||||
newposiva = app().set_cgs_row(-1, val, conto, "", tipod);
|
||||
newposiva = app().set_cgs_row(-1, val, conto, cau.desc_agg(r), tipod);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1204,7 +1222,7 @@ void TPrimanota_application::add_cgs_rit(bool fiscali)
|
||||
{
|
||||
const int riga = fiscali ? 8 : 9;
|
||||
TBill conto; _causale.bill(riga, conto);
|
||||
set_cgs_row(-1, real2imp(imp, tipo), conto, conto.descrizione(), tipo);
|
||||
set_cgs_row(-1, real2imp(imp, tipo), conto, _causale.desc_agg(riga), tipo);
|
||||
}
|
||||
else
|
||||
set_cgs_imp(pos, real2imp(imp, tipo));
|
||||
|
@ -320,10 +320,16 @@ TBill& TCausale::bill(int num, TBill& conto) const
|
||||
return conto;
|
||||
}
|
||||
|
||||
const char* TCausale::descr(int num) const
|
||||
const char* TCausale::desc_agg(int num) const
|
||||
{
|
||||
const TRectype& rec = row(num);
|
||||
return rec.get(RCA_DESC);
|
||||
TString16 cod(rec.get(RCA_CODDESC));
|
||||
|
||||
TTable da("%DPN");
|
||||
da.put("CODTAB", cod);
|
||||
if (da.read() != NOERR)
|
||||
da.zero();
|
||||
return da.get("S0");
|
||||
}
|
||||
|
||||
|
||||
|
@ -80,7 +80,7 @@ protected:
|
||||
|
||||
public:
|
||||
TBill& bill(int num, TBill& c) const;
|
||||
const char* descr(int num) const;
|
||||
const char* desc_agg(int num) const;
|
||||
|
||||
bool data_doc() const;
|
||||
bool num_doc() const;
|
||||
|
223
cg/cg2104.cpp
223
cg/cg2104.cpp
@ -1,3 +1,225 @@
|
||||
<<<<<<< cg2104.cpp
|
||||
// --------------------------------------------------------------------------
|
||||
// Scadenzario
|
||||
// fv 24/8/94
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include "cg2102.h"
|
||||
#include "cg2100.h"
|
||||
#include "cg2104a.h"
|
||||
#include "pagament.h"
|
||||
|
||||
struct shuttle
|
||||
{
|
||||
Pagamento* _pag; // pagamento
|
||||
TSheet_field* _sheet; // sheet
|
||||
TMask* _mask; // maschera
|
||||
TArray* _rows; // righe spreadsheet nella versione originale
|
||||
};
|
||||
|
||||
bool TPrimanota_application::pag_notify(int r, KEY k)
|
||||
{
|
||||
// questo e' il bello
|
||||
shuttle* sh = (shuttle*)(((TPrimanota_application*)MainApp())->get_app_data());
|
||||
|
||||
Pagamento* pag = sh->_pag;
|
||||
TSheet_field* ps = sh->_sheet;
|
||||
TMask* msk = sh->_mask;
|
||||
TArray* rws = sh->_rows;
|
||||
|
||||
int rdiff = atoi(msk->get(F_RDIFFER));
|
||||
|
||||
// ts contiene la vecchia riga, ns la nuova
|
||||
TToken_string ts(36), ns(36);
|
||||
|
||||
|
||||
bool doit = TRUE, m_imp = FALSE, m_perc = FALSE, m_pag = FALSE;
|
||||
bool m_scad = FALSE, m_tipo = FALSE, mod = FALSE;
|
||||
word ahiahi = P_OK;
|
||||
|
||||
TString news(15), newi(15), newp(15), newt(2);
|
||||
|
||||
bool recalc = msk->get_bool(F_RECALC);
|
||||
bool mcomm = msk->get_bool(F_MCOMM);
|
||||
|
||||
switch (k)
|
||||
{
|
||||
case K_SPACE:
|
||||
break;
|
||||
case K_ENTER:
|
||||
ns = ps->row(r);
|
||||
ts = (TToken_string&)(*rws)[r];
|
||||
|
||||
news = ns.get(0);
|
||||
newp = ns.get(1);
|
||||
newi = ns.get(2);
|
||||
newt = ns.get(3);
|
||||
|
||||
// qui viene il bello, si fa per dire
|
||||
if (strcmp(ts.get(0),news) != 0) // modificata data scadenza
|
||||
{
|
||||
mod = m_scad = TRUE;
|
||||
}
|
||||
if (strcmp(ts.get(1),newp) != 0) // modificata percentuale
|
||||
{
|
||||
mod = m_perc = TRUE;
|
||||
}
|
||||
if (strcmp(ts.get(2),newi) != 0) // modificato importo
|
||||
{
|
||||
if ((recalc && !m_perc) || (!recalc)) // se si modifica la percentuale l'importo non viene cagato
|
||||
{
|
||||
mod = m_imp = TRUE;
|
||||
}
|
||||
}
|
||||
if (strcmp(ts.get(3),newt) != 0) // modificato tipo pagamento
|
||||
{
|
||||
mod = m_tipo = TRUE;
|
||||
}
|
||||
break;
|
||||
case K_DEL:
|
||||
case K_INS:
|
||||
doit = FALSE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// settato da recalc_rate se occorre ridefinire lo sheet
|
||||
// aggiungendo o togliendo righe
|
||||
bool need_recalc = FALSE;
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
if (mod && recalc)
|
||||
{
|
||||
// ricalcola sheet come sai fare tu
|
||||
ahiahi = pag->recalc_rate(r, m_perc,
|
||||
((m_perc || m_imp) ?
|
||||
(m_perc ? (const char*)newp : (const char*)newi) :
|
||||
NULL),
|
||||
(m_scad ? (const char*)news : NULL),
|
||||
(m_tipo ? (const char*)newt : NULL),
|
||||
rdiff, mcomm, need_recalc);
|
||||
// see if rdiff changed
|
||||
msk->field(F_RDIFFER).set(pag->rate_differenziate() ? "1" : "2");
|
||||
}
|
||||
if (!recalc)
|
||||
{
|
||||
ahiahi = P_OK;
|
||||
// put data as they are
|
||||
TToken_string& trw = pag->rata(r);
|
||||
TToken_string srw = trw;
|
||||
if (m_scad) trw.add(news,3);
|
||||
if (m_perc) trw.add(newp,1);
|
||||
if (m_imp) trw.add(newi,4);
|
||||
if (m_tipo) trw.add(newt,2);
|
||||
// validate the payment
|
||||
if ((ahiahi = pag->validate()) != P_OK)
|
||||
pag->rata(r) = srw;
|
||||
}
|
||||
if (ahiahi) // any error?
|
||||
// rimetti le righe com'erano prima
|
||||
{
|
||||
beep();
|
||||
|
||||
// se gli errori sono voluti, spiegali
|
||||
if (!recalc)
|
||||
{
|
||||
TString s(256);
|
||||
pag->strerr(ahiahi,s);
|
||||
warning_box(s);
|
||||
}
|
||||
|
||||
ps->row(r) = (TToken_string&)(*rws)[r];
|
||||
ps->force_update(r);
|
||||
}
|
||||
|
||||
else if (recalc && mod && need_recalc)
|
||||
{
|
||||
// ridefinisci lo sheet sulla base delle nuove rate
|
||||
pag->set_sheet(*ps);
|
||||
ps->force_update(-1);
|
||||
rws->destroy();
|
||||
(*rws) = ps->rows_array();
|
||||
}
|
||||
}
|
||||
|
||||
return doit;
|
||||
}
|
||||
|
||||
void TPrimanota_application::aggiorna_scadenzario(const TMask& m)
|
||||
{
|
||||
real imponibile(0.0);
|
||||
real imposta(0.0);
|
||||
real spese(0.0);
|
||||
TString dt(m.get(F_DATAREG));
|
||||
Pagamento pag(m.get(F_CODPAG), (const char*)dt);
|
||||
|
||||
if (pag.is_new()) return;
|
||||
|
||||
TMask ms("cg2104a");
|
||||
TSheet_field& ps = (TSheet_field&)ms.field(F_RATESHEET);
|
||||
ps.set_notify(pag_notify);
|
||||
|
||||
ms.field(F_RDIFFER).set(pag.rate_differenziate() ? "1" : "2");
|
||||
ms.field(F_NAMEPAG).set(pag.name());
|
||||
ms.field(F_TIPOPR).set(pag.desc_tpr());
|
||||
ms.field(F_MCOMM).set(pag.mese_commerciale() ? "X" : "");
|
||||
|
||||
TSheet_field& iva_sh = ivas();
|
||||
|
||||
for (int i = 0; i < iva_sh.items(); i++)
|
||||
{
|
||||
TToken_string& tt = iva_sh.row(i);
|
||||
real mpo(tt.get(0));
|
||||
real imp(tt.get(3));
|
||||
imponibile += mpo;
|
||||
imposta += imp;
|
||||
// TBI: le spese che cazzo sono?
|
||||
// -----------------------------
|
||||
}
|
||||
|
||||
ms.field(F_IMPONIBILE).set(imponibile.string());
|
||||
ms.field(F_IMPOSTA).set(imposta.string());
|
||||
ms.field(F_SPESE).set(spese.string());
|
||||
ms.field(F_RECALC).set("X");
|
||||
|
||||
pag.set_total(imponibile, imposta, spese);
|
||||
|
||||
// TBI TBI TBI TBI TBI TBI TBI TBI TBI
|
||||
// controllare se c'e' una rateazione non standard gia' registrata
|
||||
// in tal caso occorre zappare e settare le rate a mano
|
||||
pag.set_rate_auto();
|
||||
|
||||
// se la prima rata e' fissa non si tocca
|
||||
if (pag.tipo_prima_rata() > 0)
|
||||
{
|
||||
ps.disable_cell(0,0);
|
||||
ps.disable_cell(0,1);
|
||||
ps.disable_cell(0,2);
|
||||
ps.disable_cell(0,3);
|
||||
}
|
||||
|
||||
// prepara lo sheet
|
||||
pag.set_sheet(ps);
|
||||
TArray rows(ps.rows_array());
|
||||
|
||||
shuttle sh;
|
||||
|
||||
sh._pag = &pag;
|
||||
sh._sheet = &ps;
|
||||
sh._mask = &ms;
|
||||
sh._rows = &rows;
|
||||
|
||||
set_app_data(&sh);
|
||||
ms.run();
|
||||
|
||||
// TBI se modificato riaggiustare i files
|
||||
// chiamando la write del caso
|
||||
// -------------------------------------------------
|
||||
}
|
||||
=======
|
||||
// --------------------------------------------------------------------------
|
||||
// Scadenzario
|
||||
// fv 24/8/94
|
||||
@ -218,3 +440,4 @@ void TPrimanota_application::aggiorna_scadenzario(const TMask& m)
|
||||
// chiamando la write del caso
|
||||
// -------------------------------------------------
|
||||
}
|
||||
>>>>>>> 1.2
|
||||
|
@ -204,8 +204,8 @@ END
|
||||
|
||||
NUMBER 103 1
|
||||
BEGIN
|
||||
PROMPT 2 9 "Detraz. "
|
||||
SHEET "Codice|Descrizione@60"
|
||||
PROMPT 2 9 "Det. "
|
||||
SHEET "Codice|Descrizione@53"
|
||||
INPUT 103
|
||||
ITEM " |Regime normale"
|
||||
ITEM "1|IVA indetraibile su acquisti riferiti a ricavi esenti"
|
||||
@ -215,9 +215,9 @@ BEGIN
|
||||
OUTPUT 213
|
||||
END
|
||||
|
||||
STRING 213 50
|
||||
STRING 213 53
|
||||
BEGIN
|
||||
PROMPT 15 9 ""
|
||||
PROMPT 12 9 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
|
@ -9,48 +9,48 @@
|
||||
|
||||
bool TRigaiva_array::add_riga(const real& imponibile, const real& imposta, const char* codiva, const int tipodet, const real& imponibilep, const real& impostap)
|
||||
{
|
||||
bool found = FALSE;
|
||||
for (int i = 0; i < items(); i++)
|
||||
{
|
||||
TRigaiva& r = (TRigaiva&)(*this)[i];
|
||||
if ((r._codiva==codiva) && (tipodet==r._tipodet))
|
||||
bool found = FALSE;
|
||||
for (int i = 0; i < items(); i++)
|
||||
{
|
||||
found = TRUE;
|
||||
r._imponibile += imponibile;
|
||||
r._imposta += imposta;
|
||||
r._imponibilep += imponibilep;
|
||||
r._impostap += impostap;
|
||||
TRigaiva& r = (TRigaiva&)(*this)[i];
|
||||
if ((r._codiva==codiva) && (tipodet==r._tipodet))
|
||||
{
|
||||
found = TRUE;
|
||||
r._imponibile += imponibile;
|
||||
r._imposta += imposta;
|
||||
r._imponibilep += imponibilep;
|
||||
r._impostap += impostap;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
TRigaiva* r = new TRigaiva(imponibile,imposta,codiva,tipodet,imponibilep,impostap);
|
||||
add(r);
|
||||
}
|
||||
return found;
|
||||
if (!found)
|
||||
{
|
||||
TRigaiva* r = new TRigaiva(imponibile,imposta,codiva,tipodet,imponibilep,impostap);
|
||||
add(r);
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
bool TRiga_array::add_riga(const real& imponibile, const real& imposta, const char* codiva, const real& imponibilep, const real& impostap)
|
||||
{
|
||||
bool found = FALSE;
|
||||
for (int i = 0; i < items(); i++)
|
||||
{
|
||||
TRiga& r = (TRiga&)(*this)[i];
|
||||
if (r._codiva==codiva)
|
||||
bool found = FALSE;
|
||||
for (int i = 0; i < items(); i++)
|
||||
{
|
||||
found = TRUE;
|
||||
r._imponibile += imponibile;
|
||||
r._imposta += imposta;
|
||||
r._imponibilep += imponibilep;
|
||||
r._impostap += impostap;
|
||||
TRiga& r = (TRiga&)(*this)[i];
|
||||
if (r._codiva==codiva)
|
||||
{
|
||||
found = TRUE;
|
||||
r._imponibile += imponibile;
|
||||
r._imposta += imposta;
|
||||
r._imponibilep += imponibilep;
|
||||
r._impostap += impostap;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
TRiga* r = new TRiga(imponibile,imposta,codiva,imponibilep,impostap);
|
||||
add(r);
|
||||
}
|
||||
return found;
|
||||
if (!found)
|
||||
{
|
||||
TRiga* r = new TRiga(imponibile,imposta,codiva,imponibilep,impostap);
|
||||
add(r);
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
bool TDociva_array::add_riga(const char* _descrdociva, const real& _importo,const int _natdoc)
|
||||
@ -79,20 +79,20 @@ bool TDociva_array::add_riga(const char* _descrdociva, const real& _importo,cons
|
||||
|
||||
bool TTipodoc_array::add_riga(const char* tipodoc, const char* descrdoc, const real& totdoc)
|
||||
{
|
||||
bool found = FALSE;
|
||||
for (int i = 0; i < items(); i++)
|
||||
{
|
||||
TTipodoc& r = (TTipodoc&)(*this)[i];
|
||||
if (r._tipodoc==tipodoc)
|
||||
bool found = FALSE;
|
||||
for (int i = 0; i < items(); i++)
|
||||
{
|
||||
found = TRUE;
|
||||
r._totdoc += totdoc;
|
||||
TTipodoc& r = (TTipodoc&)(*this)[i];
|
||||
if (r._tipodoc==tipodoc)
|
||||
{
|
||||
found = TRUE;
|
||||
r._totdoc += totdoc;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
TTipodoc* r = new TTipodoc(tipodoc,descrdoc,totdoc);
|
||||
add(r);
|
||||
}
|
||||
return found;
|
||||
if (!found)
|
||||
{
|
||||
TTipodoc* r = new TTipodoc(tipodoc,descrdoc,totdoc);
|
||||
add(r);
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
44
cg/cglib03.h
44
cg/cglib03.h
@ -22,26 +22,26 @@ struct TDociva : public TObject
|
||||
class TDociva_array : public TArray
|
||||
{
|
||||
public:
|
||||
bool add_riga(const char* _descrdociva,const real& _importo,const int _natdoc);
|
||||
bool add_riga(const char* _descrdociva,const real& _importo,const int _natdoc);
|
||||
};
|
||||
|
||||
struct TRigaiva : public TObject
|
||||
{
|
||||
real _imponibile, _imposta, _imponibilep, _impostap; //imponibili, imposte del periodo e progressivi
|
||||
TString _codiva;
|
||||
int _tipodet;
|
||||
|
||||
TRigaiva (const real& imponibile, const real& imposta, const char* codiva, int tipodet, const real& imponibilep, const real& impostap):
|
||||
_imponibile(imponibile),_imposta(imposta),_codiva(codiva),_tipodet(tipodet),_imponibilep(imponibilep),_impostap(impostap)
|
||||
{}
|
||||
};
|
||||
real _imponibile, _imposta, _imponibilep, _impostap; //imponibili, imposte del periodo e progressivi
|
||||
TString _codiva;
|
||||
int _tipodet;
|
||||
|
||||
TRigaiva (const real& imponibile, const real& imposta, const char* codiva, int tipodet, const real& imponibilep, const real& impostap):
|
||||
_imponibile(imponibile),_imposta(imposta),_codiva(codiva),_tipodet(tipodet),_imponibilep(imponibilep),_impostap(impostap)
|
||||
{}
|
||||
};
|
||||
|
||||
class TRigaiva_array : public TArray
|
||||
{
|
||||
public:
|
||||
bool add_riga(const real& imponibile, const real& imposta, const char* codiva, const int tipodet, const real& imponibilep, const real& impostap);
|
||||
public:
|
||||
bool add_riga(const real& imponibile, const real& imposta, const char* codiva, const int tipodet, const real& imponibilep, const real& impostap);
|
||||
};
|
||||
|
||||
|
||||
struct TTipodoc : public TObject
|
||||
{
|
||||
TString _tipodoc, _descrdoc;
|
||||
@ -53,23 +53,23 @@ struct TTipodoc : public TObject
|
||||
|
||||
class TTipodoc_array : public TArray
|
||||
{
|
||||
public:
|
||||
bool add_riga(const char* tipodoc, const char* descrdoc, const real& totdoc);
|
||||
public:
|
||||
bool add_riga(const char* tipodoc, const char* descrdoc, const real& totdoc);
|
||||
};
|
||||
|
||||
struct TRiga : public TObject
|
||||
{
|
||||
real _imponibile, _imposta, _imponibilep, _impostap;
|
||||
TString _codiva;
|
||||
|
||||
TRiga (const real& imponibile, const real& imposta, const char* codiva, const real& imponibilep, const real& impostap):
|
||||
_imponibile(imponibile),_imposta(imposta),_codiva(codiva),_imponibilep(imponibilep),_impostap(impostap) {}
|
||||
real _imponibile, _imposta, _imponibilep, _impostap;
|
||||
TString _codiva;
|
||||
|
||||
TRiga (const real& imponibile, const real& imposta, const char* codiva, const real& imponibilep, const real& impostap):
|
||||
_imponibile(imponibile),_imposta(imposta),_codiva(codiva),_imponibilep(imponibilep),_impostap(impostap) {}
|
||||
};
|
||||
|
||||
class TRiga_array : public TArray
|
||||
{
|
||||
public:
|
||||
bool add_riga(const real& imponibile, const real& imposta, const char* codiva, const real& imponibilep, const real& impostap);
|
||||
public:
|
||||
bool add_riga(const real& imponibile, const real& imposta, const char* codiva, const real& imponibilep, const real& impostap);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user