Patch level : 10.0

Files correlati     : ve1.exe ve1100a.msk
Ricompilazione Demo : [ ]
Commento            :
Ripristinata possibilita' di stampare copie multiple dei documenti definitivi


git-svn-id: svn://10.65.10.50/trunk@19647 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-11-18 11:17:58 +00:00
parent ff09db2cd8
commit 151c4af7bf
4 changed files with 134 additions and 142 deletions

@ -104,21 +104,21 @@ BEGIN
WARNING "Il numero di copie deve essere positivo"
END
RADIOBUTTON F_DATA_O_NUM 58
RADIOBUTTON F_DATA_O_NUM 68
BEGIN
PROMPT 1 4 "Selezione su "
PROMPT 1 4 "Selezione per "
ITEM "N|Numero documento" MESSAGE SHOW,1@|HIDE,2@
ITEM "D|Data documento" MESSAGE SHOW,2@|HIDE,1@
ITEM "D|Data documento" MESSAGE SHOW,2@|HIDE,1@
FLAG "P"
END
GROUPBOX DLG_NULL 58 5
GROUPBOX DLG_NULL 68 5
BEGIN
PROMPT 1 8 "Selezione per numero"
GROUP 1
END
GROUPBOX DLG_NULL 58 5
GROUPBOX DLG_NULL 68 5
BEGIN
PROMPT 1 8 "Selezione per data"
GROUP 2
@ -126,63 +126,63 @@ END
NUMBER F_DA_NDOC 7 0
BEGIN
PROMPT 2 9 "Dal numero "
USE 33
JOIN 20 INTO CODCF=CODCF TIPOCF=TIPOCF
JOIN 13 TO 20 INTO COM=COMCF
INPUT PROVV F_PROVV SELECT
INPUT ANNO F_ANNO SELECT
INPUT CODNUM F_CODNUM SELECT
INPUT NDOC F_DA_NDOC
DISPLAY "Data@10" DATADOC
DISPLAY "Numero@7" NDOC
DISPLAY "Cliente/Fornitore@40" 20->RAGSOC
DISPLAY "Comune@20" 13->DENCOM
OUTPUT F_DA_NDOC NDOC
// OUTPUT F_DA_DATADOC DATADOC
GROUP 1
ADD RUN ve0 -0
PROMPT 2 9 "Dal numero "
USE 33
JOIN 20 INTO CODCF=CODCF TIPOCF=TIPOCF
JOIN 13 TO 20 INTO COM=COMCF
INPUT PROVV F_PROVV SELECT
INPUT ANNO F_ANNO SELECT
INPUT CODNUM F_CODNUM SELECT
INPUT NDOC F_DA_NDOC
DISPLAY "Data@10" DATADOC
DISPLAY "Numero@7" NDOC
DISPLAY "Cliente/Fornitore@40" 20->RAGSOC
DISPLAY "Comune@20" 13->DENCOM
OUTPUT F_DA_NDOC NDOC
// OUTPUT F_DA_DATADOC DATADOC
GROUP 1
ADD RUN ve0 -0
END
NUMBER F_A_NDOC 7 0
BEGIN
PROMPT 2 11 "Al numero "
USE 33
JOIN 20 INTO CODCF=CODCF TIPOCF=TIPOCF
JOIN 13 TO 20 INTO COM=COMCF
INPUT PROVV F_PROVV SELECT
INPUT ANNO F_ANNO SELECT
INPUT CODNUM F_CODNUM SELECT
INPUT NDOC F_A_NDOC
DISPLAY "Data@10" DATADOC
DISPLAY "Numero@7" NDOC
DISPLAY "Cliente/Fornitore@40" 20->RAGSOC
DISPLAY "Comune@20" 13->DENCOM
OUTPUT F_A_NDOC NDOC
WARNING "Il numero documento deve essere superiore al limite inferiore"
// OUTPUT F_A_DATADOC DATADOC
GROUP 1
ADD RUN ve0 -0
PROMPT 2 11 "Al numero "
USE 33
JOIN 20 INTO CODCF=CODCF TIPOCF=TIPOCF
JOIN 13 TO 20 INTO COM=COMCF
INPUT PROVV F_PROVV SELECT
INPUT ANNO F_ANNO SELECT
INPUT CODNUM F_CODNUM SELECT
INPUT NDOC F_A_NDOC
DISPLAY "Data@10" DATADOC
DISPLAY "Numero@7" NDOC
DISPLAY "Cliente/Fornitore@40" 20->RAGSOC
DISPLAY "Comune@20" 13->DENCOM
OUTPUT F_A_NDOC NDOC
WARNING "Il numero documento deve essere superiore al limite inferiore"
// OUTPUT F_A_DATADOC DATADOC
GROUP 1
ADD RUN ve0 -0
END
DATE F_DA_DATADOC
BEGIN
PROMPT 2 9 "Dalla data "
USE 33 KEY 3 SELECT (PROVV==#F_PROVV) && (ANNO==#F_ANNO) && (CODNUM==#F_CODNUM)
JOIN 20 INTO CODCF=CODCF TIPOCF=TIPOCF
JOIN 13 TO 20 INTO COM=COMCF
INPUT DATADOC F_DA_DATADOC
INPUT PROVV F_PROVV
INPUT ANNO F_ANNO
INPUT CODNUM F_CODNUM
DISPLAY "Data@10" DATADOC
DISPLAY "Numero@7" NDOC
DISPLAY "Cliente/Fornitore@40" 20->RAGSOC
DISPLAY "Comune@20" 13->DENCOM
// COPY DISPLAY F_DA_NDOC
OUTPUT F_DA_NDOC NDOC
OUTPUT F_DA_DATADOC DATADOC
GROUP 2
PROMPT 2 9 "Dalla data "
USE 33 KEY 3 SELECT (PROVV==#F_PROVV) && (ANNO==#F_ANNO) && (CODNUM==#F_CODNUM)
JOIN 20 INTO CODCF=CODCF TIPOCF=TIPOCF
JOIN 13 TO 20 INTO COM=COMCF
INPUT DATADOC F_DA_DATADOC
INPUT PROVV F_PROVV
INPUT ANNO F_ANNO
INPUT CODNUM F_CODNUM
DISPLAY "Data@10" DATADOC
DISPLAY "Numero@7" NDOC
DISPLAY "Cliente/Fornitore@40" 20->RAGSOC
DISPLAY "Comune@20" 13->DENCOM
// COPY DISPLAY F_DA_NDOC
OUTPUT F_DA_NDOC NDOC
OUTPUT F_DA_DATADOC DATADOC
GROUP 2
END
DATE F_A_DATADOC
@ -204,11 +204,11 @@ BEGIN
GROUP 2
END
LIST F_TIPOST 12
RADIOBUTTON F_TIPOST 68
BEGIN
PROMPT 1 13 "Stampa "
ITEM "D|Definitiva"
ITEM "P|Provvisoria"
PROMPT 1 13 "Stampa"
ITEM "D|Definitiva (Solo i documenti non ancora stampati in definitiva)"
ITEM "P|Provvisoria (Tutti i documenti selezionati senza cambiarne lo stato)"
FLAG "P"
END

@ -295,88 +295,92 @@ int TReport_doc::set_printed_status(TDocumento& doc) const
bool TReport_doc::print(const TRecordset& doc, TReport_book& book, bool definitive, word copie, bool can_allegate, bool arc, bool signature)
{
bool printed = false;
const TString old_query = recordset()->query_text();
TDoc_recordset* rs = new TDoc_recordset(doc, old_query);
set_recordset(rs);
bool printed = definitive && !rs->doc().stampabile();
for (int c = 1; ! printed && c <= copie; c++)
TDocumento& d = rs->doc();
if (!definitive || d.stampabile())
{
set_copy(c, copie);
// Tenta di stampare gli allegati solo sull'ultima copia definitiva
if (c == copie && can_allegate)
for (int c = 1; c <= copie; c++)
{
const TDocumento& d = rs->doc();
const TTipo_documento& tipodoc = d.tipo();
if (tipodoc.allega_documenti())
set_copy(c, copie);
// Tenta di stampare gli allegati solo sull'ultima copia definitiva
if (c == copie && can_allegate)
{
const long codcf = d.get_long(CLI_CODCF);
TString_array allegati;
for (bool ok = rs->move_first(); ok; ok = rs->move_next())
const TTipo_documento& tipodoc = d.tipo();
if (tipodoc.allega_documenti())
{
const TString& codart = rs->get("RDOC.CODARTMAG").as_string();
const TRectype& anamag = cache().get(LF_ANAMAG, codart);
TToken_string golem(anamag.get(ANAMAG_GOLEM), '\n');
if (!golem.empty_items())
const long codcf = d.get_long(CLI_CODCF);
TString_array allegati;
for (bool ok = rs->move_first(); ok; ok = rs->move_next())
{
TToken_string key;
key.add(d.get(DOC_PROVV));
key.add(d.get(DOC_ANNO));
key.add(d.get(DOC_CODNUM));
key.add(d.get(DOC_NDOC));
const TString& codart = rs->get("RDOC.CODARTMAG").as_string();
const TRectype& anamag = cache().get(LF_ANAMAG, codart);
TToken_string golem(anamag.get(ANAMAG_GOLEM), '\n');
if (!golem.empty_items())
{
TToken_string key;
key.add(d.get(DOC_PROVV));
key.add(d.get(DOC_ANNO));
key.add(d.get(DOC_CODNUM));
key.add(d.get(DOC_NDOC));
TLocalisamfile alleg(LF_MULTIREL);
alleg.put(MULTI_COD, "ALLEG");
alleg.put(MULTI_FIRST, codcf);
alleg.put(MULTI_SECOND, codart);
alleg.put(MULTI_DATA, key);
TLocalisamfile alleg(LF_MULTIREL);
alleg.put(MULTI_COD, "ALLEG");
alleg.put(MULTI_FIRST, codcf);
alleg.put(MULTI_SECOND, codart);
alleg.put(MULTI_DATA, key);
bool print_alleg = alleg.write() == NOERR; // Se riesco a scrivere vuol dire che non esisteva
bool print_alleg = alleg.write() == NOERR; // Se riesco a scrivere vuol dire che non esisteva
if (!print_alleg)
{
alleg.put(MULTI_COD, "ALLEG");
alleg.put(MULTI_FIRST, codcf);
alleg.put(MULTI_SECOND, codart);
if (alleg.read() == NOERR)
print_alleg = alleg.get(MULTI_DATA) == key;
}
if (print_alleg)
{
FOR_EACH_TOKEN(golem, allegato)
{
TToken_string a(allegato);
TFilename name = a.get();
const bool link = a.get_char(2) > ' ';
if (!link)
if (!print_alleg)
{
alleg.put(MULTI_COD, "ALLEG");
alleg.put(MULTI_FIRST, codcf);
alleg.put(MULTI_SECOND, codart);
if (alleg.read() == NOERR)
print_alleg = alleg.get(MULTI_DATA) == key;
}
if (print_alleg)
{
FOR_EACH_TOKEN(golem, allegato)
{
TFilename golem_path = firm2dir(prefix().get_codditta());
golem_path.add("golem");
golem_path.add(name.name());
name = golem_path;
TToken_string a(allegato);
TFilename name = a.get();
const bool link = a.get_char(2) > ' ';
if (!link)
{
TFilename golem_path = firm2dir(prefix().get_codditta());
golem_path.add("golem");
golem_path.add(name.name());
name = golem_path;
}
if (name.exist())
allegati.add(name);
}
if (name.exist())
allegati.add(name);
}
}
}
set_allegates(allegati);
}
set_allegates(allegati);
}
printed = book.add(*this, false);
if (!printed)
break;
}
printed = book.add(*this, false);
if (!printed)
break;
}
if (printed)
{
if (definitive)
set_printed_status(d);
if (arc)
archive(signature);
}
if (printed && definitive)
set_printed_status(rs->doc());
if (printed && arc)
archive(signature);
set_recordset(old_query);
return printed;
@ -1080,7 +1084,6 @@ bool TReport_doc_app::print_loop(const TString& query, TOutput_mode mode)
}
TReport_doc& report = reports.get(profilo);
if (send_mail)
{
mail_book = new TDoc_book;

@ -629,10 +629,10 @@ bool TDocumento::stampabile() const
{
const char stato_attuale = stato();
if (stato_attuale <= ' ')
return TRUE;
return true;
if (stato_attuale == tipo().stato_finale_stampa())
return FALSE;
return false;
const TString& stati_stampa = tipo().stati_iniziali_stampa();
return stati_stampa.blank() || stati_stampa.find(stato_attuale) >= 0;
@ -2937,11 +2937,11 @@ int TDocumento::set_row_ids()
const TRiga_documento* TDocumento::get_row_id(long id) const
{
for (int r = physical_rows(); r > 0; r--)
TDocumento& doc = *(TDocumento*)this;
FOR_EACH_PHYSICAL_RDOC_BACK(doc, r, row)
{
const TRiga_documento& row = physical_row(r);
if (row.get_long(RDOC_IDRIGA) == id)
return &row;
if (row->get_long(RDOC_IDRIGA) == id)
return row;
}
return NULL;
}

@ -269,7 +269,6 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
if (rif_packed)
{
TString memo(1024);
memo = rout.get(RDOC_DESCR);
if (rout.get_bool(RDOC_DESCLUNGA))
memo << rout.get(RDOC_DESCEST);
@ -281,7 +280,7 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
}
const int maxlen = rout.length(RDOC_DESCR);
if (memo.len() < maxlen && memo.find('\n') < 0)
if (memo.len() < maxlen)
rout.put(RDOC_DESCR, memo);
else
{
@ -297,26 +296,16 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
else
{
// Altrimenti aggiungi il riferimento al memo
TString memo(1024);
memo = rout.get(RDOC_DESCEST);
if (memo.empty())
{
TString80 rif(rout.get(RDOC_DESCR));
rif << '\n'; // Strano \n in un campo di testo normale?????????????????????????
rout.put(RDOC_DESCR, rif);
rout.put(RDOC_DESCLUNGA, true);
}
else
memo << '\n';
memo << riferimento;
TString memo(1024);
memo = rout.get(RDOC_DESCEST);
memo.rtrim();
memo << '\n' << riferimento;
rout.put(RDOC_DESCEST, memo);
}
}
}
const bool ignora_desc = ignora_descrizioni();
TToken_string campi_riga(80);
campi_raggruppamento_righe(campi_riga);
const bool ragg_rig = campi_riga.full();