Corretto campo Dettaglio sul piano dei conti e relativa stampa
Migliorata gestione contropartite in prima nota Tolto azzeramento ultima riga giornale da ripristino stampa registri git-svn-id: svn://10.65.10.50/trunk@912 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7316ffc269
commit
ff2c0e1ec0
@ -272,9 +272,9 @@ HIDDEN bool conto_handler(TMask_field& f, KEY key)
|
||||
if (key == K_ENTER)
|
||||
{
|
||||
const TMask& m = f.mask();
|
||||
const int gruppo = atoi(m.get(FLD_CM1_GRUPPO));
|
||||
const int conto = atoi(m.get(FLD_CM1_CONTO));
|
||||
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
||||
const int gruppo = m.get_int(FLD_CM1_GRUPPO);
|
||||
const int conto = m.get_int(FLD_CM1_CONTO);
|
||||
const long sottoc = m.get_int(FLD_CM1_SOTTOCONTO);
|
||||
TLocalisamfile& pconti = app().get_relation()->lfile();
|
||||
|
||||
if (gruppo != 0 && conto != 0 && sottoc != 0)
|
||||
|
@ -181,7 +181,7 @@ BEGIN
|
||||
PROMPT 71 7 ""
|
||||
HELP "Codice del conto secondo la IV direttiva CEE"
|
||||
FIELD LF_PCON->NUMIVD
|
||||
FLAGS "RZ"
|
||||
FLAGS "Z"
|
||||
GROUP 1 5
|
||||
USE %IVD
|
||||
INPUT CODTAB[1,1] FLD_CM1_SEZIVD
|
||||
@ -311,7 +311,7 @@ END
|
||||
|
||||
BOOLEAN FLD_CM2_STSOTTBIL
|
||||
BEGIN
|
||||
PROMPT 1 14 "Stampa dettaglio sottoconti su bilanci "
|
||||
PROMPT 1 14 "Non stampare dettaglio sottoconti su bilanci "
|
||||
HELP "Indicare se stampare il dettaglio dei sottoconti nei bilanci di verifica"
|
||||
FIELD LF_PCON->STSOTTBIL
|
||||
GROUP 1 3
|
||||
|
@ -1059,7 +1059,7 @@ void CG1100_application::intesta (stampe tipo)
|
||||
set_header (soh++, "@20gStampa completa per IV direttiva");
|
||||
s.fill('-');
|
||||
set_header (soh++, (const char *) s);
|
||||
set_header (soh++, "Conto @59gSez. Classe@75gTipo@86gDettaglio@104gT@107gSpesa@118gDet.alleg.bil.");
|
||||
set_header (soh++, "Conto @59gSez. Classe@75gTipo@86gNo Dettaglio@104gT@107gSpesa@118gDet.alleg.bil.");
|
||||
set_header (soh++, "Sottoconto @16gDescrizione@61gIV dir.@75gConto@81gC/F@86gBilancio@97gComp.@104gA@107gRicavo@114gSez@118gSot.con * Mov.");
|
||||
break;
|
||||
|
||||
@ -1076,7 +1076,7 @@ void CG1100_application::intesta (stampe tipo)
|
||||
set_header (soh++, "@20gStampa conti non collegati per IV direttiva");
|
||||
s.fill('_');
|
||||
set_header (soh++, (const char *) s);
|
||||
set_header (soh++, "Conto @75gTipo@86gDettaglio@104gT@107gSpesa@118gDet.alleg.bil.");
|
||||
set_header (soh++, "Conto @75gTipo@86gNo Dettaglio@104gT@107gSpesa@118gDet.alleg.bil.");
|
||||
set_header (soh++, "Sottoconto @16gDescrizione@75gConto@81gC/F@86gBilancio@97gComp.@104gA@107gRicavo@114gSez@118gSot.con * Mov.");
|
||||
break;
|
||||
|
||||
@ -1092,7 +1092,7 @@ void CG1100_application::intesta (stampe tipo)
|
||||
case senza_ana_bil:
|
||||
s.fill('_');
|
||||
set_header (soh++, (const char *) s);
|
||||
set_header (soh++, "Conto @67gSez. Classe@85gTipo@96gDettaglio@112gSpesa @123gDet.bil.");
|
||||
set_header (soh++, "Conto @67gSez. Classe@85gTipo@96gNo Dettaglio@112gSpesa @123gDet.bil.");
|
||||
set_header (soh++, "Sottoconto @16gDescrizione@68gIV dir. @85gConto @91gC/F @96gBilancio @106gComp. @112gRicavo @119gSez");
|
||||
break;
|
||||
|
||||
|
@ -851,7 +851,7 @@ bool CG1500_application::bil_sez_contr()
|
||||
{
|
||||
compensa = _pcn->get_bool(PCN_COMPENS);
|
||||
indbil_conto = _pcn->get_int (PCN_INDBIL);
|
||||
dettaglio = _pcn->get_bool(PCN_STSOTTBIL);
|
||||
dettaglio = !_pcn->get_bool(PCN_STSOTTBIL);
|
||||
tipo_conto = _pcn->get(PCN_TMCF)[0];
|
||||
if ( (tipo_conto == 'C') || (tipo_conto == 'F') )
|
||||
{
|
||||
|
@ -1069,7 +1069,7 @@ void CG1600_application::crea_sort_piano_conti_scalare()
|
||||
|
||||
if ((g != 0) && (c != 0) && (s == 0))
|
||||
{
|
||||
stsottbil = pconti.get_bool(PCN_STSOTTBIL);
|
||||
stsottbil = !pconti.get_bool(PCN_STSOTTBIL);
|
||||
tmcf = pconti.get (PCN_TMCF)[0];
|
||||
indbil = pconti.get_int (PCN_INDBIL);
|
||||
|
||||
@ -1457,7 +1457,7 @@ void CG1600_application::crea_sort_piano_conti_verifica()
|
||||
|
||||
if ((g != 0) && (c != 0) && (s == 0))
|
||||
{
|
||||
stsottbil = pconti.get_bool(PCN_STSOTTBIL);
|
||||
stsottbil = !pconti.get_bool(PCN_STSOTTBIL);
|
||||
tmcf = pconti.get(PCN_TMCF)[0];
|
||||
indbil = pconti.get_int(PCN_INDBIL);
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <xvt.h>
|
||||
#include <stdlib.h>
|
||||
#include <applicat.h>
|
||||
|
||||
#include "cg2.h"
|
||||
|
||||
|
@ -26,11 +26,8 @@
|
||||
#define F_FORNITORE 161
|
||||
#define F_RAGSOCFORNITORE 162
|
||||
#define F_PIVAFORNITORE 164
|
||||
#define F_GRUPPOCLIFO 172
|
||||
#define F_CONTOCLIFO 173
|
||||
#define F_GRUPPORIC 174
|
||||
#define F_CONTORIC 175
|
||||
#define F_SOTTOCONTORIC 176
|
||||
#define F_GRUPPOCLIFO 170
|
||||
#define F_CONTOCLIFO 171
|
||||
#define F_TOTALE 118
|
||||
#define F_CODIVA 119
|
||||
#define F_RITFIS 120
|
||||
|
@ -18,31 +18,6 @@ BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER F_GRUPPOCLIFO 3
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER F_CONTOCLIFO 3
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER F_GRUPPORIC 3
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER F_CONTORIC 3
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER F_SOTTOCONTORIC 6
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 3
|
||||
BEGIN
|
||||
PROMPT 1 0 "@BMovimento IVA"
|
||||
@ -254,14 +229,9 @@ BEGIN
|
||||
OUTPUT F_CLIFO TIPOCF
|
||||
OUTPUT F_CLIENTE CODCF
|
||||
OUTPUT F_RAGSOCCLIENTE RAGSOC
|
||||
OUTPUT F_GRUPPOCLIFO GRUPPO
|
||||
OUTPUT F_CONTOCLIFO CONTO
|
||||
OUTPUT F_GRUPPORIC GRUPPORIC
|
||||
OUTPUT F_CONTORIC CONTORIC
|
||||
OUTPUT F_SOTTOCONTORIC SOTTOCRIC
|
||||
OUTPUT F_CODPAG CODPAG
|
||||
OUTPUT F_STATOPAIV STATOPAIV
|
||||
OUTPUT F_PIVACLIENTE PAIV
|
||||
OUTPUT F_CODPAG CODPAG
|
||||
MESSAGE COPY,F_FORNITORE
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Cliente assente"
|
||||
@ -285,14 +255,9 @@ BEGIN
|
||||
OUTPUT F_CLIFO TIPOCF
|
||||
OUTPUT F_FORNITORE CODCF
|
||||
OUTPUT F_RAGSOCFORNITORE RAGSOC
|
||||
OUTPUT F_GRUPPOCLIFO GRUPPO
|
||||
OUTPUT F_CONTOCLIFO CONTO
|
||||
OUTPUT F_GRUPPORIC GRUPPORIC
|
||||
OUTPUT F_CONTORIC CONTORIC
|
||||
OUTPUT F_SOTTOCONTORIC SOTTOCRIC
|
||||
OUTPUT F_CODPAG CODPAG
|
||||
OUTPUT F_STATOPAIV STATOPAIV
|
||||
OUTPUT F_PIVAFORNITORE PAIV
|
||||
OUTPUT F_CODPAG CODPAG
|
||||
MESSAGE COPY,F_CLIENTE
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Fornitore assente"
|
||||
|
123
cg/cg2102.cpp
123
cg/cg2102.cpp
@ -506,16 +506,21 @@ void TPrimanota_application::generazione_righe_cg(int r)
|
||||
TImporto importo; importo = row;
|
||||
|
||||
if (importo.is_zero())
|
||||
return;
|
||||
return; // Ignora righe senza importo
|
||||
|
||||
const bool causale_ok = causale().codice()[0] > ' ';
|
||||
|
||||
if (r == 0 && cg.row(1).empty_items())
|
||||
{
|
||||
TBill contro(row, 9, 0x3);
|
||||
if (!contro.ok())
|
||||
TBill contro(row, 9, 0x3); // Contropartita della prima riga
|
||||
if (!contro.ok() && causale_ok)
|
||||
{
|
||||
causale().bill(2, contro);
|
||||
contro.add_to(row, 9, 0x3);
|
||||
cg.force_update(r);
|
||||
causale().bill(2, contro); // Prendi contropartita dalla causale
|
||||
if (contro.ok())
|
||||
{
|
||||
contro.add_to(row, 9, 0x3);
|
||||
cg.force_update(r);
|
||||
}
|
||||
}
|
||||
if (contro.ok())
|
||||
{
|
||||
@ -523,17 +528,17 @@ void TPrimanota_application::generazione_righe_cg(int r)
|
||||
set_cgs_row(1, importo, contro, "", ' ');
|
||||
TBill conto(row, 2, 0x3);
|
||||
conto.add_to(cg.row(1), 9, 0x3);
|
||||
cg.force_update(1);
|
||||
cg.force_update(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (causale().codice()[0] > ' ')
|
||||
if (causale_ok)
|
||||
{
|
||||
int first_not_empty = 0;
|
||||
for (int i = 0; i < r; i++)
|
||||
{
|
||||
TImporto im; im = cg.row(i);
|
||||
if (!im.is_zero())
|
||||
{
|
||||
TToken_string& r = cg.row(i);
|
||||
if (r.get(0)[0] > ' ' || r.get()[0] > ' ')
|
||||
{
|
||||
first_not_empty = i;
|
||||
break;
|
||||
@ -541,21 +546,23 @@ void TPrimanota_application::generazione_righe_cg(int r)
|
||||
}
|
||||
|
||||
TBill conto(row, 2, 0x3);
|
||||
if (first_not_empty == r)
|
||||
if (first_not_empty == r) // Sono la prima riga con importo ?
|
||||
{
|
||||
int last = r;
|
||||
for (i = r+1; i < cg.items(); i++)
|
||||
{
|
||||
for (i = r+1; i < cg.items(); i++) // Aggiorna tutte le altre contropartite
|
||||
{
|
||||
TToken_string& rowi = cg.row(i);
|
||||
int gruppo = rowi.get_int(3);
|
||||
if (gruppo != 0)
|
||||
if (gruppo != 0) // Considera righe con conto ...
|
||||
{
|
||||
gruppo = rowi.get_int(10);
|
||||
if (gruppo == 0)
|
||||
{
|
||||
char sez = 'D';
|
||||
if (cg.cell_disabled(i,0)) sez = 'A';
|
||||
if (importo.sezione() != sez)
|
||||
if (gruppo == 0) // ... e senza contropartita
|
||||
{
|
||||
char sez = ' '; // Calcola sezione D/A della riga i
|
||||
if (cg.cell_disabled(i,0)) sez = 'A'; else
|
||||
if (cg.cell_disabled(i,1)) sez = 'D';
|
||||
|
||||
if (sez != ' ' && importo.sezione() != sez) // Considera solo le sezioni opposte
|
||||
{
|
||||
conto.add_to(rowi, 9, 0x3);
|
||||
cg.force_update(i);
|
||||
@ -569,17 +576,32 @@ void TPrimanota_application::generazione_righe_cg(int r)
|
||||
{
|
||||
importo.swap_section();
|
||||
set_cgs_imp(last, importo);
|
||||
|
||||
const int gruppo = row.get_int(10);
|
||||
if (gruppo == 0) // Se non ho contropartita ...
|
||||
{
|
||||
TBill contro(cg.row(last), 2, 0x3); // ... copiala dalla riga corrispondente
|
||||
contro.add_to(row, 9, 0x3);
|
||||
cg.force_update(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TToken_string& rowi = cg.row(first_not_empty);
|
||||
const int gruppo = rowi.get_int(10);
|
||||
if (gruppo == 0)
|
||||
TToken_string& first = cg.row(first_not_empty);
|
||||
int gruppo = first.get_int(10);
|
||||
if (gruppo == 0) // Se la prima riga non ha contropartita ...
|
||||
{
|
||||
conto.add_to(rowi, 9, 0x3);
|
||||
conto.add_to(first, 9, 0x3); // ... copiaci la mia partita
|
||||
cg.force_update(first_not_empty);
|
||||
}
|
||||
}
|
||||
gruppo = row.get_int(10);
|
||||
if (gruppo == 0) // Se non ho contropartita ...
|
||||
{
|
||||
TBill contro(first, 2, 0x3); // ... copiala dalla prima riga
|
||||
contro.add_to(row, 9, 0x3);
|
||||
cg.force_update(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1181,15 +1203,14 @@ bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key)
|
||||
bool TPrimanota_application::datareg_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
TMask& m = f.mask();
|
||||
|
||||
if (key == K_TAB || key == K_ENTER)
|
||||
if ((key == K_TAB && m.is_running()) || key == K_ENTER)
|
||||
{
|
||||
const TDate dr(f.get()); // Data dell'operazione
|
||||
if (dr > TDate(TODAY))
|
||||
return f.error_box("La data dell'operazione e' superiore quella di sistema");
|
||||
|
||||
TMask& m = f.mask();
|
||||
|
||||
const int ae = date2esc(dr); // Anno esercizio
|
||||
if (ae == 0)
|
||||
return f.error_box("La data dell'operazione non appartiene a nessun esercizio");
|
||||
@ -1269,11 +1290,12 @@ bool TPrimanota_application::datareg_handler(TMask_field& f, KEY key)
|
||||
// Certified 90%
|
||||
bool TPrimanota_application::datacomp_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (key == K_TAB || key == K_ENTER)
|
||||
TMask& m = f.mask();
|
||||
|
||||
if ((key == K_TAB && m.is_running()) || key == K_ENTER)
|
||||
{
|
||||
const TDate dc(f.get()); // Data di competenza
|
||||
const int ae = date2esc(dc); // Esercizio corrispondente
|
||||
TMask& m = f.mask();
|
||||
|
||||
const char* data = "del 74/ter";
|
||||
if (f.dlg() == F_DATACOMP)
|
||||
@ -1382,16 +1404,16 @@ void TPrimanota_application::add_cgs_tot(TMask& m)
|
||||
{
|
||||
// Lettura del conto dalla maschera
|
||||
char tipo = app().clifo();
|
||||
int gruppo = m.get_int(F_GRUPPOCLIFO);
|
||||
int conto = m.get_int(F_CONTOCLIFO);
|
||||
long codice = m.get_long(tipo == 'C' ? F_CLIENTE : F_FORNITORE);
|
||||
TBill bill(0, 0, codice, tipo);
|
||||
|
||||
if (conto == 0 || causale().corrispettivi())
|
||||
if (!causale().corrispettivi())
|
||||
bill.find();
|
||||
|
||||
if (bill.conto() == 0)
|
||||
{
|
||||
// Se l'utente non ha ancora specificato un conto lo prendo dalla prima riga della causale
|
||||
TBill bill; causale().bill(1, bill);
|
||||
gruppo = bill.gruppo();
|
||||
conto = bill.conto();
|
||||
causale().bill(1, bill);
|
||||
if (causale().corrispettivi())
|
||||
{
|
||||
tipo = ' ';
|
||||
@ -1399,7 +1421,7 @@ void TPrimanota_application::add_cgs_tot(TMask& m)
|
||||
}
|
||||
}
|
||||
|
||||
TBill nuovo(gruppo, conto, codice, tipo);
|
||||
TBill nuovo(bill.gruppo(), bill.conto(), codice, tipo);
|
||||
|
||||
real tot(m.get(F_TOTALE));
|
||||
|
||||
@ -1434,11 +1456,10 @@ void TPrimanota_application::add_cgs_tot(TMask& m)
|
||||
// Certified 99%
|
||||
bool TPrimanota_application::clifo_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (!suspended_handler(f, key))
|
||||
return FALSE;
|
||||
|
||||
if (key == K_TAB && f.active())
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
|
||||
const char cf = app().clifo();
|
||||
TLocalisamfile& clifo = ((TEdit_field&)f).browse()->cursor()->file();
|
||||
if (clifo.get_char(CLI_TIPOCF) != cf)
|
||||
@ -1446,11 +1467,19 @@ bool TPrimanota_application::clifo_handler(TMask_field& f, KEY key)
|
||||
clifo.put(CLI_TIPOCF, cf);
|
||||
clifo.read();
|
||||
}
|
||||
if (!suspended_handler(f, key))
|
||||
return FALSE;
|
||||
|
||||
const int alleg = clifo.get_int(CLI_ALLEG);
|
||||
TMask& m = f.mask();
|
||||
TEdit_field& upi = m.efield(F_RIEPILOGO);
|
||||
upi.check_type(alleg == 3 ? CHECK_REQUIRED : CHECK_NORMAL);
|
||||
if (!m.is_running() || f.dirty())
|
||||
{
|
||||
app()._conto_ricavo.set(clifo.get_int(CLI_GRUPPORIC),
|
||||
clifo.get_int(CLI_CONTORIC),
|
||||
clifo.get_long(CLI_SOTTOCRIC));
|
||||
|
||||
const int alleg = clifo.get_int(CLI_ALLEG);
|
||||
TEdit_field& upi = m.efield(F_RIEPILOGO);
|
||||
upi.check_type(alleg == 3 ? CHECK_REQUIRED : CHECK_NORMAL);
|
||||
}
|
||||
|
||||
const bool occas = clifo.get_bool(CLI_OCCAS);
|
||||
m.show(F_OCCASEDIT, occas); // Dati anagrfici
|
||||
@ -1494,10 +1523,8 @@ bool TPrimanota_application::IVA2bill(const TCodiceIVA& iva, TBill& bill)
|
||||
if (tipo == "NS") cau.bill(7, bill);
|
||||
}
|
||||
if (!bill.ok() && !cau.corrispettivi())
|
||||
{
|
||||
const TMask& m = curr_mask();
|
||||
bill.set(m.get_int(F_GRUPPORIC), m.get_int(F_CONTORIC), m.get_long(F_SOTTOCONTORIC));
|
||||
}
|
||||
bill = _conto_ricavo;
|
||||
|
||||
if (!bill.ok())
|
||||
cau.bill(2, bill);
|
||||
|
||||
|
@ -55,6 +55,8 @@ class TPrimanota_application : public TRelation_application
|
||||
TMask* _msk[4]; // Maschere di query, cg, iva
|
||||
long _lastreg; // Numero ultima registrazione
|
||||
int _mode; // Modo maschera corrente
|
||||
|
||||
TBill _conto_ricavo; // Conto di ricavo del clifo
|
||||
|
||||
void* _app_data;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "cg3400a.h"
|
||||
|
||||
//PAGE "Stampa Libro Giornale" -1 -1 78 18
|
||||
PAGE "Stampa Libro Giornale" -1 -1 78 17
|
||||
|
||||
GROUPBOX DLG_NULL 78 3
|
||||
@ -89,8 +88,8 @@ RADIOBUTTON DLG_NULL 12
|
||||
BEGIN
|
||||
PROMPT 1 8 ""
|
||||
HELP "Indicare l'intervallo di pagine da stampare"
|
||||
ITEM "1|Tutto" MESSAGE CLEAR,PAGINA_DA|DISABLE, PAGINA_DA
|
||||
ITEM "2|Da pagina " MESSAGE ENABLE, PAGINA_DA
|
||||
ITEM "1|Tutto" MESSAGE CLEAR,PAGINA_DA|DISABLE,PAGINA_DA
|
||||
ITEM "2|Da pagina " MESSAGE ENABLE,PAGINA_DA
|
||||
END
|
||||
|
||||
NUMBER PAGINA_DA 5
|
||||
|
@ -146,13 +146,10 @@ bool TRipristina_stampa::do_restore(long firm, const char * regist,
|
||||
else
|
||||
reg.zero("D3");
|
||||
|
||||
if (giornale)
|
||||
reg.put("I6", last_num); // Aggiorna ultima pagina giornale
|
||||
ok = (reg.rewrite() == NOERR);
|
||||
if (!ok)
|
||||
error_box("Errore nell'aggiornamento del registro %s.\n Errore n. %d",
|
||||
(const char * ) regist, mov.status());
|
||||
|
||||
}
|
||||
else
|
||||
ok = error_box("Impossibile leggere il registro %s anno %s", (const char *) regist, (const char *) year);
|
||||
|
Loading…
x
Reference in New Issue
Block a user