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
@ -139,7 +139,7 @@ BEGIN
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
@ -160,7 +160,7 @@ BEGIN
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
@ -179,7 +179,7 @@ BEGIN
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
@ -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,20 +295,21 @@ 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())
{
for (int c = 1; c <= copie; c++)
{ {
set_copy(c, copie); set_copy(c, copie);
// Tenta di stampare gli allegati solo sull'ultima copia definitiva // Tenta di stampare gli allegati solo sull'ultima copia definitiva
if (c == copie && can_allegate) if (c == copie && can_allegate)
{ {
const TDocumento& d = rs->doc();
const TTipo_documento& tipodoc = d.tipo(); const TTipo_documento& tipodoc = d.tipo();
if (tipodoc.allega_documenti()) if (tipodoc.allega_documenti())
{ {
@ -371,12 +372,15 @@ bool TReport_doc::print(const TRecordset& doc, TReport_book& book, bool definiti
if (!printed) if (!printed)
break; break;
} }
}
if (printed && definitive) if (printed)
set_printed_status(rs->doc()); {
if (definitive)
if (printed && arc) set_printed_status(d);
if (arc)
archive(signature); 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
{ {
@ -298,25 +297,15 @@ bool TFatturazione_bolle::raggruppa(TDocumento& doc_in, TDocumento& doc_out)
{ {
// 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);
if (memo.empty()) memo.rtrim();
{ 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();