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

View File

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

View File

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

View File

@ -629,10 +629,10 @@ bool TDocumento::stampabile() const
{ {
const char stato_attuale = stato(); const char stato_attuale = stato();
if (stato_attuale <= ' ') if (stato_attuale <= ' ')
return TRUE; return true;
if (stato_attuale == tipo().stato_finale_stampa()) if (stato_attuale == tipo().stato_finale_stampa())
return FALSE; return false;
const TString& stati_stampa = tipo().stati_iniziali_stampa(); const TString& stati_stampa = tipo().stati_iniziali_stampa();
return stati_stampa.blank() || stati_stampa.find(stato_attuale) >= 0; 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 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)
if (row.get_long(RDOC_IDRIGA) == id) return row;
return &row;
} }
return NULL; return NULL;
} }

View File

@ -269,7 +269,6 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
if (rif_packed) if (rif_packed)
{ {
TString memo(1024); TString memo(1024);
memo = rout.get(RDOC_DESCR); memo = rout.get(RDOC_DESCR);
if (rout.get_bool(RDOC_DESCLUNGA)) if (rout.get_bool(RDOC_DESCLUNGA))
memo << rout.get(RDOC_DESCEST); 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); const int maxlen = rout.length(RDOC_DESCR);
if (memo.len() < maxlen && memo.find('\n') < 0) if (memo.len() < maxlen)
rout.put(RDOC_DESCR, memo); rout.put(RDOC_DESCR, memo);
else else
{ {
@ -297,26 +296,16 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
else else
{ {
// Altrimenti aggiungi il riferimento al memo // Altrimenti aggiungi il riferimento al memo
TString memo(1024); TString memo(1024);
memo = rout.get(RDOC_DESCEST);
memo = rout.get(RDOC_DESCEST); memo.rtrim();
if (memo.empty()) memo << '\n' << riferimento;
{
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;
rout.put(RDOC_DESCEST, memo); rout.put(RDOC_DESCEST, memo);
} }
} }
} }
const bool ignora_desc = ignora_descrizioni(); const bool ignora_desc = ignora_descrizioni();
TToken_string campi_riga(80); TToken_string campi_riga(80);
campi_raggruppamento_righe(campi_riga); campi_raggruppamento_righe(campi_riga);
const bool ragg_rig = campi_riga.full(); const bool ragg_rig = campi_riga.full();