diff --git a/include/ac_common.php b/include/ac_common.php index 303bc823a..3f0d871ea 100644 --- a/include/ac_common.php +++ b/include/ac_common.php @@ -34,7 +34,7 @@ include_once("constant.php"); * */ function echo_error ($p_log, $p_line="", $p_message="") { - $fdebug=fopen("phpcompta_error.log","a+"); + $fdebug=fopen($_ENV['TMP'].DIRECTORY_SEPARATOR."phpcompta_error.log","a+"); fwrite($fdebug,date("Ymd H:i:s").$p_log." ".$p_line." ".$p_message."\n"); fclose($fdebug); echo_debug($p_log); diff --git a/include/user_form_ven.php b/include/user_form_ven.php index fd70aadd3..4a0b0c97c 100644 --- a/include/user_form_ven.php +++ b/include/user_form_ven.php @@ -541,7 +541,7 @@ function FormVenteView ($p_cn,$p_jrn,$p_periode,$p_array,$p_number,$p_doc='form' // if we were in the management module, appl. propose to generate an invoice // if ( $_SERVER['PHP_SELF'] == '/commercial.php') echo_debug('user_form_ven',__LINE__," _SERVER['PHP_SELF'] ".$_SERVER['PHP_SELF']); - if ( $_SERVER['PHP_SELF'] == '/commercial.php') + if ( basename($_SERVER['PHP_SELF']) == 'commercial.php') { // if a template exists propose to choose an invoice template if ( CountSql($p_cn,