Correzioni varie a nuovo saldaconto (gestione nac e pagamenti con segno inverso)
Aggiunto campo NUMDOCEXT in prima nota git-svn-id: svn://10.65.10.50/branches/R_10_00@22787 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
cb54862461
commit
7e9f0d51c5
@ -117,6 +117,7 @@ BEGIN
|
|||||||
OUTPUT O_DENCOM DENCOM
|
OUTPUT O_DENCOM DENCOM
|
||||||
OUTPUT O_CAP CAPCOM
|
OUTPUT O_CAP CAPCOM
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
|
ADD RUN ba4 -0
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER O_CAP 5
|
NUMBER O_CAP 5
|
||||||
@ -136,6 +137,7 @@ BEGIN
|
|||||||
DISPLAY "Codice@10" COM
|
DISPLAY "Codice@10" COM
|
||||||
COPY OUTPUT O_COMUNE
|
COPY OUTPUT O_COMUNE
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
|
ADD RUN ba4 -0
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 71 4
|
GROUPBOX DLG_NULL 71 4
|
||||||
|
@ -1381,8 +1381,7 @@ int TPrimanota_application::write(const TMask& m)
|
|||||||
causauto = causale().causale_collegata();
|
causauto = causale().causale_collegata();
|
||||||
if (causauto.full())
|
if (causauto.full())
|
||||||
{
|
{
|
||||||
TCausale c(causauto);
|
TCausale c(causauto);
|
||||||
|
|
||||||
if ((!gestione_saldaconto() || c.tipomov() == 0) && c.iva() == nessuna_iva)
|
if ((!gestione_saldaconto() || c.tipomov() == 0) && c.iva() == nessuna_iva)
|
||||||
tipauto = causauto.full() ? 1 : 0;
|
tipauto = causauto.full() ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#define F_ANNOES 115
|
#define F_ANNOES 115
|
||||||
#define F_DATACOMP 116
|
#define F_DATACOMP 116
|
||||||
#define F_ANNOIVA 117
|
#define F_ANNOIVA 117
|
||||||
|
#define F_NUMDOCEXT 130
|
||||||
|
|
||||||
#define F_CLIFO 128
|
#define F_CLIFO 128
|
||||||
#define F_CLIENTE 151
|
#define F_CLIENTE 151
|
||||||
|
@ -47,7 +47,7 @@ END
|
|||||||
|
|
||||||
STRING F_CODCAUS 3
|
STRING F_CODCAUS 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 "Causale "
|
PROMPT 1 4 "Causale "
|
||||||
FLAGS "UZ"
|
FLAGS "UZ"
|
||||||
FIELD CODCAUS
|
FIELD CODCAUS
|
||||||
USE LF_CAUSALI
|
USE LF_CAUSALI
|
||||||
@ -66,7 +66,7 @@ END
|
|||||||
|
|
||||||
STRING F_DESCRCAUS 50
|
STRING F_DESCRCAUS 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 25 5 ""
|
PROMPT 25 4 ""
|
||||||
USE LF_CAUSALI KEY 2
|
USE LF_CAUSALI KEY 2
|
||||||
INPUT DESCR F_DESCRCAUS
|
INPUT DESCR F_DESCRCAUS
|
||||||
DISPLAY "Descrizione@50" DESCR
|
DISPLAY "Descrizione@50" DESCR
|
||||||
@ -77,7 +77,7 @@ END
|
|||||||
|
|
||||||
LIST F_PROVVISORIO 1 24
|
LIST F_PROVVISORIO 1 24
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 6 "Movimento provvisorio "
|
PROMPT 1 5 "Movimento provvisorio "
|
||||||
FIELD PROVVIS
|
FIELD PROVVIS
|
||||||
ITEM " |No (movimento normale)"
|
ITEM " |No (movimento normale)"
|
||||||
ITEM "P|Si (cancellabile)"
|
ITEM "P|Si (cancellabile)"
|
||||||
@ -86,7 +86,7 @@ END
|
|||||||
|
|
||||||
STRING F_TIPODOC 2
|
STRING F_TIPODOC 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 60 6 "Tipo documento "
|
PROMPT 60 5 "Tipo documento "
|
||||||
FIELD TIPODOC
|
FIELD TIPODOC
|
||||||
FLAGS "DG"
|
FLAGS "DG"
|
||||||
MESSAGE COPY,K_TIPODOC
|
MESSAGE COPY,K_TIPODOC
|
||||||
@ -94,7 +94,7 @@ END
|
|||||||
|
|
||||||
DATE F_DATADOC
|
DATE F_DATADOC
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 7 "Data del documento "
|
PROMPT 1 6 "Data del documento "
|
||||||
FIELD DATADOC
|
FIELD DATADOC
|
||||||
WARNING "Specificare una data del documento non superiore a quella dell'operazione"
|
WARNING "Specificare una data del documento non superiore a quella dell'operazione"
|
||||||
VALIDATE DATE_CMP_FUNC <= F_DATAREG
|
VALIDATE DATE_CMP_FUNC <= F_DATAREG
|
||||||
@ -103,7 +103,7 @@ END
|
|||||||
|
|
||||||
STRING F_NUMDOC 7
|
STRING F_NUMDOC 7
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 50 7 "Documento n. "
|
PROMPT 50 6 "Documento n. "
|
||||||
FIELD NUMDOC
|
FIELD NUMDOC
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
WARNING "La causale impone di specificare il numero documento"
|
WARNING "La causale impone di specificare il numero documento"
|
||||||
@ -112,7 +112,13 @@ END
|
|||||||
|
|
||||||
BUTTON F_LINKDOC 3 1
|
BUTTON F_LINKDOC 3 1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 73 7 "Doc."
|
PROMPT 73 6 "Doc."
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_NUMDOCEXT 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 7 "Numero documento esteso "
|
||||||
|
FIELD NUMDOCEXT
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_ANNOIVA 4
|
NUMBER F_ANNOIVA 4
|
||||||
|
1720
cg/cg2100c.uml
1720
cg/cg2100c.uml
File diff suppressed because it is too large
Load Diff
@ -104,6 +104,7 @@ BEGIN
|
|||||||
OUTPUT O_DENCOM DENCOM
|
OUTPUT O_DENCOM DENCOM
|
||||||
OUTPUT O_CAP CAPCOM
|
OUTPUT O_CAP CAPCOM
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
|
ADD RUN ba4 -0
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER O_CAP 5
|
NUMBER O_CAP 5
|
||||||
@ -123,6 +124,7 @@ BEGIN
|
|||||||
DISPLAY "Codice@10" COM
|
DISPLAY "Codice@10" COM
|
||||||
COPY OUTPUT O_COMUNE
|
COPY OUTPUT O_COMUNE
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
|
ADD RUN ba4 -0
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 70 4
|
GROUPBOX DLG_NULL 70 4
|
||||||
|
@ -196,13 +196,18 @@ int TMovimentoPN::registra(bool re, bool force)
|
|||||||
const TRectype& m = curr();
|
const TRectype& m = curr();
|
||||||
long numreg = m.get_long(MOV_NUMREG);
|
long numreg = m.get_long(MOV_NUMREG);
|
||||||
|
|
||||||
if (!re && numreg <= 0) // Tento di numerare automaticamente in caso di write
|
if (numreg <= 0)
|
||||||
{
|
{
|
||||||
TLocalisamfile mov(LF_MOV); // Non sposto il file principale della relazione!
|
if (!re) // Tento di numerare automaticamente in caso di write
|
||||||
numreg = 1;
|
{
|
||||||
if (mov.last() == NOERR)
|
TLocalisamfile mov(LF_MOV); // Non sposto il file principale della relazione!
|
||||||
numreg += mov.get_long(MOV_NUMREG);
|
numreg = 1;
|
||||||
curr().put(MOV_NUMREG, numreg);
|
if (mov.last() == NOERR)
|
||||||
|
numreg += mov.get_long(MOV_NUMREG);
|
||||||
|
curr().put(MOV_NUMREG, numreg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return _isnocurkey;
|
||||||
}
|
}
|
||||||
|
|
||||||
int err = re ? TRelation::rewrite(force) : TRelation::write(force);
|
int err = re ? TRelation::rewrite(force) : TRelation::write(force);
|
||||||
@ -235,15 +240,12 @@ int TMovimentoPN::registra(bool re, bool force)
|
|||||||
r.put(RMI_TIPOATT, tipoatt);
|
r.put(RMI_TIPOATT, tipoatt);
|
||||||
|
|
||||||
const TString & indetr = r.get(RMI_TIPODET);
|
const TString & indetr = r.get(RMI_TIPODET);
|
||||||
|
|
||||||
if (indetr.full())
|
if (indetr.full())
|
||||||
{
|
{
|
||||||
const TRectype & det = cache().get("%DET", indetr);
|
const TRectype& det = cache().get("%DET", indetr);
|
||||||
|
|
||||||
if (!det.empty() && !det.get_bool("FPC"))
|
if (!det.empty() && !det.get_bool("FPC"))
|
||||||
{
|
{
|
||||||
TTable tab("%DET");
|
TTable tab("%DET");
|
||||||
|
|
||||||
tab.curr() = det;
|
tab.curr() = det;
|
||||||
tab.curr().put("FPC", "X");
|
tab.curr().put("FPC", "X");
|
||||||
tab.rewrite();
|
tab.rewrite();
|
||||||
@ -256,7 +258,6 @@ int TMovimentoPN::registra(bool re, bool force)
|
|||||||
if (err != NOERR)
|
if (err != NOERR)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|
||||||
// Aggiorna data registrazione e protocollo IVA sul registro
|
// Aggiorna data registrazione e protocollo IVA sul registro
|
||||||
const TDate datareg(m.get(MOV_DATAREG));
|
const TDate datareg(m.get(MOV_DATAREG));
|
||||||
if (reg.not_empty())
|
if (reg.not_empty())
|
||||||
|
@ -585,7 +585,7 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
|
|||||||
TPrimanota_application& a = app();
|
TPrimanota_application& a = app();
|
||||||
const TCurrency saldo(a.calcola_saldo());
|
const TCurrency saldo(a.calcola_saldo());
|
||||||
|
|
||||||
if (!saldo.get_num().is_zero())
|
if (!saldo.is_zero())
|
||||||
{
|
{
|
||||||
const char* ss = saldo.string(true);
|
const char* ss = saldo.string(true);
|
||||||
if (*ss == '-') ss++;
|
if (*ss == '-') ss++;
|
||||||
|
660
cg/cg2102.h
660
cg/cg2102.h
@ -1,331 +1,331 @@
|
|||||||
#ifndef __CG2102_H
|
#ifndef __CG2102_H
|
||||||
#define __CG2102_H
|
#define __CG2102_H
|
||||||
|
|
||||||
#ifndef __RELAPP_H
|
#ifndef __RELAPP_H
|
||||||
#include <relapp.h>
|
#include <relapp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CGPAGAME_H
|
#ifndef __CGPAGAME_H
|
||||||
#include "cgpagame.h"
|
#include "cgpagame.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CGSALDAC_H
|
#ifndef __CGSALDAC_H
|
||||||
#include "cgsaldac.h"
|
#include "cgsaldac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CGLIB02_H
|
#ifndef __CGLIB02_H
|
||||||
#include "cglib02.h"
|
#include "cglib02.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CG2101_H
|
#ifndef __CG2101_H
|
||||||
#include "cg2101.h"
|
#include "cg2101.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class TDati_mov_auto;
|
class TDati_mov_auto;
|
||||||
|
|
||||||
class TPrimanota_application : public TRelation_application
|
class TPrimanota_application : public TRelation_application
|
||||||
{
|
{
|
||||||
TMovimentoPN* _rel; // Relazione principale
|
TMovimentoPN* _rel; // Relazione principale
|
||||||
|
|
||||||
TPagamento* _pag;
|
TPagamento* _pag;
|
||||||
|
|
||||||
bool _ges_val, _ges_sal; // Gestione valuta e saldaconto
|
bool _ges_val, _ges_sal; // Gestione valuta e saldaconto
|
||||||
bool _num_cli, _num_for; // Riferimento partita allineato a destra
|
bool _num_cli, _num_for; // Riferimento partita allineato a destra
|
||||||
bool _liqdiff; // Liquidazione differita
|
bool _liqdiff; // Liquidazione differita
|
||||||
bool _npart_is_prot; // Riferimento partita = n. prot. IVA anziche' doc
|
bool _npart_is_prot; // Riferimento partita = n. prot. IVA anziche' doc
|
||||||
|
|
||||||
bool _skip_giornale_check; // Ignora controllo data stampa libro giornale
|
bool _skip_giornale_check; // Ignora controllo data stampa libro giornale
|
||||||
bool _skip_bollato_check; // Ignora controllo data stampa bollato
|
bool _skip_bollato_check; // Ignora controllo data stampa bollato
|
||||||
|
|
||||||
bool _savenew; // Registra e nuovo
|
bool _savenew; // Registra e nuovo
|
||||||
short _firstfocus; // Primo campo della maschera a prendere il focus
|
short _firstfocus; // Primo campo della maschera a prendere il focus
|
||||||
|
|
||||||
bool _sheet_shown; // Lo sheet e' gia' stato visualizzato una volta?
|
bool _sheet_shown; // Lo sheet e' gia' stato visualizzato una volta?
|
||||||
bool _swap_mask;
|
bool _swap_mask;
|
||||||
|
|
||||||
bool _is_saldaconto; // saldaconto si/no (vede parametri e causale)
|
bool _is_saldaconto; // saldaconto si/no (vede parametri e causale)
|
||||||
bool _scad_free; // posso variare liberamente le rate della fattura
|
bool _scad_free; // posso variare liberamente le rate della fattura
|
||||||
bool _easy_sal; // Nuovo saldaconto semplificato
|
bool _easy_sal; // Nuovo saldaconto semplificato
|
||||||
bool _quadratura; // Bottone quadratura automatica per ATS
|
bool _quadratura; // Bottone quadratura automatica per ATS
|
||||||
|
|
||||||
TString _perc_attesa_fld; // Percentuale del fornitore/cliente
|
TString _perc_attesa_fld; // Percentuale del fornitore/cliente
|
||||||
|
|
||||||
TSaldo_agg _saldi; // Saldi da aggiornare
|
TSaldo_agg _saldi; // Saldi da aggiornare
|
||||||
TPartite_array _partite; // Partite coinvolte
|
TPartite_array _partite; // Partite coinvolte
|
||||||
|
|
||||||
TMask* _msk[4]; // Maschere di query, cg, iva, occasionali
|
TMask* _msk[4]; // Maschere di query, cg, iva, occasionali
|
||||||
int _mode; // Modo maschera corrente
|
int _mode; // Modo maschera corrente
|
||||||
bool _as400; // Movimento trasferito da as400?
|
bool _as400; // Movimento trasferito da as400?
|
||||||
bool _sal_dirty; // Il saldaconto e' stato "toccato"?
|
bool _sal_dirty; // Il saldaconto e' stato "toccato"?
|
||||||
|
|
||||||
TipoIVA _iva; // Tipo di IVA corrente
|
TipoIVA _iva; // Tipo di IVA corrente
|
||||||
TCausale* _causale; // Causale corrente
|
TCausale* _causale; // Causale corrente
|
||||||
TLibro_giornale* _giornale; // Libro giornale corrente
|
TLibro_giornale* _giornale; // Libro giornale corrente
|
||||||
long _lastreg; // Numero ultima registrazione
|
long _lastreg; // Numero ultima registrazione
|
||||||
|
|
||||||
TDate _last_dreg; // Ultima data registrazione inserita
|
TDate _last_dreg; // Ultima data registrazione inserita
|
||||||
TDate _last_dcom; // Ultima data competenza inserita
|
TDate _last_dcom; // Ultima data competenza inserita
|
||||||
|
|
||||||
TDati_mov_auto* _automatico;// Dati per gestire incasso immediato
|
TDati_mov_auto* _automatico;// Dati per gestire incasso immediato
|
||||||
|
|
||||||
TBill _conto_ricavo; // Conto di ricavo del clifo
|
TBill _conto_ricavo; // Conto di ricavo del clifo
|
||||||
|
|
||||||
TToken_string _tmp; // Stringa temporanea da ritornare
|
TToken_string _tmp; // Stringa temporanea da ritornare
|
||||||
TString_array _pag_rows; // Copia dello sheet delle rate
|
TString_array _pag_rows; // Copia dello sheet delle rate
|
||||||
|
|
||||||
TEsercizi_contabili _esercizi; // Tabella degli esercizi contabili
|
TEsercizi_contabili _esercizi; // Tabella degli esercizi contabili
|
||||||
|
|
||||||
TAssoc_array _colori; // Colori delle righe
|
TAssoc_array _colori; // Colori delle righe
|
||||||
|
|
||||||
static bool showpartite_handler(TMask_field& f, KEY k);
|
static bool showpartite_handler(TMask_field& f, KEY k);
|
||||||
static bool speserimb_handler(TMask_field& f, KEY k);
|
static bool speserimb_handler(TMask_field& f, KEY k);
|
||||||
static bool altrespese_handler(TMask_field& f, KEY k);
|
static bool altrespese_handler(TMask_field& f, KEY k);
|
||||||
static bool abbatt_handler(TMask_field& f, KEY k);
|
static bool abbatt_handler(TMask_field& f, KEY k);
|
||||||
static bool abbpass_handler(TMask_field& f, KEY k);
|
static bool abbpass_handler(TMask_field& f, KEY k);
|
||||||
static bool ritprof_handler(TMask_field& f, KEY k);
|
static bool ritprof_handler(TMask_field& f, KEY k);
|
||||||
static bool diffcamb_handler(TMask_field& f, KEY k);
|
static bool diffcamb_handler(TMask_field& f, KEY k);
|
||||||
static bool suspended_handler(TMask_field& f, KEY k);
|
static bool suspended_handler(TMask_field& f, KEY k);
|
||||||
static bool num_handler(TMask_field& f, KEY key);
|
static bool num_handler(TMask_field& f, KEY key);
|
||||||
static bool caus_query_handler(TMask_field& f, KEY key);
|
static bool caus_query_handler(TMask_field& f, KEY key);
|
||||||
static bool caus_modify_handler(TMask_field& f, KEY key);
|
static bool caus_modify_handler(TMask_field& f, KEY key);
|
||||||
static bool datareg_handler(TMask_field& f, KEY key);
|
static bool datareg_handler(TMask_field& f, KEY key);
|
||||||
static bool datacomp_handler(TMask_field& f, KEY key);
|
static bool datacomp_handler(TMask_field& f, KEY key);
|
||||||
static bool data74ter_handler(TMask_field& f, KEY key);
|
static bool data74ter_handler(TMask_field& f, KEY key);
|
||||||
static bool datadoc_handler(TMask_field& f, KEY key);
|
static bool datadoc_handler(TMask_field& f, KEY key);
|
||||||
static bool numdoc_handler(TMask_field& f, KEY key);
|
static bool numdoc_handler(TMask_field& f, KEY key);
|
||||||
static bool annorif_handler(TMask_field& f, KEY key);
|
static bool annorif_handler(TMask_field& f, KEY key);
|
||||||
static bool numrif_handler(TMask_field& f, KEY key);
|
static bool numrif_handler(TMask_field& f, KEY key);
|
||||||
static bool protiva_handler(TMask_field& f, KEY key);
|
static bool protiva_handler(TMask_field& f, KEY key);
|
||||||
static bool clifo_handler(TMask_field& f, KEY key);
|
static bool clifo_handler(TMask_field& f, KEY key);
|
||||||
static bool totdoc_handler(TMask_field& f, KEY key);
|
static bool totdoc_handler(TMask_field& f, KEY key);
|
||||||
static bool totdocval_handler(TMask_field& f, KEY key);
|
static bool totdocval_handler(TMask_field& f, KEY key);
|
||||||
static bool ritfis_handler(TMask_field& f, KEY key);
|
static bool ritfis_handler(TMask_field& f, KEY key);
|
||||||
static bool ritsoc_handler(TMask_field& f, KEY key);
|
static bool ritsoc_handler(TMask_field& f, KEY key);
|
||||||
static bool main_codiva_handler(TMask_field& f, KEY key);
|
static bool main_codiva_handler(TMask_field& f, KEY key);
|
||||||
static bool liqdiff_handler(TMask_field& f, KEY key);
|
static bool liqdiff_handler(TMask_field& f, KEY key);
|
||||||
static bool ivaxcassa_handler(TMask_field& f, KEY key);
|
static bool ivaxcassa_handler(TMask_field& f, KEY key);
|
||||||
static bool dataintra_handler(TMask_field& f, KEY key);
|
static bool dataintra_handler(TMask_field& f, KEY key);
|
||||||
static bool corrlire_handler(TMask_field& f, KEY key);
|
static bool corrlire_handler(TMask_field& f, KEY key);
|
||||||
static bool corrvaluta_handler(TMask_field& f, KEY key);
|
static bool corrvaluta_handler(TMask_field& f, KEY key);
|
||||||
static bool occas_code_handler(TMask_field& f, KEY key);
|
static bool occas_code_handler(TMask_field& f, KEY key);
|
||||||
static bool occas_cfpi_handler(TMask_field& f, KEY key);
|
static bool occas_cfpi_handler(TMask_field& f, KEY key);
|
||||||
static bool occas_handler(TMask_field& f, KEY key);
|
static bool occas_handler(TMask_field& f, KEY key);
|
||||||
static bool solaiva_handler(TMask_field& f, KEY key);
|
static bool solaiva_handler(TMask_field& f, KEY key);
|
||||||
static bool descr_handler(TMask_field& f, KEY k);
|
static bool descr_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
static bool sheet_clifo_handler(TMask_field& f, KEY k);
|
static bool sheet_clifo_handler(TMask_field& f, KEY k);
|
||||||
static bool sheet_mastrino_handler(TMask_field& f, KEY k);
|
static bool sheet_mastrino_handler(TMask_field& f, KEY k);
|
||||||
static bool sheet_rateo_handler(TMask_field& f, KEY k);
|
static bool sheet_rateo_handler(TMask_field& f, KEY k);
|
||||||
static bool sheet_risconto_handler(TMask_field& f, KEY k);
|
static bool sheet_risconto_handler(TMask_field& f, KEY k);
|
||||||
static bool iva_sottoconto_handler(TMask_field& f, KEY k);
|
static bool iva_sottoconto_handler(TMask_field& f, KEY k);
|
||||||
static bool imponibile_handler(TMask_field& f, KEY key);
|
static bool imponibile_handler(TMask_field& f, KEY key);
|
||||||
static bool detrazione_handler(TMask_field& f, KEY key);
|
static bool detrazione_handler(TMask_field& f, KEY key);
|
||||||
static bool codiva_handler(TMask_field& f, KEY key);
|
static bool codiva_handler(TMask_field& f, KEY key);
|
||||||
static bool imposta_handler(TMask_field& f, KEY key);
|
static bool imposta_handler(TMask_field& f, KEY key);
|
||||||
static bool dareavere_handler(TMask_field& f, KEY k);
|
static bool dareavere_handler(TMask_field& f, KEY k);
|
||||||
static bool fase_handler(TMask_field& f, KEY key);
|
static bool fase_handler(TMask_field& f, KEY key);
|
||||||
static bool cg_tipo_handler(TMask_field& f, KEY key);
|
static bool cg_tipo_handler(TMask_field& f, KEY key);
|
||||||
static bool cg_gruppo_handler(TMask_field& f, KEY key);
|
static bool cg_gruppo_handler(TMask_field& f, KEY key);
|
||||||
static bool cg_conto_handler(TMask_field& f, KEY key);
|
static bool cg_conto_handler(TMask_field& f, KEY key);
|
||||||
static bool cg_sottoconto_handler(TMask_field& f, KEY key);
|
static bool cg_sottoconto_handler(TMask_field& f, KEY key);
|
||||||
|
|
||||||
static bool codpag_handler(TMask_field& f, KEY key);
|
static bool codpag_handler(TMask_field& f, KEY key);
|
||||||
static bool valuta_handler(TMask_field& f, KEY key);
|
static bool valuta_handler(TMask_field& f, KEY key);
|
||||||
static bool datacambio_handler(TMask_field& f, KEY key);
|
static bool datacambio_handler(TMask_field& f, KEY key);
|
||||||
static bool cambio_handler(TMask_field& f, KEY key);
|
static bool cambio_handler(TMask_field& f, KEY key);
|
||||||
static bool reset_handler(TMask_field& f, KEY key);
|
static bool reset_handler(TMask_field& f, KEY key);
|
||||||
static bool nrate_handler(TMask_field& f, KEY key);
|
static bool nrate_handler(TMask_field& f, KEY key);
|
||||||
static bool recalc_handler(TMask_field& f, KEY key);
|
static bool recalc_handler(TMask_field& f, KEY key);
|
||||||
static bool codcab_handler(TMask_field& f, KEY key);
|
static bool codcab_handler(TMask_field& f, KEY key);
|
||||||
static bool tipopag_handler(TMask_field& f, KEY key);
|
static bool tipopag_handler(TMask_field& f, KEY key);
|
||||||
static bool linkdoc_handler(TMask_field& f, KEY k);
|
static bool linkdoc_handler(TMask_field& f, KEY k);
|
||||||
static bool mastrino_handler(TMask_field& f, KEY k);
|
static bool mastrino_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
static bool rataeur_handler(TMask_field& f, KEY key);
|
static bool rataeur_handler(TMask_field& f, KEY key);
|
||||||
static bool rataval_handler(TMask_field& f, KEY key);
|
static bool rataval_handler(TMask_field& f, KEY key);
|
||||||
|
|
||||||
static bool iva_handler(TMask_field& f, KEY key);
|
static bool iva_handler(TMask_field& f, KEY key);
|
||||||
static bool cg_handler(TMask_field& f, KEY key);
|
static bool cg_handler(TMask_field& f, KEY key);
|
||||||
|
|
||||||
static bool pag_notify(TSheet_field& s, int r, KEY key);
|
static bool pag_notify(TSheet_field& s, int r, KEY key);
|
||||||
static bool pag_sheet_handler(TMask_field& f, KEY key);
|
static bool pag_sheet_handler(TMask_field& f, KEY key);
|
||||||
static bool colors_handler(TMask_field& f, KEY k);
|
static bool colors_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
static bool quadratura_handler(TMask_field& f, KEY k); // Bottone quadratura per ATS
|
static bool quadratura_handler(TMask_field& f, KEY k); // Bottone quadratura per ATS
|
||||||
|
|
||||||
void reset_sheet_row(TSheet_field& s, int n);
|
void reset_sheet_row(TSheet_field& s, int n);
|
||||||
int crea_somma_spese(TImporto& imp);
|
int crea_somma_spese(TImporto& imp);
|
||||||
void update_saldo_riga(int r);
|
void update_saldo_riga(int r);
|
||||||
void link_mastrino(const TBill& bill) const;
|
void link_mastrino(const TBill& bill) const;
|
||||||
|
|
||||||
protected: // TApplication
|
protected: // TApplication
|
||||||
virtual void on_firm_change();
|
virtual void on_firm_change();
|
||||||
virtual void on_config_change();
|
virtual void on_config_change();
|
||||||
virtual void print();
|
virtual void print();
|
||||||
void dump_rec(TConfig & ini, const TRectype & rec, int row = 0, int pref = 0);
|
void dump_rec(TConfig & ini, const TRectype & rec, int row = 0, int pref = 0);
|
||||||
void dump_fatt(TConfig& ini, TPartita & game, int rigafatt, int pref = 0);
|
void dump_fatt(TConfig& ini, TPartita & game, int rigafatt, int pref = 0);
|
||||||
virtual void ini2mask(TConfig& ini, TMask& msk, bool query);
|
virtual void ini2mask(TConfig& ini, TMask& msk, bool query);
|
||||||
virtual void mask2ini(const TMask& msk, TConfig& ini);
|
virtual void mask2ini(const TMask& msk, TConfig& ini);
|
||||||
virtual bool save(bool check_dirty);
|
virtual bool save(bool check_dirty);
|
||||||
|
|
||||||
bool get_mask_swap_file(TFilename& name) const;
|
bool get_mask_swap_file(TFilename& name) const;
|
||||||
bool force_mask_swap(const TCausale& old_caus, const TCausale& new_caus);
|
bool force_mask_swap(const TCausale& old_caus, const TCausale& new_caus);
|
||||||
|
|
||||||
protected: // TRelation_application
|
protected: // TRelation_application
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
virtual bool changing_mask(int mode);
|
virtual bool changing_mask(int mode);
|
||||||
virtual TMask* get_mask(int mode);
|
virtual TMask* get_mask(int mode);
|
||||||
virtual TRelation* get_relation() const { return _rel; }
|
virtual TRelation* get_relation() const { return _rel; }
|
||||||
virtual void init_query_mode(TMask& m);
|
virtual void init_query_mode(TMask& m);
|
||||||
virtual void init_insert_mode(TMask& m);
|
virtual void init_insert_mode(TMask& m);
|
||||||
virtual void init_modify_mode(TMask& m);
|
virtual void init_modify_mode(TMask& m);
|
||||||
virtual bool save_and_new() const;
|
virtual bool save_and_new() const;
|
||||||
virtual bool save_and_quit() const;
|
virtual bool save_and_quit() const;
|
||||||
virtual bool is_transaction() const;
|
virtual bool is_transaction() const;
|
||||||
virtual bool get_next_key(TToken_string& key);
|
virtual bool get_next_key(TToken_string& key);
|
||||||
virtual int read(TMask& m);
|
virtual int read(TMask& m);
|
||||||
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) {}
|
virtual void write_enable(bool) {}
|
||||||
virtual bool protected_record(TRectype& rec);
|
virtual bool protected_record(TRectype& rec);
|
||||||
virtual bool can_I_write(const TRelation* rel) const;
|
virtual bool can_I_write(const TRelation* rel) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void check_saldi();
|
void check_saldi();
|
||||||
void genera_automatico(int tipo, const char* causimm); // 0=nessuno, 1=incasso, 2=regolarizzazione
|
void genera_automatico(int tipo, const char* causimm); // 0=nessuno, 1=incasso, 2=regolarizzazione
|
||||||
void gioca_cambi(int force = 0x00);
|
void gioca_cambi(int force = 0x00);
|
||||||
|
|
||||||
TMask* load_mask(int n);
|
TMask* load_mask(int n);
|
||||||
TMask& occas_mask() { return *load_mask(3); }
|
TMask& occas_mask() { return *load_mask(3); }
|
||||||
|
|
||||||
void mask2rel(const TMask& m);
|
void mask2rel(const TMask& m);
|
||||||
|
|
||||||
TipoIVA iva() const { return _iva; }
|
TipoIVA iva() const { return _iva; }
|
||||||
char clifo() const { return iva() == iva_vendite ? 'C' : 'F'; }
|
char clifo() const { return iva() == iva_vendite ? 'C' : 'F'; }
|
||||||
bool gestione_valuta() const { return _ges_val; }
|
bool gestione_valuta() const { return _ges_val; }
|
||||||
bool gestione_saldaconto() const { return _ges_sal; }
|
bool gestione_saldaconto() const { return _ges_sal; }
|
||||||
bool npart_is_prot() const { return _npart_is_prot; }
|
bool npart_is_prot() const { return _npart_is_prot; }
|
||||||
|
|
||||||
bool is_saldaconto() const { return _is_saldaconto; }
|
bool is_saldaconto() const { return _is_saldaconto; }
|
||||||
bool is_fattura() const { return is_saldaconto() && causale().tipomov() == 1; }
|
bool is_fattura() const { return is_saldaconto() && causale().tipomov() == 1; }
|
||||||
bool is_nota_credito() const { return is_saldaconto() && causale().tipomov() == 2; }
|
bool is_nota_credito() const { return is_saldaconto() && causale().tipomov() == 2; }
|
||||||
bool is_pagamento() const { return is_saldaconto() && causale().tipomov() >= 3; }
|
bool is_pagamento() const { return is_saldaconto() && causale().tipomov() >= 3; }
|
||||||
bool activate_numrif(TMask& m, bool set_pag);
|
bool activate_numrif(TMask& m, bool set_pag);
|
||||||
|
|
||||||
void fill_sheet(TMask& m) const;
|
void fill_sheet(TMask& m) const;
|
||||||
void init_mask(TMask& m);
|
void init_mask(TMask& m);
|
||||||
|
|
||||||
static TipoIVA reg2IVA(const char* registro, int anno);
|
static TipoIVA reg2IVA(const char* registro, int anno);
|
||||||
static const real& cod2IVA(const TMask& m);
|
static const real& cod2IVA(const TMask& m);
|
||||||
static real scorpora(real& imponibile, const real& percentuale);
|
static real scorpora(real& imponibile, const real& percentuale);
|
||||||
static int get_importi_iva(const TToken_string& row, real& imp_det, real& iva_det, real& imp_ind, real& iva_ind);
|
static int get_importi_iva(const TToken_string& row, real& imp_det, real& iva_det, real& imp_ind, real& iva_ind);
|
||||||
static int bill2pos(const TBill& conto, char tipo);
|
static int bill2pos(const TBill& conto, char tipo);
|
||||||
|
|
||||||
TipoIVA cau2IVA(const char* causale, int anno);
|
TipoIVA cau2IVA(const char* causale, int anno);
|
||||||
bool IVA2bill(const TCodiceIVA& iva, TBill& bill);
|
bool IVA2bill(const TCodiceIVA& iva, TBill& bill);
|
||||||
int bill2contr(const TBill& c, char sezione) const;
|
int bill2contr(const TBill& c, char sezione) const;
|
||||||
int bill_used(const TBill& conto) const;
|
int bill_used(const TBill& conto) const;
|
||||||
TBill& ivas_bill(TBill& tc);
|
TBill& ivas_bill(TBill& tc);
|
||||||
|
|
||||||
void load_colors();
|
void load_colors();
|
||||||
void save_colors();
|
void save_colors();
|
||||||
COLOR type2color(char tipor, char tipoc);
|
COLOR type2color(char tipor, char tipoc);
|
||||||
void set_type_color(char tipor, char tipoc, COLOR col);
|
void set_type_color(char tipor, char tipoc, COLOR col);
|
||||||
void set_colors();
|
void set_colors();
|
||||||
|
|
||||||
bool read_caus(const char* cod, int year);
|
bool read_caus(const char* cod, int year);
|
||||||
TLibro_giornale& giornale() { return *_giornale; }
|
TLibro_giornale& giornale() { return *_giornale; }
|
||||||
|
|
||||||
bool test_swap(bool ritsoc);
|
bool test_swap(bool ritsoc);
|
||||||
TImporto real2imp(const real& r, char tipo);
|
TImporto real2imp(const real& r, char tipo);
|
||||||
real totale_documento();
|
real totale_documento();
|
||||||
|
|
||||||
void ivas_pack();
|
void ivas_pack();
|
||||||
void cgs_pack();
|
void cgs_pack();
|
||||||
bool ci_sono_importi(const TSheet_field& cgs) const;
|
bool ci_sono_importi(const TSheet_field& cgs) const;
|
||||||
real calcola_saldo() const;
|
real calcola_saldo() const;
|
||||||
real calcola_imp() const;
|
real calcola_imp() const;
|
||||||
|
|
||||||
void add_cgs_tot(TMask& m);
|
void add_cgs_tot(TMask& m);
|
||||||
int set_cgs_row(int n, const TImporto& importo, TBill& conto, const char* desc, char tipo,
|
int set_cgs_row(int n, const TImporto& importo, TBill& conto, const char* desc, char tipo,
|
||||||
const char* cms = NULL, const char* fas = NULL);
|
const char* cms = NULL, const char* fas = NULL);
|
||||||
void set_cgs_imp(int n, const TImporto& importo);
|
void set_cgs_imp(int n, const TImporto& importo);
|
||||||
bool add_cgs_imp(int n, const TImporto& importo);
|
bool add_cgs_imp(int n, const TImporto& importo);
|
||||||
bool sub_cgs_imp(int n, const TImporto& importo);
|
bool sub_cgs_imp(int n, const TImporto& importo);
|
||||||
void disable_cgs_cells(int n, char tipo);
|
void disable_cgs_cells(int n, char tipo);
|
||||||
|
|
||||||
void add_cup_or_cig(short id, const TRectype& rec, TToken_string& riga) const;
|
void add_cup_or_cig(short id, const TRectype& rec, TToken_string& riga) const;
|
||||||
void add_cup_or_cig(short id, TConfig& ini, TToken_string& riga) const;
|
void add_cup_or_cig(short id, TConfig& ini, TToken_string& riga) const;
|
||||||
|
|
||||||
void add_cgs_rit(bool fisc);
|
void add_cgs_rit(bool fisc);
|
||||||
void generazione_righe_cg(int r);
|
void generazione_righe_cg(int r);
|
||||||
|
|
||||||
void reset_cgs_row(int n) { reset_sheet_row(cgs(), n); }
|
void reset_cgs_row(int n) { reset_sheet_row(cgs(), n); }
|
||||||
void reset_ivas_row(int n) { reset_sheet_row(ivas(), n); }
|
void reset_ivas_row(int n) { reset_sheet_row(ivas(), n); }
|
||||||
|
|
||||||
TPagamento& pagamento() const;
|
TPagamento& pagamento() const;
|
||||||
|
|
||||||
void set_pagamento(const char* c, const char* d);
|
void set_pagamento(const char* c, const char* d);
|
||||||
void set_totale_pagamento(bool update);
|
void set_totale_pagamento(bool update);
|
||||||
void reset_pagamento();
|
void reset_pagamento();
|
||||||
void set_scadenze(TMask& m);
|
void set_scadenze(TMask& m);
|
||||||
void set_banche(TMask& m);
|
void set_banche(TMask& m);
|
||||||
bool read_scadenze(TMask& m);
|
bool read_scadenze(TMask& m);
|
||||||
void write_scadenze(const TMask& m);
|
void write_scadenze(const TMask& m);
|
||||||
void remove_scadenze(const TMask& m, const char* rif);
|
void remove_scadenze(const TMask& m, const char* rif);
|
||||||
void renumber_partita(TMask& m, const char* oldp, const char* newp);
|
void renumber_partita(TMask& m, const char* oldp, const char* newp);
|
||||||
void recalc_scadenze(const TDate& d);
|
void recalc_scadenze(const TDate& d);
|
||||||
|
|
||||||
#ifdef PRORATA100
|
#ifdef PRORATA100
|
||||||
static bool prorata_handler(TMask_field& f, KEY k);
|
static bool prorata_handler(TMask_field& f, KEY k);
|
||||||
bool test_prorata();
|
bool test_prorata();
|
||||||
bool aggiusta_prorata();
|
bool aggiusta_prorata();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int cerca_conto_cf(TBill& bill) const;
|
int cerca_conto_cf(TBill& bill) const;
|
||||||
|
|
||||||
bool edit_partite(const TMask& m, int riga);
|
bool edit_partite(const TMask& m, int riga);
|
||||||
bool crea_partita(const TBill& bill, int anno, const TString& numero, int numrig, const TImporto& importo);
|
bool crea_partita(const TBill& bill, int anno, const TString& numero, int numrig, const TImporto& importo);
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
bool is_percipient(long forn, char& tipper, long& codper) const;
|
bool is_percipient(long forn, char& tipper, long& codper) const;
|
||||||
long calcola_m770(int tipo_coll, real& spese, real& compenso, real& iva, real& ritfis);
|
long calcola_m770(int tipo_coll, real& spese, real& compenso, real& iva, real& ritfis);
|
||||||
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);
|
bool link_anal(const TMask& msk, const char* action);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static int type2pos(char tipo);
|
static int type2pos(char tipo);
|
||||||
static char row_type(const TToken_string& s);
|
static char row_type(const TToken_string& s);
|
||||||
static bool iva_notify(TSheet_field& s, int r, KEY key);
|
static bool iva_notify(TSheet_field& s, int r, KEY key);
|
||||||
static bool cg_notify(TSheet_field& s, int r, KEY key);
|
static bool cg_notify(TSheet_field& s, int r, KEY key);
|
||||||
|
|
||||||
void type2colors(char tipor, COLOR& back, COLOR& fore);
|
void type2colors(char tipor, COLOR& back, COLOR& fore);
|
||||||
void set_type_colors(char tipor, COLOR back, COLOR fore);
|
void set_type_colors(char tipor, COLOR back, COLOR fore);
|
||||||
void reset_colors();
|
void reset_colors();
|
||||||
|
|
||||||
TCausale& causale() const { return *_causale; }
|
TCausale& causale() const { return *_causale; }
|
||||||
TPartite_array& partite() { return _partite; } // Partite editate
|
TPartite_array& partite() { return _partite; } // Partite editate
|
||||||
bool edit_pagamento(TPartita& p, int nriga, int nrata, int nrigp);
|
bool edit_pagamento(TPartita& p, int nriga, int nrata, int nrigp);
|
||||||
bool notify_edit_pagamento(TPartita& partita, TRectype& new_pag,
|
bool notify_edit_pagamento(TPartita& partita, TRectype& new_pag,
|
||||||
const TValuta& valuta, int deleting = 0);
|
const TValuta& valuta, int deleting = 0);
|
||||||
|
|
||||||
TSheet_field& cgs() const;
|
TSheet_field& cgs() const;
|
||||||
TSheet_field& ivas() const;
|
TSheet_field& ivas() const;
|
||||||
TSheet_field& pags() const;
|
TSheet_field& pags() const;
|
||||||
TString_array& pag_rows() { return _pag_rows; }
|
TString_array& pag_rows() { return _pag_rows; }
|
||||||
TImporto get_cgs_imp(int n) const;
|
TImporto get_cgs_imp(int n) const;
|
||||||
|
|
||||||
TPrimanota_application();
|
TPrimanota_application();
|
||||||
virtual ~TPrimanota_application() { }
|
virtual ~TPrimanota_application() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
inline TPrimanota_application& app()
|
inline TPrimanota_application& app()
|
||||||
{ return (TPrimanota_application&)main_app(); }
|
{ return (TPrimanota_application&)main_app(); }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -187,12 +187,8 @@ void TEasySolder_mask::save_sheet()
|
|||||||
}
|
}
|
||||||
|
|
||||||
TRectype newpag = partita.pagamento(rigaf, nrata, nrigp);
|
TRectype newpag = partita.pagamento(rigaf, nrata, nrigp);
|
||||||
TBill conto_banca; conto_banca.get(*this, G_GRUPPOC, G_CONTOC, G_SOTTOCONTOC);
|
|
||||||
conto_banca.put(newpag, true);
|
|
||||||
|
|
||||||
newpag.put(PAGSCA_ACCSAL, a_saldo ? 'S' : 'A');
|
newpag.put(PAGSCA_ACCSAL, a_saldo ? 'S' : 'A');
|
||||||
newpag.put(PAGSCA_CODABIPR, get(G_ABI));
|
|
||||||
newpag.put(PAGSCA_CODCABPR, get(G_CAB));
|
|
||||||
if (valuta.in_valuta())
|
if (valuta.in_valuta())
|
||||||
{
|
{
|
||||||
newpag.put(PAGSCA_IMPORTOVAL, importo);
|
newpag.put(PAGSCA_IMPORTOVAL, importo);
|
||||||
@ -207,7 +203,23 @@ void TEasySolder_mask::save_sheet()
|
|||||||
newpag.put(PAGSCA_RITSOC, ritsoc);
|
newpag.put(PAGSCA_RITSOC, ritsoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
app().notify_edit_pagamento(partita, newpag, valuta, importo.is_zero() ? _numrig : 0);
|
if (part.tipo() == tm_nota_credito)
|
||||||
|
{
|
||||||
|
const TBill conto_nullo;
|
||||||
|
conto_nullo.put(newpag, true); // Azzera conto
|
||||||
|
newpag.zero(PAGSCA_CODABIPR);
|
||||||
|
newpag.zero(PAGSCA_CODCABPR);
|
||||||
|
app().notify_edit_pagamento(partita, newpag, valuta, importo.is_zero() ? _numrig : 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TBill conto_banca;
|
||||||
|
conto_banca.get(*this, G_GRUPPOC, G_CONTOC, G_SOTTOCONTOC);
|
||||||
|
conto_banca.put(newpag, true);
|
||||||
|
newpag.put(PAGSCA_CODABIPR, get(G_ABI));
|
||||||
|
newpag.put(PAGSCA_CODCABPR, get(G_CAB));
|
||||||
|
app().notify_edit_pagamento(partita, newpag, valuta, importo.is_zero() ? _numrig : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,13 +524,11 @@ bool TEasySolder_mask::on_field_event(TOperable_field& o, TField_event e, long j
|
|||||||
real residuo = m.get(S_RESIDUO);
|
real residuo = m.get(S_RESIDUO);
|
||||||
if (residuo.is_zero())
|
if (residuo.is_zero())
|
||||||
{
|
{
|
||||||
const int anno = m.get_int(S_ANNO);
|
const int anno = m.get_int(S_ANNO);
|
||||||
const TString8 num = m.get(S_PARTITA);
|
const TString8 num = m.get(S_PARTITA);
|
||||||
const int nriga = m.get_int(S_RIGAF);
|
const int nriga = m.get_int(S_RIGAF);
|
||||||
const int nrata = m.get_int(S_RATA);
|
const int nrata = m.get_int(S_RATA);
|
||||||
const TPartita& game = app().partite().partita(_conto, anno, num);
|
const TPartita& game = app().partite().partita(_conto, anno, num);
|
||||||
|
|
||||||
|
|
||||||
if (game.esiste(nriga, nrata))
|
if (game.esiste(nriga, nrata))
|
||||||
residuo = game.rata(nriga, nrata).residuo(true).valore();
|
residuo = game.rata(nriga, nrata).residuo(true).valore();
|
||||||
}
|
}
|
||||||
@ -662,27 +672,35 @@ static int nrigp_pagamento_locale(const TSolder_tree& st)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_lonely_nc(TPartita& game)
|
static int has_lonely_nc(TPartita& game)
|
||||||
{
|
{
|
||||||
int numrig[8]; memset(numrig, 0, sizeof(numrig));
|
int ncs = 0;
|
||||||
for (int i = game.last(); i > 0; i = game.pred(i))
|
const TRecord_array& u = game.unassigned();
|
||||||
numrig[game.riga(i).tipo()]++;
|
for (int i = u.last_row(); i > 0; i = u.pred_row(i))
|
||||||
return numrig[tm_fattura] == 0 && numrig[tm_nota_credito] > 0;
|
{
|
||||||
|
const TRiga_partite& r = game.riga(i);
|
||||||
|
if (r.tipo() == tm_nota_credito)
|
||||||
|
{
|
||||||
|
ncs = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ncs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Aggiunge una nota di credito non associata a fattura
|
// Aggiunge una nota di credito non associata a fattura
|
||||||
static bool add_lonely_nc(TPartita& game, TSheet_field& sheet, int rigasheet)
|
static bool add_lonely_nc(TPartita& game, TSheet_field& sheet, int rigasheet)
|
||||||
{
|
{
|
||||||
if (!is_lonely_nc(game))
|
int nrigp = has_lonely_nc(game);
|
||||||
|
if (nrigp <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const int nrigp = game.prima_riga(-1, tm_nota_credito);
|
|
||||||
const TRiga_partite& riga = game.riga(nrigp);
|
const TRiga_partite& riga = game.riga(nrigp);
|
||||||
|
|
||||||
TToken_string& row = sheet.row(rigasheet);
|
TToken_string& row = sheet.row(rigasheet);
|
||||||
row.add(game.codice_valuta(), sheet.cid2index(S_VALUTA));
|
|
||||||
|
|
||||||
const char expected_section = riga.get_char(PART_TIPOCF) == 'C' ? 'D' : 'A';
|
const TCausale& causale = app().causale();
|
||||||
|
const char expected_section = causale.sezione_clifo() == 'D' ? 'A' : 'D';
|
||||||
|
|
||||||
TImporto res = game.calcola_saldo(true);
|
TImporto res = game.calcola_saldo(true);
|
||||||
res.normalize(expected_section);
|
res.normalize(expected_section);
|
||||||
@ -700,6 +718,7 @@ static bool add_lonely_nc(TPartita& game, TSheet_field& sheet, int rigasheet)
|
|||||||
set_row_str(sheet, row, S_DATASCAD, riga.get(PART_DATAPAG));
|
set_row_str(sheet, row, S_DATASCAD, riga.get(PART_DATAPAG));
|
||||||
if (game.in_valuta())
|
if (game.in_valuta())
|
||||||
{
|
{
|
||||||
|
row.add(game.codice_valuta(), sheet.cid2index(S_VALUTA));
|
||||||
TImporto reseur = riga.importo(false);
|
TImporto reseur = riga.importo(false);
|
||||||
reseur.normalize(expected_section);
|
reseur.normalize(expected_section);
|
||||||
set_row_currency(sheet, row, S_RESIDUO_EUR, reseur.valore());
|
set_row_currency(sheet, row, S_RESIDUO_EUR, reseur.valore());
|
||||||
@ -712,7 +731,8 @@ static bool add_lonely_nc(TPartita& game, TSheet_field& sheet, int rigasheet)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sheet_rate_filler(TTree& tree, void* jolly, word /* flags */)
|
// static callback function
|
||||||
|
bool TEasySolder_mask::sheet_rate_filler(TTree& tree, void* jolly, word /* flags */)
|
||||||
{
|
{
|
||||||
const TSolder_tree& st = (const TSolder_tree&)tree;
|
const TSolder_tree& st = (const TSolder_tree&)tree;
|
||||||
const TToken_string& curr = *(TToken_string*)st.curr_node();
|
const TToken_string& curr = *(TToken_string*)st.curr_node();
|
||||||
@ -739,8 +759,15 @@ static bool sheet_rate_filler(TTree& tree, void* jolly, word /* flags */)
|
|||||||
CHECKD(false, "Rata nulla inattesa ", nrata); // Segnalazione 1867
|
CHECKD(false, "Rata nulla inattesa ", nrata); // Segnalazione 1867
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tipo_movimento tm = app().causale().tipomov();
|
TSheet_field& sheet = *(TSheet_field*)jolly;
|
||||||
|
|
||||||
|
const TCausale& causale = app().causale();
|
||||||
|
const tipo_movimento tm = causale.tipomov();
|
||||||
|
|
||||||
|
const char pag_section = ((TEasySolder_mask&)sheet.mask()).calcola_sezione();
|
||||||
|
const char rat_section = pag_section == 'D' ? 'A' : 'D';
|
||||||
|
|
||||||
switch (tm)
|
switch (tm)
|
||||||
{
|
{
|
||||||
case tm_nota_credito:
|
case tm_nota_credito:
|
||||||
@ -782,7 +809,6 @@ static bool sheet_rate_filler(TTree& tree, void* jolly, word /* flags */)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
TSheet_field& sheet = *(TSheet_field*)jolly;
|
|
||||||
if (good_rat || good_pag) // Creo una nuova riga solo se necessario
|
if (good_rat || good_pag) // Creo una nuova riga solo se necessario
|
||||||
{
|
{
|
||||||
TToken_string& row = sheet.row(-1);
|
TToken_string& row = sheet.row(-1);
|
||||||
@ -796,9 +822,8 @@ static bool sheet_rate_filler(TTree& tree, void* jolly, word /* flags */)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char expected_section = scad->get_char(SCAD_TIPOCF) == 'C' ? 'D' : 'A';
|
|
||||||
res = scad->residuo(true);
|
res = scad->residuo(true);
|
||||||
res.normalize(expected_section);
|
res.normalize(rat_section);
|
||||||
}
|
}
|
||||||
set_row_currency(sheet, row, S_RESIDUO, res.valore());
|
set_row_currency(sheet, row, S_RESIDUO, res.valore());
|
||||||
const TImporto tot = scad->importo(true);
|
const TImporto tot = scad->importo(true);
|
||||||
@ -837,7 +862,7 @@ static bool sheet_rate_filler(TTree& tree, void* jolly, word /* flags */)
|
|||||||
}
|
}
|
||||||
if (good_pag)
|
if (good_pag)
|
||||||
{
|
{
|
||||||
if (!good_rat && nrigp > 1 && is_lonely_nc(game))
|
if (!good_rat && nrigp > 1 && has_lonely_nc(game))
|
||||||
add_lonely_nc(game, sheet, sheet.items()-1);
|
add_lonely_nc(game, sheet, sheet.items()-1);
|
||||||
|
|
||||||
const TRiga_partite& rigp = game.riga(nrigp);
|
const TRiga_partite& rigp = game.riga(nrigp);
|
||||||
@ -884,7 +909,7 @@ static bool sheet_rate_filler(TTree& tree, void* jolly, word /* flags */)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Nota di credito non assegnata e senza pagamenti n questo movimento
|
// Nota di credito non assegnata e senza pagamenti n questo movimento
|
||||||
if (level == 4 && nriga == TPartita::UNASSIGNED && nrigp == 0 && curr.ends_with("|1") && is_lonely_nc(game))
|
if (level == 4 && nriga == TPartita::UNASSIGNED && nrigp == 0 && has_lonely_nc(game))
|
||||||
{
|
{
|
||||||
const TImporto sld = game.calcola_saldo(true);
|
const TImporto sld = game.calcola_saldo(true);
|
||||||
if (!sld.is_zero())
|
if (!sld.is_zero())
|
||||||
@ -899,11 +924,11 @@ char TEasySolder_mask::calcola_sezione() const
|
|||||||
{
|
{
|
||||||
const char tipoc = _conto.tipo();
|
const char tipoc = _conto.tipo();
|
||||||
const TCausale& causale = app().causale();
|
const TCausale& causale = app().causale();
|
||||||
const tipo_movimento tm = causale.tipomov();
|
char sezione = causale.sezione_clifo(); // Usa la sezione della causale
|
||||||
char sezione = causale.sezione(1); // Usa la sezione della causale
|
|
||||||
|
|
||||||
if (sezione != 'A' && sezione != 'D') // Se non c'e' la sezione bell'e' ch'e' pronta
|
if (sezione != 'A' && sezione != 'D') // Se non c'e' la sezione bell'e' ch'e' pronta
|
||||||
{
|
{
|
||||||
|
const tipo_movimento tm = causale.tipomov();
|
||||||
if (tm == tm_fattura || tm == tm_insoluto) // calcola in base al tipo movimento e
|
if (tm == tm_fattura || tm == tm_insoluto) // calcola in base al tipo movimento e
|
||||||
sezione = (tipoc == 'C') ? 'D' : 'A'; // al tipo cliente/fornitore
|
sezione = (tipoc == 'C') ? 'D' : 'A'; // al tipo cliente/fornitore
|
||||||
else
|
else
|
||||||
@ -916,7 +941,7 @@ char TEasySolder_mask::calcola_sezione() const
|
|||||||
TBill bill; causale.bill(1, bill); // Legge primo conto causale
|
TBill bill; causale.bill(1, bill); // Legge primo conto causale
|
||||||
const char tc = bill.tipo();
|
const char tc = bill.tipo();
|
||||||
if (tc > ' ' && tc != tipoc)
|
if (tc > ' ' && tc != tipoc)
|
||||||
sezione = (sezione == 'D') ? 'A' : 'D'; // scambia segno
|
sezione = (sezione == 'D') ? 'A' : 'D'; // inverti sezione
|
||||||
}
|
}
|
||||||
|
|
||||||
return sezione;
|
return sezione;
|
||||||
@ -1119,6 +1144,10 @@ void TEasySolder_mask::init(const TBill& conto, long numreg, int numrig)
|
|||||||
for (short id = G_ABI; id <= G_DESCONTOC; id++)
|
for (short id = G_ABI; id <= G_DESCONTOC; id++)
|
||||||
reset(id);
|
reset(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Nel caso di nota di credito devo nascondere il conto (fuorviante)
|
||||||
|
for (short id = G_ABI; id <= G_DESCONTOC; id++)
|
||||||
|
show(id, _tipomov != tm_nota_credito);
|
||||||
|
|
||||||
if (_tree == NULL)
|
if (_tree == NULL)
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,8 @@ protected:
|
|||||||
real eur2val(const real& val) const;
|
real eur2val(const real& val) const;
|
||||||
TImporto eur2val(const TImporto& imp) const;
|
TImporto eur2val(const TImporto& imp) const;
|
||||||
|
|
||||||
|
static bool sheet_rate_filler(TTree& tree, void* jolly, word flags);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool changed() const { return _changed; }
|
bool changed() const { return _changed; }
|
||||||
void init(const TBill& conto, long numreg, int numrig);
|
void init(const TBill& conto, long numreg, int numrig);
|
||||||
|
@ -1141,6 +1141,9 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
refused = true;
|
refused = true;
|
||||||
|
// Altrimenti sbaglia a ridisegnare le righe della DBService!
|
||||||
|
XI_RCT rct; xi_get_rect(_obj, &rct);
|
||||||
|
xi_invalidate_rect(xi_get_window(_obj), &rct);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_GET_PERCENT:
|
case XIE_GET_PERCENT:
|
||||||
@ -1177,10 +1180,15 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
|||||||
{
|
{
|
||||||
if (xiev->v.select.column == 0)
|
if (xiev->v.select.column == 0)
|
||||||
{
|
{
|
||||||
if (rec == _cur_rec) // Simulo intercettazione doppio click
|
|
||||||
_grid->on_record_button(rec);
|
|
||||||
if (_read_only)
|
if (_read_only)
|
||||||
refused = true;
|
{
|
||||||
|
refused = !select(rec);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (rec == _cur_rec) // Simulo intercettazione doppio click
|
||||||
|
_grid->on_record_button(rec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2259,6 +2267,10 @@ TMastrino_set::TMastrino_set(TMastrini_grid& g)
|
|||||||
add_field(_alfafld,-108, 1, "Sezione"); // Sezione
|
add_field(_alfafld,-108, 1, "Sezione"); // Sezione
|
||||||
add_field(_realfld, 109, 13); // Saldo giornaliero
|
add_field(_realfld, 109, 13); // Saldo giornaliero
|
||||||
add_field(_alfafld,-109, 1, "Sezione"); // Sezione giornaliera
|
add_field(_alfafld,-109, 1, "Sezione"); // Sezione giornaliera
|
||||||
|
|
||||||
|
const bool show_cms = main_app().has_module(CMAUT) || main_app().has_module(CAAUT);
|
||||||
|
if (show_cms)
|
||||||
|
add_field(_alfafld, 110, 40); // Commessa
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -2378,47 +2390,21 @@ bool TGrid_mask::export_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
bool TGrid_mask::on_key(KEY k)
|
bool TGrid_mask::on_key(KEY k)
|
||||||
{
|
{
|
||||||
long rec = grid().selected();
|
|
||||||
switch (k)
|
switch (k)
|
||||||
{
|
{
|
||||||
case K_LHOME:
|
|
||||||
rec = 0;
|
|
||||||
break;
|
|
||||||
case K_PREV:
|
|
||||||
rec -= _grid->visible_rows();
|
|
||||||
if (rec < 0) rec = 0;
|
|
||||||
break;
|
|
||||||
case K_UP:
|
|
||||||
if (rec > 0)
|
|
||||||
rec--;
|
|
||||||
break;
|
|
||||||
case K_DOWN:
|
|
||||||
if (rec < _grid->items()-1)
|
|
||||||
rec++;
|
|
||||||
break;
|
|
||||||
case K_NEXT:
|
|
||||||
rec += _grid->visible_rows();
|
|
||||||
if (rec >= _grid->items())
|
|
||||||
rec = _grid->items()-1;
|
|
||||||
break;
|
|
||||||
case K_LEND:
|
|
||||||
rec = _grid->items()-1;
|
|
||||||
break;
|
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
case K_CTRL+'+':
|
case K_CTRL+'+':
|
||||||
case K_CTRL+'-':
|
case K_CTRL+'-':
|
||||||
if (focus_field().dlg() == _grid->dlg())
|
if (focus_field().dlg() == _grid->dlg())
|
||||||
|
{
|
||||||
|
const long rec = grid().selected();
|
||||||
_grid->on_dbl_cell(rec, DLG_USER);
|
_grid->on_dbl_cell(rec, DLG_USER);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (rec != grid().selected())
|
|
||||||
{
|
|
||||||
grid().select(rec);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TMask::on_key(k);
|
return TMask::on_key(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2436,7 +2422,7 @@ long TGrid_mask::handler(WINDOW win, EVENT* ep)
|
|||||||
|
|
||||||
if (_last_grid)
|
if (_last_grid)
|
||||||
{
|
{
|
||||||
TGrid_field& sht = (TGrid_field&)*_last_grid;
|
//TGrid_field& sht = (TGrid_field&)*_last_grid;
|
||||||
MENU_ITEM* menu = xvt_res_get_menu(BROWSE_BAR);
|
MENU_ITEM* menu = xvt_res_get_menu(BROWSE_BAR);
|
||||||
|
|
||||||
if (menu != NULL)
|
if (menu != NULL)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
23
|
23
|
||||||
0
|
0
|
||||||
$mov|0|0|421|0|Movimenti di prima nota|||
|
$mov|0|0|471|0|Movimenti di prima nota|||
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
23
|
23
|
||||||
54
|
55
|
||||||
ANNOES|9|4|0|Codice esercizio
|
ANNOES|9|4|0|Codice esercizio
|
||||||
NUMREG|3|7|0|Numero di operazione
|
NUMREG|3|7|0|Numero di operazione
|
||||||
DATAREG|5|8|0|Data operazione
|
DATAREG|5|8|0|Data operazione
|
||||||
@ -8,6 +8,7 @@ DATADOC|5|8|0|Data documento
|
|||||||
DATA74TER|5|8|0|Data per art. 74 ter
|
DATA74TER|5|8|0|Data per art. 74 ter
|
||||||
MESELIQ|2|2|0|Mese per liquidazione differita
|
MESELIQ|2|2|0|Mese per liquidazione differita
|
||||||
NUMDOC|1|7|0|Numero documento
|
NUMDOC|1|7|0|Numero documento
|
||||||
|
NUMDOCEXT|1|50|0|Numero documento esteso
|
||||||
TIPODOC|1|2|0|Tipo documento
|
TIPODOC|1|2|0|Tipo documento
|
||||||
CODCAUS|1|3|0|Codice causale
|
CODCAUS|1|3|0|Codice causale
|
||||||
DESCR|1|50|0|Descrizione
|
DESCR|1|50|0|Descrizione
|
||||||
|
Loading…
x
Reference in New Issue
Block a user