diff --git a/include/class/acc_plan_mtable.class.php b/include/class/acc_plan_mtable.class.php index 97ea1a2e0..9b8a1c5fb 100644 --- a/include/class/acc_plan_mtable.class.php +++ b/include/class/acc_plan_mtable.class.php @@ -113,7 +113,6 @@ class Acc_Plan_MTable extends Manage_Table_SQL echo ''; $a_code=explode(",",$p_row[$v]); $nb_code=count($a_code); - echo \Noalyss\Dbg::hidden_info("card",$p_row); for ($xx = 0;$xx < $nb_code;$xx++) { echo HtmlInput::card_detail($a_code[$xx],'','style="display:inline"')."," ; diff --git a/include/class/additional_tax.class.php b/include/class/additional_tax.class.php index 9f13df81f..cec720697 100644 --- a/include/class/additional_tax.class.php +++ b/include/class/additional_tax.class.php @@ -160,6 +160,7 @@ class Additional_Tax */ static function display_row($p_jrn_id, &$sum_euro, &$sum_currency, $decalage = 0) { + global $g_parameter; $a_additional_tax = Additional_Tax::get_by_operation($p_jrn_id, $sum_euro, $sum_currency); $nb = count($a_additional_tax); for ($i = 0; $i < $nb; $i++) { @@ -168,7 +169,10 @@ class Additional_Tax echo td($a_additional_tax[$i]->ac_accounting); echo td($a_additional_tax[$i]->ac_label . " ( " . $a_additional_tax[$i]->ac_rate . " %)"); echo td(nbm($a_additional_tax[$i]->tax_amount), 'class="num"'); - echo td("") . td("") . td("") . td(""); + if ($g_parameter->MY_TVA_USE == 'Y') + echo td("") . td("") . td("") . td(""); + else + echo td("") ; for ($e = 0; $e < $decalage; $e++) { echo td(""); } diff --git a/include/class/anticipation.class.php b/include/class/anticipation.class.php index 81d925bd4..9ed971254 100644 --- a/include/class/anticipation.class.php +++ b/include/class/anticipation.class.php @@ -159,13 +159,13 @@ EOF; $form.=HtmlInput::hidden('f_id', $this->getForecastId()); $form.=HtmlInput::hidden('ac', $ac); - echo '
'; + echo ''; echo $form; echo HtmlInput::hidden("action","del"); echo HtmlInput::submit('del_bt', _('Effacer')); echo '
'; - echo '
'; + echo ''; echo $form; echo HtmlInput::hidden("action","clone"); echo HtmlInput::submit("clone_bt",_("Clone")); diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php index 355b3befe..ef4a90e45 100644 --- a/include/class/fiche.class.php +++ b/include/class/fiche.class.php @@ -1368,7 +1368,7 @@ class Fiche $odd=""; $odd = ($i % 2 == 0 ) ? ' odd ': ' even '; - $accounting=$tiers->strAttribut(ATTR_DEF_ACCOUNT); + $accounting=$tiers->strAttribut(ATTR_DEF_ACCOUNT,0); if ( ! empty($accounting) && $p_action == 'bank' && $amount['debit'] < $amount['credit'] && @@ -1393,9 +1393,9 @@ class Fiche $r.=" $e".$tiers->strAttribut(ATTR_DEF_QUICKCODE).""; $r.=" $e".$accounting.""; $r.="".h($tiers->strAttribut(ATTR_DEF_NAME)).""; - $r.="".h($tiers->strAttribut(ATTR_DEF_ADRESS). - " ".$tiers->strAttribut(ATTR_DEF_CP). - " ".$tiers->strAttribut(ATTR_DEF_PAYS)). + $r.="".h($tiers->strAttribut(ATTR_DEF_ADRESS,0). + " ".$tiers->strAttribut(ATTR_DEF_CP,0). + " ".$tiers->strAttribut(ATTR_DEF_PAYS,0)). ""; $r.=''.linkTo($tiers->strAttribut(ATTR_DEF_WEBSITE,0)).''; $str_deb=(($amount['debit']==0)?0:nbm($amount['debit'])); diff --git a/include/compta_ods.inc.php b/include/compta_ods.inc.php index 83952b504..a749e448b 100644 --- a/include/compta_ods.inc.php +++ b/include/compta_ods.inc.php @@ -27,25 +27,24 @@ * quant_purchase and quant_sold are not changed by this * */ -if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis'); -require_once NOALYSS_INCLUDE.'/lib/ac_common.php'; -require_once NOALYSS_INCLUDE.'/lib/function_javascript.php'; +if (!defined('ALLOWED')) die('Appel direct ne sont pas permis'); +require_once NOALYSS_INCLUDE . '/lib/ac_common.php'; +require_once NOALYSS_INCLUDE . '/lib/function_javascript.php'; -global $g_user,$http; +global $g_user, $http; $cn = Dossier::connect(); -$id_predef = $http->request('p_jrn_predef','number',-1); -$id_ledger = $http->request('p_jrn','number',$id_predef); +$id_predef = $http->request('p_jrn_predef', 'number', -1); +$id_ledger = $http->request('p_jrn', 'number', $id_predef); $ledger = new Acc_Ledger($cn, $id_ledger); $first_ledger = $ledger->get_first('ODS'); -if ( empty ($first_ledger)) -{ - exit( ''. - _('Pas de journal disponible'). - ''); +if (empty ($first_ledger)) { + exit('' . + _('Pas de journal disponible') . + ''); } $ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id_ledger; @@ -54,105 +53,91 @@ $def = -1; $ledger->with_concerned = true; - - -if ($g_user->check_jrn($ledger->id) == 'X') -{ - NoAccess(); - exit - 1; +if ($g_user->check_jrn($ledger->id) == 'X') { + NoAccess(); + exit - 1; } -$p_msg=""; -if (!isset($_POST['summary']) && !isset($_POST['save'])) -{ - require NOALYSS_INCLUDE.'/operation_ods_new.inc.php'; - return; -} -elseif (isset($_POST['summary'])) -{ +$p_msg = ""; +if (!isset($_POST['summary']) && !isset($_POST['save'])) { + require NOALYSS_INCLUDE . '/operation_ods_new.inc.php'; + return; +} elseif (isset($_POST['summary'])) { try { $ledger->verify_operation($_POST); - require_once NOALYSS_INCLUDE.'/operation_ods_confirm.inc.php'; - } catch (Exception $e) - { + require_once NOALYSS_INCLUDE . '/operation_ods_confirm.inc.php'; + } catch (Exception $e) { echo alert($e->getMessage()); - $p_msg=$e->getMessage(); - require_once NOALYSS_INCLUDE.'/operation_ods_new.inc.php'; + $p_msg = $e->getMessage(); + require_once NOALYSS_INCLUDE . '/operation_ods_new.inc.php'; } return; -} -elseif (isset($_POST['save'])) -{ - $array = $_POST; - echo '
'; - try - { - $ledger->save($array); - $jr_id=$ledger->jr_id; - - /* save followup */ - $ledger->save_followup($http->request("action_gestion","string","")); - - - echo '

'._("Opération enregistrée")._("Piece") . h($ledger->pj) . '

'; - if (strcmp($ledger->pj, $_POST['e_pj']) != 0) - { - echo '

' . _('Attention numéro pièce existante, elle a du être adaptée') . - '

'; - } - printf('%s
', - $jr_id, dossier::id(), $ledger->internal); +} elseif (isset($_POST['save'])) { + $array = $_POST; + echo '
'; + try { + $ledger->save($array); + $jr_id = $ledger->jr_id; - // show feedback - echo '
'; echo '

' . - $ledger->get_name() . '

'; echo '
'; - echo $ledger->confirm($_POST, true); - // extourne - if (isset($_POST['reverse_ck'])) - { - $p_date=$http->post('reverse_date',"string", ''); - $p_msg=$http->post("ext_label"); - if (isDate($p_date)==$p_date) - { - // reverse the operation - try - { - $ledger->reverse($p_date,$p_msg); - echo '

'; - echo _('Extourné au ').$p_date; - echo '

'; - } - catch (Exception $e) - { - echo ''._('Opération non extournée'). - $e->getMessage(). - ''; - - } - } - else - { - // warning because date is invalid - echo ''._('Date invalide, opération non extournée').''; - } - } - echo '
    '; - echo "
  • "; - echo $ledger->button_new_operation(); - echo "
  • "; - echo "
  • "; - echo $ledger->button_copy_operation(); - echo "
  • "; - echo "
"; - } - catch (Exception $e) - { - require NOALYSS_INCLUDE.'/operation_ods_new.inc.php'; - alert($e->getMessage()); - $p_msg=$e->getMessage(); - } + /* save followup */ + $ledger->save_followup($http->request("action_gestion", "string", "")); + + + echo '

' . _("Opération enregistrée") ." ". _("Piece") ." ". h($ledger->pj) . '

'; + if (strcmp($ledger->pj, $_POST['e_pj']) != 0) { + echo '

' . _('Attention numéro pièce existante, elle a du être adaptée') . + '

'; + } + echo '
'; + echo _("Détail opération"); + echo " "; + printf('%s
', + $jr_id, dossier::id(), $ledger->internal); echo '
'; - return; + + // show feedback + echo '
'; + echo '

' . + $ledger->get_name() . '

'; + echo '
'; + echo $ledger->confirm($_POST, true); + // extourne + if (isset($_POST['reverse_ck'])) { + $p_date = $http->post('reverse_date', "string", ''); + $p_msg = $http->post("ext_label"); + if (isDate($p_date) == $p_date) { + // reverse the operation + try { + $ledger->reverse($p_date, $p_msg); + echo '

'; + echo _('Extourné au ') . $p_date; + echo '

'; + } catch (Exception $e) { + echo '' . _('Opération non extournée') . + $e->getMessage() . + ''; + + } + } else { + // warning because date is invalid + echo '' . _('Date invalide, opération non extournée') . ''; + } + } + echo '
    '; + echo "
  • "; + echo $ledger->button_new_operation(); + echo "
  • "; + echo "
  • "; + echo $ledger->button_copy_operation(); + echo "
  • "; + echo "
"; + } catch (Exception $e) { + require NOALYSS_INCLUDE . '/operation_ods_new.inc.php'; + alert($e->getMessage()); + $p_msg = $e->getMessage(); + } + echo '
'; + return; } return; diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php index 732cd72b2..0def7c302 100644 --- a/include/compta_ven.inc.php +++ b/include/compta_ven.inc.php @@ -274,7 +274,7 @@ try echo HtmlInput::hidden("ledger_type", "VEN"); echo HtmlInput::hidden("ac", $strac); echo HtmlInput::hidden("sa", "p"); - $action_id=$http->get('ag_id',"number"); + $action_id=$http->get('ag_id',"string",""); echo HtmlInput::hidden("action_gestion",$action_id); echo $Ledger->input($array); echo '
'; diff --git a/include/forecast.inc.php b/include/forecast.inc.php index 6eef9ff19..a77a3db0d 100644 --- a/include/forecast.inc.php +++ b/include/forecast.inc.php @@ -138,7 +138,7 @@ if ($sa=="vw") echo HtmlInput::hidden('ac', $ac); $href=http_build_query(array('ac'=>$ac, 'gDossier'=>Dossier::id())); - echo ''._('Retour').''; + echo ''._('Retour').''; echo ''; echo '
'; echo '
'; @@ -196,4 +196,4 @@ if ($sa=='list') return; } ?> - \ No newline at end of file + diff --git a/include/lib/html_input.class.php b/include/lib/html_input.class.php index 167e53264..f44cd7f45 100755 --- a/include/lib/html_input.class.php +++ b/include/lib/html_input.class.php @@ -249,7 +249,7 @@ class HtmlInput $href=""; if ($p_value!="") $href=sprintf(' href ="%s" ', $p_value); - $r=sprintf(' %s', + $r=sprintf(' %s', $p_name, $href, $p_javascript, $p_label); return $r; } diff --git a/include/template/ledger_detail_ach.php b/include/template/ledger_detail_ach.php index d418526e4..87997d6b8 100644 --- a/include/template/ledger_detail_ach.php +++ b/include/template/ledger_detail_ach.php @@ -104,6 +104,25 @@ global $div,$g_parameter,$cn,$access,$jr_id,$obj; + + +
+ set_jrn_id($obj->det->jr_id); + $tag_operation->tag_cell($div); + ?> + + det->jr_id,$div);} + ?> +
+ + diff --git a/include/template/ledger_detail_bottom.php b/include/template/ledger_detail_bottom.php index 6dbd1d3e1..73c434aed 100644 --- a/include/template/ledger_detail_bottom.php +++ b/include/template/ledger_detail_bottom.php @@ -43,7 +43,7 @@ $a_tab['linked_operation_div']=array('id'=>'linked_operation_div'.$div,'label'=> $a_tab['document_operation_div']=array('id'=>'document_operation_div'.$div,'label'=>_('Document').'('.$nb_document.')','display'=>'block'); $a_tab['linked_action_div']=array('id'=>'linked_action_div'.$div,'label'=>_('Actions Gestion').'('.count($a_followup).')','display'=>'none'); $a_tab['analytic_div']=array('id'=>'analytic_div'.$div,'label'=>_('Comptabilité Analytique'),'display'=>'none'); -$a_tab['tag_operation_div']=array('id'=>'tag_operation_div'.$div,'label'=>_('Etiquette'),'display'=>'none'); + // show tabs @@ -316,23 +316,7 @@ require_once NOALYSS_TEMPLATE.'/ledger_detail_file.php'; -
-
- set_jrn_id($obj->det->jr_id); - $tag_operation->tag_cell($div); - ?> - -
- det->jr_id,$div);} - ?> -
+
'; diff --git a/include/template/ledger_detail_fin.php b/include/template/ledger_detail_fin.php index a262ec0b6..0b515cc78 100644 --- a/include/template/ledger_detail_fin.php +++ b/include/template/ledger_detail_fin.php @@ -84,6 +84,25 @@ echo td(_('Pièce')).td($itext->input()); + + +
+ set_jrn_id($obj->det->jr_id); + $tag_operation->tag_cell($div); + ?> + + det->jr_id,$div);} + ?> +
+ + diff --git a/include/template/ledger_detail_misc.php b/include/template/ledger_detail_misc.php index 46f94bdcc..029e7d293 100644 --- a/include/template/ledger_detail_misc.php +++ b/include/template/ledger_detail_misc.php @@ -78,6 +78,25 @@ require_once NOALYSS_TEMPLATE.'/ledger_detail_top.php'; + + +
+ set_jrn_id($obj->det->jr_id); + $tag_operation->tag_cell($div); + ?> + + det->jr_id,$div);} + ?> +
+ + diff --git a/include/template/ledger_detail_ven.php b/include/template/ledger_detail_ven.php index 7581ee836..577d5db96 100644 --- a/include/template/ledger_detail_ven.php +++ b/include/template/ledger_detail_ven.php @@ -116,7 +116,25 @@ $str_anc = ""; - + + +
+ set_jrn_id($obj->det->jr_id); + $tag_operation->tag_cell($div); + ?> + det->jr_id,$div);} + ?> +
+ + +