Patch level : 2.0 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento : Allineato uso process_link git-svn-id: svn://10.65.10.50/trunk@11569 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
25c64e75e0
commit
9e403350af
@ -936,18 +936,7 @@ bool TGame_mask::prima_nota(const long nreg)
|
|||||||
TRectype pn(LF_MOV);
|
TRectype pn(LF_MOV);
|
||||||
pn.put(MOV_NUMREG, nreg);
|
pn.put(MOV_NUMREG, nreg);
|
||||||
bool ok = pn.edit();
|
bool ok = pn.edit();
|
||||||
|
if (ok)
|
||||||
if (!ok)
|
|
||||||
{
|
|
||||||
// Vecchio modo, brutto ed obsoleto
|
|
||||||
const char* const pn = "cg2 -0";
|
|
||||||
TExternal_app prima_nota(pn);
|
|
||||||
TString numreg; numreg << "1|" << nreg;
|
|
||||||
TMessage msg(pn, MSG_LN, numreg); // Messaggio di collegamento al movimento nreg
|
|
||||||
msg.send();
|
|
||||||
ok = prima_nota.run() == 0; // Lancia la prima nota
|
|
||||||
}
|
|
||||||
|
|
||||||
fill_partite(); // Rilegge partite
|
fill_partite(); // Rilegge partite
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
|
@ -1309,6 +1309,8 @@ void TStampaEC_application::find_agents_scads(TAssoc_array& agents)
|
|||||||
{
|
{
|
||||||
const TString& fromage = mask().get(F_FROM_AGENT);
|
const TString& fromage = mask().get(F_FROM_AGENT);
|
||||||
const TString& toage = mask().get(F_TO_AGENT);
|
const TString& toage = mask().get(F_TO_AGENT);
|
||||||
|
const long fromcli = mask().get_long(SC_CFCODFR);
|
||||||
|
const long tocli = mask().get_long(SC_CFCODTO);
|
||||||
|
|
||||||
TRelation rel(LF_SCADENZE);
|
TRelation rel(LF_SCADENZE);
|
||||||
rel.add(LF_PAGSCA, "TIPOC==TIPOC|GRUPPO==GRUPPO|CONTO==CONTO|SOTTOCONTO==SOTTOCONTO|"
|
rel.add(LF_PAGSCA, "TIPOC==TIPOC|GRUPPO==GRUPPO|CONTO==CONTO|SOTTOCONTO==SOTTOCONTO|"
|
||||||
@ -1318,10 +1320,16 @@ void TStampaEC_application::find_agents_scads(TAssoc_array& agents)
|
|||||||
const TRectype& pagsca = rel.curr(LF_PAGSCA);
|
const TRectype& pagsca = rel.curr(LF_PAGSCA);
|
||||||
|
|
||||||
curr.put(SCAD_TIPOCF, mask().get(SC_CLIFO));
|
curr.put(SCAD_TIPOCF, mask().get(SC_CLIFO));
|
||||||
|
TRectype recfr(curr), recto(curr);
|
||||||
|
if (fromcli > 0)
|
||||||
|
recfr.put(PAGSCA_SOTTOCONTO, fromcli);
|
||||||
|
if (tocli >= fromcli)
|
||||||
|
recto.put(PAGSCA_SOTTOCONTO, tocli);
|
||||||
|
|
||||||
TString filter;
|
TString filter;
|
||||||
if (!mask().get_bool(F_STAMPCHIU))
|
if (!mask().get_bool(F_STAMPCHIU))
|
||||||
filter << "PAGATA!=\"X\"";
|
filter << "PAGATA!=\"X\"";
|
||||||
TCursor cur(&rel, filter, 1, &curr, &curr);
|
TCursor cur(&rel, filter, 1, &recfr, &recto);
|
||||||
const long items = cur.items();
|
const long items = cur.items();
|
||||||
cur.freeze();
|
cur.freeze();
|
||||||
|
|
||||||
@ -1358,12 +1366,19 @@ void TStampaEC_application::find_agents_unassigned_pags(TAssoc_array& agents)
|
|||||||
{
|
{
|
||||||
const TString& fromage = mask().get(F_FROM_AGENT);
|
const TString& fromage = mask().get(F_FROM_AGENT);
|
||||||
const TString& toage = mask().get(F_TO_AGENT);
|
const TString& toage = mask().get(F_TO_AGENT);
|
||||||
|
const long fromcli = mask().get_long(SC_CFCODFR);
|
||||||
|
const long tocli = mask().get_long(SC_CFCODTO);
|
||||||
|
|
||||||
TRelation rel(LF_PAGSCA);
|
TRelation rel(LF_PAGSCA);
|
||||||
TRectype& curr = rel.curr();
|
TRectype& curr = rel.curr();
|
||||||
|
|
||||||
curr.put(PAGSCA_TIPOC, mask().get(SC_CLIFO));
|
curr.put(PAGSCA_TIPOC, mask().get(SC_CLIFO));
|
||||||
|
|
||||||
|
TRectype recfr(curr), recto(curr);
|
||||||
|
if (fromcli > 0)
|
||||||
|
recfr.put(PAGSCA_SOTTOCONTO, fromcli);
|
||||||
|
if (tocli >= fromcli)
|
||||||
|
recto.put(PAGSCA_SOTTOCONTO, tocli);
|
||||||
|
|
||||||
TString filter;
|
TString filter;
|
||||||
filter << '(' << PAGSCA_NRATA <<"==9999)";
|
filter << '(' << PAGSCA_NRATA <<"==9999)";
|
||||||
if (fromage.not_empty())
|
if (fromage.not_empty())
|
||||||
@ -1373,11 +1388,12 @@ void TStampaEC_application::find_agents_unassigned_pags(TAssoc_array& agents)
|
|||||||
if (toage.not_empty())
|
if (toage.not_empty())
|
||||||
filter << "&&(" << PAGSCA_CODAG << "<=" << toage << ')';
|
filter << "&&(" << PAGSCA_CODAG << "<=" << toage << ')';
|
||||||
|
|
||||||
TCursor cur(&rel, filter, 1, &curr, &curr);
|
TCursor cur(&rel, filter, 1, &recfr, &recto);
|
||||||
const long items = cur.items();
|
const long items = cur.items();
|
||||||
|
if (items > 0)
|
||||||
|
{
|
||||||
cur.freeze();
|
cur.freeze();
|
||||||
|
TProgind pi(items, TR("Ricerca pagamenti non assegnati per agente..."), TRUE, TRUE);
|
||||||
TProgind pi(items, "Ricerca oagamenti non assegnati per agente...", TRUE, TRUE);
|
|
||||||
for (cur = 0L; cur.pos() < items; ++cur)
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
pi.addstatus(1);
|
pi.addstatus(1);
|
||||||
@ -1392,6 +1408,7 @@ void TStampaEC_application::find_agents_unassigned_pags(TAssoc_array& agents)
|
|||||||
}
|
}
|
||||||
games->add_game(curr);
|
games->add_game(curr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
long TStampaEC_application::find_agents_games(TAssoc_array& agents)
|
long TStampaEC_application::find_agents_games(TAssoc_array& agents)
|
||||||
|
@ -11,6 +11,56 @@
|
|||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <pconti.h>
|
#include <pconti.h>
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// Log
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TGameLog
|
||||||
|
{
|
||||||
|
static clock_t _first;
|
||||||
|
TString80 _str;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void fire();
|
||||||
|
|
||||||
|
public:
|
||||||
|
TGameLog(const char* s);
|
||||||
|
TGameLog(const TPartita& p);
|
||||||
|
~TGameLog();
|
||||||
|
};
|
||||||
|
|
||||||
|
clock_t TGameLog::_first = 0;
|
||||||
|
|
||||||
|
void TGameLog::fire()
|
||||||
|
{
|
||||||
|
if (_first == 0)
|
||||||
|
{
|
||||||
|
const clock_t s = clock();
|
||||||
|
while (clock() == s);
|
||||||
|
_first = clock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TGameLog::TGameLog(const char* s)
|
||||||
|
{
|
||||||
|
_str = s;
|
||||||
|
fire();
|
||||||
|
}
|
||||||
|
|
||||||
|
TGameLog::TGameLog(const TPartita& p)
|
||||||
|
{
|
||||||
|
_str << p.anno() << ' ' << p.numero() << ' ' << p.conto().sottoconto();
|
||||||
|
fire();
|
||||||
|
}
|
||||||
|
|
||||||
|
TGameLog::~TGameLog()
|
||||||
|
{
|
||||||
|
const double tot = (clock() - _first) / 1000.0;
|
||||||
|
TString t; t.format("%7.3lf - ", tot);
|
||||||
|
_str.insert(t);
|
||||||
|
__trace(_str);
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Stampa scaduto
|
// Stampa scaduto
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -61,6 +111,9 @@ class TStampaScaduto : public TPrintapp
|
|||||||
static TString _last_game;
|
static TString _last_game;
|
||||||
static bool fil_function(const TRelation *);
|
static bool fil_function(const TRelation *);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void on_firm_change();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool preprocess_page(int file, int counter);
|
virtual bool preprocess_page(int file, int counter);
|
||||||
virtual bool preprocess_print(int file, int counter);
|
virtual bool preprocess_print(int file, int counter);
|
||||||
@ -150,6 +203,8 @@ void TStampaScaduto::compute_unassigned(TPartita& p)
|
|||||||
|
|
||||||
void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
void TStampaScaduto::compute_all(TPartita& p, TBill& bill)
|
||||||
{
|
{
|
||||||
|
TGameLog gl(p);
|
||||||
|
|
||||||
real residuo,nonscad,buonf,s1,s2,s3,s4,s5,s6,s7,res_pagati;
|
real residuo,nonscad,buonf,s1,s2,s3,s4,s5,s6,s7,res_pagati;
|
||||||
compute_unassigned(p);
|
compute_unassigned(p);
|
||||||
for (int r = p.last(); r > 0; r = p.pred(r)) // Browse all rows (partite)
|
for (int r = p.last(); r > 0; r = p.pred(r)) // Browse all rows (partite)
|
||||||
@ -456,6 +511,15 @@ print_action TStampaScaduto::postprocess_page(int file, int counter)
|
|||||||
return NEXT_PAGE;
|
return NEXT_PAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TStampaScaduto::on_firm_change()
|
||||||
|
{
|
||||||
|
if (_m != NULL)
|
||||||
|
{
|
||||||
|
TConfig conf (CONFIG_DITTA,"cg");
|
||||||
|
_m->enable(F_VALUTA,conf.get_bool("GesVal"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool TStampaScaduto::user_create()
|
bool TStampaScaduto::user_create()
|
||||||
{
|
{
|
||||||
open_files(LF_TAB, LF_TABCOM, LF_NDITTE, LF_PARTITE, LF_SCADENZE, LF_PAGSCA, 0);
|
open_files(LF_TAB, LF_TABCOM, LF_NDITTE, LF_PARTITE, LF_SCADENZE, LF_PAGSCA, 0);
|
||||||
@ -675,16 +739,12 @@ void TStampaScaduto::print_header()
|
|||||||
|
|
||||||
reset_header ();
|
reset_header ();
|
||||||
|
|
||||||
const TRectype & ditta = cache().get(LF_NDITTE, firm);
|
|
||||||
|
|
||||||
TString s;
|
|
||||||
s = ditta.get(NDT_RAGSOC);
|
|
||||||
TString datas = _datas.string();
|
TString datas = _datas.string();
|
||||||
TString limop = _limop.string();
|
TString limop = _limop.string();
|
||||||
TString limscad = _limscad.string();
|
TString limscad = _limscad.string();
|
||||||
|
|
||||||
set_header (soh++, FR("Ditta : %ld %s@158gData@163g%s @190gPag. @#"),
|
set_header (soh++, FR("Ditta : %ld %s@158gData@163g%s @190gPag. @#"),
|
||||||
firm, (const char *)s, (const char *)datas);
|
firm, (const char *)_m->get(F_RAGSOC), (const char *)datas);
|
||||||
|
|
||||||
switch (_tipost)
|
switch (_tipost)
|
||||||
{
|
{
|
||||||
@ -712,7 +772,7 @@ void TStampaScaduto::print_header()
|
|||||||
set_header(soh++,FR("Riferim.@12gNumero@20gNumero@27gData@50gResiduo@102g"
|
set_header(soh++,FR("Riferim.@12gNumero@20gNumero@27gData@50gResiduo@102g"
|
||||||
"-------------------------------------------------------- S C A D U T O "
|
"-------------------------------------------------------- S C A D U T O "
|
||||||
"-------------------------------------------------------"));
|
"-------------------------------------------------------"));
|
||||||
set_header(soh++,FR("partita@12gDocum.@20gProt.@27gDocumento@38gValuta"
|
set_header(soh++,FR("Partita@12gDocum.@20gProt.@27gDocumento@38gValuta"
|
||||||
"@50gDocumento@67gNon Scaduto@86g%s@112g%s@129g%s@148g%s@167g%s@185g%s@204g%s@223g%s"),
|
"@50gDocumento@67gNon Scaduto@86g%s@112g%s@129g%s@148g%s@167g%s@185g%s@204g%s@223g%s"),
|
||||||
(const char*)s1,scaglioni[0],scaglioni[1+o],scaglioni[2+o],
|
(const char*)s1,scaglioni[0],scaglioni[1+o],scaglioni[2+o],
|
||||||
scaglioni[3+o],scaglioni[4+o],(const char*) s2, (const char*) s3);
|
scaglioni[3+o],scaglioni[4+o],(const char*) s2, (const char*) s3);
|
||||||
@ -728,7 +788,7 @@ void TStampaScaduto::print_header()
|
|||||||
set_header(soh++,FR("CONTO@18gD E S C R I Z I O N E"));
|
set_header(soh++,FR("CONTO@18gD E S C R I Z I O N E"));
|
||||||
set_header(soh++,FR("Riferim.@12gNumero@20gNumero@27gData@50gResiduo@102g"
|
set_header(soh++,FR("Riferim.@12gNumero@20gNumero@27gData@50gResiduo@102g"
|
||||||
"-------------------------- S C A D U T O -------------------------"));
|
"-------------------------- S C A D U T O -------------------------"));
|
||||||
set_header(soh++,FR("partita@12gDocum.@20gProt.@27gDocumento@38gValuta"
|
set_header(soh++,FR("Partita@12gDocum.@20gProt.@27gDocumento@38gValuta"
|
||||||
"@50gDocumento@67gNon Scaduto@112g%s@129g%s@148g%s@167g%s@185g%s"),
|
"@50gDocumento@67gNon Scaduto@112g%s@129g%s@148g%s@167g%s@185g%s"),
|
||||||
scaglioni[0],scaglioni[5],scaglioni[6],
|
scaglioni[0],scaglioni[5],scaglioni[6],
|
||||||
scaglioni[7],scaglioni[8]);
|
scaglioni[7],scaglioni[8]);
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
#include <tabutil.h>
|
|
||||||
#include <urldefid.h>
|
|
||||||
|
|
||||||
#include "sc2.h"
|
#include "sc2.h"
|
||||||
#include "sc2402.h"
|
#include "sc2402.h"
|
||||||
|
@ -180,7 +180,7 @@ void TESSL_row::print_on(TPrint_section& body)
|
|||||||
TESSL_form& form = (TESSL_form&)body.form();
|
TESSL_form& form = (TESSL_form&)body.form();
|
||||||
|
|
||||||
const bool show_value = form.in_valuta() && in_valuta();
|
const bool show_value = form.in_valuta() && in_valuta();
|
||||||
const char* cod_valuta = show_value ? valuta().codice() : EMPTY_STRING;
|
const TString& cod_valuta = show_value ? valuta().codice() : EMPTY_STRING;
|
||||||
|
|
||||||
TForm_item& campo_valuta = body.find_field(PEC_VALUTA);
|
TForm_item& campo_valuta = body.find_field(PEC_VALUTA);
|
||||||
campo_valuta.set(cod_valuta);
|
campo_valuta.set(cod_valuta);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user