Patch level : 10.0 186
Files correlati : ve0.exe Ricompilazione Demo : [ ] Commento : Handler per agganciare la distinta corrispppondente all' articolo di una riga documento. E' l'handler n.ro 7 delle righe documento da agganciare al codice articolo , la funzione si attiva con F8 sul codice aricolo git-svn-id: svn://10.65.10.50/trunk@17835 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
03b704c555
commit
2fa807c9e4
@ -1,4 +1,5 @@
|
||||
#include <applicat.h>
|
||||
#include <execp.h>
|
||||
#include <defmask.h>
|
||||
#include <modaut.h>
|
||||
#include <progind.h>
|
||||
@ -7,6 +8,7 @@
|
||||
#include <smartcard.h>
|
||||
#include <tabutil.h>
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "sconti.h"
|
||||
#include "veini.h"
|
||||
@ -396,8 +398,15 @@ void TDocumento_mask::user_set_row_handler(TMask& rm, short field, int index)
|
||||
if (field == FR_CODART)
|
||||
rm.set_handler( field, link_row_handler );
|
||||
break;
|
||||
case 6: rm.set_handler( field, evasion_check_handler ); break;
|
||||
default:
|
||||
case 6:
|
||||
if (field == FR_CODART)
|
||||
rm.set_handler( field, evasion_check_handler );
|
||||
break;
|
||||
case 7:
|
||||
if (field == FR_CODART)
|
||||
rm.set_handler(field, distinta_link_handler);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1744,6 +1753,7 @@ bool codart_handler(TMask_field& f, KEY key )
|
||||
new_row.zero(RDOC_DESCEST);
|
||||
new_row.put(RDOC_CHECKED, "");
|
||||
new_row.put(RDOC_UMQTA, r.um());
|
||||
new_row.put(RDOC_GENERATA, "X");
|
||||
new_row.put(RDOC_QTA, r.val() /* * qta_fin */);
|
||||
new_row.autoload(sh);
|
||||
sh.check_row(row);
|
||||
@ -2576,3 +2586,47 @@ bool evasion_check_handler(TMask_field& f, KEY key )
|
||||
}
|
||||
|
||||
|
||||
bool distinta_link_handler(TMask_field& f, KEY key )
|
||||
{
|
||||
if (key == K_F8)
|
||||
{
|
||||
TMask& row_mask = f.mask();
|
||||
TSheet_field& sh = *row_mask.get_sheet();
|
||||
|
||||
TFilename tempfile;
|
||||
TCodice_articolo codart(row_mask.get(FR_CODART));
|
||||
const bool exist = !cache().get(LF_DIST, codart).empty();
|
||||
|
||||
tempfile.temp("ve0");
|
||||
tempfile.ext("ini");
|
||||
|
||||
|
||||
{
|
||||
TConfig configfile(tempfile);
|
||||
TString8 para;
|
||||
para << LF_DIST;
|
||||
|
||||
configfile.set("Action", exist ? "Modify" : "Insert", "Transaction");
|
||||
configfile.set("Mode", "R", "Transaction");
|
||||
configfile.set("CODDIST", codart, para);
|
||||
}
|
||||
|
||||
TString commandline;
|
||||
|
||||
commandline.format("db0 -4 /i%s",(const char*)tempfile);
|
||||
|
||||
TExternal_app db(commandline);
|
||||
db.run();
|
||||
|
||||
remove_file(tempfile);
|
||||
|
||||
TDocumento_mask & m = (TDocumento_mask & )sh.mask();
|
||||
const TDocumento & d = m.doc();
|
||||
const int row = sh.selected() + 1;
|
||||
|
||||
if (row < d.physical_rows() && d[row + 1].get_bool(RDOC_GENERATA))
|
||||
return true;
|
||||
}
|
||||
return codart_handler( f, key);
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,8 @@ bool link_handler( TMask_field& f, KEY key );
|
||||
bool cdc_mag_handler(TMask_field& f, KEY key);
|
||||
bool cms_mag_handler(TMask_field& f, KEY key);
|
||||
bool evasion_check_handler( TMask_field& f, KEY key );
|
||||
bool distinta_link_handler(TMask_field& f, KEY key );
|
||||
|
||||
|
||||
|
||||
bool codcms_handler(TMask_field &f, KEY key);
|
||||
|
Loading…
x
Reference in New Issue
Block a user