Patch level : 10.0 606
Files correlati : lv4.exe Ricompilazione Demo : [ ] Commento : Aggiunta creazione file ini per le fatture in sospensione aperte git-svn-id: svn://10.65.10.50/trunk@20068 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
488f191f0d
commit
633e835a96
@ -1,5 +1,6 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <automask.h>
|
#include <automask.h>
|
||||||
|
#include <execp.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <reputils.h>
|
#include <reputils.h>
|
||||||
@ -133,12 +134,13 @@ protected:
|
|||||||
bool find_clifo_bill(char tipocf, int& gruppo, int& conto, long sottoconto);
|
bool find_clifo_bill(char tipocf, int& gruppo, int& conto, long sottoconto);
|
||||||
|
|
||||||
TRiga_partite& nuova_fattura(const TImporta_cogeco_recset& recset, TPartita& game);
|
TRiga_partite& nuova_fattura(const TImporta_cogeco_recset& recset, TPartita& game);
|
||||||
|
long fattura_in_sospensione(const TImporta_cogeco_recset& recset, const TRiga_partite& rigafat, long nmov);
|
||||||
void nuova_scadenza(const TImporta_cogeco_recset& recset, TPartita& game, bool is_riba);
|
void nuova_scadenza(const TImporta_cogeco_recset& recset, TPartita& game, bool is_riba);
|
||||||
void nuova_riba(const TImporta_cogeco_recset& recset, TPartita& game);
|
void nuova_riba(const TImporta_cogeco_recset& recset, TPartita& game);
|
||||||
void nuovo_pagamento(const TImporta_cogeco_recset& recset, TPartita& game);
|
void nuovo_pagamento(const TImporta_cogeco_recset& recset, TPartita& game);
|
||||||
void nuova_nota_credito(const TImporta_cogeco_recset& recset, TPartita& game);
|
void nuova_nota_credito(const TImporta_cogeco_recset& recset, TPartita& game);
|
||||||
bool nuovo_insoluto(const TImporta_cogeco_recset& recset, TPartita& game, TLog_report& log);
|
bool nuovo_insoluto(const TImporta_cogeco_recset& recset, TPartita& game, TLog_report& log);
|
||||||
void salva_partita(TPartita*& game);
|
void salva_partita(TPartita*& game, long nmov);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
@ -280,6 +282,38 @@ TRiga_partite& TImporta_sc::nuova_fattura(const TImporta_cogeco_recset& recset,
|
|||||||
return fattura;
|
return fattura;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long TImporta_sc::fattura_in_sospensione(const TImporta_cogeco_recset& recset, const TRiga_partite& rigafat, long nmov)
|
||||||
|
{
|
||||||
|
TFilename temp(_msk->get(F_PATHOUT));
|
||||||
|
|
||||||
|
temp << '/' << format("%05ld", nmov++);
|
||||||
|
temp.ext("ini");
|
||||||
|
if (fexist(temp))
|
||||||
|
remove_file(temp);
|
||||||
|
TConfig conf(temp);
|
||||||
|
|
||||||
|
conf.set_paragraph("Transaction"); //setto il paragrafo [Transaction] del file ini
|
||||||
|
conf.set("Action","INSERT");
|
||||||
|
conf.set("Mode","AUTO");
|
||||||
|
|
||||||
|
conf.set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||||
|
conf.set(MOV_CODCAUS, rigafat.get(PART_CODCAUS));
|
||||||
|
conf.set(MOV_DATAREG, rigafat.get_date(PART_DATAREG));
|
||||||
|
conf.set(MOV_CODPAG, rigafat.get(PART_CODPAG));
|
||||||
|
conf.set(MOV_DATADOC, rigafat.get(PART_DATADOC));
|
||||||
|
conf.set(MOV_NUMDOC, rigafat.get(PART_NUMDOC));
|
||||||
|
conf.set("SOLAIVA", "X");
|
||||||
|
conf.set(MOV_STAMPATO, "X");
|
||||||
|
conf.set(MOV_REGST, "X");
|
||||||
|
conf.set(MOV_NUMDOC, rigafat.get(PART_DESCR));
|
||||||
|
conf.set(MOV_TIPO, rigafat.get(PART_TIPOCF));
|
||||||
|
conf.set(MOV_CODCF, rigafat.get(PART_SOTTOCONTO));
|
||||||
|
conf.set(MOV_TOTDOC, rigafat.get(PART_IMPTOTDOC));
|
||||||
|
conf.set("CODIVA", _msk->get(F_CODIVA));
|
||||||
|
|
||||||
|
return nmov;
|
||||||
|
}
|
||||||
|
|
||||||
// Aggiunge una nuova rata alla UNICA fattura di 'game'.
|
// Aggiunge una nuova rata alla UNICA fattura di 'game'.
|
||||||
// Attenzione: in assenza di fattura ne viene creata una "al volo" di pari importo.
|
// Attenzione: in assenza di fattura ne viene creata una "al volo" di pari importo.
|
||||||
void TImporta_sc::nuova_scadenza(const TImporta_cogeco_recset& recset, TPartita& game, bool is_riba)
|
void TImporta_sc::nuova_scadenza(const TImporta_cogeco_recset& recset, TPartita& game, bool is_riba)
|
||||||
@ -616,11 +650,20 @@ static int game_sorter(const TObject** o1, const TObject** o2)
|
|||||||
return cmp;
|
return cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TImporta_sc::salva_partita(TPartita*& game)
|
void TImporta_sc::salva_partita(TPartita*& game, long nmov)
|
||||||
{
|
{
|
||||||
if (game != NULL)
|
if (game != NULL)
|
||||||
{
|
{
|
||||||
game->write();
|
game->write();
|
||||||
|
if (game->chiusa(true))
|
||||||
|
{
|
||||||
|
TFilename temp(_msk->get(F_PATHOUT));
|
||||||
|
|
||||||
|
temp << '/' << format("%05ld", nmov--);
|
||||||
|
temp.ext("ini");
|
||||||
|
if (fexist(temp))
|
||||||
|
remove_file(temp);
|
||||||
|
}
|
||||||
delete game;
|
delete game;
|
||||||
game = NULL;
|
game = NULL;
|
||||||
}
|
}
|
||||||
@ -643,6 +686,7 @@ void TImporta_sc::transfer(const TFilename& file)
|
|||||||
TToken_string key;
|
TToken_string key;
|
||||||
const TString& codcausc = _msk->get(F_CODCAUSC);
|
const TString& codcausc = _msk->get(F_CODCAUSC);
|
||||||
const TString& codcausf = _msk->get(F_CODCAUSF);
|
const TString& codcausf = _msk->get(F_CODCAUSF);
|
||||||
|
long nmov = 1L;
|
||||||
|
|
||||||
TLog_report log(caption);
|
TLog_report log(caption);
|
||||||
|
|
||||||
@ -661,7 +705,7 @@ void TImporta_sc::transfer(const TFilename& file)
|
|||||||
|
|
||||||
if (tipocf != t || sottoconto != s || anno != a || p != part)
|
if (tipocf != t || sottoconto != s || anno != a || p != part)
|
||||||
{
|
{
|
||||||
salva_partita(game); // Salva parita corrente se non nulla
|
salva_partita(game, nmov); // Salva parita corrente se non nulla
|
||||||
|
|
||||||
TToken_string key; key.format("%c|%ld", t, s);
|
TToken_string key; key.format("%c|%ld", t, s);
|
||||||
const TRectype& clifo = cache().get(LF_CLIFO, key);
|
const TRectype& clifo = cache().get(LF_CLIFO, key);
|
||||||
@ -709,7 +753,13 @@ void TImporta_sc::transfer(const TFilename& file)
|
|||||||
{
|
{
|
||||||
case 1: nuova_fattura(recset, *game); break; // Fattura
|
case 1: nuova_fattura(recset, *game); break; // Fattura
|
||||||
case 2: nuova_nota_credito(recset, *game); break; // Nota di credito
|
case 2: nuova_nota_credito(recset, *game); break; // Nota di credito
|
||||||
case 3: nuova_fattura(recset, *game); break; // Fattura in sospensione
|
case 3:
|
||||||
|
{
|
||||||
|
const TRiga_partite & rigafat = nuova_fattura(recset, *game);
|
||||||
|
|
||||||
|
nmov = fattura_in_sospensione( recset, rigafat, nmov);
|
||||||
|
break;
|
||||||
|
} // Fattura in sospensione
|
||||||
case 4: nuova_nota_credito(recset, *game); break; // Reso su fattura in sospensione
|
case 4: nuova_nota_credito(recset, *game); break; // Reso su fattura in sospensione
|
||||||
case 5: nuovo_pagamento(recset, *game); break; // Pagamento fattura in sospeso
|
case 5: nuovo_pagamento(recset, *game); break; // Pagamento fattura in sospeso
|
||||||
case 6: nuovo_insoluto(recset, *game, log); break; // Insoluto
|
case 6: nuovo_insoluto(recset, *game, log); break; // Insoluto
|
||||||
@ -727,8 +777,16 @@ void TImporta_sc::transfer(const TFilename& file)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
salva_partita(game); // Salva ultima partita se non nulla
|
salva_partita(game, nmov); // Salva ultima partita se non nulla
|
||||||
|
|
||||||
|
if (nmov > 1 && yesno_box(FR("Si desidera confermare l'importazione di %ld fatture in sospensione"), nmov - 1))
|
||||||
|
{
|
||||||
|
TString app;
|
||||||
|
|
||||||
|
app << "cg2 -0 -i" << _msk->get(F_PATHOUT) << "/*.ini";
|
||||||
|
TExternal_app primanota(app);
|
||||||
|
primanota.run(true);
|
||||||
|
}
|
||||||
if (log.recordset()->items() > 0)
|
if (log.recordset()->items() > 0)
|
||||||
log.preview();
|
log.preview();
|
||||||
}
|
}
|
||||||
|
@ -8,4 +8,7 @@
|
|||||||
#define F_CODCAUSF 106
|
#define F_CODCAUSF 106
|
||||||
#define F_DESCRCAUSC 107
|
#define F_DESCRCAUSC 107
|
||||||
#define F_DESCRCAUSF 108
|
#define F_DESCRCAUSF 108
|
||||||
|
#define F_CODIVA 109
|
||||||
|
#define F_DESCRIVA 110
|
||||||
|
#define F_PATHOUT 111
|
||||||
|
|
||||||
|
@ -108,6 +108,43 @@ BEGIN
|
|||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
|
STRING F_CODIVA 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 3 12 "IVA sosp. "
|
||||||
|
FLAGS "U"
|
||||||
|
USE %IVA
|
||||||
|
INPUT CODTAB F_CODIVA
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione@60" S0
|
||||||
|
OUTPUT F_CODIVA CODTAB
|
||||||
|
OUTPUT F_DESCRIVA S0
|
||||||
|
CHECKTYPE REEQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRIVA 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 20 12 ""
|
||||||
|
USE %IVA KEY 2
|
||||||
|
INPUT DESCR F_DESCRIVA
|
||||||
|
DISPLAY "Descrizione@60" S0
|
||||||
|
DISPLAY "Codice" CODCAUS
|
||||||
|
COPY OUTPUT F_CODIVA
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 90 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 13 "Destinazione"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_PATHOUT 256 39
|
||||||
|
BEGIN
|
||||||
|
PROMPT 3 14 "Cartella "
|
||||||
|
DSELECT
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
FIELD ComOutPath
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
ENDMASK
|
ENDMASK
|
Loading…
x
Reference in New Issue
Block a user