Patch level :2.0 p@rtners 680

Files correlati     :cg3 cg3800a.msk/frm
Ricompilazione Demo : [ ]
Commento            :secondo step evolutivo della lista fatture doppie; adesso stampa


git-svn-id: svn://10.65.10.50/trunk@11748 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2004-02-06 11:56:55 +00:00
parent 2200151308
commit b3f899b13c
7 changed files with 126 additions and 53 deletions

View File

@ -4063,11 +4063,11 @@ void TStampa_bilanci::preprocess_header()
if (_tipo_stampa1 == 1 && _datada == _dataini)
h << TR("MOVIMENTI DI APERTURA");
else
h << TR("SALDO INIZIALE");
h << TR(" SALDO INIZIALE");
}
else
if (_tipo_stampa1 == 1)
set_header(r,TR("PROGRESSIVI PRECEDENTI"));
h << TR("PROGRESSIVI PRECEDENTI");
h << "@80g!@88g";
h << TR("MOVIMENTI DEL PERIODO");
set_header(r, h);

View File

@ -14,6 +14,7 @@ int main(int argc,char** argv)
case 4 : cg3500(argc,argv) ; break; // Stampa ripilogo gruppi conti
case 5 : cg3600(argc,argv) ; break; // Visualizzazione mastrini
case 6 : cg3700(argc,argv) ; break; // Lista fatture
case 7 : cg3800(argc,argv) ; break; // Lista fatture doppie
default: cg3100(argc,argv) ; break; // Lista movimenti
}
exit(0);

View File

@ -20,6 +20,7 @@ int cg3400(int argc, char* argv[]);
int cg3500(int argc, char* argv[]);
int cg3600(int argc, char* argv[]);
int cg3700(int argc, char* argv[]);
int cg3800(int argc, char* argv[]);
#endif // __CG3_H

View File

