Patch level : 2.0 592
Files correlati : ve0.exe ve6.exe Ricompilazione Demo : [ ] Commento : AO20097 In fase di bollettazione voglio evadere un ordine già evaso parzialmente, se premo su "Consegna tutte le righe" nella bolla generata mi riporta anche le righe già evase lasciandole tutte con quantità nulla. GF20100 L'evasione di un ordine con riga merce con qtà a blank non riporta alcuna riga evasa nel d.d.t. git-svn-id: svn://10.65.10.50/trunk@11473 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
289f23b1b5
commit
1fd0a23742
@ -1968,17 +1968,17 @@ error_type TContabilizzazione::adjust_iva_rows(TDocumento& doc)
|
||||
TRiepilogo_iva * riep;
|
||||
const int items = _movimento->iva_items();// Numero di righe IVA
|
||||
const bool in_valuta = doc.in_valuta();
|
||||
const real cambio = doc.cambio();
|
||||
const bool calcolo_lordo = doc.tipo().calcolo_lordo();
|
||||
real imponibile;
|
||||
const int ndec = TCurrency::get_firm_dec();
|
||||
const int ndec = TCurrency::get_firm_dec(); // Numero di decimali della valuta di ditta
|
||||
const TString16 codval(doc.get(DOC_CODVAL));
|
||||
const real cambio = doc.cambio();
|
||||
const exchange_type et = doc.get_bool(DOC_CONTROEURO) ? _exchange_contro : _exchange_base;
|
||||
// Scorre tutti gli elementi della tabella IVA del documento (elementi per codice iva)
|
||||
for (riep = (TRiepilogo_iva*) aa.first_item(); riep != NULL; riep = (TRiepilogo_iva*) aa.succ_item())
|
||||
{
|
||||
const TCodiceIVA & cod = riep->cod_iva(); // Codice IVA
|
||||
const TString16 codiva(cod.codice());
|
||||
const TString8 codiva(cod.codice());
|
||||
real iva_g;
|
||||
if (calcolo_lordo)
|
||||
{
|
||||
@ -1995,13 +1995,19 @@ error_type TContabilizzazione::adjust_iva_rows(TDocumento& doc)
|
||||
TCurrency_documento tot(imponibile + iva_g, doc);
|
||||
tot.change_to_firm_val();
|
||||
imponibile = tot.get_num();
|
||||
iva_g = cod.scorpora(imponibile, tot.decimals());
|
||||
iva_g = cod.scorpora(imponibile, ndec);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
TCurrency_documento iva(iva_g, doc);
|
||||
iva.change_to_firm_val();
|
||||
iva_g = iva.get_num();
|
||||
*/
|
||||
TCurrency_documento tot(riep->imponibile() + iva_g, doc);
|
||||
tot.change_to_firm_val();
|
||||
imponibile = tot.get_num();
|
||||
iva_g = cod.scorpora(imponibile, ndec);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2033,7 +2039,7 @@ error_type TContabilizzazione::adjust_iva_rows(TDocumento& doc)
|
||||
if (ie.get(RMI_CODIVA) == codiva) // Se il codice IVA e' uguale
|
||||
{
|
||||
gd_iva.add(ie.get_real(RMI_IMPOSTA)); // Aggiunge al TGeneric_distrib l'imposta corrente
|
||||
if (calcolo_lordo)
|
||||
if (calcolo_lordo || in_valuta)
|
||||
gd_imp.add(ie.get_real(RMI_IMPONIBILE));
|
||||
}
|
||||
}
|
||||
@ -2046,7 +2052,7 @@ error_type TContabilizzazione::adjust_iva_rows(TDocumento& doc)
|
||||
if (ie.get(RMI_CODIVA) == codiva) // Se il codice IVA e' uguale
|
||||
{
|
||||
ie.put(RMI_IMPOSTA,gd_iva.get()); // Sostituisce l'imposta con quella ricalcolata al fine di avere tutto giusto
|
||||
if (calcolo_lordo)
|
||||
if (calcolo_lordo || in_valuta)
|
||||
ie.put(RMI_IMPONIBILE, gd_imp.get());
|
||||
}
|
||||
}
|
||||
@ -2200,7 +2206,7 @@ error_type TContabilizzazione::create_total_doc_row(TDocumento& doc)
|
||||
TString descr = head.get(MOV_DESCR);// La descrizione della riga di totale documento la prende dalla testata
|
||||
|
||||
TConto contro;
|
||||
if (_movimento->iva_items())
|
||||
if (_movimento->iva_items() > 0)
|
||||
{
|
||||
TRectype& first_iva_row = _movimento->iva(0);
|
||||
contro.get(first_iva_row);
|
||||
|
@ -13,6 +13,7 @@
|
||||
class TConsegna_mask : public TAutomask
|
||||
{
|
||||
bool _ordina_per_codice;
|
||||
const TDocumento* _doc;
|
||||
|
||||
protected:
|
||||
virtual bool on_field_event(class TOperable_field& f, TField_event e, long jolly);
|
||||
@ -73,17 +74,24 @@ bool TConsegna_mask::on_field_event(class TOperable_field& f, TField_event e, lo
|
||||
TSheet_field& s = sfield(F_ROWS);
|
||||
FOR_EACH_SHEET_ROW(s, n, row)
|
||||
if (!s.cell_disabled(n,S_RIGACONSEGNATA-FIRST_FIELD))
|
||||
{
|
||||
{
|
||||
bool select = true;
|
||||
const real residuo = row->get(S_QTARESIDUA-FIRST_FIELD);
|
||||
const real evaso = row->get(S_QTADAEVADERE-FIRST_FIELD);
|
||||
|
||||
const real evaso = row->get(S_QTADAEVADERE-FIRST_FIELD);
|
||||
if (evaso == ZERO && residuo > ZERO)
|
||||
{
|
||||
row->add(residuo.string(), S_QTADAEVADERE-FIRST_FIELD);
|
||||
row->add("X", S_RIGAEVASA-FIRST_FIELD);
|
||||
s.disable_cell(n, S_RIGAEVASA-FIRST_FIELD);
|
||||
}
|
||||
row->add("X", S_RIGACONSEGNATA-FIRST_FIELD);
|
||||
if (evaso == ZERO && residuo == ZERO)
|
||||
{
|
||||
const int nriga = row->get_int(S_NUMRIGA-FIRST_FIELD);
|
||||
const TRiga_documento& rdoc = (*_doc)[nriga];
|
||||
select = rdoc.quantita().is_zero();
|
||||
}
|
||||
if (select)
|
||||
row->add("X", S_RIGACONSEGNATA-FIRST_FIELD);
|
||||
}
|
||||
s.force_update();
|
||||
}
|
||||
@ -146,6 +154,7 @@ rows_sort_func(TSheet_field & s, int i, int j)
|
||||
void TConsegna_mask::doc2mask(const TDocumento& doc, const TString & articolo)
|
||||
{
|
||||
TWait_cursor hourglass;
|
||||
_doc = &doc;
|
||||
|
||||
for (int n = fields()-1; n >= 0; n--)
|
||||
{
|
||||
@ -207,7 +216,7 @@ void TConsegna_mask::doc2mask(const TDocumento& doc, const TString & articolo)
|
||||
}
|
||||
|
||||
TConsegna_mask::TConsegna_mask(int header_code, bool per_codice)
|
||||
: TAutomask("velib04d") , _ordina_per_codice(per_codice)
|
||||
: TAutomask("velib04d") , _ordina_per_codice(per_codice), _doc(NULL)
|
||||
{
|
||||
TCodgiac_livelli cl;
|
||||
TSheet_field& s = sfield(F_ROWS);
|
||||
@ -382,7 +391,7 @@ bool TConsegna_ordini::elabora(TLista_documenti& doc_in, TLista_documenti& doc_o
|
||||
const real qta = outrec.get_real(qta_field) + daeva;
|
||||
outrec.put(qta_field, qta);
|
||||
if (qta_field != RDOC_QTA)
|
||||
outrec.put(RDOC_QTA, 1); // Pezza temporanea
|
||||
outrec.put(RDOC_QTA, UNO); // Pezza temporanea
|
||||
outrec.dirty_fields(); // Forza ricalcolo peso etc.
|
||||
elaborata = TRUE; // Ricorda di averla gia' elaborata
|
||||
break;
|
||||
@ -399,9 +408,9 @@ bool TConsegna_ordini::elabora(TLista_documenti& doc_in, TLista_documenti& doc_o
|
||||
outrec.put(qta_field, daeva);
|
||||
if (qta_field != RDOC_QTA)
|
||||
{
|
||||
real q = inrec.get(RDOC_QTA);
|
||||
if (q.is_zero()) q = 1.0;
|
||||
outrec.put(RDOC_QTA, q); // Pezza temporanea
|
||||
const real q = inrec.get(RDOC_QTA);
|
||||
if (q.is_zero())
|
||||
outrec.put(RDOC_QTA, UNO); // Pezza temporanea
|
||||
}
|
||||
outrec.dirty_fields(); // Forza ricalcolo peso etc.
|
||||
outrec.zero(RDOC_QTAEVASA);
|
||||
|
Loading…
x
Reference in New Issue
Block a user