diff --git a/sc/sc0101.cpp b/sc/sc0101.cpp index 04b47d932..06dc178ae 100755 --- a/sc/sc0101.cpp +++ b/sc/sc0101.cpp @@ -564,6 +564,10 @@ bool TFattura_mask::read_scadenze() TRelation rel(LF_PARTITE); rel.curr() = _fattura; autoload(&rel); + + // Attenzione: alcune fatture (*) possono non avere il totale del documento! + if (get(E_TOTALE).empty()) + set(E_TOTALE, _fattura.get(PART_IMPORTO)); // Determino il codice pagamento dalla riga di fattura TString codpag; @@ -841,6 +845,8 @@ bool TGame_mask::edit_fattura(TPartita& p, int nriga) bool TGame_mask::prima_nota(const long nreg) { bool ok = TRUE; + +/* Attualmente tutte le mnodifiche vengono salvata subito if (_changed) { ok = yesno_box("Registrare le parite modificate?"); @@ -850,6 +856,8 @@ bool TGame_mask::prima_nota(const long nreg) _changed = FALSE; // Resetta flag di cambiato } } +*/ + if (ok) { app().partite().destroy(); // Distrugge tutte le partite in memoria diff --git a/sc/sc1200.cpp b/sc/sc1200.cpp index 1f43ea4b8..8355528df 100755 --- a/sc/sc1200.cpp +++ b/sc/sc1200.cpp @@ -214,15 +214,16 @@ int TCreatepart_app::crea_partite(int anno_es, int anno_rif, bool check) } TRiga_partite& riga = game.new_row(); - riga.put(PART_DATAREG, _today); - riga.put(PART_DATADOC, _today); - riga.put(PART_SEZ, saldo.sezione()); - riga.put(PART_IMPORTO, saldo.valore()); + riga.put(PART_DATAREG, _today); + riga.put(PART_DATADOC, _today); + riga.put(PART_SEZ, saldo.sezione()); + riga.put(PART_IMPORTO, saldo.valore()); + riga.put(PART_IMPTOTDOC,saldo.valore()); riga.put(PART_DESCR, cf == 'C' ? _desccl : _descfo); // cazzata dare/avere/fare/baciare/cagare - const tipo_movimento tipo = (cf == 'C' ? (saldo.sezione() == 'D' ? tm_fattura : tm_nota_credito) : - (saldo.sezione() == 'D' ? tm_nota_credito : tm_fattura)); + const tipo_movimento tipo = (cf == 'C') ^ (saldo.sezione() == 'A') ? + tm_fattura : tm_nota_credito; riga.put(PART_TIPOMOV, (int)tipo); if (tipo == tm_fattura)