Modificata la stampa delle deleghe IVA in funzione delle rivoluzioni all'uso
dei form (nome + codice) Collegata la prima nota al modello 770 tramite messaggio git-svn-id: svn://10.65.10.50/trunk@1424 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5cde32a1ba
commit
66f345e712
@ -6,9 +6,8 @@
|
|||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <utility.h>
|
|
||||||
|
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
#include <utility.h>
|
||||||
|
|
||||||
#include "cg1400.h"
|
#include "cg1400.h"
|
||||||
|
|
||||||
@ -21,7 +20,10 @@ class TStampa_deleghe_IVA : public TApplication
|
|||||||
|
|
||||||
int _mese, _anno, _tipo;
|
int _mese, _anno, _tipo;
|
||||||
TString16 _azienda, _dipendenza, _concessione;
|
TString16 _azienda, _dipendenza, _concessione;
|
||||||
TFilename _profilo;
|
|
||||||
|
TString16 _profilo;
|
||||||
|
long _codice;
|
||||||
|
|
||||||
bool _stampa_distinte, _aggiorna_codici, _definitiva, _contofis;
|
bool _stampa_distinte, _aggiorna_codici, _definitiva, _contofis;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -63,43 +65,15 @@ bool TStampa_deleghe_IVA::create()
|
|||||||
bool TStampa_deleghe_IVA::destroy()
|
bool TStampa_deleghe_IVA::destroy()
|
||||||
{
|
{
|
||||||
delete _ditte;
|
delete _ditte;
|
||||||
|
|
||||||
delete _nditte;
|
|
||||||
delete _banche;
|
delete _banche;
|
||||||
|
delete _nditte;
|
||||||
return TApplication::destroy();
|
return TApplication::destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HIDDEN bool abi_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (k == K_TAB)
|
|
||||||
{
|
|
||||||
TMask& m = f.mask();
|
|
||||||
if (!m.get_bool(F_CONTOFIS))
|
|
||||||
m.set(F_PROFILO, f.get());
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
HIDDEN bool profile_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (f.to_check(k))
|
|
||||||
{
|
|
||||||
TFilename p;
|
|
||||||
p << "del" << f.get() << ".frm";
|
|
||||||
if (!fexist(p))
|
|
||||||
error_box("Non esiste il file di profilo %s", (const char*)p);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TStampa_deleghe_IVA::select()
|
int TStampa_deleghe_IVA::select()
|
||||||
{
|
{
|
||||||
TMask m("cg1400a");
|
TMask m("cg1400a");
|
||||||
m.set_handler(F_ABI, abi_handler);
|
|
||||||
m.set_handler(F_PROFILO, profile_handler);
|
|
||||||
|
|
||||||
m.set(F_CONCESSIONE, _concessione);
|
m.set(F_CONCESSIONE, _concessione);
|
||||||
m.set(F_ABI, _azienda);
|
m.set(F_ABI, _azienda);
|
||||||
@ -119,7 +93,8 @@ int TStampa_deleghe_IVA::select()
|
|||||||
_contofis = m.get_bool(F_CONTOFIS);
|
_contofis = m.get_bool(F_CONTOFIS);
|
||||||
|
|
||||||
_profilo = "del";
|
_profilo = "del";
|
||||||
_profilo << m.get(F_PROFILO);
|
if (_contofis) _profilo << "titcf";
|
||||||
|
_codice = m.get_long(F_PROFILO);
|
||||||
|
|
||||||
const TDate pd(m.get(F_DATA));
|
const TDate pd(m.get(F_DATA));
|
||||||
printer().setdate(pd);
|
printer().setdate(pd);
|
||||||
@ -179,7 +154,8 @@ int TStampa_deleghe_IVA::select()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
warning_box("Nessuna ditta ha deleghe da stampare");
|
warning_box("Nessuna ditta ha deleghe %s da stampare",
|
||||||
|
_contofis ? "per conto fiscale" : "normali");
|
||||||
res = 2;
|
res = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +163,7 @@ int TStampa_deleghe_IVA::select()
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampa_deleghe_IVA::menu(MENU_TAG mt)
|
bool TStampa_deleghe_IVA::menu(MENU_TAG)
|
||||||
{
|
{
|
||||||
int s;
|
int s;
|
||||||
while ((s = select()) != 0)
|
while ((s = select()) != 0)
|
||||||
@ -200,7 +176,7 @@ void TStampa_deleghe_IVA::print()
|
|||||||
print_deleghe();
|
print_deleghe();
|
||||||
if (_stampa_distinte)
|
if (_stampa_distinte)
|
||||||
{
|
{
|
||||||
const bool ok = yesno_box("Inserire il modulo continuo nella stampante "
|
const bool ok = yesno_box("Inserire il modulo di carta nella stampante "
|
||||||
"e confermare la stampa della distinta");
|
"e confermare la stampa della distinta");
|
||||||
if (ok) print_distinta();
|
if (ok) print_distinta();
|
||||||
}
|
}
|
||||||
@ -309,7 +285,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
bool ok = printer().open();
|
bool ok = printer().open();
|
||||||
if (!ok) return FALSE;
|
if (!ok) return FALSE;
|
||||||
|
|
||||||
TForm f(_profilo);
|
TForm f(_profilo, _codice);
|
||||||
|
|
||||||
TCursor& cur = *f.cursor();
|
TCursor& cur = *f.cursor();
|
||||||
TLocalisamfile& delega = cur.file();
|
TLocalisamfile& delega = cur.file();
|
||||||
|
@ -32,7 +32,6 @@ BEGIN
|
|||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
NUMBER F_SOLO_ABI 5
|
NUMBER F_SOLO_ABI 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 3 "Codice ABI "
|
PROMPT 2 3 "Codice ABI "
|
||||||
@ -169,8 +168,6 @@ END
|
|||||||
BOOLEAN F_CONTOFIS
|
BOOLEAN F_CONTOFIS
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 43 13 "Titolari Conto fiscale"
|
PROMPT 43 13 "Titolari Conto fiscale"
|
||||||
MESSAGE FALSE ENABLE,F_PROFILO
|
|
||||||
MESSAGE TRUE DISABLE,F_PROFILO|"TITCF",F_PROFILO
|
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_SELECT 9 2
|
BUTTON DLG_SELECT 9 2
|
||||||
|
@ -6,9 +6,8 @@
|
|||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <utility.h>
|
|
||||||
|
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
#include <utility.h>
|
||||||
|
|
||||||
#include "cg1400.h"
|
#include "cg1400.h"
|
||||||
|
|
||||||
@ -21,7 +20,10 @@ class TStampa_deleghe_IVA : public TApplication
|
|||||||
|
|
||||||
int _mese, _anno, _tipo;
|
int _mese, _anno, _tipo;
|
||||||
TString16 _azienda, _dipendenza, _concessione;
|
TString16 _azienda, _dipendenza, _concessione;
|
||||||
TFilename _profilo;
|
|
||||||
|
TString16 _profilo;
|
||||||
|
long _codice;
|
||||||
|
|
||||||
bool _stampa_distinte, _aggiorna_codici, _definitiva, _contofis;
|
bool _stampa_distinte, _aggiorna_codici, _definitiva, _contofis;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -63,43 +65,15 @@ bool TStampa_deleghe_IVA::create()
|
|||||||
bool TStampa_deleghe_IVA::destroy()
|
bool TStampa_deleghe_IVA::destroy()
|
||||||
{
|
{
|
||||||
delete _ditte;
|
delete _ditte;
|
||||||
|
|
||||||
delete _nditte;
|
|
||||||
delete _banche;
|
delete _banche;
|
||||||
|
delete _nditte;
|
||||||
return TApplication::destroy();
|
return TApplication::destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HIDDEN bool abi_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (k == K_TAB)
|
|
||||||
{
|
|
||||||
TMask& m = f.mask();
|
|
||||||
if (!m.get_bool(F_CONTOFIS))
|
|
||||||
m.set(F_PROFILO, f.get());
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
HIDDEN bool profile_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (f.to_check(k))
|
|
||||||
{
|
|
||||||
TFilename p;
|
|
||||||
p << "del" << f.get() << ".frm";
|
|
||||||
if (!fexist(p))
|
|
||||||
error_box("Non esiste il file di profilo %s", (const char*)p);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TStampa_deleghe_IVA::select()
|
int TStampa_deleghe_IVA::select()
|
||||||
{
|
{
|
||||||
TMask m("cg1400a");
|
TMask m("cg1400a");
|
||||||
m.set_handler(F_ABI, abi_handler);
|
|
||||||
m.set_handler(F_PROFILO, profile_handler);
|
|
||||||
|
|
||||||
m.set(F_CONCESSIONE, _concessione);
|
m.set(F_CONCESSIONE, _concessione);
|
||||||
m.set(F_ABI, _azienda);
|
m.set(F_ABI, _azienda);
|
||||||
@ -119,7 +93,8 @@ int TStampa_deleghe_IVA::select()
|
|||||||
_contofis = m.get_bool(F_CONTOFIS);
|
_contofis = m.get_bool(F_CONTOFIS);
|
||||||
|
|
||||||
_profilo = "del";
|
_profilo = "del";
|
||||||
_profilo << m.get(F_PROFILO);
|
if (_contofis) _profilo << "titcf";
|
||||||
|
_codice = m.get_long(F_PROFILO);
|
||||||
|
|
||||||
const TDate pd(m.get(F_DATA));
|
const TDate pd(m.get(F_DATA));
|
||||||
printer().setdate(pd);
|
printer().setdate(pd);
|
||||||
@ -179,7 +154,8 @@ int TStampa_deleghe_IVA::select()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
warning_box("Nessuna ditta ha deleghe da stampare");
|
warning_box("Nessuna ditta ha deleghe %s da stampare",
|
||||||
|
_contofis ? "per conto fiscale" : "normali");
|
||||||
res = 2;
|
res = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +163,7 @@ int TStampa_deleghe_IVA::select()
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampa_deleghe_IVA::menu(MENU_TAG mt)
|
bool TStampa_deleghe_IVA::menu(MENU_TAG)
|
||||||
{
|
{
|
||||||
int s;
|
int s;
|
||||||
while ((s = select()) != 0)
|
while ((s = select()) != 0)
|
||||||
@ -200,7 +176,7 @@ void TStampa_deleghe_IVA::print()
|
|||||||
print_deleghe();
|
print_deleghe();
|
||||||
if (_stampa_distinte)
|
if (_stampa_distinte)
|
||||||
{
|
{
|
||||||
const bool ok = yesno_box("Inserire il modulo continuo nella stampante "
|
const bool ok = yesno_box("Inserire il modulo di carta nella stampante "
|
||||||
"e confermare la stampa della distinta");
|
"e confermare la stampa della distinta");
|
||||||
if (ok) print_distinta();
|
if (ok) print_distinta();
|
||||||
}
|
}
|
||||||
@ -309,7 +285,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
bool ok = printer().open();
|
bool ok = printer().open();
|
||||||
if (!ok) return FALSE;
|
if (!ok) return FALSE;
|
||||||
|
|
||||||
TForm f(_profilo);
|
TForm f(_profilo, _codice);
|
||||||
|
|
||||||
TCursor& cur = *f.cursor();
|
TCursor& cur = *f.cursor();
|
||||||
TLocalisamfile& delega = cur.file();
|
TLocalisamfile& delega = cur.file();
|
||||||
|
@ -32,7 +32,6 @@ BEGIN
|
|||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
NUMBER F_SOLO_ABI 5
|
NUMBER F_SOLO_ABI 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 3 "Codice ABI "
|
PROMPT 2 3 "Codice ABI "
|
||||||
@ -169,8 +168,6 @@ END
|
|||||||
BOOLEAN F_CONTOFIS
|
BOOLEAN F_CONTOFIS
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 43 13 "Titolari Conto fiscale"
|
PROMPT 43 13 "Titolari Conto fiscale"
|
||||||
MESSAGE FALSE ENABLE,F_PROFILO
|
|
||||||
MESSAGE TRUE DISABLE,F_PROFILO|"TITCF",F_PROFILO
|
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_SELECT 9 2
|
BUTTON DLG_SELECT 9 2
|
||||||
|
166
cg/cg2100.cpp
166
cg/cg2100.cpp
@ -1,4 +1,5 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <mailbox.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
@ -12,7 +13,7 @@
|
|||||||
|
|
||||||
// Nomi dei campi
|
// Nomi dei campi
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <causali.h>
|
#include <clifo.h>
|
||||||
#include <rcausali.h>
|
#include <rcausali.h>
|
||||||
|
|
||||||
TPrimanota_application::TPrimanota_application()
|
TPrimanota_application::TPrimanota_application()
|
||||||
@ -876,6 +877,8 @@ int TPrimanota_application::write(const TMask& m)
|
|||||||
_partite.write();
|
_partite.write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
link_m770();
|
||||||
}
|
}
|
||||||
|
|
||||||
lasterr = err;
|
lasterr = err;
|
||||||
@ -891,7 +894,6 @@ int TPrimanota_application::rewrite(const TMask& m)
|
|||||||
{
|
{
|
||||||
_saldi.registra();
|
_saldi.registra();
|
||||||
check_saldi();
|
check_saldi();
|
||||||
}
|
|
||||||
|
|
||||||
if (_is_saldaconto)
|
if (_is_saldaconto)
|
||||||
{
|
{
|
||||||
@ -900,6 +902,10 @@ int TPrimanota_application::rewrite(const TMask& m)
|
|||||||
else
|
else
|
||||||
_partite.rewrite();
|
_partite.rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
link_m770();
|
||||||
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1085,6 +1091,162 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
long TPrimanota_application::calcola_m770(int tipo_coll, real& spese, real& compenso,
|
||||||
|
real& iva, real& ritfis)
|
||||||
|
{
|
||||||
|
const int m770 = causale().link_m770();
|
||||||
|
long forn = 0;
|
||||||
|
|
||||||
|
if (tipo_coll == 1)
|
||||||
|
{
|
||||||
|
TString_array& riva = ivas().rows_array();
|
||||||
|
TCodiceIVA codiva;
|
||||||
|
for (int i = 0; i < riva.items(); i++)
|
||||||
|
{
|
||||||
|
TToken_string& row = riva.row(i);
|
||||||
|
codiva.read(row.get(1));
|
||||||
|
const TString& tipoiva = codiva.tipo();
|
||||||
|
|
||||||
|
const real imponibile(row.get(0));
|
||||||
|
if ((tipoiva == "ES" || tipoiva == "NI" ||tipoiva == "NS") && riva.items() > 1)
|
||||||
|
{
|
||||||
|
if (m770 != 5)
|
||||||
|
spese += imponibile;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
compenso += imponibile;
|
||||||
|
|
||||||
|
const real imposta(row.get(3));
|
||||||
|
iva += imposta;
|
||||||
|
}
|
||||||
|
|
||||||
|
i = type2pos('F');
|
||||||
|
if (i >= 0)
|
||||||
|
{
|
||||||
|
TImporto imp; imp = cgs().row(i);
|
||||||
|
ritfis = imp.valore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tipo_coll == 3 || tipo_coll == 6)
|
||||||
|
{
|
||||||
|
TBill zio; causale().bill(1, zio);
|
||||||
|
TImporto imp;
|
||||||
|
|
||||||
|
TString_array& rcg = cgs().rows_array();
|
||||||
|
for (int i = 0; i < rcg.items(); i++)
|
||||||
|
{
|
||||||
|
TToken_string& row = rcg.row(i);
|
||||||
|
imp = row;
|
||||||
|
if (tipo_coll == 3)
|
||||||
|
{
|
||||||
|
const char cf = row.get_char(2);
|
||||||
|
if (cf == 'F')
|
||||||
|
{
|
||||||
|
if (forn == 0)
|
||||||
|
forn = row.get_long(5);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
forn = 0;
|
||||||
|
compenso = ZERO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
compenso = imp.valore();
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
if (tipo_coll == 6)
|
||||||
|
compenso += imp.valore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return forn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool TPrimanota_application::link_m770()
|
||||||
|
{
|
||||||
|
const int m770 = causale().link_m770();
|
||||||
|
if (!has_module(4) || iva() == iva_vendite || m770 == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
int tipo_coll = 0;
|
||||||
|
char tipper = ' ';
|
||||||
|
long codper = 0;
|
||||||
|
real spese, compenso, imposte, ritenute;
|
||||||
|
|
||||||
|
if (iva() == iva_acquisti)
|
||||||
|
{
|
||||||
|
if (m770 == 1 || m770 == 5)
|
||||||
|
{
|
||||||
|
TLocalisamfile fornitori(LF_CLIFO);
|
||||||
|
fornitori.put("TIPOCF", "F");
|
||||||
|
fornitori.put("CODCF", curr_mask().get(F_FORNITORE));
|
||||||
|
fornitori.read();
|
||||||
|
tipper = fornitori.get_char(CLI_TIPOAPER);
|
||||||
|
codper = fornitori.get_long(CLI_CODANAGPER);
|
||||||
|
if (codper > 0)
|
||||||
|
calcola_m770(tipo_coll = 1, spese, compenso, imposte, ritenute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
switch (m770)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
const long f = calcola_m770(tipo_coll = 3, spese, compenso, imposte, ritenute);
|
||||||
|
if (f != 0)
|
||||||
|
{
|
||||||
|
TLocalisamfile fornitori(LF_CLIFO);
|
||||||
|
fornitori.put("TIPOCF", "F");
|
||||||
|
fornitori.put("CODCF", f);
|
||||||
|
fornitori.read();
|
||||||
|
tipper = fornitori.get_char(CLI_TIPOAPER);
|
||||||
|
codper = fornitori.get_long(CLI_CODANAGPER);
|
||||||
|
}
|
||||||
|
else tipo_coll = 7;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
tipo_coll = 4;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
calcola_m770(tipo_coll = 6, spese, compenso, imposte, ritenute);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tipo_coll)
|
||||||
|
{
|
||||||
|
TToken_string s(80);
|
||||||
|
s.add(tipo_coll);
|
||||||
|
s.add(curr_mask().insert_mode() ? "I" : "M");
|
||||||
|
s.add(tipper);
|
||||||
|
s.add(codper);
|
||||||
|
s.add(curr_mask().get(F_NUMREG));
|
||||||
|
s.add(curr_mask().get(F_NUMDOC));
|
||||||
|
s.add(curr_mask().get(F_DATADOC));
|
||||||
|
if (iva() == iva_acquisti)
|
||||||
|
s.add(curr_mask().get(F_TOTALE));
|
||||||
|
else
|
||||||
|
s.add("");
|
||||||
|
s.add(spese.string());
|
||||||
|
s.add(compenso.string());
|
||||||
|
s.add(imposte.string());
|
||||||
|
s.add(ritenute.string());
|
||||||
|
|
||||||
|
const char* name = (tipo_coll == 4) ? "770 -1" : "770 -0";
|
||||||
|
TMessage m(name, "LINK770", s);
|
||||||
|
m.send();
|
||||||
|
|
||||||
|
TExternal_app a(name);
|
||||||
|
a.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
return tipo_coll > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int cg2100 (int argc, char** argv)
|
int cg2100 (int argc, char** argv)
|
||||||
{
|
{
|
||||||
TPrimanota_application a;
|
TPrimanota_application a;
|
||||||
|
@ -270,7 +270,6 @@ int TPrimanota_application::det_used(char det) const
|
|||||||
return users;
|
return users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Gestione sheet CG
|
// Gestione sheet CG
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -134,6 +134,7 @@ protected: // TRelation_application
|
|||||||
virtual int write(const TMask& m);
|
virtual int write(const TMask& m);
|
||||||
virtual int rewrite(const TMask& m);
|
virtual int rewrite(const TMask& m);
|
||||||
virtual bool remove();
|
virtual bool remove();
|
||||||
|
virtual void write_enable(bool) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void check_saldi();
|
void check_saldi();
|
||||||
@ -218,6 +219,9 @@ protected:
|
|||||||
bool notify_cgline_deletion(TPartita& partita, long nreg, int numrig);
|
bool notify_cgline_deletion(TPartita& partita, long nreg, int numrig);
|
||||||
bool notify_cgline_deletion(int numrig);
|
bool notify_cgline_deletion(int numrig);
|
||||||
|
|
||||||
|
long calcola_m770(int tipo_coll, real& spese, real& compenso, real& iva, real& ritfis);
|
||||||
|
bool link_m770();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static TPrimanota_application& app() { return (TPrimanota_application&)main_app(); }
|
static TPrimanota_application& app() { return (TPrimanota_application&)main_app(); }
|
||||||
TPrimanota_application();
|
TPrimanota_application();
|
||||||
|
@ -299,7 +299,7 @@ bool TCausale::read(const char* cod, int year)
|
|||||||
for (int riga = 1; riga < size(); riga++) // Fill gaps
|
for (int riga = 1; riga < size(); riga++) // Fill gaps
|
||||||
if (objptr(riga) == NULL) add(rcaus.curr(), riga);
|
if (objptr(riga) == NULL) add(rcaus.curr(), riga);
|
||||||
|
|
||||||
TString16 codreg(caus.get("REG"));
|
TString16 codreg(caus.get(CAU_REG));
|
||||||
const bool ok = _reg.read(codreg, year); // Read register
|
const bool ok = _reg.read(codreg, year); // Read register
|
||||||
if (!ok && codreg.not_empty())
|
if (!ok && codreg.not_empty())
|
||||||
return error_box("Non esiste il registro '%s' per l'anno %d",
|
return error_box("Non esiste il registro '%s' per l'anno %d",
|
||||||
@ -354,38 +354,41 @@ const char* TCausale::codice() const
|
|||||||
|
|
||||||
|
|
||||||
bool TCausale::data_doc() const
|
bool TCausale::data_doc() const
|
||||||
{ return _rec.get_bool("DATADOC"); }
|
{ return _rec.get_bool(CAU_DATADOC); }
|
||||||
|
|
||||||
bool TCausale::num_doc() const
|
bool TCausale::num_doc() const
|
||||||
{ return _rec.get_bool("NUMDOC"); }
|
{ return _rec.get_bool(CAU_NUMDOC); }
|
||||||
|
|
||||||
bool TCausale::apertura() const
|
bool TCausale::apertura() const
|
||||||
{ return _rec.get_char("MOVAP") == 'A'; }
|
{ return _rec.get_char(CAU_MOVAP) == 'A'; }
|
||||||
|
|
||||||
bool TCausale::sezionale() const
|
bool TCausale::sezionale() const
|
||||||
{ return _rec.get_bool("MOVSEZ"); }
|
{ return _rec.get_bool(CAU_MOVSEZ); }
|
||||||
|
|
||||||
bool TCausale::valuta() const
|
bool TCausale::valuta() const
|
||||||
{ return _rec.get_bool("MOVVAL"); }
|
{ return _rec.get_bool(CAU_MOVVAL); }
|
||||||
|
|
||||||
bool TCausale::intra() const
|
bool TCausale::intra() const
|
||||||
{ return _rec.get_bool("INTRACOM"); }
|
{ return _rec.get_bool(CAU_INTRACOM); }
|
||||||
|
|
||||||
bool TCausale::valintra() const
|
bool TCausale::valintra() const
|
||||||
{ return _rec.get_bool("VALINTRA"); }
|
{ return _rec.get_bool(CAU_VALINTRA); }
|
||||||
|
|
||||||
const char* TCausale::causale_inc_imm() const
|
const char* TCausale::causale_inc_imm() const
|
||||||
{ return _rec.get("CODCAUSIM"); }
|
{ return _rec.get(CAU_CODCAUSIM); }
|
||||||
|
|
||||||
const char* TCausale::tipo_doc() const
|
const char* TCausale::tipo_doc() const
|
||||||
{ return _rec.get("TIPODOC"); }
|
{ return _rec.get(CAU_TIPODOC); }
|
||||||
|
|
||||||
int TCausale::tipomov() const
|
int TCausale::tipomov() const
|
||||||
{ return _rec.get_int("TIPOMOV"); }
|
{ return _rec.get_int(CAU_TIPOMOV); }
|
||||||
|
|
||||||
bool TCausale::saldaconto() const
|
bool TCausale::saldaconto() const
|
||||||
{ return tipomov() > 0; }
|
{ return tipomov() > 0; }
|
||||||
|
|
||||||
|
int TCausale::link_m770() const
|
||||||
|
{ return _rec.get_int(CAU_M770); }
|
||||||
|
|
||||||
bool TCausale::ok() const
|
bool TCausale::ok() const
|
||||||
{
|
{
|
||||||
if (iva() == iva_errata)
|
if (iva() == iva_errata)
|
||||||
@ -431,12 +434,12 @@ void TCausale::calcIVA()
|
|||||||
TipoIVA i = nessuna_iva; // Tipo IVA di default
|
TipoIVA i = nessuna_iva; // Tipo IVA di default
|
||||||
bool c = FALSE; // Corrispettivi di default
|
bool c = FALSE; // Corrispettivi di default
|
||||||
|
|
||||||
const TString16 tipodoc(_rec.get("TIPODOC"));
|
const TString16 td(tipo_doc());
|
||||||
if (tipodoc.not_empty())
|
if (td.not_empty())
|
||||||
{
|
{
|
||||||
TTable tpd("%TPD");
|
TTable tpd("%TPD");
|
||||||
tpd.setkey(1);
|
tpd.setkey(1);
|
||||||
tpd.put("CODTAB", tipodoc);
|
tpd.put("CODTAB", td);
|
||||||
if (tpd.read() == NOERR)
|
if (tpd.read() == NOERR)
|
||||||
{
|
{
|
||||||
i = (TipoIVA)tpd.get_int("I0"); // IVA acquisti, vendite, generica
|
i = (TipoIVA)tpd.get_int("I0"); // IVA acquisti, vendite, generica
|
||||||
@ -445,12 +448,12 @@ void TCausale::calcIVA()
|
|||||||
i = ri;
|
i = ri;
|
||||||
if (i != ri)
|
if (i != ri)
|
||||||
{
|
{
|
||||||
error_box("Tipo documento '%s' incompatibile con tipo registro", (const char*)tipodoc);
|
error_box("Tipo documento '%s' incompatibile con tipo registro", (const char*)td);
|
||||||
i = iva_errata;
|
i = iva_errata;
|
||||||
}
|
}
|
||||||
c = tpd.get_bool("B0");
|
c = tpd.get_bool("B0");
|
||||||
}
|
}
|
||||||
else error_box("Tipo documento sconosciuto: '%s'", (const char*)tipodoc);
|
else error_box("Tipo documento sconosciuto: '%s'", (const char*)td);
|
||||||
}
|
}
|
||||||
_iva = i;
|
_iva = i;
|
||||||
_corrisp = c;
|
_corrisp = c;
|
||||||
|
@ -90,10 +90,12 @@ class TCausale : public TArray
|
|||||||
char _sezione_clifo, _sezione_ritsoc;
|
char _sezione_clifo, _sezione_ritsoc;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
const TRectype& row(int num) const;
|
const TRectype& row(int num) const;
|
||||||
void calcIVA();
|
void calcIVA();
|
||||||
|
|
||||||
|
public: // TObject
|
||||||
|
virtual bool ok() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TBill& bill(int num, TBill& c) const;
|
TBill& bill(int num, TBill& c) const;
|
||||||
|
|
||||||
@ -116,8 +118,8 @@ public:
|
|||||||
bool corrispettivi() const { return _corrisp; }
|
bool corrispettivi() const { return _corrisp; }
|
||||||
int tipomov() const;
|
int tipomov() const;
|
||||||
bool saldaconto() const;
|
bool saldaconto() const;
|
||||||
|
int link_m770() const;
|
||||||
|
|
||||||
virtual bool ok() const;
|
|
||||||
bool similar(const TCausale& c) const;
|
bool similar(const TCausale& c) const;
|
||||||
|
|
||||||
char sezione(int riga) const;
|
char sezione(int riga) const;
|
||||||
@ -130,6 +132,7 @@ public:
|
|||||||
virtual ~TCausale() {}
|
virtual ~TCausale() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TCodiceIVA : public TRectype
|
class TCodiceIVA : public TRectype
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user