Patch level :4.0 580
Files correlati : Ricompilazione Demo : [ ] Commento :sistemate paranoie enrichettiche relative a pagamenti doppi e ritenute mancanti. Da testare git-svn-id: svn://10.65.10.50/trunk@14690 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
dc39749783
commit
35b4a82f59
@ -9,6 +9,7 @@
|
|||||||
#include "cg7200a.h"
|
#include "cg7200a.h"
|
||||||
#include "cg2101.h"
|
#include "cg2101.h"
|
||||||
#include "cg2103.h"
|
#include "cg2103.h"
|
||||||
|
#include "cgsaldac.h"
|
||||||
|
|
||||||
#include <pagsca.h>
|
#include <pagsca.h>
|
||||||
#include <partite.h>
|
#include <partite.h>
|
||||||
@ -541,7 +542,6 @@ bool TInvioP::i_proforma_righe(TCursor& cur, TInvioP_file* trasfilerighe)
|
|||||||
//..tali righe che non avevano commessa!)
|
//..tali righe che non avevano commessa!)
|
||||||
const long conti_importi_items = conti_importi.items();
|
const long conti_importi_items = conti_importi.items();
|
||||||
TString workstring; //stringa di lavoro che serve nel ciclo sotto
|
TString workstring; //stringa di lavoro che serve nel ciclo sotto
|
||||||
|
|
||||||
for (int i = 0; i < conti_importi_items; i++)
|
for (int i = 0; i < conti_importi_items; i++)
|
||||||
{
|
{
|
||||||
if (!conti_importi.importo(i).is_zero())
|
if (!conti_importi.importo(i).is_zero())
|
||||||
@ -641,7 +641,7 @@ bool TInvioP::i_proforma_righe(TCursor& cur, TInvioP_file* trasfilerighe)
|
|||||||
|
|
||||||
const long analrigheiva_items = analmov.body().rows();
|
const long analrigheiva_items = analmov.body().rows();
|
||||||
|
|
||||||
for (i = 1; i <= analrigheiva_items; i++)
|
for (int i = 1; i <= analrigheiva_items; i++)
|
||||||
{
|
{
|
||||||
//scanning delle righe analitiche per estrarne i conti e controllare se compaiono nell'assoc_array..
|
//scanning delle righe analitiche per estrarne i conti e controllare se compaiono nell'assoc_array..
|
||||||
//..dei conti riempito con i conti trovati nelle righe iva
|
//..dei conti riempito con i conti trovati nelle righe iva
|
||||||
@ -934,16 +934,22 @@ real TInvioP::calcola_pagamento(TRectype& curpag_rec)
|
|||||||
pn.curr().put(MOV_NUMREG, nreg);
|
pn.curr().put(MOV_NUMREG, nreg);
|
||||||
if (pn.read() == NOERR)
|
if (pn.read() == NOERR)
|
||||||
{
|
{
|
||||||
|
//dichiariamo una serie di simpatici real utilizzati in seguito
|
||||||
|
real totdoc,imponibile;
|
||||||
|
|
||||||
|
//Movimenti CON SALDACONTO
|
||||||
|
//se movimento IVA..
|
||||||
|
if (pn.iva_items() > 0)
|
||||||
|
{
|
||||||
|
real imposta;
|
||||||
const TRectype& movfat = pn.curr();
|
const TRectype& movfat = pn.curr();
|
||||||
|
|
||||||
//dichiariamo una serie di simpatici real utilizzati in seguito
|
const real ritfis = movfat.get_real(MOV_RITFIS);
|
||||||
real totdoc,imponibile,imposta;
|
|
||||||
|
|
||||||
const real ritfis = pn.curr().get_real(MOV_RITFIS);
|
|
||||||
totpagato += ritfis;
|
totpagato += ritfis;
|
||||||
|
|
||||||
//Le ritenute sociali invece vanno testate con la test_swap..
|
//Le ritenute sociali invece vanno testate con la test_swap..
|
||||||
const real ritsoc = curpag_rec.get_real(PAGSCA_RITSOC);
|
real ritsoc = curpag_rec.get_real(PAGSCA_RITSOC);
|
||||||
|
ritsoc += movfat.get_real(MOV_RITSOC);
|
||||||
|
|
||||||
if (!ritsoc.is_zero())
|
if (!ritsoc.is_zero())
|
||||||
{
|
{
|
||||||
@ -956,10 +962,6 @@ real TInvioP::calcola_pagamento(TRectype& curpag_rec)
|
|||||||
else
|
else
|
||||||
totpagato += ritsoc;
|
totpagato += ritsoc;
|
||||||
}
|
}
|
||||||
//Movimenti CON SALDACONTO
|
|
||||||
//se movimento IVA..
|
|
||||||
if (pn.iva_items() > 0)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < pn.iva_items(); i++)
|
for (int i = 0; i < pn.iva_items(); i++)
|
||||||
{
|
{
|
||||||
const TRectype& rmoviva = pn.iva(i);
|
const TRectype& rmoviva = pn.iva(i);
|
||||||
@ -990,9 +992,9 @@ real TInvioP::calcola_pagamento(TRectype& curpag_rec)
|
|||||||
TImporto importo(rmov.get_char(RMV_SEZIONE), rmov.get_real(RMV_IMPORTO));
|
TImporto importo(rmov.get_char(RMV_SEZIONE), rmov.get_real(RMV_IMPORTO));
|
||||||
importo.normalize('D');
|
importo.normalize('D');
|
||||||
|
|
||||||
if (conto.tipo() > ' ')
|
if (conto.tipo() > ' ') //e' un conto cliente/fornitore...
|
||||||
totdoc -= importo.valore();
|
totdoc -= importo.valore();
|
||||||
else
|
else //..e' un conto normale
|
||||||
{
|
{
|
||||||
if (cerca_fiscali(conto) || cerca_sociali(conto))
|
if (cerca_fiscali(conto) || cerca_sociali(conto))
|
||||||
totdoc -= importo.valore(); //valore da stampare nella colonna Tot.fattura con ritenute
|
totdoc -= importo.valore(); //valore da stampare nella colonna Tot.fattura con ritenute
|
||||||
@ -1091,13 +1093,12 @@ bool TInvioP::i_proforma_pagamenti()
|
|||||||
TRectype& cur_rec = cur.curr();
|
TRectype& cur_rec = cur.curr();
|
||||||
for (cur = 0; cur.pos() < cur_items; ++(cur))
|
for (cur = 0; cur.pos() < cur_items; ++(cur))
|
||||||
{
|
{
|
||||||
pi.addstatus(1);
|
if (!pi.addstatus(1))
|
||||||
if (pi.iscancelled())
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//pagamenti saldacontati! vedi l'else per quelli non saldacontati
|
//pagamenti saldacontati! vedi l'else per quelli non saldacontati
|
||||||
const char tipomov = cur_rec.get(MOV_TIPOMOV)[0];
|
const tipo_movimento tipomov = (tipo_movimento)cur_rec.get_int(MOV_TIPOMOV);
|
||||||
if (tipomov == '3' || tipomov == '2' || tipomov == '6')
|
if (tipomov == tm_pagamento || tipomov == tm_nota_credito || tipomov == tm_pagamento_insoluto)
|
||||||
{
|
{
|
||||||
TRelation relpart(LF_PARTITE);
|
TRelation relpart(LF_PARTITE);
|
||||||
TRectype da(LF_PARTITE);
|
TRectype da(LF_PARTITE);
|
||||||
@ -1170,7 +1171,7 @@ bool TInvioP::i_proforma_pagamenti()
|
|||||||
}//if curpart_items..
|
}//if curpart_items..
|
||||||
|
|
||||||
}//if tipomov ==..
|
}//if tipomov ==..
|
||||||
else //tocca ai pagamenti NON saldacontati (procedura analoga a quella della stampa del pagato)
|
if (tipomov == tm_nessuno) //tocca ai pagamenti NON saldacontati (procedura analoga a quella della stampa del pagato)
|
||||||
{
|
{
|
||||||
const long numregcg = cur_rec.get_long(MOV_NUMREG);
|
const long numregcg = cur_rec.get_long(MOV_NUMREG);
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ BEGIN
|
|||||||
PROMPT 40 12 "Data finale "
|
PROMPT 40 12 "Data finale "
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON F_RIPRISTINA 20
|
BUTTON F_RIPRISTINA 20 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 14 "Annulla invio"
|
PROMPT 2 14 "Annulla invio"
|
||||||
MESSAGE SHOW,F_DATARIPRISTINO|ENABLE,F_DATARIPRISTINO
|
MESSAGE SHOW,F_DATARIPRISTINO|ENABLE,F_DATARIPRISTINO
|
||||||
|
Loading…
x
Reference in New Issue
Block a user