La date sur formulaire saisi charge est une date
This commit is contained in:
parent
b203600997
commit
2656ace64b
@ -120,8 +120,8 @@ class ChargeSociales
|
|||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount)";
|
||||||
$sql.= " VALUES (".$this->type.",'".addslashes($this->lib)."',";
|
$sql.= " VALUES (".$this->type.",'".addslashes($this->lib)."',";
|
||||||
$sql.= "'".$this->date_ech."','".$this->periode."',";
|
$sql.= " '".$this->db->idate($this->date_ech)."','".$this->periode."',";
|
||||||
$sql.= " ".$newamount;
|
$sql.= " ".price2num($newamount);
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dolibarr_syslog("ChargesSociales::create sql=".$sql);
|
dolibarr_syslog("ChargesSociales::create sql=".$sql);
|
||||||
@ -177,7 +177,7 @@ class ChargeSociales
|
|||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales";
|
||||||
$sql.= " SET libelle='".addslashes($this->lib)."',";
|
$sql.= " SET libelle='".addslashes($this->lib)."',";
|
||||||
$sql.= " date_ech='".$this->date_ech."',";
|
$sql.= " date_ech='".$this->db->idate($this->date_ech)."',";
|
||||||
$sql.= " periode='".$this->periode."'";
|
$sql.= " periode='".$this->periode."'";
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|
||||||
@ -358,7 +358,9 @@ class PaiementCharge
|
|||||||
if ($total > 0)
|
if ($total > 0)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiementcharge (fk_charge, datec, datep, amount, fk_typepaiement, num_paiement, note, fk_user_creat)";
|
$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->db->idate($this->datepaye).", ".price2num($total).", $this->paiementtype, '$this->num_paiement', '$this->note', $user->id)";
|
$sql.= " VALUES ($this->chid, now(), ";
|
||||||
|
$sql.= $this->db->idate($this->date_ech).", ";
|
||||||
|
$sql.= price2num($total).", $this->paiementtype, '$this->num_paiement', '".addslashes($this->note)."', $user->id)";
|
||||||
|
|
||||||
dolibarr_syslog("PaiementCharge::create sql=".$sql);
|
dolibarr_syslog("PaiementCharge::create sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
|
|||||||
@ -97,7 +97,8 @@ if ($_POST["action"] == 'confirm_delete')
|
|||||||
|
|
||||||
if ($_POST["action"] == 'add' && $user->rights->tax->charges->creer)
|
if ($_POST["action"] == 'add' && $user->rights->tax->charges->creer)
|
||||||
{
|
{
|
||||||
if (! $_POST["date"])
|
$dateech=@dolibarr_mktime($_POST["echhour"],$_POST["echmin"],$_POST["echsec"],$_POST["echmonth"],$_POST["echday"],$_POST["echyear"]);
|
||||||
|
if (! $dateech)
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>';
|
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>';
|
||||||
$_GET["action"] = 'create';
|
$_GET["action"] = 'create';
|
||||||
@ -118,7 +119,7 @@ if ($_POST["action"] == 'add' && $user->rights->tax->charges->creer)
|
|||||||
|
|
||||||
$chargesociales->type=$_POST["type"];
|
$chargesociales->type=$_POST["type"];
|
||||||
$chargesociales->lib=$_POST["label"];
|
$chargesociales->lib=$_POST["label"];
|
||||||
$chargesociales->date_ech=$_POST["date"];
|
$chargesociales->date_ech=$dateech;
|
||||||
$chargesociales->periode=$_POST["period"];
|
$chargesociales->periode=$_POST["period"];
|
||||||
$chargesociales->amount=$_POST["amount"];
|
$chargesociales->amount=$_POST["amount"];
|
||||||
|
|
||||||
@ -137,7 +138,8 @@ if ($_POST["action"] == 'add' && $user->rights->tax->charges->creer)
|
|||||||
|
|
||||||
if ($_GET["action"] == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->creer)
|
if ($_GET["action"] == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->creer)
|
||||||
{
|
{
|
||||||
if (! $_POST["date"])
|
$dateech=@dolibarr_mktime($_POST["echhour"],$_POST["echmin"],$_POST["echsec"],$_POST["echmonth"],$_POST["echday"],$_POST["echyear"]);
|
||||||
|
if (! $dateech)
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>';
|
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>';
|
||||||
$_GET["action"] = 'edit';
|
$_GET["action"] = 'edit';
|
||||||
@ -153,7 +155,7 @@ if ($_GET["action"] == 'update' && ! $_POST["cancel"] && $user->rights->tax->cha
|
|||||||
$result=$chargesociales->fetch($_GET["id"]);
|
$result=$chargesociales->fetch($_GET["id"]);
|
||||||
|
|
||||||
$chargesociales->lib=$_POST["label"];
|
$chargesociales->lib=$_POST["label"];
|
||||||
$chargesociales->date_ech=$_POST["date"];
|
$chargesociales->date_ech=$dateech;
|
||||||
$chargesociales->periode=$_POST["period"];
|
$chargesociales->periode=$_POST["period"];
|
||||||
|
|
||||||
$result=$chargesociales->update($user);
|
$result=$chargesociales->update($user);
|
||||||
@ -170,6 +172,8 @@ if ($_GET["action"] == 'update' && ! $_POST["cancel"] && $user->rights->tax->cha
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
$html = new Form($db);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mode creation
|
* Mode creation
|
||||||
*
|
*
|
||||||
@ -183,7 +187,7 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
$var=false;
|
$var=false;
|
||||||
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/compta/sociales/charges.php">';
|
print '<form name="charge" method="post" action="'.DOL_URL_ROOT.'/compta/sociales/charges.php">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
@ -207,7 +211,9 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
print '<tr '.$bc[$var].' valign="top">';
|
print '<tr '.$bc[$var].' valign="top">';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '<td><input type="text" size="8" name="date"><br>YYYYMMDD</td>';
|
print '<td>';
|
||||||
|
print $html->select_date('-1', 'ech', 0, 0, 0, 'charge', 1);
|
||||||
|
print '</td>';
|
||||||
print '<td><input type="text" size="8" name="period"><br>YYYYMMDD</td>';
|
print '<td><input type="text" size="8" name="period"><br>YYYYMMDD</td>';
|
||||||
|
|
||||||
print '<td align="left"><select class="flat" name="type">';
|
print '<td align="left"><select class="flat" name="type">';
|
||||||
@ -247,8 +253,6 @@ if ($_GET["action"] == 'create')
|
|||||||
/* *************************************************************************** */
|
/* *************************************************************************** */
|
||||||
if ($chid > 0)
|
if ($chid > 0)
|
||||||
{
|
{
|
||||||
$html = new Form($db);
|
|
||||||
|
|
||||||
$cha = new ChargeSociales($db);
|
$cha = new ChargeSociales($db);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -284,7 +288,7 @@ if ($chid > 0)
|
|||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['action'] == 'edit') print "<form action=\"charges.php?id=$cha->id&action=update\" method=\"post\">";
|
if ($_GET['action'] == 'edit') print "<form name=\"charge\" action=\"charges.php?id=$cha->id&action=update\" method=\"post\">";
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -367,7 +371,7 @@ if ($chid > 0)
|
|||||||
print '<input type="text" name="label" size="40" value="'.$cha->lib.'">';
|
print '<input type="text" name="label" size="40" value="'.$cha->lib.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td>";
|
print '<tr><td>'.$langs->trans("DateDue")."</td><td>";
|
||||||
print "<input type=\"text\" name=\"date\" value=\"".strftime("%Y%m%d",$cha->date_ech)."\">";
|
print $html->select_date($cha->date_ech, 'ech', 0, 0, 0, 'charge', 1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user