@ -4,6 +4,7 @@
#include <printer.h>
#include <progind.h>
#include <clifo.h>
#include <mov.h>
#include <partite.h>
#include <rmov.h>
@ -43,36 +44,98 @@ bool TDouble_fatt_mask::on_field_event(TOperable_field& o, TField_event e, long
class TDouble_fatt_form : public TForm
{
TPointer_array& _duplicati;
protected:
bool validate(TForm_item &cf, TToken_string &s);
virtual bool validate(TForm_item &cf, TToken_string &s);
virtual long records() const {return _duplicati.items();}
const TRectype& get_mov (int i, int j) const;
public:
void fill_header_last(int i);
void fill_body_odd(int i , int j);
void print(const TMask& m);
TDouble_fatt_form();
TDouble_fatt_form(TPointer_array&);
virtual ~TDouble_fatt_form();
};
bool TDouble_fatt_form::validate(TForm_item &cf, TToken_string &s)
{
/* if (s == "_NEXTPAG")
{
_curr_pag ++; //aggiorna il contatore pagamenti quando ne trova uno sull'arrayone
return true;
}*/
return TForm::validate(cf,s);
}
const TRectype& TDouble_fatt_form::get_mov (int i, int j) const
{
const TPointer_array& dup = (const TPointer_array&)_duplicati[i];
const long numreg = dup.get_long(j);
return cache().get(LF_MOV, numreg);
}
void TDouble_fatt_form::fill_header_last(int i)
{
const TRectype& mov = get_mov(i,0);
TPrint_section& header = section('H', last_page);
header.reset();
header.find_field(FR_ANNODOC).set(mov.get(MOV_DATADOC).right(4));
header.find_field(FR_NDOC).set(mov.get(MOV_NUMDOC));
const TString& codcf = mov.get(MOV_CODCF);
TString16 key;
key.format("F|%s",(const char *)codcf);
const TRectype& clifo = cache().get(LF_CLIFO, key);
header.find_field(FR_CODCF).set(codcf);
header.find_field(FR_RAGSOC).set(clifo.get(CLI_RAGSOC));
header.update();
for (word k = 0; k < header.height(); k++)
printer().print(header.row(k));
}
void TDouble_fatt_form::fill_body_odd(int i, int j)
{
const TRectype& mov = get_mov(i,j);
TPrint_section& body = section('B', odd_page);
body.reset();
body.find_field(FR_NUMREG).set(mov.get(MOV_NUMREG));
body.find_field(FR_DATAREG).set(mov.get(MOV_DATAREG));
body.find_field(FR_DESCREG).set(mov.get(MOV_DESCR));
body.update();
for (word k = 0; k < body.height(); k++)
printer().print(body.row(k));
}
void TDouble_fatt_form::print(const TMask& m)
{
TPrint_section& header = section('H', odd_page);
header.find_field(FR_DADATA).set(m.get(F_DADATA));
header.find_field(FR_ADATA).set(m.get(F_ADATA));
header.update();
set_background(1, TRUE);
set_header(1, TRUE);
set_footer(1, FALSE);
TForm::print(); //chiama la vera print dopo aver azzerato il contatore
printer().open();
for (int i = 0; i < _duplicati.items(); i++)
{
fill_header_last(i);
const TPointer_array& dup = (const TPointer_array&)_duplicati[i];
for (int j = 0; j < dup.items(); j++)
fill_body_odd(i,j);
}
printer().close();
}
TDouble_fatt_form::TDouble_fatt_form() :TForm ("cg3800a")
TDouble_fatt_form::TDouble_fatt_form(TPointer_array& dupl) :TForm ("cg3800a"), _duplicati(dupl)
{
}
@ -108,7 +171,7 @@ public:
bool TDouble_fatt::create()
{
_mask = new TDouble_fatt_mask;
_form = new TDouble_fatt_form();
_form = new TDouble_fatt_form(_duplicati);
return TSkeleton_application::create();
@ -208,9 +271,15 @@ void TDouble_fatt::main_loop()
TCursor cur(&rel, "TIPO=='F'", 2, &darec, &arec);
_movimenti.destroy();
scan_cursor(cur, "Ricerca fatture doppie...", mov_callback, this);
if (_duplicati.items() > 0)
_form->print(*_mask);
}
}
int cg3800(int argc, char* argv[])
{
TDouble_fatt a;

View File

@ -3,5 +3,14 @@
#define FR_DADATA 11
#define FR_ADATA 12
#define FR_ANNODOC 15
#define FR_NDOC 16
#define FR_CODCF 17
#define FR_RAGSOC 18
#define FR_NUMREG 20
#define FR_DATAREG 21
#define FR_DESCREG 22

View File

@ -9,13 +9,13 @@ END
LINEA -1 132 1
BEGIN
PROMPT 1 7 "@b"
PROMPT 1 8 "@b"
END
END
// intestazione generale stampa pagato per commessa
SECTION HEADER ODD 7
SECTION HEADER ODD 8
NUMERO -1
BEGIN
@ -49,110 +49,102 @@ BEGIN
PROMPT 40 3 "al "
END
LINEA -1 132 1
BEGIN
PROMPT 1 4 "B"
END
STRINGA -1
BEGIN
KEY "anno documento"
PROMPT 1 5 "@bANNO"
PROMPT 1 6 "@bANNO"
END
STRINGA -1
BEGIN
KEY "numero documento"
PROMPT 6 5 "@bNUM. DOC. "
PROMPT 6 6 "@bNUM. DOC. "
END
STRING -1
BEGIN
KEY "codice fornitore"
PROMPT 18 5 "@bFORNITORE"
PROMPT 18 6 "@bFORNITORE"
END
STRING -1
BEGIN
KEY "ragione sociale"
PROMPT 28 5 "@bRAGIONE SOCIALE"
PROMPT 28 6 "@bRAGIONE SOCIALE"
END
STRING -1
BEGIN
KEY "numero registrazione"
PROMPT 6 6 "@bNum.Reg."
PROMPT 6 7 "@bNum.Reg."
END
STRING -1
BEGIN
KEY "data registrazione"
PROMPT 15 6 "@bData Reg."
PROMPT 15 7 "@bData Reg."
END
STRING -1
BEGIN
KEY "descrizione registrazione"
PROMPT 26 6 "@bDescrizione"
END
LINEA -1 132 1
BEGIN
PROMPT 1 7 "B"
PROMPT 26 7 "@bDescrizione"
END
END // section header odd
// riga di stampa (utilizzata per ogni movimento)
SECTION BODY ODD 1
// documento duplicato
SECTION HEADER LAST 2
NUMERO FR_ANNODOC 4
BEGIN
KEY "anno doc"
PROMPT
PROMPT 1 2 ""
END
STRINGA FR_NDOC 7
BEGIN
KEY "num doc"
PROMPT 6 2 ""
END
NUMERO FR_CODCF 6
BEGIN
KEY "codice clifo"
PROMPT 18 2 ""
END
STRINGA FR_RAGSOC 50
BEGIN
KEY "ragsoc"
PROMPT 28 2 ""
END
SECTION REGISTRAZIONI 2 1 1 FILE LF_MOV GROUP LF_MOV->
END //end della header last: section del documento che viene duplicato
NUMERO FR_NUMREG
BEGIN
KEY "numero registrazione"
PROMPT ""
END
SECTION BODY ODD 1 // section dei duplicati
DATA FR_DATAREG
BEGIN
KEY "data registrazione"
PROMPT ""
END
NUMERO FR_NUMREG
BEGIN
KEY "numero registrazione"
PROMPT 6 1 ""
END
STRINGA FR_DESCREG 50
BEGIN
KEY "descrizione registrazione"
PROMPT ""
END
DATA FR_DATAREG
BEGIN
KEY "data registrazione"
PROMPT 15 1 ""
END
END //end section registrazioni
STRINGA FR_DESCREG 50
BEGIN
KEY "descrizione registrazione"
PROMPT 26 1 ""
END
END //end section duplicati
END // section body odd
SECTION FOOTER ODD 1
END

View File

@ -258,6 +258,7 @@ Flags = ""
Item_01 = "Lista fatture con iva indetraibile", "cg3 -6 I", "F"
Item_02 = "Lista fatture per tipo costo/ricavo", "cg3 -6 C", "F"
Item_03 = "Lista fatture intracomunitarie", "cg3 -6 N", "F"
Item_04 = "Lista fatture doppie", "cg3 -7", "F"
[CGMENU_027]
Caption = "Gestione acconti IVA"