Patch level : 10.0 285
Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.2 patch 1358 git-svn-id: svn://10.65.10.50/trunk@18724 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d2e77b63fb
commit
78576bdc46
@ -4,6 +4,7 @@
|
||||
|
||||
#include <progind.h>
|
||||
#include <reprint.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include <anagr.h>
|
||||
#include <anafis.h>
|
||||
@ -11,6 +12,7 @@
|
||||
#include <comuni.h>
|
||||
#include <causali.h>
|
||||
#include <nditte.h>
|
||||
#include <attiv.h>
|
||||
#include <mov.h>
|
||||
#include <pconti.h>
|
||||
#include <rmov.h>
|
||||
@ -202,6 +204,21 @@ bool TTS_campo_sender::mov_reverse_charge(const TRecordset& mov)
|
||||
return regsp == 13 || regsp == 50 || regsp == 51;
|
||||
}
|
||||
|
||||
bool TTS_campo_sender::regime_agricolo(const TRecordset& mov) const
|
||||
{
|
||||
TToken_string key;
|
||||
|
||||
key.format("%04d%s", mov.get(MOV_ANNOIVA).as_int(), (const char *) mov.get(MOV_REG).as_string());
|
||||
|
||||
const TRectype& reg = cache().get("REG", key);
|
||||
|
||||
key.cut(0);
|
||||
key.add(prefix().get_codditta());
|
||||
key.add(reg.get("S8"));
|
||||
const TRectype& attiv = cache().get(LF_ATTIV, key);
|
||||
return attiv.get_bool(ATT_REGAGR);
|
||||
}
|
||||
|
||||
TMask & TTS_campo_sender::get_mask()
|
||||
{
|
||||
if (_mask == NULL)
|
||||
|
@ -48,6 +48,8 @@ protected:
|
||||
virtual bool mov_intra(const TRecordset& mov);
|
||||
virtual bool mov_reverse_charge(const TRecordset& mov);
|
||||
virtual long iva11_reverse(const TRecordset & mov);
|
||||
virtual bool regime_agricolo(const TRecordset& mov) const;
|
||||
|
||||
|
||||
public:
|
||||
virtual void postprocess_movs(TRecordset & mov);
|
||||
|
@ -958,7 +958,7 @@ void TTS_sender::add_datiiva(const TRecordset& mov)
|
||||
if (corrispettivo)
|
||||
if (imposta == ZERO)
|
||||
imposta = c.scorpora(imponibile);
|
||||
if (agricolo)
|
||||
if (regime_agricolo(mov) && agricolo)
|
||||
{
|
||||
TString key;
|
||||
key.format("%03ld|%03ld|%06ld", rmoviva.get(RMI_GRUPPO).as_int(), rmoviva.get(RMI_CONTO).as_int(), rmoviva.get(RMI_SOTTOCONTO).as_int());
|
||||
|
@ -59,7 +59,7 @@ protected:
|
||||
const TString & scod2ricl(const char* tab, const TVariant& cod);
|
||||
const long cod2ricl(const char* tab, const TString& cod);
|
||||
const long cod2ricl(const char* tab, const TVariant& cod);
|
||||
const long bill2ricl(char & t, int gr, int co, long so, const bool header_cli = false);
|
||||
const long bill2ricl(char & t, int gr, int co, long so, const bool header_cli = true);
|
||||
virtual void get_citta_provincia(const TRecordset& cli, TString & dencom, TString & provcom, bool nascita = false);
|
||||
virtual const char * decode_causale(const TRecordset& mov) { return EMPTY_STRING; }
|
||||
virtual bool test_swap(const TRecordset& mov) { return false;}
|
||||
@ -76,6 +76,7 @@ protected:
|
||||
virtual TRecordset & rmovrecset(const TRecordset & mov) pure;
|
||||
virtual TRecordset & rivarecset(const TRecordset & mov) pure;
|
||||
virtual const TRecordset & clirecset(const char tipocf, const long codcf) pure;
|
||||
virtual bool regime_agricolo(const TRecordset& mov) const { return false; }
|
||||
virtual TMask & get_mask() pure ;
|
||||
|
||||
public:
|
||||
|
@ -458,6 +458,7 @@ void TTrasferimentoPack_mask::trasferisci()
|
||||
TPack_ddt pc;
|
||||
pc.activate_custref(get_bool(F_CUSTREF));
|
||||
pc.activate_paper_info(get_bool(F_PAPER));
|
||||
pc.activate_paper_size(get_bool(F_SIZE));
|
||||
pc.activate_customer_code(get_bool(F_CUSTCODE));
|
||||
pc.activate_ref_info(get_bool(F_REFINFO));
|
||||
pc.activate_cmsref(get_bool(F_CMSREF));;
|
||||
|
@ -178,7 +178,7 @@ class TPack_ddt : public TPack_transfer
|
||||
{
|
||||
TCache_art* _art;
|
||||
TCache_umart* _umart;
|
||||
bool _cust_ref, _paper_info, _ref_info, _cust_code;
|
||||
bool _cust_ref, _paper_info, _paper_size, _ref_info, _cust_code;
|
||||
bool _cms_ref, _order_paper_info, _extended_discount;
|
||||
TDate _data_limite;
|
||||
TAssoc_array _iva; // Codici IVA PACK
|
||||
@ -203,6 +203,7 @@ public:
|
||||
|
||||
void activate_custref(bool on) { _cust_ref = on; }
|
||||
void activate_paper_info(bool on) { _paper_info = on; }
|
||||
void activate_paper_size(bool on) { _paper_size = on; }
|
||||
void activate_ref_info(bool on) { _ref_info = on; }
|
||||
void activate_cmsref(bool on) { _cms_ref = on; }
|
||||
void set_data_limite(const TDate& data) { _data_limite = data; }
|
||||
|
@ -21,6 +21,7 @@
|
||||
#define F_CMSREF 214
|
||||
#define F_ORDPAPER 215
|
||||
#define F_DISCOUNT 216
|
||||
#define F_SIZE 217
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -36,7 +36,7 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 58 6
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 1 4 "@bTabelle"
|
||||
END
|
||||
@ -72,7 +72,7 @@ ENDPAGE
|
||||
|
||||
PAGE "Configurazione" -1 -1 78 18
|
||||
|
||||
GROUPBOX DLG_NULL 48 5
|
||||
GROUPBOX DLG_NULL 78 5
|
||||
BEGIN
|
||||
PROMPT 1 1 "@bDatabase"
|
||||
END
|
||||
@ -94,7 +94,7 @@ BEGIN
|
||||
FLAGS "*"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 9
|
||||
GROUPBOX DLG_NULL 78 10
|
||||
BEGIN
|
||||
PROMPT 1 6 "@bDocumenti di trasporto"
|
||||
END
|
||||
@ -109,29 +109,34 @@ BEGIN
|
||||
PROMPT 2 8 "Inserire formato carta nella descrizione aggiuntiva"
|
||||
END
|
||||
|
||||
BOOLEAN F_SIZE
|
||||
BEGIN
|
||||
PROMPT 2 9 "Inserire dimensioni articolo nella descrizione aggiuntiva"
|
||||
END
|
||||
|
||||
BOOLEAN F_REFINFO
|
||||
BEGIN
|
||||
PROMPT 2 9 "Inserire riferimenti cliente nella descrizione aggiuntiva"
|
||||
PROMPT 2 10 "Inserire riferimenti cliente nella descrizione aggiuntiva"
|
||||
END
|
||||
|
||||
BOOLEAN F_CMSREF
|
||||
BEGIN
|
||||
PROMPT 2 10 "Inserire riferimenti cliente nel campo CODCMS"
|
||||
PROMPT 2 11 "Inserire riferimenti cliente nel campo CODCMS"
|
||||
END
|
||||
|
||||
BOOLEAN F_CUSTCODE
|
||||
BEGIN
|
||||
PROMPT 2 11 "Utilizzare il codice articolo del cliente (Richiede tipo riga 14)"
|
||||
PROMPT 2 12 "Utilizzare il codice articolo del cliente (Richiede tipo riga 14)"
|
||||
END
|
||||
|
||||
BOOLEAN F_ORDPAPER
|
||||
BEGIN
|
||||
PROMPT 2 12 "Descrizione articoli come da eventuale ordine"
|
||||
PROMPT 2 13 "Descrizione articoli come da eventuale ordine"
|
||||
END
|
||||
|
||||
BOOLEAN F_DISCOUNT
|
||||
BEGIN
|
||||
PROMPT 2 13 "Gestione sconti di riga multipli"
|
||||
PROMPT 2 14 "Gestione sconti di riga multipli"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
@ -612,31 +612,30 @@ bool TPack_indsped::trasferisci()
|
||||
codcf = codcontab.get_long(0);
|
||||
codind = codcontab.get_int();
|
||||
}
|
||||
bool needs_creation = codcf <= 0;
|
||||
bool good = true;
|
||||
if (!needs_creation)
|
||||
|
||||
bool needs_creation = codcf <= 0; // Devo creare un nuovo indirizzo?
|
||||
bool good = true; // Suppongo che il cliente esista in campo
|
||||
if (codcf > 0) // Il campo cliente e' gia' stato inserito in CodContab?
|
||||
{
|
||||
rec_clifo.zero();
|
||||
rec_clifo.put(CLI_TIPOCF, tipocf);
|
||||
rec_clifo.put(CLI_CODCF, codcf);
|
||||
good = clifo.read() == NOERR;
|
||||
if (!good)
|
||||
{
|
||||
// custsupprefcode e' il cliente/fornitore a cui si riferisce l'indirizzo di spedizione
|
||||
const TString& custsupprefcode = get_str("CustSuppRefCode");
|
||||
str.format(FR("Non esiste l'indirizzo di spedizione %ld/%d corrispondente a %s"),
|
||||
codcf, codind, (const char*)custsupprefcode);
|
||||
log(str, 1);
|
||||
}
|
||||
if (good)
|
||||
{
|
||||
rec_indsped.zero();
|
||||
rec_indsped.put(IND_TIPOCF, tipocf);
|
||||
rec_indsped.put(IND_CODCF, codcf);
|
||||
rec_indsped.put(IND_CODCF, codcf);
|
||||
rec_indsped.put(IND_CODIND, codind);
|
||||
good = indsped.read() == NOERR;
|
||||
if (!good)
|
||||
needs_creation = true;
|
||||
needs_creation = indsped.read() != NOERR;
|
||||
}
|
||||
else
|
||||
{
|
||||
// custsupprefcode e' il cliente/fornitore a cui si riferisce l'indirizzo di spedizione
|
||||
const char* custsupprefcode = get_str("CustSuppRefCode");
|
||||
str.format(FR("Non esiste l'indirizzo di spedizione %ld/%d corrispondente a %s"),
|
||||
codcf, codind, custsupprefcode);
|
||||
log(str, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,6 @@ TObject* TCache_art::key2obj(const char* key)
|
||||
_anamag.put(ANAMAG_GRUPPOV, gruconto / 1000);
|
||||
_anamag.put(ANAMAG_CONTOV, gruconto % 1000);
|
||||
_anamag.put(ANAMAG_SOTTOCV, sottoconto);
|
||||
|
||||
test_write(_anamag);
|
||||
}
|
||||
|
||||
@ -430,14 +429,14 @@ bool TPack_ddt::trasferisci()
|
||||
"PDdT_Header.PaymentCode, PDdT_Header.ApplyEnvTax, PDdT_Header.DiscountOnPayment, "
|
||||
"CausaliTrasporto.Code AS CodTrasporto, Porto.Code AS CodResa, CausaliTrasporto.Description1 AS TipoTrasporto, "
|
||||
"Porto.Description1 AS TipoResa, PDdT_Header.Appearance, PDdT_Header.GrossWeight, PDdT_Header.NetWeight, "
|
||||
"PDdT_Header.ShiverNumber, (select case when [PDdT_Header].[BankDesc] is null Or [PDdT_Header].[BankDesc]<>''then "
|
||||
"[PDdT_Header].[BankDesc] else [customers_suppliers].[bankname] end) AS BankDesc, PDdT_Header.CodIvaNI, "
|
||||
"PDdT_Header.ShiverNumber, (select case when PDdT_Header.BankDesc is null Or [PDdT_Header].[BankDesc]<>''then "
|
||||
"PDdT_Header.BankDesc else customers_suppliers.bankname end) AS BankDesc, PDdT_Header.CodIvaNI, "
|
||||
"Customers_Suppliers_2.CustSuppCode AS DestCode, Customers_Suppliers_2.FlagCustSupp AS FlagDestCode, "
|
||||
"Customers_Suppliers_2.CodContab AS DestCodContab, "
|
||||
"Customers_Suppliers_2.TradeName1, Customers_Suppliers_2.Address, Customers_Suppliers_2.Locality, "
|
||||
"Customers_Suppliers_2.ZipCode, Customers_Suppliers_2.Region, PDdT_Row.DocRow, PDdT_Row.ArtCode, "
|
||||
"PDdT_Row.ArtDesc, PDdT_Row.CDocNumber, PDdT_Row.CDocRow, CDoc_Rows.CustReference AS RowCustReference ,CDoc_Header.CustReference, PDdT_Row.Provv, "
|
||||
"PDdT_Row.DiscountRowDesc, " /* "PDdT_Row.Discount2, PDdT_Row.Discount3, " */
|
||||
"PDdT_Row.ArtDesc, PDdT_Row.CDocNumber, PDdT_Row.CDocRow, CDoc_Rows.CustReference AS RowCustReference, CDoc_Header.CustReference, PDdT_Row.Provv, "
|
||||
"PDdT_Row.DiscountRowDesc, CDoc_Header.DocDate AS OrderDate, " /* "PDdT_Row.Discount2, PDdT_Row.Discount3, " */
|
||||
"PDdT_Row.Quantity, Unit_Measure.UMDesc, PDdT_Row.Quantity1, Unit_Measure_1.UMDesc AS UMDesc1, "
|
||||
"PDdT_Row.Quantity2, Unit_Measure_2.UMDesc AS UMDesc2, PDdT_Row.AdvanceSale, PDdT_Row.Price, "
|
||||
"PDdT_Row.DefPrice, PDdT_Row.PriceNet, PDdT_Row.PriceNetDef, PDdT_Row.AmountNet, PDdT_Row.AmountNetDef, "
|
||||
@ -587,7 +586,7 @@ bool TPack_ddt::trasferisci()
|
||||
bool bIsMerce = true;
|
||||
if (qta.is_zero())
|
||||
{
|
||||
rowtype = "05"; // Se la qta e' nulla allora e' una descrizione
|
||||
rowtype = "05"; // Se la qta e' nulla allora e' una descrizione
|
||||
bIsMerce = false;
|
||||
}
|
||||
else
|
||||
@ -670,31 +669,36 @@ bool TPack_ddt::trasferisci()
|
||||
TString info;
|
||||
if (_paper_info)
|
||||
{
|
||||
info = art.get(ANAMAG_USER10);
|
||||
if (info.full())
|
||||
info.insert("\n");
|
||||
|
||||
const TString& pap_comp = art.get(ANAMAG_USER10);
|
||||
if (pap_comp.full())
|
||||
info << "\n" << pap_comp;
|
||||
}
|
||||
|
||||
if (_paper_size)
|
||||
{
|
||||
TString80 misure;
|
||||
misure << get_str("Height") << 'x' << get_str("Width") << 'x'<< get_str("Lenght");
|
||||
misure << get_str("Height") << 'x' << get_str("Width") << 'x' << get_str("Lenght");
|
||||
if (misure[0] > '0')
|
||||
info << "\nMISURE: " << misure;
|
||||
}
|
||||
|
||||
|
||||
if (_ref_info)
|
||||
{
|
||||
TString80 docnum = get_str("CDocNumber"); docnum.trim();
|
||||
if (docnum.full())
|
||||
info << "\nNS.ORD: " << docnum << '.' << get_str("CDocRow");
|
||||
|
||||
const TString& custref = get_customer_reference();
|
||||
if (custref.full())
|
||||
info << "\nVS.ORD: " << custref;
|
||||
info << "\nVs. rifer.: " << custref;
|
||||
|
||||
TString80 docnum = get_str("CDocNumber"); docnum.trim();
|
||||
if (docnum.full())
|
||||
info << "\nNs. Ordine nr. " << docnum << '.' << get_str("CDocRow")
|
||||
<< " del " << get_str("OrderDate");
|
||||
}
|
||||
|
||||
if (info.full())
|
||||
{
|
||||
TString descest;
|
||||
descest << rdoc.get(RDOC_DESCEST) << info;
|
||||
descest.rtrim();
|
||||
rdoc.put(RDOC_DESCLUNGA, "X");
|
||||
rdoc.put(RDOC_DESCEST, descest);
|
||||
}
|
||||
@ -711,7 +715,8 @@ bool TPack_ddt::trasferisci()
|
||||
}
|
||||
}
|
||||
}
|
||||
save_doc(doc, curr_code);
|
||||
|
||||
save_doc(doc, curr_code); // Salva l'eventuale ultimo documento pendente
|
||||
|
||||
return write_enabled();
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ bool TFatturazione_bolle_app::process(TIndwin& iw, TElaborazione & eld,
|
||||
if (ok)
|
||||
{
|
||||
TString msg;
|
||||
msg << din.items() << " documenti raggruppati in " << dout.items();
|
||||
msg << din.items() << TR(" documenti raggruppati in ") << dout.items();
|
||||
iw.set_text(msg); // Messaggio sul cliente
|
||||
do_events(); // Attende visualizzazione
|
||||
|
||||
@ -193,6 +193,7 @@ void TFatturazione_bolle_app::process_by_doc(const TMask& m)
|
||||
char tipocf(t.tipocf());
|
||||
TLista_cf clienti(tipocf);
|
||||
const int tot_cli = clienti.leggi(dc, ac);
|
||||
TLista_documenti din, dout; // Legge tutti i documenti di input
|
||||
|
||||
TString msg(80);
|
||||
for (int c = 0; c < tot_cli && !iw.iscancelled(); c++)
|
||||
@ -203,12 +204,13 @@ void TFatturazione_bolle_app::process_by_doc(const TMask& m)
|
||||
iw.set_text(msg); // Messaggio sul cliente
|
||||
do_events(); // Attende visualizzazione
|
||||
|
||||
TLista_documenti din, dout; // Legge tutti i documenti di input
|
||||
din.read('D', tipocf, codcli, anno, tipidoc, statidoc, dd, ad, codnum, dn, an);
|
||||
TLista_documenti list;
|
||||
|
||||
list.read('D', tipocf, codcli, anno, tipidoc, statidoc, dd, ad, codnum, dn, an);
|
||||
|
||||
for (int i = din.items()-1; i >= 0; i--)
|
||||
for (int i = list.items()-1; i >= 0; i--)
|
||||
{
|
||||
const TDocumento& doc = din[i];
|
||||
const TDocumento& doc = list[i];
|
||||
|
||||
bool to_del = FALSE;
|
||||
const int agente = doc.get_int(DOC_CODAG);
|
||||
@ -226,13 +228,12 @@ void TFatturazione_bolle_app::process_by_doc(const TMask& m)
|
||||
if (to_del)
|
||||
din.destroy(i);
|
||||
}
|
||||
if (din.items() > 0 && !iw.iscancelled())
|
||||
{
|
||||
bool ok = process(iw, eld, din, data_elab);
|
||||
if (!ok) // In caso di errore termina qui l'elaborazione.
|
||||
break;
|
||||
}
|
||||
const int items = list.items();
|
||||
for (int j = 0; j < items; j++)
|
||||
din.add(list[j]);
|
||||
}
|
||||
if (din.items() > 0 && !iw.iscancelled())
|
||||
bool ok = process(iw, eld, din, data_elab);
|
||||
delete e;
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ void TRiga_documento::forza_sola_descrizione()
|
||||
// In realta' il test serve anche a caricare la lista dei tipi riga!
|
||||
if (!tipo_valido() || !is_descrizione())
|
||||
{
|
||||
TString16 cod;
|
||||
TString4 cod;
|
||||
_tipi.restart();
|
||||
for (const TObject* o = _tipi.get(); o; o = _tipi.get())
|
||||
{
|
||||
@ -271,9 +271,9 @@ void TRiga_documento::forza_sola_descrizione()
|
||||
cod = c;
|
||||
}
|
||||
}
|
||||
put("TIPORIGA", cod);
|
||||
zero("QTA");
|
||||
zero("PREZZO");
|
||||
put(RDOC_TIPORIGA, cod);
|
||||
zero(RDOC_QTA);
|
||||
zero(RDOC_PREZZO);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include <execp.h>
|
||||
#include <progind.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "velib04.h"
|
||||
|
||||
@ -166,12 +168,24 @@ int TLista_documenti::read(char provv, char tipocf, long clifo, int anno,
|
||||
|
||||
int TLista_documenti::write(bool re) const
|
||||
{
|
||||
const int docs = _documenti.items();
|
||||
TString msg;
|
||||
if (re)
|
||||
msg.format(FR("Aggiornamento di %d documenti"), docs);
|
||||
else
|
||||
msg.format(FR("Creazione di %d documenti"), docs);
|
||||
|
||||
TProgind pi(docs, msg, true, true);
|
||||
int err = NOERR;
|
||||
for (int i = 0; i < _documenti.items() && err == NOERR; i++)
|
||||
for (int i = 0; i < docs && err == NOERR; i++)
|
||||
{
|
||||
err = doc(i).write(re);
|
||||
((TDocumento&)doc(i)).flush_rows();
|
||||
TDocumento& d = (TDocumento&)doc(i);
|
||||
err = d.write(re);
|
||||
d.flush_rows();
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -454,8 +468,7 @@ int TElaborazione::read(const char* cod)
|
||||
|
||||
TElaborazione_esterna::TElaborazione_esterna(const char* cod)
|
||||
: TElaborazione(cod)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
bool TElaborazione_esterna::elabora(TLista_documenti& doc_in, TLista_documenti& doc_out,
|
||||
const TDate& data_elab, bool interattivo)
|
||||
|
Loading…
x
Reference in New Issue
Block a user