Merge pull request #6056 from aspangaro/5.0-p38
Presentation of social contribution
This commit is contained in:
commit
4bff869507
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||||
|
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -286,14 +287,16 @@ if ($action == 'create')
|
|||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print "<tr>";
|
|
||||||
// Label
|
// Label
|
||||||
print '<td class="fieldrequired">';
|
print "<tr>";
|
||||||
|
print '<td class="titlefieldcreate fieldrequired">';
|
||||||
print $langs->trans("Label");
|
print $langs->trans("Label");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left"><input type="text" size="34" name="label" class="flat" value="'.GETPOST('label').'"></td>';
|
print '<td><input type="text" size="34" name="label" class="flat" value="'.GETPOST('label').'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<td class="fieldrequired">';
|
print '<td class="fieldrequired">';
|
||||||
print $langs->trans("Type");
|
print $langs->trans("Type");
|
||||||
@ -302,6 +305,7 @@ if ($action == 'create')
|
|||||||
$formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode")?GETPOST("actioncode"):'','actioncode',1);
|
$formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode")?GETPOST("actioncode"):'','actioncode',1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date end period
|
// Date end period
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">';
|
print '<td class="fieldrequired">';
|
||||||
@ -311,6 +315,7 @@ if ($action == 'create')
|
|||||||
print $form->select_date(! empty($dateperiod)?$dateperiod:'-1', 'period', 0, 0, 0, 'charge', 1);
|
print $form->select_date(! empty($dateperiod)?$dateperiod:'-1', 'period', 0, 0, 0, 'charge', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">';
|
print '<td class="fieldrequired">';
|
||||||
@ -318,10 +323,12 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" size="6" name="amount" class="flat" value="'.GETPOST('amount').'"></td>';
|
print '<td><input type="text" size="6" name="amount" class="flat" value="'.GETPOST('amount').'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Payment Mode
|
// Payment Mode
|
||||||
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
|
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
|
||||||
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
|
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Bank Account
|
// Bank Account
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
@ -329,6 +336,7 @@ if ($action == 'create')
|
|||||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date due
|
// Date due
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">';
|
print '<td class="fieldrequired">';
|
||||||
@ -345,7 +353,9 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '<div>';
|
print ' ';
|
||||||
|
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
@ -396,10 +406,8 @@ if ($id > 0)
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
|
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
|
||||||
|
|
||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
// Ref customer
|
// Ref customer
|
||||||
$morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
|
||||||
@ -420,7 +428,7 @@ if ($id > 0)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="fieldtitle">'.$langs->trans("Ref").'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans("Ref").'</td><td>';
|
||||||
print $form->showrefnav($object,'id',$linkback);
|
print $form->showrefnav($object,'id',$linkback);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
*/
|
*/
|
||||||
@ -428,7 +436,7 @@ if ($id > 0)
|
|||||||
// Label
|
// Label
|
||||||
/*if ($action == 'edit')
|
/*if ($action == 'edit')
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans("Label").'</td><td>';
|
||||||
print '<input type="text" name="label" size="40" value="'.$object->lib.'">';
|
print '<input type="text" name="label" size="40" value="'.$object->lib.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -520,7 +528,7 @@ if ($id > 0)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="fichehalfright">';
|
print '<div class="fichehalfright">';
|
||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Payments
|
* Payments
|
||||||
*/
|
*/
|
||||||
@ -534,7 +542,7 @@ if ($id > 0)
|
|||||||
$sql.= " AND cs.entity = ".$conf->entity;
|
$sql.= " AND cs.entity = ".$conf->entity;
|
||||||
$sql.= " AND p.fk_typepaiement = c.id";
|
$sql.= " AND p.fk_typepaiement = c.id";
|
||||||
$sql.= " ORDER BY dp DESC";
|
$sql.= " ORDER BY dp DESC";
|
||||||
|
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -568,13 +576,13 @@ if ($id > 0)
|
|||||||
|
|
||||||
if ($object->paye == 0)
|
if ($object->paye == 0)
|
||||||
{
|
{
|
||||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\">".price($totalpaye)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\" bgcolor=\"#d0d0d0\">".price($object->amount)."</td><td bgcolor=\"#d0d0d0\"> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\">".price($object->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||||
|
|
||||||
$resteapayer = $object->amount - $totalpaye;
|
$resteapayer = $object->amount - $totalpaye;
|
||||||
|
|
||||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
||||||
print "<td align=\"right\" bgcolor=\"#f0f0f0\"><b>".price($resteapayer)."</b></td><td bgcolor=\"#f0f0f0\"> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
print "<td align=\"right\">".price($resteapayer)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
@ -589,10 +597,9 @@ if ($id > 0)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="clearboth"></div>';
|
print '<div class="clearboth"></div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
print '<div align="center">';
|
print '<div align="center">';
|
||||||
@ -618,7 +625,7 @@ if ($id > 0)
|
|||||||
{
|
{
|
||||||
print "<a class=\"butAction\" href=\"".dol_buildpath("/compta/sociales/card.php",1). "?id=$object->id&action=reopen\">".$langs->trans("ReOpen")."</a>";
|
print "<a class=\"butAction\" href=\"".dol_buildpath("/compta/sociales/card.php",1). "?id=$object->id&action=reopen\">".$langs->trans("ReOpen")."</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
if ($object->paye == 0 && $user->rights->tax->charges->creer)
|
if ($object->paye == 0 && $user->rights->tax->charges->creer)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user