Patch level : 2.2 bopatch
Files correlati : cg0 cg2 Ricompilazione Demo : [ ] Commento : Implementato collegamento tra contabilita' generale e contabilita' analitica git-svn-id: svn://10.65.10.50/trunk@12690 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4381888011
commit
3915f8dff5
@ -457,7 +457,7 @@ END
|
|||||||
|
|
||||||
BOOLEAN FLD_CM2_CMSNEEDED
|
BOOLEAN FLD_CM2_CMSNEEDED
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 17 "Attivo per l'analitica"
|
PROMPT 1 17 "Conto attivo per contabilita' analitica"
|
||||||
FIELD ANALITICA
|
FIELD ANALITICA
|
||||||
GROUP 8
|
GROUP 8
|
||||||
END
|
END
|
||||||
|
@ -166,19 +166,6 @@ BEGIN
|
|||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
END
|
END
|
||||||
|
|
||||||
LISTBOX F_M_770 1 48
|
|
||||||
BEGIN
|
|
||||||
PROMPT 2 6 "Collegamento Mod.770 "
|
|
||||||
FIELD M770
|
|
||||||
ITEM " |Nessuno"
|
|
||||||
ITEM "1|Ricevuta e/o pagamento fattura percipiente"
|
|
||||||
ITEM "2|Versamento ritenute percipiente"
|
|
||||||
ITEM "3|Versamento ritenute dipendente"
|
|
||||||
ITEM "4|Versamento contributi dipendente"
|
|
||||||
ITEM "5|Compensi non soggetti"
|
|
||||||
ITEM "6|Ritenute per prestazioni occasionali"
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_CORRISP
|
BOOLEAN F_CORRISP
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 33 5 ""
|
PROMPT 33 5 ""
|
||||||
@ -317,9 +304,27 @@ BEGIN
|
|||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 78 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 15 "@bCollegamenti"
|
||||||
|
END
|
||||||
|
|
||||||
|
LISTBOX F_M_770 1 48
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 16 "Modello 770 "
|
||||||
|
FIELD M770
|
||||||
|
ITEM " |Nessuno"
|
||||||
|
ITEM "1|Ricevuta e/o pagamento fattura percipiente"
|
||||||
|
ITEM "2|Versamento ritenute percipiente"
|
||||||
|
ITEM "3|Versamento ritenute dipendente"
|
||||||
|
ITEM "4|Versamento contributi dipendente"
|
||||||
|
ITEM "5|Compensi non soggetti"
|
||||||
|
ITEM "6|Ritenute per prestazioni occasionali"
|
||||||
|
END
|
||||||
|
|
||||||
LIST F_COLL_CESP 1 40
|
LIST F_COLL_CESP 1 40
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 16 "Collegamento cespiti "
|
PROMPT 2 17 "Cespiti "
|
||||||
FIELD COLLCESP
|
FIELD COLLCESP
|
||||||
ITEM " |Nessuno"
|
ITEM " |Nessuno"
|
||||||
ITEM "A|Acquisto cespite"
|
ITEM "A|Acquisto cespite"
|
||||||
@ -334,11 +339,9 @@ BEGIN
|
|||||||
ITEM "Z|Rettifica vendita"
|
ITEM "Z|Rettifica vendita"
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST F_MOVIND 2
|
BOOLEAN F_MOVIND
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 17 "Contabilita' industriale "
|
PROMPT 2 18 "Contabilita' industriale"
|
||||||
ITEM "|No"
|
|
||||||
ITEM "1|Si"
|
|
||||||
FIELD MOVIND
|
FIELD MOVIND
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
// Nomi dei campi
|
// Nomi dei campi
|
||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
#include <rcausali.h>
|
#include <rcausali.h>
|
||||||
|
#include "../ca/movana.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Dati incasso immediato
|
// Dati incasso immediato
|
||||||
@ -1156,6 +1157,7 @@ int TPrimanota_application::write(const TMask& m)
|
|||||||
link_m770();
|
link_m770();
|
||||||
link_cesp(m, "Insert");
|
link_cesp(m, "Insert");
|
||||||
link_intra(m, "Insert");
|
link_intra(m, "Insert");
|
||||||
|
link_anal(m, "Insert");
|
||||||
}
|
}
|
||||||
|
|
||||||
lasterr = err;
|
lasterr = err;
|
||||||
@ -1202,6 +1204,7 @@ int TPrimanota_application::rewrite(const TMask& m)
|
|||||||
link_m770();
|
link_m770();
|
||||||
link_cesp(m, "Modify");
|
link_cesp(m, "Modify");
|
||||||
link_intra(m, "Modify");
|
link_intra(m, "Modify");
|
||||||
|
link_anal(m, "Modify");
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
@ -1233,6 +1236,7 @@ bool TPrimanota_application::remove()
|
|||||||
}
|
}
|
||||||
link_cesp(m, "Remove");
|
link_cesp(m, "Remove");
|
||||||
link_intra(m, "Remove");
|
link_intra(m, "Remove");
|
||||||
|
link_anal(m, "Remove");
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -1904,6 +1908,80 @@ bool TPrimanota_application::link_intra(const TMask& m, const char* action)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TPrimanota_application::link_anal(const TMask& msk, const char* action)
|
||||||
|
{
|
||||||
|
// Controlla autorizzazione
|
||||||
|
if (!has_module(CAAUT))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Controlla flag sulla causale
|
||||||
|
if (causale().link_analitica())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Controlla l'esistenza del programma dei movimenti analitici
|
||||||
|
if (!fexist("ca2.exe"))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bool bAnalBill = false;
|
||||||
|
TSheet_field& sheet = msk.sfield(F_SHEETCG);
|
||||||
|
FOR_EACH_SHEET_ROW(sheet, i, row)
|
||||||
|
{
|
||||||
|
const TBill bill(*row, 3, 0x0);
|
||||||
|
bAnalBill = bill.is_analitico();
|
||||||
|
if (bAnalBill)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
long nExist = 0L;
|
||||||
|
if (action[0] == 'I')
|
||||||
|
{
|
||||||
|
// Cerco se c'e' almeno un conto interessato all'analitica
|
||||||
|
// Se non ci sono conti analitici e' inutile inserire
|
||||||
|
if (!bAnalBill)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Se sono in modo Modify o Remove, controllo se esiste il movimento
|
||||||
|
TLocalisamfile movana(LF_MOVANA);
|
||||||
|
movana.setkey(3);
|
||||||
|
movana.put(MOVANA_NUMREGCG, msk.get(F_NUMREG));
|
||||||
|
if (movana.read() == NOERR)
|
||||||
|
nExist = movana.get_long(MOVANA_NUMREG);
|
||||||
|
|
||||||
|
if (!nExist)
|
||||||
|
{
|
||||||
|
if (action[0] == 'R') // Nulla da cancellare
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!bAnalBill) // Non c'erano e non ci sono tuttora conti analitici
|
||||||
|
return false;
|
||||||
|
action = "Insert"; // Il movimento e' andato perduto!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TFilename ini;
|
||||||
|
ini.tempdir();
|
||||||
|
ini.add("ActAnal.ini");
|
||||||
|
|
||||||
|
// Parentesi strategiche per salvare il config
|
||||||
|
{
|
||||||
|
TConfig config(ini, "Transaction");
|
||||||
|
config.set("Action", action);
|
||||||
|
|
||||||
|
TString4 para; para << LF_MOVANA;
|
||||||
|
config.set_paragraph(para);
|
||||||
|
|
||||||
|
config.set(MOVANA_NUMREG, nExist);
|
||||||
|
config.set(MOVANA_NUMREGCG, msk.get(F_NUMREG));
|
||||||
|
}
|
||||||
|
|
||||||
|
TString cmd; cmd << "ca2 -0 /i" << ini;
|
||||||
|
TExternal_app app(cmd);
|
||||||
|
app.run();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::protected_record(TRectype& mov)
|
bool TPrimanota_application::protected_record(TRectype& mov)
|
||||||
{
|
{
|
||||||
|
@ -2251,7 +2251,7 @@ bool TPrimanota_application::datacomp_handler(TMask_field& f, KEY key)
|
|||||||
ok = (ca == ra) || (ca == ri);
|
ok = (ca == ra) || (ca == ri);
|
||||||
}
|
}
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return f.error_box("La data di competenza non può superare la data di registrazione");
|
return f.error_box(TR("La data di competenza non puo' superare la data di registrazione"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,6 +290,7 @@ protected:
|
|||||||
bool link_m770();
|
bool link_m770();
|
||||||
bool link_cesp(const TMask& msk, const char* action);
|
bool link_cesp(const TMask& msk, const char* action);
|
||||||
bool link_intra(const TMask& msk, const char* action);
|
bool link_intra(const TMask& msk, const char* action);
|
||||||
|
bool link_anal(const TMask& msk, const char* action);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static char row_type(const TToken_string& s);
|
static char row_type(const TToken_string& s);
|
||||||
|
@ -151,6 +151,9 @@ int TCausale::link_m770() const
|
|||||||
char TCausale::link_cespiti() const
|
char TCausale::link_cespiti() const
|
||||||
{ return _rec.get_char(CAU_COLLCESP); }
|
{ return _rec.get_char(CAU_COLLCESP); }
|
||||||
|
|
||||||
|
bool TCausale::link_analitica() const
|
||||||
|
{ return _rec.get_bool(CAU_MOVIND); }
|
||||||
|
|
||||||
bool TCausale::ok() const
|
bool TCausale::ok() const
|
||||||
{
|
{
|
||||||
if (iva() == iva_errata)
|
if (iva() == iva_errata)
|
||||||
|
@ -52,6 +52,7 @@ public:
|
|||||||
bool saldaconto() const;
|
bool saldaconto() const;
|
||||||
int link_m770() const;
|
int link_m770() const;
|
||||||
char link_cespiti() const;
|
char link_cespiti() const;
|
||||||
|
bool link_analitica() const;
|
||||||
|
|
||||||
bool similar(const TCausale& c) const;
|
bool similar(const TCausale& c) const;
|
||||||
|
|
||||||
|
@ -964,3 +964,17 @@ bool TBill::default_cdc(TString& cdc, TString& fas) const
|
|||||||
}
|
}
|
||||||
return ok && (cdc.not_empty() || fas.not_empty());
|
return ok && (cdc.not_empty() || fas.not_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TBill::is_analitico() const
|
||||||
|
{
|
||||||
|
TString16 key;
|
||||||
|
|
||||||
|
for (int i = 2; i >= 0; i--)
|
||||||
|
{
|
||||||
|
key.format("%d|%d|%ld", gruppo(), i > 0 ? conto() : 0, i > 1 ? sottoconto() : 0);
|
||||||
|
const TRectype& picone = cache().get(LF_PCON, key);
|
||||||
|
if (picone.get_bool(PCN_ANALITICA))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -239,6 +239,7 @@ public:
|
|||||||
|
|
||||||
bool required_cdc() const;
|
bool required_cdc() const;
|
||||||
bool default_cdc(TString& cdc, TString& fas) const;
|
bool default_cdc(TString& cdc, TString& fas) const;
|
||||||
|
bool is_analitico() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
|
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user