Patch level : 2.2
Files correlati : ve0 Ricompilazione Demo : [ ] Commento : Aggiunta commessa automaticamente anche nelle righe spese generate git-svn-id: svn://10.65.10.50/trunk@13754 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
0b64b3ae0f
commit
44922a7656
@ -2206,26 +2206,23 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old,
|
|||||||
sh->destroy(i - 1);
|
sh->destroy(i - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TString4 cod_iva_cli;
|
|
||||||
const int nspese = spese_aut.items();
|
const int nspese = spese_aut.items();
|
||||||
if (nspese > 0)
|
if (nspese > 0)
|
||||||
{
|
{
|
||||||
TLocalisamfile cfven(LF_CFVEN);
|
TString16 key; key.format("%c|%ld", get_char(DOC_TIPOCF), get_long(DOC_CODCF));
|
||||||
|
const TString4 cod_iva_cli = cache().get(LF_CFVEN, key, "ASSFIS");
|
||||||
|
|
||||||
TSpesa_prest sp;
|
TSpesa_prest sp;
|
||||||
cfven.put("TIPOCF", get("TIPOCF"));
|
|
||||||
cfven.put("CODCF", get("CODCF"));
|
|
||||||
if (cfven.read() == NOERR)
|
|
||||||
cod_iva_cli = cfven.get("ASSFIS");
|
|
||||||
for (i = 0; i < nspese; i++)
|
for (i = 0; i < nspese; i++)
|
||||||
{
|
{
|
||||||
const TString & s = spese_aut.row(i);
|
const TString& s = spese_aut.row(i);
|
||||||
|
|
||||||
if (sp.read(s) != NOERR)
|
if (sp.read(s) != NOERR)
|
||||||
message_box("Codice spesa %s assente", (const char *) s);
|
message_box("Codice spesa %s assente", (const char *) s);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TString16 tipo(sp.tipo_riga());
|
const TString4 tipo(sp.tipo_riga());
|
||||||
TRiga_documento & riga = new_row(tipo);
|
TRiga_documento& riga = new_row(tipo);
|
||||||
|
|
||||||
riga.put(RDOC_CODART, s);
|
riga.put(RDOC_CODART, s);
|
||||||
riga.generata();
|
riga.generata();
|
||||||
@ -2236,13 +2233,14 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old,
|
|||||||
{
|
{
|
||||||
real qta = sp.qta();
|
real qta = sp.qta();
|
||||||
if (qta == ZERO)
|
if (qta == ZERO)
|
||||||
qta = 1.0;
|
qta = UNO;
|
||||||
riga.put("QTA", qta);
|
riga.put("QTA", qta);
|
||||||
}
|
}
|
||||||
|
// Continua perche' e' quantita' e valore
|
||||||
case 'V':
|
case 'V':
|
||||||
{
|
{
|
||||||
const real cambio = get_real(DOC_CAMBIO);
|
const real cambio = get_real(DOC_CAMBIO);
|
||||||
const TString16 valuta = get(DOC_CODVAL);
|
const TString4 valuta = get(DOC_CODVAL);
|
||||||
const exchange_type controeuro = get_bool(DOC_CONTROEURO) ? _exchange_contro : _exchange_base;
|
const exchange_type controeuro = get_bool(DOC_CONTROEURO) ? _exchange_contro : _exchange_base;
|
||||||
real prezzo = sp.prezzo();
|
real prezzo = sp.prezzo();
|
||||||
|
|
||||||
@ -2257,9 +2255,14 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (cod_iva_cli.empty())
|
if (cod_iva_cli.empty())
|
||||||
riga.put("CODIVA", sp.cod_iva());
|
riga.put(RDOC_CODIVA, sp.cod_iva());
|
||||||
else
|
else
|
||||||
riga.put("CODIVA", cod_iva_cli);
|
riga.put(RDOC_CODIVA, cod_iva_cli);
|
||||||
|
|
||||||
|
riga.put(RDOC_CODCOSTO, sp.cdc());
|
||||||
|
riga.put(RDOC_CODCMS, sp.cms());
|
||||||
|
riga.put(RDOC_FASCMS, sp.fase());
|
||||||
|
|
||||||
if (interactive)
|
if (interactive)
|
||||||
{
|
{
|
||||||
const int nrow = sh->insert(-1, FALSE);
|
const int nrow = sh->insert(-1, FALSE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user