Skip to content
Snippets Groups Projects
Commit 4bff8695 authored by Laurent Destailleur's avatar Laurent Destailleur Committed by GitHub
Browse files

Merge pull request #6056 from aspangaro/5.0-p38

Presentation of social contribution
parents dce3d5d8 953feefb
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
/* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* 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
* it under the terms of the GNU General Public License as published by
......@@ -286,14 +287,16 @@ if ($action == 'create')
dol_fiche_head();
print '<table class="border" width="100%">';
print "<tr>";
// Label
print '<td class="fieldrequired">';
print "<tr>";
print '<td class="titlefieldcreate fieldrequired">';
print $langs->trans("Label");
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>';
// Type
print '<td class="fieldrequired">';
print $langs->trans("Type");
......@@ -302,6 +305,7 @@ if ($action == 'create')
$formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode")?GETPOST("actioncode"):'','actioncode',1);
print '</td>';
print '</tr>';
// Date end period
print '<tr>';
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 '</td>';
print '</tr>';
// Amount
print '<tr>';
print '<td class="fieldrequired">';
......@@ -318,10 +323,12 @@ if ($action == 'create')
print '</td>';
print '<td><input type="text" size="6" name="amount" class="flat" value="'.GETPOST('amount').'"></td>';
print '</tr>';
// Payment Mode
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
print '</td></tr>';
// Bank Account
if (! empty($conf->banque->enabled))
{
......@@ -329,6 +336,7 @@ if ($action == 'create')
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
print '</td></tr>';
}
// Date due
print '<tr>';
print '<td class="fieldrequired">';
......@@ -345,7 +353,9 @@ if ($action == 'create')
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
print '<div>';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
print '</div>';
print '</form>';
}
......@@ -396,10 +406,8 @@ if ($id > 0)
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
}
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
$morehtmlref='<div class="refidno">';
// Ref customer
$morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
......@@ -420,7 +428,7 @@ if ($id > 0)
/*
// 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 "</td></tr>";
*/
......@@ -428,7 +436,7 @@ if ($id > 0)
// Label
/*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 '</td></tr>';
}
......@@ -520,7 +528,7 @@ if ($id > 0)
print '</div>';
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
/*
* Payments
*/
......@@ -534,7 +542,7 @@ if ($id > 0)
$sql.= " AND cs.entity = ".$conf->entity;
$sql.= " AND p.fk_typepaiement = c.id";
$sql.= " ORDER BY dp DESC";
//print $sql;
$resql = $db->query($sql);
if ($resql)
......@@ -568,13 +576,13 @@ if ($id > 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>&nbsp;".$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\">&nbsp;".$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>&nbsp;".$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>&nbsp;".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
$resteapayer = $object->amount - $totalpaye;
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\">&nbsp;".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
print "<td align=\"right\">".price($resteapayer)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
}
print "</table>";
$db->free($resql);
......@@ -589,10 +597,9 @@ if ($id > 0)
print '</div>';
print '<div class="clearboth"></div>';
dol_fiche_end();
if ($action == 'edit')
{
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&amp;action=reopen\">".$langs->trans("ReOpen")."</a>";
}
// Edit
if ($object->paye == 0 && $user->rights->tax->charges->creer)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment