Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@16033 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
95a9dd6aac
commit
063b45782c
@ -144,7 +144,8 @@ int TOmasa::strip_zero(TString& importo)
|
|||||||
|
|
||||||
int size = importo.len();
|
int size = importo.len();
|
||||||
|
|
||||||
for (int i = 0; i < size; i++)
|
int i;
|
||||||
|
for (i = 0; i < size; i++)
|
||||||
if (importo[i] != '0') break;
|
if (importo[i] != '0') break;
|
||||||
|
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
@ -203,7 +204,7 @@ void TOmasa::mask2ini()
|
|||||||
_configfile->set(contoomasa, conto, "CONTI");
|
_configfile->set(contoomasa, conto, "CONTI");
|
||||||
}
|
}
|
||||||
TSheet_field& sheetcms = (TSheet_field&)_msk->field(F_SHEET_CMS);
|
TSheet_field& sheetcms = (TSheet_field&)_msk->field(F_SHEET_CMS);
|
||||||
for (i=0;i<sheetcms.items();i++)
|
for (int i=0;i<sheetcms.items();i++)
|
||||||
{
|
{
|
||||||
TToken_string& row = sheetcms.row(i);
|
TToken_string& row = sheetcms.row(i);
|
||||||
TString16 cmsomasa = row.get(0);
|
TString16 cmsomasa = row.get(0);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
int pg0001100(int argc, char* argv[]);
|
int pg0001100(int argc, char* argv[]);
|
||||||
int pg0001200(int argc, char* argv[]);
|
int pg0001200(int argc, char* argv[]);
|
||||||
int pg0001300(int argc, char* argv[]);
|
int pg0001300(int argc, char* argv[]);
|
||||||
|
int pg0001400(int argc, char* argv[]);
|
@ -181,7 +181,7 @@ public:
|
|||||||
virtual bool destroy();
|
virtual bool destroy();
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
void add_testata(const TRecordset& paghe, TConfig& doc);
|
void add_testata(const TRecordset& paghe, TConfig& doc);
|
||||||
void add_riga_doc(const TRecordset& paghe, TConfig& doc, const int nriga);
|
void add_riga_doc(const TRecordset& paghe, TConfig& doc, const int nriga, const TString& codivaes);
|
||||||
TPaghe2Doc() {}
|
TPaghe2Doc() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ void TPaghe2Doc::add_testata(const TRecordset& paghe, TConfig& doc)
|
|||||||
doc.set(RDOC_DESCR, _descdoc); // descrizione x fattura
|
doc.set(RDOC_DESCR, _descdoc); // descrizione x fattura
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPaghe2Doc::add_riga_doc(const TRecordset& paghe, TConfig& doc, const int nriga)
|
void TPaghe2Doc::add_riga_doc(const TRecordset& paghe, TConfig& doc, const int nriga, const TString& codivaes)
|
||||||
{
|
{
|
||||||
doc.set_paragraph(format("%d,%d",LF_RIGHEDOC, nriga));
|
doc.set_paragraph(format("%d,%d",LF_RIGHEDOC, nriga));
|
||||||
doc.set(RDOC_CHECKED, "X");
|
doc.set(RDOC_CHECKED, "X");
|
||||||
@ -246,7 +246,6 @@ void TPaghe2Doc::add_riga_doc(const TRecordset& paghe, TConfig& doc, const int n
|
|||||||
doc.set(RDOC_CODART, codtri);
|
doc.set(RDOC_CODART, codtri);
|
||||||
doc.set(RDOC_PREZZO, prezzo.string());
|
doc.set(RDOC_PREZZO, prezzo.string());
|
||||||
doc.set(RDOC_DESCR, recprs.get("S0")); // descrizione x fattura
|
doc.set(RDOC_DESCR, recprs.get("S0")); // descrizione x fattura
|
||||||
doc.set(RDOC_CODIVA, recprs.get("S3")); // codice iva
|
|
||||||
if (codivaes.not_empty())
|
if (codivaes.not_empty())
|
||||||
doc.set(RDOC_CODIVA, codivaes); // esente
|
doc.set(RDOC_CODIVA, codivaes); // esente
|
||||||
else
|
else
|
||||||
@ -359,7 +358,7 @@ void TPaghe2Doc::main_loop()
|
|||||||
codivaes = "";
|
codivaes = "";
|
||||||
}
|
}
|
||||||
nriga++;
|
nriga++;
|
||||||
add_riga_doc(paghe, *docum, nriga);
|
add_riga_doc(paghe, *docum, nriga, codivaes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (docum != NULL)
|
if (docum != NULL)
|
||||||
|
@ -845,6 +845,9 @@ class TMaestri_sender : public TTS_sender
|
|||||||
{
|
{
|
||||||
TMaestri_mask * _mask;
|
TMaestri_mask * _mask;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// virtual bool test_swap(const TRecordset& mov) { return ((TMov_recset&)mov).nota_credito();}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual TRecordset & movrecset();
|
virtual TRecordset & movrecset();
|
||||||
virtual TRecordset & rmovrecset(const TRecordset & mov);
|
virtual TRecordset & rmovrecset(const TRecordset & mov);
|
||||||
|
@ -358,9 +358,9 @@ void TLandi_converter::main_loop()
|
|||||||
|
|
||||||
TFixed_recset output;
|
TFixed_recset output;
|
||||||
_log = new TLog_report(title);
|
_log = new TLog_report(title);
|
||||||
|
input.move_first();
|
||||||
|
|
||||||
|
for (bool ok = input.move_next(); ok ; ok = input.move_next())
|
||||||
for (bool ok = input.move_first(); ok ; ok = input.move_next())
|
|
||||||
{
|
{
|
||||||
output.new_rec("");
|
output.new_rec("");
|
||||||
for (int i = 0; i < 36; i++)
|
for (int i = 0; i < 36; i++)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "pg0001300a.h"
|
#include "pg0001300a.h"
|
||||||
|
|
||||||
PAGE "Creazione file per Studio Vitali" -1 -1 78 13
|
PAGE "Conversione Landi" -1 -1 78 13
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 76 5
|
GROUPBOX DLG_NULL 76 5
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
|
|
||||||
|
#include "../cg/cgsaldac.h"
|
||||||
|
|
||||||
#include "ps0713.h"
|
#include "ps0713.h"
|
||||||
#include "ps0713100a.h"
|
#include "ps0713100a.h"
|
||||||
|
|
||||||
@ -99,6 +101,8 @@ protected:
|
|||||||
virtual const char * extra_modules() const {return "cg";}
|
virtual const char * extra_modules() const {return "cg";}
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
|
|
||||||
|
bool test_partita(const long numreg, TDate& last_data_pag) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void esporta_righe_iva(const TMask& msk) const;
|
void esporta_righe_iva(const TMask& msk) const;
|
||||||
void set_inviva(TISAM_recordset& rmoviva) const;
|
void set_inviva(TISAM_recordset& rmoviva) const;
|
||||||
@ -117,6 +121,11 @@ void TEsporta_ps0713_app::set_inviva(TISAM_recordset& rmoviva) const
|
|||||||
break;
|
break;
|
||||||
const long curr_numreg = rmoviva.get(RMI_NUMREG).as_int();
|
const long curr_numreg = rmoviva.get(RMI_NUMREG).as_int();
|
||||||
if (curr_numreg != last_numreg)
|
if (curr_numreg != last_numreg)
|
||||||
|
{
|
||||||
|
TDate last_data_pag;
|
||||||
|
bool partita_chiusa = test_partita(curr_numreg, last_data_pag);
|
||||||
|
|
||||||
|
if (partita_chiusa)
|
||||||
{
|
{
|
||||||
mov.put(MOV_NUMREG, curr_numreg);
|
mov.put(MOV_NUMREG, curr_numreg);
|
||||||
int err = mov.read();
|
int err = mov.read();
|
||||||
@ -133,11 +142,39 @@ void TEsporta_ps0713_app::set_inviva(TISAM_recordset& rmoviva) const
|
|||||||
error_box(cazzone);
|
error_box(cazzone);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
last_numreg = curr_numreg;
|
last_numreg = curr_numreg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TEsporta_ps0713_app::test_partita(const long numreg, TDate& last_data_pag) const
|
||||||
|
{
|
||||||
|
bool finito = false;
|
||||||
|
|
||||||
|
TPartite_array torneo;
|
||||||
|
torneo.add_numreg(numreg);
|
||||||
|
TPartita* partita = torneo.first();
|
||||||
|
if (partita != NULL && partita->chiusa())
|
||||||
|
{
|
||||||
|
for (int r = partita->last(); r > 0; r = partita->pred(r))
|
||||||
|
{
|
||||||
|
const TRiga_partite& row = partita->riga(r);
|
||||||
|
const tipo_movimento tipo = row.tipo();
|
||||||
|
if (tipo == tm_pagamento || tipo == tm_pagamento_insoluto)
|
||||||
|
{
|
||||||
|
const TDate datadoc = row.get_date(PART_DATAPAG);
|
||||||
|
if (datadoc > last_data_pag)
|
||||||
|
last_data_pag = datadoc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finito = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return finito;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TEsporta_ps0713_app::esporta_righe_iva(const TMask& m) const
|
void TEsporta_ps0713_app::esporta_righe_iva(const TMask& m) const
|
||||||
{
|
{
|
||||||
TFilename path = m.get(F_PATH);
|
TFilename path = m.get(F_PATH);
|
||||||
@ -149,14 +186,20 @@ void TEsporta_ps0713_app::esporta_righe_iva(const TMask& m) const
|
|||||||
// query su righe iva joinati ai mov
|
// query su righe iva joinati ai mov
|
||||||
TString query;
|
TString query;
|
||||||
query << "USE RMOVIVA ";
|
query << "USE RMOVIVA ";
|
||||||
query << "SELECT ((NUM(ANSI(23.DATAREG))>=NUM(ANSI(#DADATA)))&&(NUM(ANSI(23.DATAREG))<=NUM(ANSI(#ADATA))))&&(23.INVIVA!=\"X\")\n";
|
query << "SELECT ((NUM(ANSI(23.DATAREG))>=NUM(ANSI(#DADATA)))&&(NUM(ANSI(23.DATAREG))<=NUM(ANSI(#ADATA))))&&(23.INVIVA!=\"X\")&&(23.TIPO=\"F\")";
|
||||||
query << "JOIN MOV INTO NUMREG==NUMREG\n";
|
|
||||||
query << "JOIN %IVA ALIAS 101 INTO CODTAB==CODIVA";
|
if (m.get_int(F_JOB) == 1)
|
||||||
|
query << "&&(CODCMS!=\"\")";
|
||||||
|
else
|
||||||
|
query << "&&(CODCMS=\"\")";
|
||||||
|
|
||||||
|
query << "\nJOIN MOV INTO NUMREG==NUMREG";
|
||||||
|
query << "\nJOIN %IVA ALIAS 101 INTO CODTAB==CODIVA";
|
||||||
|
query << "\nJOIN CLIFO TO MOV INTO TIPOCF==TIPO CODCF==CODCF";
|
||||||
|
|
||||||
TISAM_recordset rmoviva(query);
|
TISAM_recordset rmoviva(query);
|
||||||
const TDate& adata = m.get_date(F_ADATA);
|
const TDate& adata = m.get_date(F_ADATA);
|
||||||
TDate dadata = adata;
|
const TDate dadata(1,1, adata.year() - 1);
|
||||||
dadata.addyear(-1);
|
|
||||||
rmoviva.set_var("#DADATA", dadata);
|
rmoviva.set_var("#DADATA", dadata);
|
||||||
rmoviva.set_var("#ADATA", adata);
|
rmoviva.set_var("#ADATA", adata);
|
||||||
|
|
||||||
@ -170,16 +213,33 @@ void TEsporta_ps0713_app::esporta_righe_iva(const TMask& m) const
|
|||||||
if (!pi.addstatus(1))
|
if (!pi.addstatus(1))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
TDate last_data_pag;
|
||||||
|
bool partita_chiusa = test_partita(rmoviva.get(RMI_NUMREG).as_int(), last_data_pag);
|
||||||
|
|
||||||
|
if (partita_chiusa)
|
||||||
|
{
|
||||||
//creazione di un nuovo record da esportare
|
//creazione di un nuovo record da esportare
|
||||||
csv.new_rec("");
|
csv.new_rec("");
|
||||||
//..e successivo riempimento
|
//..e successivo riempimento
|
||||||
csv.set(0, rmoviva.get(RMI_CODCMS));
|
csv.set(0, rmoviva.get(RMI_CODCMS));
|
||||||
csv.set(1, rmoviva.get(RMI_IMPONIBILE));
|
csv.set(1, rmoviva.get("23.CODCF"));
|
||||||
csv.set(2, rmoviva.get("101@.R0"));
|
csv.set(2, rmoviva.get("20.RAGSOC"));
|
||||||
csv.set(3, rmoviva.get(RMI_IMPOSTA));
|
const real imponibile = rmoviva.get(RMI_IMPONIBILE).as_real();
|
||||||
csv.set(4, rmoviva.get(RMI_GRUPPO));
|
// const real imposta = rmoviva.get(RMI_IMPOSTA).as_real();
|
||||||
csv.set(5, rmoviva.get(RMI_CONTO));
|
// const real lordo = imponibile + imposta;
|
||||||
csv.set(6, rmoviva.get(RMI_SOTTOCONTO));
|
// csv.set(3, lordo);
|
||||||
|
csv.set(3, imponibile);
|
||||||
|
//csv.set(2, rmoviva.get("101@.R0")); //aliquota non ci vuole piu'
|
||||||
|
// csv.set(5, imposta);
|
||||||
|
csv.set(6, rmoviva.get("23.DATADOC"));
|
||||||
|
csv.set(7, rmoviva.get("23.NUMDOC"));
|
||||||
|
csv.set(8, last_data_pag);
|
||||||
|
|
||||||
|
// csv.set(9, rmoviva.get(RMI_GRUPPO));
|
||||||
|
// csv.set(10, rmoviva.get(RMI_CONTO));
|
||||||
|
// csv.set(11, rmoviva.get(RMI_SOTTOCONTO));
|
||||||
|
// csv.set(12, rmoviva.get(RMI_NUMREG));
|
||||||
|
}
|
||||||
|
|
||||||
} //for(move_first()..
|
} //for(move_first()..
|
||||||
|
|
||||||
|
@ -3,3 +3,4 @@
|
|||||||
#define F_PATH 101
|
#define F_PATH 101
|
||||||
#define F_NAME 102
|
#define F_NAME 102
|
||||||
#define F_ADATA 103
|
#define F_ADATA 103
|
||||||
|
#define F_JOB 104
|
||||||
|
@ -42,5 +42,12 @@ BEGIN
|
|||||||
FIELD ADATA
|
FIELD ADATA
|
||||||
END
|
END
|
||||||
|
|
||||||
|
RADIOBUTTON F_JOB 20
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 7 "Tipo record da esportare"
|
||||||
|
ITEM "1|CON id. lavoro"
|
||||||
|
ITEM "2|SENZA id. lavoro"
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user