check_module('PREDOP') == 0) exit(); $name=HtmlInput::default_value_post("opd_name", ""); if ( trim($name) != '') { $od_id=HtmlInput::default_value_post("od_id", -1); if ( $od_id == -1 ||isNumber($od_id) == 0) return; $cn->exec_sql('delete from op_predef where od_id=$1', array($od_id)); $cn->exec_sql("delete from op_predef_detail where od_id=$1",array($od_id)); $jrn_type=HtmlInput::default_value_post("jrn_type", null); switch ($jrn_type) { case 'ACH': $operation=new Pre_op_ach($cn); break; case 'VEN': $operation=new Pre_op_ven($cn); break; case 'ODS': $operation=new Pre_Op_Advanced($cn); break; default : throw new Exception(_('Type de journal invalide')); } $operation->get_post(); $operation->save(); $cn->commit(); } ?>