Scartati articoli non a magazzino da invio Esselunga
git-svn-id: svn://10.65.10.50/branches/R_10_00@22920 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a1ebb0c715
commit
bb9b591e96
@ -118,7 +118,7 @@ protected:
|
||||
bool genera_eff(const TDocumento& fat, const real& tot_nac, TLog_report& log);
|
||||
|
||||
//metodi basso livello
|
||||
word find_contratti_cliente(const long codcfatt, const TMask& mask, int flags, TArray& contratti_cliente);
|
||||
word find_contratti_cliente(const long codcfatt, const TMask& mask, int flags, char freq, TArray& contratti_cliente);
|
||||
void check_date(const TDate& datafine, TDate& dataini);
|
||||
int find_numerazioni(const TString& tipo_to_elab, TString_array& num_doc);
|
||||
int month_diff(const TDate& inizio, const TDate& fine) const;
|
||||
@ -284,7 +284,7 @@ long THardy_elab_docs::genera_recordset(const TMask& mask, TISAM_recordset& recs
|
||||
|
||||
//metodo che riempie un array con tutti i contratti del cliente passatogli (in base alla tipologia di contratti da elaborare)
|
||||
// flags: 0x7 = tutti tranne nolo; 0x8 = nolo
|
||||
word THardy_elab_docs::find_contratti_cliente(const long codcfatt, const TMask& mask, int flags, TArray& contratti_cliente)
|
||||
word THardy_elab_docs::find_contratti_cliente(const long codcfatt, const TMask& mask, int flags, char selected_freq, TArray& contratti_cliente)
|
||||
{
|
||||
word freq = 0;
|
||||
contratti_cliente.destroy();
|
||||
@ -345,6 +345,16 @@ word THardy_elab_docs::find_contratti_cliente(const long codcfatt, const TMask&
|
||||
//aggiunge i contratti all'array: solo quelli in auge nel periodo di calcolo selezionato sulla maschera!
|
||||
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
||||
{
|
||||
// Ignora contratti conm frequenza indesiderata
|
||||
if ( (f < 3) && selected_freq >= 'A')
|
||||
{
|
||||
char fr = recset.get(DOC_CATVEN).as_string()[0];
|
||||
if (fr < 'A') fr = 'A';
|
||||
if (fr != selected_freq)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
//contratti anticipo 'A': datainizio esiste sempre, datafine non esiste (va ad esaurimento)
|
||||
//contratti nolo 'N': datainizio esiste sempre, datafine esiste sempre
|
||||
//contratti posticipo 'P': datainizio esiste sempre, datafine può non esistere
|
||||
@ -1060,11 +1070,12 @@ void THardy_elab_docs::elabora_documenti(const TMask& mask, TISAM_recordset& fat
|
||||
TAssoc_array fat_nolo;
|
||||
|
||||
const int tc = mask.get_int(F_TIPOCONTR); // 0x7 (tutti tranne nolo) o 0x8 (solo nolo)
|
||||
const char fr = (tc & 0x8) ? 'M' : mask.get(F_FREQUENZA)[0];
|
||||
|
||||
if (tc & 0x8) // Elaborazione nolo?
|
||||
{
|
||||
// Elabora tutti i contratti di nolo per generare fatture ed effetti
|
||||
const word freq = find_contratti_cliente(mask.get_long(F_CODCF), mask, 0x8, contratti_cliente);
|
||||
const word freq = find_contratti_cliente(mask.get_long(F_CODCF), mask, 0x8, fr, contratti_cliente);
|
||||
if (freq) // Nolo sarebbe solo mensile -> if (freq == 0x01)
|
||||
{
|
||||
FOR_EACH_ARRAY_ROW(contratti_cliente, n_nolo, r_nolo)
|
||||
@ -1103,7 +1114,7 @@ void THardy_elab_docs::elabora_documenti(const TMask& mask, TISAM_recordset& fat
|
||||
//aggiorna old_codcf in modo da poter controllare i contratti solo al cambio codcf
|
||||
old_codcf = codcf;
|
||||
documenti_cliente.destroy();
|
||||
const word freq = find_contratti_cliente(codcf, mask, tc, contratti_cliente);
|
||||
const word freq = find_contratti_cliente(codcf, mask, tc, fr, contratti_cliente);
|
||||
if (freq != 0)
|
||||
{
|
||||
TString8 key; key.format("C|%ld", codcf);
|
||||
@ -1145,7 +1156,7 @@ void THardy_elab_docs::elabora(const TMask& mask)
|
||||
nac_killed = kill_provv_nac(mask);
|
||||
|
||||
//log report con segnalazioni sui clienti trattati (bene o male)
|
||||
TLog_report log("Sintesi elaborazione");
|
||||
TLog_report log(TR("Sintesi elaborazione"));
|
||||
log.log(0, "");
|
||||
|
||||
//2) recordset ordinato codag-codcf-numdoc con tutti i docs che soddisfano i parametri dell'utente
|
||||
|
@ -13,4 +13,5 @@
|
||||
#define F_DATAELAB 214
|
||||
#define F_DEFINITIVO 215
|
||||
#define F_KILLPROVV 216
|
||||
#define F_DATANOLO 217
|
||||
#define F_DATANOLO 217
|
||||
#define F_FREQUENZA 218
|
||||
|
@ -99,14 +99,25 @@ BEGIN
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
RADIOBUTTON F_TIPOCONTR 1 76
|
||||
RADIOBUTTON F_TIPOCONTR 1 56
|
||||
BEGIN
|
||||
PROMPT 1 10 "@bContratti da elaborare"
|
||||
ITEM "7|Anticipo/Posticipo/Rifatturazione"
|
||||
MESSAGE ENABLE,F_FREQUENZA
|
||||
ITEM "8|Nolo"
|
||||
MESSAGE DISABLE,F_FREQUENZA
|
||||
END
|
||||
|
||||
STRING DLG_PROFILE 50
|
||||
RADIOBUTTON F_FREQUENZA 1 17
|
||||
BEGIN
|
||||
PROMPT 59 10 "@bFrequenza"
|
||||
ITEM "T|Trimestre"
|
||||
ITEM "S|Semestre"
|
||||
ITEM "A|Anno"
|
||||
ITEM " |Tutte"
|
||||
END
|
||||
|
||||
STRING DLG_PROFILE 46
|
||||
BEGIN
|
||||
PROMPT 1 -1 "Profilo "
|
||||
PSELECT
|
||||
|
@ -547,19 +547,25 @@ bool THardy_esselunga_fat::esistono_righe_esselunga(const TDocumento& doc) const
|
||||
{
|
||||
FOR_EACH_PHYSICAL_RDOC((TDocumento&)doc, r, rigadoc)
|
||||
{
|
||||
const TString& codart = rigadoc->get(RDOC_CODART);
|
||||
const TString& codart_esselunga = ((TCodArtEsselunga_cache&)_cache_ca).decode(codart);
|
||||
if (codart_esselunga.full())
|
||||
return true;
|
||||
const TString& codart = rigadoc->get(RDOC_CODARTMAG);
|
||||
if (codart.full())
|
||||
{
|
||||
const TString& codart_esselunga = ((TCodArtEsselunga_cache&)_cache_ca).decode(codart);
|
||||
if (codart_esselunga.full())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void THardy_esselunga_fat::add_recs_dettaglio(TFatture_recordset& fat, TDocumento& doc)
|
||||
{
|
||||
TString codart;
|
||||
FOR_EACH_PHYSICAL_RDOC(doc, r, rigadoc)
|
||||
{
|
||||
const TString16 codart = rigadoc->get(RDOC_CODART);
|
||||
codart = rigadoc->get(RDOC_CODARTMAG);
|
||||
if (codart.blank())
|
||||
continue;
|
||||
const TString& codart_esselunga = _cache_ca.decode(codart);
|
||||
if (codart_esselunga.blank())
|
||||
continue;
|
||||
|
44
ha/halib.cpp
44
ha/halib.cpp
@ -83,14 +83,20 @@ TContratto_premi::TContratto_premi(const TRectype& rec_doc)
|
||||
|
||||
TObject* TCodArtEsselunga_cache::key2obj(const char* key)
|
||||
{
|
||||
TToken_string code(key);
|
||||
TString80 codart; code.get(0, codart);
|
||||
const TString& codcf = ini_get_string(CONFIG_DITTA, "ha", "Esselunga_CodEsselunga");
|
||||
TISAM_recordset codcorr("USE CODCORR\nSELECT CODCF=#CODCF\nFROM CODART=#COD\nTO CODART=#COD");
|
||||
codcorr.set_var("#COD", TVariant(codart));
|
||||
codcorr.set_var("#CODCF", TVariant(codcf));
|
||||
if (codcorr.move_first())
|
||||
return new TString80(codcorr.get(CODCORR_CODARTALT).as_string());
|
||||
if (key && *key)
|
||||
{
|
||||
TToken_string code(key);
|
||||
TString80 codart; code.get(0, codart);
|
||||
if (codart.full())
|
||||
{
|
||||
const TString& codcf = ini_get_string(CONFIG_DITTA, "ha", "Esselunga_CodEsselunga");
|
||||
TISAM_recordset codcorr("USE CODCORR\nSELECT CODCF=#CODCF\nFROM CODART=#COD\nTO CODART=#COD");
|
||||
codcorr.set_var("#COD", TVariant(codart));
|
||||
codcorr.set_var("#CODCF", TVariant(codcf));
|
||||
if (codcorr.move_first())
|
||||
return new TString80(codcorr.get(CODCORR_CODARTALT).as_string());
|
||||
}
|
||||
}
|
||||
return new TString4;
|
||||
}
|
||||
|
||||
@ -101,14 +107,20 @@ const TString& TCodArtEsselunga_cache::decode(const TString& codart)
|
||||
|
||||
TObject* TCodArtEsselungaUM_cache::key2obj(const char* key)
|
||||
{
|
||||
TToken_string code(key);
|
||||
TString80 codart; code.get(0, codart);
|
||||
const TString& codcf = ini_get_string(CONFIG_DITTA, "ha", "Esselunga_CodEsselunga");
|
||||
TISAM_recordset codcorr("USE CODCORR\nSELECT CODCF=#CODCF\nFROM CODART=#COD\nTO CODART=#COD");
|
||||
codcorr.set_var("#COD", TVariant(codart));
|
||||
codcorr.set_var("#CODCF", TVariant(codcf));
|
||||
if (codcorr.move_first())
|
||||
return new TString4(codcorr.get(CODCORR_UM).as_string());
|
||||
if (key && *key)
|
||||
{
|
||||
TToken_string code(key);
|
||||
TString80 codart; code.get(0, codart);
|
||||
if (codart.full())
|
||||
{
|
||||
const TString& codcf = ini_get_string(CONFIG_DITTA, "ha", "Esselunga_CodEsselunga");
|
||||
TISAM_recordset codcorr("USE CODCORR\nSELECT CODCF=#CODCF\nFROM CODART=#COD\nTO CODART=#COD");
|
||||
codcorr.set_var("#COD", TVariant(codart));
|
||||
codcorr.set_var("#CODCF", TVariant(codcf));
|
||||
if (codcorr.move_first())
|
||||
return new TString4(codcorr.get(CODCORR_UM).as_string());
|
||||
}
|
||||
}
|
||||
return new TString4;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user