Aggiunta gestione fax

git-svn-id: svn://10.65.10.50/trunk@3299 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-07-30 15:37:39 +00:00
parent 83438e7b0a
commit fea309e387
7 changed files with 87 additions and 34 deletions

View File

@ -1,5 +1,7 @@
#include <config.h>
#include <defmask.h>
#include <execp.h>
#include <golem.h>
#include <msksheet.h>
#include <relapp.h>
#include <sheet.h>
@ -60,6 +62,7 @@ protected:
static bool tipo_handler(TMask_field& f, KEY key);
static bool percip_handler(TMask_field& f, KEY key);
static bool fax_handler(TMask_field& f, KEY k);
public:
virtual TRelation* get_relation() const {return (TRelation*)_rel;}
@ -79,9 +82,7 @@ bool TClifo_application::protected_record(TRectype &rec)
_mov->curr().put(MOV_TIPO, tipocf);
_mov->curr().put(MOV_CODCF, codice);
_mov->read();
return tipocf == _mov->get(MOV_TIPO) &&
codice == atol(_mov->get(MOV_CODCF));
return FALSE;
return tipocf == _mov->get(MOV_TIPO) && codice == atol(_mov->get(MOV_CODCF));
}
const char* TClifo_application::get_next_key()
@ -269,6 +270,31 @@ bool TClifo_application::percip_handler(TMask_field& f, KEY key)
return TRUE;
}
bool TClifo_application::fax_handler(TMask_field& f, KEY k)
{
bool ok = TRUE;
if (k == K_SPACE)
{
TConfig ini(CONFIG_USER, "Link");
TFilename editor = ini.get("Editor", NULL, -1, "notepad");
TExternal_app app(editor);
ok = app.run(TRUE, FALSE) == 0;
if (ok)
{
const TMask& m = f.mask();
const char* tipo = m.get(F_TIPOCF) == "C" ? "Clienti" : "Fornitori";
const char* codice = m.get(F_CODCF);
TDDE dde;
TString cmd(80);
cmd << "[SetRecipient(" << tipo << ',' << codice << ")]";
ok = dde.execute("EASYFAX", "FAX", cmd, "bafax");
}
}
return ok;
}
HIDDEN bool alleg_handler(TMask_field& f, KEY key)
@ -578,6 +604,8 @@ bool TClifo_application::user_create() // initvar e arrmask
_msk->set_handler(F_TIPOPERS, tipo_handler);
_msk->set_handler(F_ALLEG, alleg_handler);
_msk->set_handler(F_CODALLEG, codalleg_handler);
_msk->set_handler(DLG_FAX, fax_handler);
TSheet_field& ind = (TSheet_field&) _msk->field(F_SHEET_G_VEN);
ind.set_notify(indsp_notify);

View File

@ -331,6 +331,12 @@ BEGIN
PROMPT 32 16 "Sospeso "
FIELD SOSPESO
HELP "Indicare se il C/F e' movimentato ma non piu' utilizzabile"
END
BUTTON DLG_FAX 10 2
BEGIN
PROMPT -11 -1 "Fax"
PICTURE BMP_FAX
END
ENDPAGE

View File

@ -1250,6 +1250,14 @@ long TPrimanota_application::calcola_m770(int tipo_coll, real& spese, real& comp
TImporto imp; imp = cgs().row(i);
ritfis = imp.valore();
}
i = type2pos('S');
if (i >= 0)
{
TImporto imp; imp = cgs().row(i);
ritfis += imp.valore();
}
}
if (tipo_coll == 3 || tipo_coll == 7)

View File

@ -97,7 +97,13 @@ char TMovimentoPN::frequenza_versamenti(int year) const
}
else
last_freq = lia.get_char("S7");
CHECK(last_freq == 'M' || last_freq == 'T', "Frequenza versamenti IVA assurda");
if (last_freq != 'M' && last_freq != 'T')
{
error_box("La frequenza versamenti IVA per la ditta %ld\n"
"non e' valida: la si considera mensile.", firm);
last_freq = 'M';
}
last_firm = firm;
last_year = year;

View File

@ -6,7 +6,6 @@
#include <config.h>
#include <utility.h>
#include <lffiles.h>
#include "cg4300.h"

View File

@ -1288,29 +1288,16 @@ bool TStampaEC_application::print_selected()
printer().open();
bool one_printed = FALSE;
const long items = c.items();
for (long i = 0; i < items; i++)
if (print_all || s.checked(i))
{
if (one_printed)
printer().formfeed();
fc = i; // Muove il cursore alla posizione corrente
const int ret = print_ec();
if (ret > 0)
one_printed = TRUE;
else
{
one_printed = FALSE;
if (ret < 0)
analfabeti++;
}
if (ret < 0)
analfabeti++;
}
if (one_printed)
printer().formfeed();
printer().close();
if (analfabeti > 0)
@ -1322,6 +1309,8 @@ bool TStampaEC_application::print_selected()
int TStampaEC_application::print_ec()
{
begin_wait();
TEC_form& f = form();
const TRectype& clf = f.cursor()->file().curr();
@ -1348,6 +1337,8 @@ int TStampaEC_application::print_ec()
const bool stampa_chiuse = mask().get_bool(F_STAMPCHIU);
const TDate data_chiuse = mask().get(F_DATACHIU);
TString status;
bool one_printed = FALSE; // Non ho stampato ancora nulla
for (int err = partite.read(_isgteq);
@ -1356,6 +1347,11 @@ int TStampaEC_application::print_ec()
{
TPartita game(partite.curr());
status.cut(0);
status << game.anno() << ' ' << game.numero();
xvt_statbar_set(status);
do_events();
// if (game.chiusa())
// {
const TDate& dir = f.data_inizio_rischio();
@ -1397,7 +1393,19 @@ int TStampaEC_application::print_ec()
}
if (one_printed)
{
f.ultima_pagina();
printer().formfeed();
if (printer().isfax())
{
const char* tipo = clf.get_char(CLI_TIPOCF) == 'C' ? "Clienti" : "Fornitori";
const char* codice = clf.get(CLI_CODCF);
printer().send_fax(tipo, codice);
}
}
xvt_statbar_set(NULL);
end_wait();
return one_printed ? 1 : 0;
}

View File

@ -65,28 +65,17 @@ bool TStampaSol_application::print_selected()
printer().open();
bool one_printed = FALSE;
const long items = c.items();
for (long i=0; i < items; i++)
if (print_all || s.checked(i))
{
if (one_printed)
printer().formfeed();
fc= i; // muove il cursore alla posizione corrente
const int ret = print_sol();
if (ret > 0)
one_printed = TRUE;
else
{
one_printed = FALSE;
if (ret < 0)
analfabeti++;
}
if (ret < 0)
analfabeti++;
}
if (one_printed)
printer().formfeed();
printer().close();
if (analfabeti > 0) {
@ -189,7 +178,16 @@ int TStampaSol_application::print_sol()
}
if (one_printed)
{
f.ultima_pagina();
printer().formfeed();
if (printer().isfax())
{
const char* tipo = clf.get_char(CLI_TIPOCF) ? "Clienti" : "Fornitori";
const char* codice = clf.get(CLI_CODCF);
printer().send_fax(tipo, codice);
}
}
return one_printed ? 1 : 0;
}