Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/branches/R_10_00@22044 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a29efbd07e
commit
f60fd159de
@ -98,7 +98,7 @@ void THardy_esselunga::check_date(const TDate& datafine, TDate& dataini)
|
||||
long THardy_esselunga::genera_recordset(const TMask& mask, TISAM_recordset& recset)
|
||||
{
|
||||
TString query;
|
||||
query << "USE DOC \n";
|
||||
query << "USE DOC KEY 3\n";
|
||||
|
||||
TString filt_expr;
|
||||
// aggiungo alla query le condizioni sulle numerazioni selezionare da maschera
|
||||
@ -139,6 +139,7 @@ long THardy_esselunga::genera_recordset(const TMask& mask, TISAM_recordset& recs
|
||||
recset.set_var("#DATAFIN", datafin);
|
||||
return recset.items();
|
||||
}
|
||||
|
||||
TFilename THardy_esselunga::scrivi_testata(const TMask& mask)
|
||||
{
|
||||
const TString4 dipendenza = mask.get(F_DIPENDENZA);
|
||||
|
@ -193,10 +193,10 @@ TFatture_recordset::TFatture_recordset()
|
||||
add_field("BGM.ID-EDI-DEST-1", AN, 35, 57, true, piva_esselunga);
|
||||
add_field("BGM.ID-EDI-DEST-2", AN, 4, 92, true, tipo_emissione);
|
||||
add_field("BGM.ID-EDI-DEST-3", AN, 14, 96);
|
||||
add_field("BGM.TIPODOC", AN, 6, 110, true, "INVOIC");
|
||||
add_field("BGM.TIPODOC", AN, 6, 110, true);
|
||||
add_field("BGM.NUMDOC", AN, 35, 116, true);
|
||||
add_field("BGM.DATADOC", DA, 8, 151, true);
|
||||
add_field("BGM.ORADOC", NU, 4, 159);
|
||||
add_field("BGM.ORADOC", AN, 4, 159);
|
||||
add_field("BGM.FILLER", AN, 6, 163);
|
||||
add_field("BGM.FINERECORD", AN, 2, 0, true, "\r\n");
|
||||
|
||||
@ -328,18 +328,19 @@ TFatture_recordset::TFatture_recordset()
|
||||
|
||||
// Record ALD: sconti di riga
|
||||
add_field("ALD.TIPOREC", AN, 3, 1, true, "ALD");
|
||||
add_field("ALD.INDSCADD", AN, 3, 4);
|
||||
add_field("ALD.INDSCADD", AN, 3, 4, true, "A");
|
||||
add_field("ALD.DESCR", AN, 35, 7);
|
||||
add_field("ALD.INDSEQ", NU, 3, 42);
|
||||
add_field("ALD.TIPOSCADD", AN, 6, 45);
|
||||
add_field("ALD.INDSEQ", AN, 3, 42);
|
||||
add_field("ALD.TIPOSCADD", AN, 6, 45, true, "TD");
|
||||
add_field("ALD.IMPORTO", NS, 16, 51);
|
||||
add_field("ALD.PERC", NU, 7, 67, true);
|
||||
add_field("ALD.PERC", AN, 7, 67, true);
|
||||
add_field("ALD.FLGPRZUN", AN, 3, 74);
|
||||
add_field("ALD.FINERECORD", AN, 2, 0, true, "\r\n");
|
||||
|
||||
// Record NAD: identificazione punto di consegna
|
||||
add_field("NAD.TIPOREC", AN, 3, 1, true, "NAD");
|
||||
add_field("NAD.CODCONS", NU, 6, 4);
|
||||
add_field("NAD.CODCONS1", NU, 2, 4, true, "00");
|
||||
add_field("NAD.CODCONS2", AN, 4, 6);
|
||||
add_field("NAD.QCODCONS", AN, 3, 21, true, "92");
|
||||
add_field("NAD.RAGSOCD", AN, 70, 24, true);
|
||||
add_field("NAD.INDIRD", AN, 70, 94, true);
|
||||
@ -409,7 +410,7 @@ protected:
|
||||
long genera_recordset(const TMask& mask, TISAM_recordset& recset);
|
||||
void elabora(const TMask& mask);
|
||||
void check_date(const TDate& datafine, TDate& dataini);
|
||||
long check_cliente(const long codcf);
|
||||
TString4 check_cliente(const long codcf);
|
||||
void add_rec_testata(TFatture_recordset& fat, TDocumento& doc);
|
||||
void add_rec_sommario(TFatture_recordset& fat, TDocumento& doc);
|
||||
void add_recs_dettaglio(TFatture_recordset& fat, TDocumento& doc);
|
||||
@ -432,7 +433,7 @@ void THardy_esselunga_fat::check_date(const TDate& datafine, TDate& dataini)
|
||||
long THardy_esselunga_fat::genera_recordset(const TMask& mask, TISAM_recordset& recset)
|
||||
{
|
||||
TString query;
|
||||
query << "USE DOC \n";
|
||||
query << "USE DOC KEY 3\n";
|
||||
|
||||
TString filt_expr;
|
||||
// aggiungo alla query le condizioni sulle numerazioni selezionare da maschera
|
||||
@ -483,8 +484,13 @@ void THardy_esselunga_fat::add_rec_testata(TFatture_recordset& fat, TDocumento&
|
||||
numdoc << cache().get("%NUM", num, "S7");
|
||||
numdoc.strip("/");
|
||||
numdoc = numdoc.right(12);
|
||||
|
||||
if (doc.tipo().nota_credito())
|
||||
fat.set("BGM.TIPODOC", "NOTACC"); // nota di credito
|
||||
else
|
||||
fat.set("BGM.TIPODOC", "INVOIC"); // fattura
|
||||
fat.set("BGM.NUMDOC", numdoc);
|
||||
fat.set("BGM.DATADOC", doc.data());
|
||||
fat.set("BGM.DATADOC", TVariant(doc.data()));
|
||||
|
||||
fat.new_rec("NAS");
|
||||
fat.new_rec("NAI");
|
||||
@ -492,24 +498,27 @@ void THardy_esselunga_fat::add_rec_testata(TFatture_recordset& fat, TDocumento&
|
||||
|
||||
fat.new_rec("PAT");
|
||||
fat.set("PAT.DESCRIZ", doc.pagamento().name());
|
||||
fat.set("PAT.DATASCAD", doc.pagamento().data_rata(0));
|
||||
fat.set("PAT.IMPORTO", doc.pagamento().importo_da_dividere());
|
||||
fat.set("PAT.DATASCAD", TVariant(doc.pagamento().data_rata(0)));
|
||||
fat.set("PAT.IMPORTO", TVariant(doc.pagamento().importo_rata(0)));
|
||||
TString8 tp = doc.pagamento().tipo_prima_rata();
|
||||
real imp = doc.pagamento().importo_rata(0);
|
||||
}
|
||||
|
||||
void THardy_esselunga_fat::add_rec_sommario(TFatture_recordset& fat, TDocumento& doc)
|
||||
{
|
||||
//fat.new_rec("FTT"); non ci sono note nel documento!
|
||||
// se c'e' sconto scrivo il record corrispondente
|
||||
/*
|
||||
real r;
|
||||
TString80 s;
|
||||
bool sconto = scontoexpr2perc(doc.get(DOC_SCONTOPERC), FALSE, s, r);
|
||||
if ( sconto && r != ZERO)
|
||||
if (sconto && r != ZERO)
|
||||
{
|
||||
fat.new_rec("ALT");
|
||||
fat.set("ALT.IMPORTO", r);
|
||||
fat.set("ALT.PERC", s);
|
||||
}
|
||||
|
||||
*/
|
||||
TAssoc_array& tabella_iva = doc.tabella_iva();
|
||||
TRiepilogo_iva* ri;
|
||||
for (ri = (TRiepilogo_iva*) tabella_iva.first_item(); ri != NULL; ri = (TRiepilogo_iva*) tabella_iva.succ_item())
|
||||
@ -536,7 +545,7 @@ void THardy_esselunga_fat::add_rec_sommario(TFatture_recordset& fat, TDocumento&
|
||||
fat.set("TMA.TOTDOC1", doc.totale_doc());
|
||||
fat.set("TMA.IMPOSTA1", doc.imposta());
|
||||
fat.set("TMA.IMPONIB1", doc.imponibile());
|
||||
fat.set("TMA.TOTRIGHE1", doc.totale_netto());
|
||||
fat.set("TMA.TOTRIGHE1", doc.get_real("TOTMER"));
|
||||
fat.set("TMA.TOTANT1", "");
|
||||
}
|
||||
|
||||
@ -581,11 +590,18 @@ void THardy_esselunga_fat::add_recs_dettaglio(TFatture_recordset& fat, TDocument
|
||||
if (tipo == "NS")
|
||||
tipo_hardy = "E";
|
||||
fat.set("TAX.CATIMP", tipo_hardy);
|
||||
|
||||
//fat.new_rec("ALD");
|
||||
// gestione sconto riga
|
||||
real sconto = rigadoc->sconto();
|
||||
if (!sconto.is_zero())
|
||||
{
|
||||
fat.new_rec("ALD");
|
||||
TString8 str = sconto.stringa(8,4,'0');
|
||||
str.strip(",");
|
||||
fat.set("ALD.PERC", str);
|
||||
}
|
||||
fat.new_rec("NAD");
|
||||
const long codcf = doc.codcf();
|
||||
const long codcf_esselunga = check_cliente(codcf);
|
||||
const TString4 codcf_esselunga = check_cliente(codcf);
|
||||
TToken_string key;
|
||||
key.add("C"); key.add(codcf);
|
||||
const TRectype& rec_cli = cache().get(LF_CLIFO, key);
|
||||
@ -594,7 +610,7 @@ void THardy_esselunga_fat::add_recs_dettaglio(TFatture_recordset& fat, TDocument
|
||||
key.cut(0);
|
||||
key.add(stato); key.add(comune);
|
||||
const TRectype& com = cache().get(LF_COMUNI, key);
|
||||
fat.set("NAD.CODCONS", codcf_esselunga);
|
||||
fat.set("NAD.CODCONS2", codcf_esselunga);
|
||||
fat.set("NAD.RAGSOCD", rec_cli.get(CLI_RAGSOC));
|
||||
TString80 str;
|
||||
str.cut(0);
|
||||
@ -613,7 +629,9 @@ void THardy_esselunga_fat::add_recs_dettaglio(TFatture_recordset& fat, TDocument
|
||||
numdoc.strip("/");
|
||||
numdoc = numdoc.right(12);
|
||||
fat.set("NAD.NUMDOC", numdoc);
|
||||
fat.set("NAD.DATADOC", doc.data());
|
||||
fat.set("NAD.DATADOC", TVariant(doc.data()));
|
||||
fat.set("NAD.NUMBOLLA", numdoc);
|
||||
fat.set("NAD.DATABOLL", TVariant(doc.data()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -640,8 +658,8 @@ void THardy_esselunga_fat::elabora(const TMask& mask)
|
||||
|
||||
const long codcf = recset.get(DOC_CODCF).as_int();
|
||||
// verificare se il cliente ha tutti i parametri per poter essere inviato (invio e codice cliente per hardy)
|
||||
const long codcf_esselunga = check_cliente(codcf);
|
||||
if ( codcf_esselunga > 0)
|
||||
const TString4 codcf_esselunga = check_cliente(codcf);
|
||||
if (codcf_esselunga.not_empty())
|
||||
{
|
||||
TDocumento* doc = new TDocumento(recset.cursor()->curr());
|
||||
add_rec_testata(fatture, *doc);
|
||||
@ -656,15 +674,19 @@ void THardy_esselunga_fat::elabora(const TMask& mask)
|
||||
log.print_or_preview();
|
||||
}
|
||||
|
||||
long THardy_esselunga_fat::check_cliente(const long codcf)
|
||||
TString4 THardy_esselunga_fat::check_cliente(const long codcf)
|
||||
{
|
||||
long codcf_hardy = -1;
|
||||
TString4 codcf_hardy = "";
|
||||
TString key;
|
||||
key.format("%ld", codcf);
|
||||
const TRectype rec_cliente = cache().get("&CEL", key);
|
||||
const bool invio = rec_cliente.get_bool("B0");
|
||||
const char dipendenza = rec_cliente.get("S1")[0];
|
||||
if (invio)
|
||||
codcf_hardy = rec_cliente.get_long("I0");
|
||||
{
|
||||
codcf_hardy << dipendenza;
|
||||
codcf_hardy << format("%03d", rec_cliente.get_long("I0"));
|
||||
}
|
||||
return codcf_hardy;
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ END
|
||||
|
||||
BOOLEAN F_DEFINITIVO
|
||||
BEGIN
|
||||
PROMPT 2 5 "Trasferimento definitivo"
|
||||
PROMPT 2 6 "Trasferimento definitivo"
|
||||
END
|
||||
|
||||
SPREADSHEET F_SHEETDOC 78
|
||||
|
Loading…
x
Reference in New Issue
Block a user