Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@20366 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2010-04-21 11:00:13 +00:00
parent 37922c3de9
commit 21f1a81ccd
6 changed files with 126 additions and 43 deletions

View File

@ -1,3 +1,4 @@
#include <applicat.h>
#include <automask.h>
#include <progind.h>

View File

@ -536,7 +536,7 @@ void TEsporta_SAP_app::esporta_clienti(const TString& path) const
} //for(move_first()..
//scrivitore in formato xls
clienti_sap.save_as(path, fmt_silk);
clienti_sap.save_as(path, fmt_html);
#ifdef DBG
xvt_sys_goto_url(path, "open");
#endif
@ -702,7 +702,7 @@ void TEsporta_SAP_app::esporta_fornitori(const TString& path) const
} //for(move_first()..
//scrivitore in formato xls
fornitori_sap.save_as(path, fmt_silk);
fornitori_sap.save_as(path, fmt_html);
#ifdef DBG
xvt_sys_goto_url(path, "open");
#endif
@ -847,7 +847,7 @@ void TEsporta_SAP_app::esporta_partite(const TMask& msk, const char tipo) const
else
path = msk.get(F_PARTFILEF);
partite_sap.save_as(path, fmt_silk);
partite_sap.save_as(path, fmt_html);
#ifdef DBG
xvt_sys_goto_url(path, "open");
/*
@ -941,7 +941,7 @@ void TEsporta_SAP_app::esporta_cespiti(const TString& path) const
cespiti_sap.set("KNAFA01", TVariant(ws));
}
cespiti_sap.save_as(path, fmt_silk);
cespiti_sap.save_as(path, fmt_html);
#ifdef DBG
xvt_sys_goto_url(path, "open");
/*

View File

@ -18,7 +18,7 @@
#include "pd6142100a.h"
// La parte di selezione delle ditte e' tratta dal programma di liquidazione IVA (cg4300.cpp)
class TCopia_movimenti : public TApplication
class TCopia_movimenti : public TSkeleton_application
{
TArray_sheet *_ditte; // Array sheet delle ditte selezionabili
TLocalisamfile *_nditte; // File delle ditte
@ -411,9 +411,8 @@ bool TCopia_movimenti::create()
_lia = new TTable("%LIA");
_firm = TApplication::get_firm();
build_ditte_sheet();
dispatch_e_menu (BAR_ITEM(1));
return TRUE;
return TSkeleton_application::create();
}
bool TCopia_movimenti::destroy()

View File

@ -1,7 +1,12 @@
#include <applicat.h>
#include <automask.h>
#include <progind.h>
#include <recarray.h>
#include <textset.h>
#include "../ca/calib01.h"
#include "../ca/calib02.h"
#include "../ca/movana.h"
#include "../ca/rmovana.h"
#include "ps1001.h"
@ -43,7 +48,6 @@ bool TVariazione_budget_mask::on_field_event(TOperable_field& o, TField_event e,
void TVariazione_budget_mask::carica_rmovana()
{
TWait_cursor hourglass;
TString query;
query << "USE RMOVANA KEY 4\n";
query << "SELECT ((MOVANA.TIPOMOV=\"P\")||(MOVANA.TIPOMOV=\"V\"))\n";
@ -52,9 +56,11 @@ void TVariazione_budget_mask::carica_rmovana()
query << "TO CODCMS=#CODCMS\n";
//instanzio un TISAM_recordset sulle rmovana
TISAM_recordset rmovana(query);
rmovana.set_var("#CODCMS", get(F_CODCMS));
const TString cms = get(F_CODCMS);
rmovana.set_var("#CODCMS", cms);
const long rmovana_items = rmovana.items();
TProgind pi(rmovana_items, "Generazione righe in corso...", true, true);
//recupero sheet e realtiva mashera di riga
TSheet_field& sf_righe = sfield(F_RIGHE);
@ -64,24 +70,70 @@ void TVariazione_budget_mask::carica_rmovana()
//per ogni riga del recordset va ad aggiornare lo sheet sulla maschera (aggiunge la riga)
for (bool ok = rmovana.move_first(); ok; ok = rmovana.move_next())
{
if (!pi.addstatus(1))
break;
TToken_string& row = sf_righe.row(-1);
row.add(rmovana.get(RMOVANA_CODCCOSTO).as_string(), 0);
row.add(rmovana.get(RMOVANA_CODFASE).as_string(), 1);
row.add(rmovana.get(RMOVANA_CODCONTO).as_string(), 2);
//chiave iniziale di riga
const TString& cdc = rmovana.get(RMOVANA_CODCCOSTO).as_string();
row.add(cdc, 0);
const TString& fase = rmovana.get(RMOVANA_CODFASE).as_string();
row.add(fase, 1);
const TString& conto = rmovana.get(RMOVANA_CODCONTO).as_string();
row.add(conto, 2);
//date competenza iniziale e finale
const TDate datacomp = rmovana.get("MOVANA."MOVANA_DATACOMP).as_date();
TDate datafcomp = rmovana.get("MOVANA."MOVANA_DATAFCOMP).as_date();
const bool autofcomp = rmovana.get("MOVANA."MOVANA_AUTOFCOMP).as_bool();
//caso cazzuto della scadenza con la fine della commessa (come nella stampa bilancio commessa)
if (autofcomp)
{
const TRectype& rec_commesse = cache().get(LF_COMMESSE, cms);
//data del cazzo che serve per non rovinare datacomp, che è la data sulla riga, non quella iniziale di cms
TDate datainicms;
ca_durata_commessa(rec_commesse, datainicms, datafcomp);
}
if (!datafcomp.ok())
datafcomp = datacomp;
row.add(datacomp, 3);
row.add(datafcomp, 4);
//costo o ricavo? all'indbil l'ardua sentenza!
TAnal_bill bill(conto, cdc, cms, fase);
const int indbil = bill.indicatore_bilancio();
const char* str_indbil = indbil == 3 ? "C" : "R";
row.add(str_indbil, 5);
real valore = rmovana.get(RMOVANA_IMPORTO).as_real();
const char sezione = rmovana.get(RMOVANA_SEZIONE).as_string()[0];
TImporto importo(sezione, valore);
importo.normalize('D');
importo.normalize(indbil == 3 ? 'D' : 'A');
valore = importo.valore();
TString str_valore;
str_valore << valore;
row.add(str_valore, 3);
row.add(valore.string(), 6);
row.add(rmovana.get(RMOVANA_NUMREG).as_int(), 4);
row.add(rmovana.get(RMOVANA_NUMRIG).as_int(), 5);
row.add(rmovana.get(RMOVANA_DESCR).as_string(), 6);
//recupera il saldo finale in base alla chiave cms/cdc/fase/conto e lo mette nel campo consuntivo
const TDate dataini, datafin;
const TSaldanal& saldanal = ca_saldo(bill, dataini, datafin, _saldanal_consuntivo | _saldanal_ultima_imm);
TImporto saldo_finale = saldanal._fin;
saldo_finale.normalize(indbil == 3 ? 'D' : 'A');
const real saldo_finale_valore = saldo_finale.valore();
row.add(saldo_finale_valore.string(), 7);
//completa la riga
row.add(rmovana.get(RMOVANA_DESCR).as_string(), 8);
row.add(rmovana.get(RMOVANA_NUMREG).as_int(), 9);
row.add(rmovana.get(RMOVANA_NUMRIG).as_int(), 10);
const TString& tipomov = rmovana.get("MOVANA."MOVANA_TIPOMOV).as_string();
row.add(tipomov, 11);
//disabilita tutti i campi ma non l'intera riga, perchè deve poter cliccare sul numero riga..
//..per procedere alle operazioni di pareggio
if (tipomov != "V")
sf_righe.disable_cell(sf_righe.items() - 1, -1);
}
sf_righe.force_update();
}

View File

@ -7,7 +7,13 @@
#define F_CDC 101
#define F_FASE 102
#define F_CONTO 103
#define F_IMPORTO 104
#define F_NUMREG 105
#define F_NUMRIG 106
#define F_DESCR 107
#define F_DATACOMP 104
#define F_DATAFCOMP 105
#define F_COSRIC 106
#define F_IMPORTO 107
#define F_MATURATO 108
#define F_DESCR 109
#define F_NUMREG 110
#define F_NUMRIG 111
#define F_TIPOMOV 112

View File

@ -40,10 +40,15 @@ BEGIN
ITEM "Sede@4"
ITEM "Fase@5"
ITEM "Conto@12"
ITEM "Importo@18"
ITEM "Iniz comp."
ITEM "Fine comp."
ITEM "C/R"
ITEM "Importo@15"
ITEM "Maturato@15"
ITEM "Descrizione riga@50"
ITEM "N. Reg."
ITEM "Riga"
ITEM "Descrizione riga@50"
ITEM "Tipo"
END
ENDPAGE
@ -52,47 +57,67 @@ ENDMASK
/////////////////////////////////////////
//maschera di riga
PAGE "Riga analitica" -1 -1 78 10
PAGE "Riga analitica" -1 -1 70 14
STRING F_CDC 4
BEGIN
PROMPT 1 1 "Sede "
FLAGS "L"
PROMPT 1 1 "Sede "
END
STRING F_FASE 5
BEGIN
PROMPT 1 2 "Fase "
FLAGS "L"
PROMPT 1 2 "Fase "
END
STRING F_CONTO 12
BEGIN
PROMPT 1 3 "Conto "
FLAGS "L"
PROMPT 1 3 "Conto "
END
DATE F_DATACOMP
BEGIN
PROMPT 1 4 "Ini.comp "
END
DATE F_DATAFCOMP
BEGIN
PROMPT 1 5 "Fin.comp "
END
STRING F_COSRIC 1
BEGIN
PROMPT 1 6 "Cst/Ric "
END
NUMBER F_IMPORTO 15 2
BEGIN
PROMPT 1 4 "Importo "
PROMPT 1 7 "Importo "
END
NUMBER F_NUMREG 7
NUMBER F_MATURATO 15 2
BEGIN
PROMPT 1 5 "N. reg. "
FLAGS "L"
END
NUMBER F_NUMRIG 3
BEGIN
PROMPT 1 6 "N. riga "
PROMPT 1 8 "Maturato "
FLAGS "L"
END
STRING F_DESCR 50
BEGIN
PROMPT 1 7 "Descr. "
FLAGS "L"
PROMPT 1 9 "Descr. "
END
NUMBER F_NUMREG 7
BEGIN
PROMPT 1 10 "N. reg. "
END
NUMBER F_NUMRIG 3
BEGIN
PROMPT 1 11 "N. riga "
END
STRING F_TIPOMOV 1
BEGIN
PROMPT 1 12 "Tipo "
END
ENDPAGE