task #6427 : Ajout modif parametre conf->global->MAIN_USE_PREVIEW_TABS
This commit is contained in:
parent
cc6e66f513
commit
87b3784cea
@ -52,12 +52,13 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update')
|
||||
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"]);
|
||||
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"]);
|
||||
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"]);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["disable_javascript"]);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_AJAX", $_POST["disable_ajax"]);
|
||||
dolibarr_set_const($db, "MAIN_POPUP_CALENDAR", $_POST["popup_calendar"]);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"]);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_AJAX", $_POST["main_disable_ajax"]);
|
||||
dolibarr_set_const($db, "MAIN_POPUP_CALENDAR", $_POST["main_popup_calendar"]);
|
||||
dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["main_use_preview_tabs"]);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_SHOW_BUGTRACK_LINK", $_POST["bugtrack"]);
|
||||
dolibarr_set_const($db, "MAIN_SHOW_WORKBOARD", $_POST["workboard"]);
|
||||
dolibarr_set_const($db, "MAIN_SHOW_BUGTRACK_LINK", $_POST["main_show_bugtrack_link"]);
|
||||
dolibarr_set_const($db, "MAIN_SHOW_WORKBOARD", $_POST["main_show_workboard"]);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_MENU_BARRETOP", $_POST["main_menu_barretop"]);
|
||||
dolibarr_set_const($db, "MAIN_MENU_BARRELEFT", $_POST["main_menu_barreleft"]);
|
||||
@ -118,24 +119,24 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
|
||||
$html->selectyesnonum('bugtrack',$conf->global->MAIN_SHOW_BUGTRACK_LINK);
|
||||
$html->selectyesnonum('main_show_bugtrack_link',$conf->global->MAIN_SHOW_BUGTRACK_LINK);
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowWorkBoard").'</td><td>';
|
||||
$html->selectyesnonum('workboard',$conf->global->MAIN_SHOW_WORKBOARD);
|
||||
$html->selectyesnonum('main_show_workboard',$conf->global->MAIN_SHOW_WORKBOARD);
|
||||
print '</td></tr>';
|
||||
|
||||
// Désactiver javascript
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
|
||||
$html->selectyesnonum('disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0);
|
||||
$html->selectyesnonum('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0);
|
||||
print '</td></tr>';
|
||||
|
||||
// Désactiver ajax
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableAjax").'</td><td>';
|
||||
$html->selectyesnonum('disable_ajax',isset($conf->global->MAIN_DISABLE_AJAX)?$conf->global->MAIN_DISABLE_AJAX:1);
|
||||
$html->selectyesnonum('main_disable_ajax',isset($conf->global->MAIN_DISABLE_AJAX)?$conf->global->MAIN_DISABLE_AJAX:1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Désactiver le calendrier popup
|
||||
@ -145,10 +146,16 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
'0'=>$langs->trans("No"),
|
||||
'eldy'=>$langs->trans("Yes").' (style eldy)',
|
||||
'andre'=>$langs->trans("Yes").' (style andre)');
|
||||
$html->select_array('popup_calendar',$liste_popup_calendar,$conf->global->MAIN_POPUP_CALENDAR);
|
||||
$html->select_array('main_popup_calendar',$liste_popup_calendar,$conf->global->MAIN_POPUP_CALENDAR);
|
||||
print ' ('.$langs->trans("AvailableOnlyIfJavascriptNotDisabled").')';
|
||||
print '</td></tr>';
|
||||
|
||||
// Activer onglet preview
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
|
||||
$html->selectyesnonum('main_use_preview_tabs',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
@ -274,6 +281,11 @@ else
|
||||
else print ($conf->global->MAIN_POPUP_CALENDAR?$langs->trans("Yes").' (style '.$conf->global->MAIN_POPUP_CALENDAR.')':$langs->trans("No"));
|
||||
print "</td></tr>";
|
||||
|
||||
// Activer onglet preview
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
|
||||
print yn(isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:1)."</td></tr>";
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -28,100 +28,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/** \class PaiementCharge
|
||||
\brief Classe permettant la gestion des paiements des charges
|
||||
*/
|
||||
class PaiementCharge
|
||||
{
|
||||
var $db;
|
||||
|
||||
var $id;
|
||||
var $chid;
|
||||
var $paiementtype;
|
||||
var $datepaye;
|
||||
var $amounts;
|
||||
var $num_paiement;
|
||||
var $note;
|
||||
|
||||
function PaiementCharge($DB) {
|
||||
$this->db = $DB;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Creation d'un paiement de charge sociale
|
||||
* \param user Utilisateur qui crée le paiement
|
||||
* \return int <0 si erreur, >0 si ok
|
||||
*/
|
||||
function create($user) {
|
||||
$sql_err = 0;
|
||||
/*
|
||||
* Insertion dans la base
|
||||
*/
|
||||
if ($this->db->begin())
|
||||
{
|
||||
$total = 0;
|
||||
foreach ($this->amounts as $key => $value)
|
||||
{
|
||||
$facid = $key;
|
||||
$value = trim($value);
|
||||
$amount = round(price2num($value), 2); // Un round est ok si nb avec '.'
|
||||
if (is_numeric($amount)) $total += $amount;
|
||||
}
|
||||
$total = price2num($total);
|
||||
|
||||
if ($total > 0)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiementcharge (fk_charge, datec, datep, amount, fk_typepaiement, num_paiement, note, fk_user_creat)";
|
||||
$sql .= " VALUES ($this->chid, now(), $this->datepaye, '$total', $this->paiementtype, '$this->num_paiement', '$this->note', $user->id)";
|
||||
|
||||
if ( $this->db->query($sql) )
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."paiementcharge");
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_err++;
|
||||
dolibarr_syslog("chargessociales::create Echec $sql");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($total > 0 && $sql_err == 0)
|
||||
{
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank générée
|
||||
* \param id_bank Id de la banque
|
||||
* \return int 1 ou 0
|
||||
*/
|
||||
function update_fk_bank($id_bank) {
|
||||
$sql = "UPDATE llx_paiementcharge set fk_bank = ".$id_bank." where rowid = ".$this->id;
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() ."<br>".$sql;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** \class ChargeSociales
|
||||
\brief Classe permettant la gestion des paiements des charges
|
||||
La tva collectée n'est calculée que sur les factures payées.
|
||||
@ -154,17 +60,20 @@ class ChargeSociales
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
$sql = "SELECT cs.rowid,".$this->db->pdate("cs.date_ech")." as date_ech,".$this->db->pdate("cs.date_pai")." as date_pai";
|
||||
$sql .=", cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, ".$this->db->pdate("cs.periode")." as periode, c.libelle";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs, ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql .= " WHERE cs.fk_type = c.id";
|
||||
$sql .=" AND cs.rowid = ".$id;
|
||||
$sql = "SELECT cs.rowid,".$this->db->pdate("cs.date_ech")." as date_ech,".$this->db->pdate("cs.date_pai")." as date_pai,";
|
||||
$sql.= " cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, ".$this->db->pdate("cs.periode")." as periode,";
|
||||
$sql.= " c.libelle";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs, ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= " WHERE cs.fk_type = c.id";
|
||||
$sql.= " AND cs.rowid = ".$id;
|
||||
|
||||
if ($this->db->query($sql))
|
||||
dolibarr_syslog("ChargesSociales::fetch sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
$obj = $this->db->fetch_object();
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->date_ech = $obj->date_ech;
|
||||
@ -182,15 +91,43 @@ class ChargeSociales
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
$this->db->free();
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
return 0;
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Crée une charge sociale
|
||||
* \param user Utilisateur qui crée
|
||||
* \return int <0 si erreur, >0 si ok
|
||||
*/
|
||||
function create($user)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount)";
|
||||
$sql.= " VALUES (".$this->type.",'".addslashes($this->lib)."',";
|
||||
$sql.= "'".$this->date_ech."','".$this->periode."',";
|
||||
$sql.= "'".$this->amount."'";
|
||||
$sql.= ')';
|
||||
|
||||
dolibarr_syslog("ChargesSociales::create sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Efface un charge sociale
|
||||
* \param user Utilisateur qui crée le paiement
|
||||
@ -199,9 +136,17 @@ class ChargeSociales
|
||||
function delete($user)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales where rowid='".$this->id."'";
|
||||
if (! $this->db->query($sql))
|
||||
|
||||
dolibarr_syslog("ChargesSociales::delete sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -238,7 +183,7 @@ class ChargeSociales
|
||||
*/
|
||||
function set_payed($rowid)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales set paye=1 WHERE rowid = $rowid ;";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales set paye=1 WHERE rowid = ".$rowid;
|
||||
$return = $this->db->query( $sql);
|
||||
}
|
||||
|
||||
@ -299,4 +244,102 @@ class ChargeSociales
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** \class PaiementCharge
|
||||
\brief Classe permettant la gestion des paiements des charges
|
||||
*/
|
||||
class PaiementCharge
|
||||
{
|
||||
var $db;
|
||||
|
||||
var $id;
|
||||
var $chid;
|
||||
var $paiementtype;
|
||||
var $datepaye;
|
||||
var $amounts;
|
||||
var $num_paiement;
|
||||
var $note;
|
||||
|
||||
|
||||
function PaiementCharge($DB)
|
||||
{
|
||||
$this->db = $DB;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Creation d'un paiement de charge sociale dans la base
|
||||
* \param user Utilisateur qui crée le paiement
|
||||
* \return int <0 si KO, id du paiement crée si OK
|
||||
*/
|
||||
function create($user)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$total = 0;
|
||||
foreach ($this->amounts as $key => $value)
|
||||
{
|
||||
$facid = $key;
|
||||
$value = trim($value);
|
||||
$amount = round(price2num($value), 2); // Un round est ok si nb avec '.'
|
||||
if (is_numeric($amount)) $total += $amount;
|
||||
}
|
||||
$total = price2num($total);
|
||||
|
||||
if ($total > 0)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiementcharge (fk_charge, datec, datep, amount, fk_typepaiement, num_paiement, note, fk_user_creat)";
|
||||
$sql .= " VALUES ($this->chid, now(), $this->datepaye, '$total', $this->paiementtype, '$this->num_paiement', '$this->note', $user->id)";
|
||||
|
||||
dolibarr_syslog("PaiementCharges::create sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."paiementcharge");
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($total > 0 && ! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dolibarr_syslog("PaiementCharges::create ".$this->error);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank générée
|
||||
* \param id_bank Id de la banque
|
||||
* \return int 1 ou 0
|
||||
*/
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
$sql = "UPDATE llx_paiementcharge set fk_bank = ".$id_bank." where rowid = ".$this->id;
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error()." sql=".$sql;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -319,7 +319,7 @@ if ($_GET["action"] == 'create')
|
||||
*
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
print "</table>";
|
||||
print "</form>\n";
|
||||
// }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -27,24 +27,22 @@
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require(DOL_DOCUMENT_ROOT."/chargesociales.class.php");
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
|
||||
|
||||
// Protection
|
||||
$user->getrights('compta');
|
||||
|
||||
if (!$user->admin && !$user->rights->tax->charges)
|
||||
accessforbidden();
|
||||
|
||||
require("../../chargesociales.class.php");
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
$chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"];
|
||||
|
||||
|
||||
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* Action Classer Payé */
|
||||
@ -56,7 +54,29 @@ if ($_GET["action"] == 'payed')
|
||||
$result = $cha->set_payed($chid);
|
||||
}
|
||||
|
||||
/*
|
||||
* Suppression d'une charge sociale
|
||||
*/
|
||||
|
||||
if ($_GET["action"] == 'del' && $_POST["confirm"] == 'yes')
|
||||
{
|
||||
$chargesociales=new ChargeSociales($db);
|
||||
$chargesociales->id=$_GET["id"];
|
||||
$result=$chargesociales->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$chargesociales->error.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
@ -69,12 +89,13 @@ if ($chid > 0)
|
||||
|
||||
$cha = new ChargeSociales($db);
|
||||
|
||||
/*
|
||||
* Charge
|
||||
*/
|
||||
if ($cha->fetch($chid) > 0)
|
||||
{
|
||||
/*
|
||||
* Charge
|
||||
*/
|
||||
|
||||
if ($mesg) print $mesg.'<br>';
|
||||
|
||||
//$head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id;
|
||||
$head[0][1] = $langs->trans("SocialContribution").": $cha->id";
|
||||
$h = 1;
|
||||
@ -88,7 +109,7 @@ if ($chid > 0)
|
||||
*/
|
||||
if ($_GET["action"] == 'delete')
|
||||
{
|
||||
$html->form_confirm("index.php?id=$cha->id&action=del","Supprimer la charge sociale","Etes-vous sûr de vouloir supprimer cette charge sociale ?","confirm_delete");
|
||||
$html->form_confirm($_SERVER["PHP_SELF"]."?id=$cha->id&action=del","Supprimer la charge sociale","Etes-vous sûr de vouloir supprimer cette charge sociale ?","confirm_delete");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@ -98,7 +119,18 @@ if ($chid > 0)
|
||||
|
||||
print "<tr><td>".$langs->trans("Type")."</td><td>$cha->type_libelle</td><td>".$langs->trans("Payments")."</td></tr>";
|
||||
|
||||
print "<tr><td>".$langs->trans("Period")."</td><td>".dolibarr_print_date($cha->periode,"%Y")."</td>";
|
||||
print "<tr><td>".$langs->trans("Period")."</td>";
|
||||
print "<td>";
|
||||
if ($cha->paye==0)
|
||||
{
|
||||
print "<input type=\"text\" name=\"period\" value=\"".strftime("%Y%m%d",$cha->period)."\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
print dolibarr_print_date($cha->periode,"%Y");
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print '<td rowspan="5" valign="top">';
|
||||
|
||||
/*
|
||||
@ -135,7 +167,7 @@ if ($chid > 0)
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($fac->paye == 0)
|
||||
if ($cha->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"2\" align=\"right\">Total payé:</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td>".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
print "<tr><td colspan=\"2\" align=\"right\">Réclamé :</td><td align=\"right\" bgcolor=\"#d0d0d0\">".price($cha->amount)."</td><td bgcolor=\"#d0d0d0\">".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
@ -156,10 +188,11 @@ if ($chid > 0)
|
||||
|
||||
print "</tr>";
|
||||
|
||||
if ($cha->paye==0) {
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="desc" size="40" value="'.stripslashes($cha->lib).'"></td></tr>';
|
||||
if ($cha->paye==0)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="desc" size="40" value="'.$cha->lib.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td><input type=\"text\" name=\"amount\" value=\"".strftime("%Y%m%d",$cha->date_ech)."\"></td></tr>";
|
||||
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td><b><input type=\"text\" name=\"amount\" value=\"$cha->amount\"></b></td></tr>";
|
||||
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td><b><input type=\"text\" name=\"amount\" value=\"".$cha->amount."\"></b></td></tr>";
|
||||
}
|
||||
else {
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$cha->lib.'</td></tr>';
|
||||
@ -168,7 +201,7 @@ if ($chid > 0)
|
||||
}
|
||||
|
||||
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$cha->getLibStatut().'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$cha->getLibStatut(4).'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -208,7 +241,7 @@ if ($chid > 0)
|
||||
else
|
||||
{
|
||||
/* Charge non trouvée */
|
||||
print "Charge inexistante ou accés refusé";
|
||||
dolibarr_print_error('',$cha->error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -39,9 +39,6 @@ if (!$user->admin && ! $user->rights->tax->charges->lire)
|
||||
accessforbidden();
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
$sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
||||
$sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||
$page = $_GET["page"];
|
||||
@ -53,6 +50,11 @@ $offset = $limit * $page ;
|
||||
if (! $sortfield) $sortfield="c.id";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
$year=$_GET["year"];
|
||||
$filtre=$_GET["filtre"];
|
||||
//if (! $year) { $year=date("Y", time()); }
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Ajout d'une charge sociale
|
||||
@ -60,33 +62,38 @@ if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
if ($_POST["action"] == 'add')
|
||||
{
|
||||
if (! $_POST["date"] || ! $_POST["periode"] || ! $_POST["amount"]) {
|
||||
$mesg="<div class=\"error\">Erreur: Tous les champs date et montant doivent etre renseignés avec une valeur non vide.</div>";
|
||||
}
|
||||
else {
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount) ";
|
||||
$sql .= " VALUES (".$_POST["type"].",'".addslashes($_POST["libelle"])."','".$_POST["date"]."','".$_POST["periode"]."','".$_POST["amount"]."');";
|
||||
|
||||
if (! $db->query($sql) )
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
else {
|
||||
$mesg="<div class=\"ok\">La charge a été ajoutée.</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Suppression d'une charge sociale
|
||||
*/
|
||||
|
||||
if ($_GET["action"] == 'del' && $_POST["confirm"] == 'yes')
|
||||
{
|
||||
$chargesociales=new ChargeSociales($db);
|
||||
$chargesociales->id=$_GET["id"];
|
||||
$result=$chargesociales->delete($user);
|
||||
if (! $_POST["date"])
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>';
|
||||
}
|
||||
elseif (! $_POST["periode"])
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")).'</div>';
|
||||
}
|
||||
elseif (! $_POST["amount"])
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")).'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$chargesociales=new ChargeSociales($db);
|
||||
|
||||
$chargesociales->type=$_POST["type"];
|
||||
$chargesociales->lib=$_POST["libelle"];
|
||||
$chargesociales->date_ech=$_POST["date"];
|
||||
$chargesociales->period=$_POST["period"];
|
||||
$chargesociales->amount=$_POST["amount"];
|
||||
|
||||
$result=$chargesociales->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$mesg='<div class="ok">'.$langs->trans("SocialContributionAdded").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$chargesociales->error.'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -95,9 +102,7 @@ if ($_GET["action"] == 'del' && $_POST["confirm"] == 'yes')
|
||||
* Affichage liste et formulaire des charges.
|
||||
*/
|
||||
|
||||
$year=$_GET["year"];
|
||||
$filtre=$_GET["filtre"];
|
||||
//if (! $year) { $year=date("Y", time()); }
|
||||
llxHeader();
|
||||
|
||||
print_fiche_titre($langs->trans("SocialContributions"),($year?"<a href='index.php?year=".($year-1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='index.php?year=".($year+1)."'>".img_next()."</a>":""));
|
||||
print "<br>\n";
|
||||
|
||||
@ -21,6 +21,7 @@ UseSearchToSelectProduct=Use a search form to choose a product (intead of using
|
||||
NotAvailableWhenAjaxDisabled=Not available when Ajax disabled
|
||||
JavascriptDisabled=Javascript disabled
|
||||
UsePopupCalendar=Use popup for dates input
|
||||
UsePreviewTabs=Use preview tabs
|
||||
NextValue=Next value
|
||||
NextValueForInvoices=Next value (invoices)
|
||||
NextValueForCreditNotes=Next value (credit notes)
|
||||
|
||||
@ -3,7 +3,7 @@ ErrorPasswordDiffers=Passwords differs, please type them again.
|
||||
ErrorForbidden=Access forbidden.<br>You try to access to a page, area or feature without being in an authenticated session or that is not allowed to your user.
|
||||
ErrorForbidden2=Permission for this login can be defined by your Dolibarr administrator from menu %s->%s.
|
||||
ErrorForbidden3=It seems that Dolibarr is not used through an authenticated session. Take a look at Dolibarr setup documentation to know how to manage authentications (htaccess, mod_auth or other...).
|
||||
ErrorNoImagickReadimage=Function imagick_readimage is not found in this PHP. No preview can be available.
|
||||
ErrorNoImagickReadimage=Function imagick_readimage is not found in this PHP. No preview can be available. Administrators can disable this tab from menu Setup - Display.
|
||||
ErrorRecordAlreadyExists=Record already exists
|
||||
ErrorCantReadFile=Failed to read file '%s'
|
||||
ErrorCantReadDir=Failed to read directory '%s'
|
||||
|
||||
@ -21,6 +21,7 @@ UseSearchToSelectProduct=Utiliser un formulaire de recherche pour choix d'un pro
|
||||
NotAvailableWhenAjaxDisabled=Non disponible quand Ajax désactivé
|
||||
JavascriptDisabled=Javascript désactivé
|
||||
UsePopupCalendar=Utiliser les popups pour la saisie des dates
|
||||
UsePreviewTabs=Afficher les onglets "Aperçu"
|
||||
NextValue=Prochaine valeur
|
||||
NextValueForInvoices=Prochaine valeur (factures)
|
||||
NextValueForCreditNotes=Prochaine valeur (avoirs)
|
||||
|
||||
@ -3,7 +3,7 @@ ErrorPasswordDiffers=Les mots de passe ne sont pas identiques, veuillez les sais
|
||||
ErrorForbidden=Accès non autorisé.<br>Vous essayez d'accéder à une page, zone ou fonction sans être au sein d'une session authentifiée ou qui n'est pas autorisée pour votre compte utilisateur.
|
||||
ErrorForbidden2=Les permissions pour ce login peuvent être attribuées par l'administrateur Dolibarr via le menu %s -> %s.
|
||||
ErrorForbidden3=Dolibarr ne semble pas fonctionner au sein d'une session authentifiée. Consultez la documentation d'installation de Dolibarr pour savoir comment gérer les authentifications (htaccess, mod_auth ou autre...).
|
||||
ErrorNoImagickReadimage=La fonction imagick_readimage n'est pas présente sur cette installation de PHP. L'aperçu n'est donc pas disponible.
|
||||
ErrorNoImagickReadimage=La fonction imagick_readimage n'est pas présente sur cette installation de PHP. L'aperçu n'est donc pas disponible. Les administrateurs pouvent désactiver cet onglet dans le menu Configuration - Affichage.
|
||||
ErrorRecordAlreadyExists=Enregistrement déjà existant
|
||||
ErrorCantReadFile=Echec de lecture du fichier '%s'
|
||||
ErrorCantReadDir=Echec de lecture du répertoire '%s'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user