Patch level : 12.0 842
Files correlati : fp0.exe fp0400a.msk Commento : Aggiunto controllo contabilizzazione senza cod. fornitore
This commit is contained in:
parent
ddc75bbc2e
commit
e32b198b47
@ -72,6 +72,7 @@ protected:
|
|||||||
// Gestione F1
|
// Gestione F1
|
||||||
int prepara_contab() const;
|
int prepara_contab() const;
|
||||||
void log_contab();
|
void log_contab();
|
||||||
|
int check_err() const;
|
||||||
void contabilizza();
|
void contabilizza();
|
||||||
TDate load_data() const;
|
TDate load_data() const;
|
||||||
// Handlers
|
// Handlers
|
||||||
@ -544,6 +545,10 @@ void TPassive_mask::run_cg0(const TString& filename) const
|
|||||||
|
|
||||||
int TPassive_mask::prepara_contab() const
|
int TPassive_mask::prepara_contab() const
|
||||||
{
|
{
|
||||||
|
const int err = check_err();
|
||||||
|
if (err != no_err)
|
||||||
|
return err;
|
||||||
|
|
||||||
int n_sel = 0;
|
int n_sel = 0;
|
||||||
TSheet_field& sf = sfield(F_DOCS);
|
TSheet_field& sf = sfield(F_DOCS);
|
||||||
sf.hide();
|
sf.hide();
|
||||||
@ -557,18 +562,13 @@ int TPassive_mask::prepara_contab() const
|
|||||||
TToken_string keys(prokeys, ';');
|
TToken_string keys(prokeys, ';');
|
||||||
TString codcaus(get_codcaus(row->get(2), row->get(10)));
|
TString codcaus(get_codcaus(row->get(2), row->get(10)));
|
||||||
|
|
||||||
if(!TString(row->get(sf.cid2index(S_NUMREGCONT))).empty())
|
|
||||||
return n+1000;
|
|
||||||
if (codcaus.empty())
|
|
||||||
return no_codcaus;
|
|
||||||
|
|
||||||
TString tipodoc(row->get(sf.cid2index(S_TIPODOCSDI)));
|
TString tipodoc(row->get(sf.cid2index(S_TIPODOCSDI)));
|
||||||
if(tipodoc == "TD01" && !check_causale(codcaus, "FA"))
|
if(tipodoc == "TD01" && !check_causale(codcaus, "FA"))
|
||||||
if(!yesno_box("Attenzione, per un documento di tipo TD01 e' stata selezionata \nuna causale diversa da Fattura d'Acquisto.\nContinuare?"))
|
if(!yesno_box("Attenzione, per un documento di tipo TD01 e' stata selezionata \nuna causale diversa da Fattura d'Acquisto.\nProcedere lo stesso con l'esportazione?"))
|
||||||
return cancel;
|
continue;
|
||||||
if(tipodoc == "TD04" && !check_causale(codcaus, "NC"))
|
if(tipodoc == "TD04" && !check_causale(codcaus, "NC"))
|
||||||
if(!yesno_box("Attenzione, per un documento di tipo TD04 e' stata selezionata \nuna causale diversa da Nota Credito di Acquisto.\nContinuare?"))
|
if(!yesno_box("Attenzione, per un documento di tipo TD04 e' stata selezionata \nuna causale diversa da Nota Credito di Acquisto.\nProcedere lo stesso con l'esportazione?"))
|
||||||
return cancel;
|
continue;
|
||||||
n_sel++;
|
n_sel++;
|
||||||
|
|
||||||
vector<iva>& riva = get_righe_iva(keys);
|
vector<iva>& riva = get_righe_iva(keys);
|
||||||
@ -712,6 +712,25 @@ void TPassive_mask::log_contab()
|
|||||||
log.show_log();
|
log.show_log();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TPassive_mask::check_err() const
|
||||||
|
{
|
||||||
|
TSheet_field& sf = sfield(F_DOCS);
|
||||||
|
FOR_EACH_SHEET_ROW(sf, nr, row)
|
||||||
|
{
|
||||||
|
if (row->starts_with("X"))
|
||||||
|
{
|
||||||
|
TString codcaus(get_codcaus(row->get(2), row->get(10)));
|
||||||
|
if (codcaus.empty())
|
||||||
|
return no_codcaus;
|
||||||
|
if (TString(row->get(cid2index(S_FORNITORE))).empty())
|
||||||
|
return forn_err;
|
||||||
|
if (!TString(row->get(cid2index(S_NUMREGCONT))).empty())
|
||||||
|
return nr + 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return no_err;
|
||||||
|
}
|
||||||
|
|
||||||
void TPassive_mask::contabilizza()
|
void TPassive_mask::contabilizza()
|
||||||
{
|
{
|
||||||
const int stato = prepara_contab();
|
const int stato = prepara_contab();
|
||||||
@ -727,11 +746,13 @@ void TPassive_mask::contabilizza()
|
|||||||
break;
|
break;
|
||||||
case no_codcaus:
|
case no_codcaus:
|
||||||
message_box("Attenzione, il fornitore non ha associato nessun codice causale predefinito.\nPrego selezionare un codice causale per la contabilizzazione.");
|
message_box("Attenzione, il fornitore non ha associato nessun codice causale predefinito.\nPrego selezionare un codice causale per la contabilizzazione.");
|
||||||
fill();
|
|
||||||
break;
|
break;
|
||||||
case no_selected:
|
case no_selected:
|
||||||
message_box("Selezionare almeno un documento.");
|
message_box("Selezionare almeno un documento.");
|
||||||
break;
|
break;
|
||||||
|
case forn_err:
|
||||||
|
warning_box("Almeno un documento selezionato non presenta il codice fornitore. \nSi prega di associare il documento a un fornitore e procedere \nnuovamente con la contabilizzazione.");
|
||||||
|
break;
|
||||||
case cancel:
|
case cancel:
|
||||||
next_page(1000);
|
next_page(1000);
|
||||||
default: break;
|
default: break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user