Ejemplo n.º 1
0
 */
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
$langs->load("compta");
$langs->load("bills");
$id = GETPOST('id', 'int');
$action = GETPOST("action");
// Security check
$socid = GETPOST('socid', 'int');
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges');
/*
 * View
 */
$help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividendes|ES:Módulo Impuestos y cargas sociales (IVA, impuestos)';
llxHeader("", $langs->trans("SocialContribution"), $help_url);
$chargesociales = new ChargeSociales($db);
$chargesociales->fetch($id);
$chargesociales->info($id);
$head = tax_prepare_head($chargesociales);
dol_fiche_head($head, 'info', $langs->trans("SocialContribution"), 0, 'bill');
print '<table width="100%"><tr><td>';
dol_print_object_info($chargesociales);
print '</td></tr></table>';
print '</div>';
llxFooter();
$db->close();
Ejemplo n.º 2
0
    print '<td align="center"><input type="submit" class="button" value="' . $langs->trans("Add") . '"></td>';
    print '</tr>';
    print '</table>';
    print '</form>';
}
/* *************************************************************************** */
/*                                                                             */
/* Mode fiche                                                                  */
/*                                                                             */
/* *************************************************************************** */
if ($id > 0) {
    $object = new ChargeSociales($db);
    $result = $object->fetch($id);
    if ($result > 0) {
        dol_htmloutput_mesg($mesg);
        $head = tax_prepare_head($object);
        dol_fiche_head($head, 'card', $langs->trans("SocialContribution"), 0, 'bill');
        // Confirmation de la suppression de la charge
        if ($action == 'paid') {
            $text = $langs->trans('ConfirmPaySocialContribution');
            print $form->formconfirm($_SERVER["PHP_SELF"] . "?id=" . $object->id, $langs->trans('PaySocialContribution'), $text, "confirm_paid", '', '', 2);
        }
        if ($action == 'delete') {
            $text = $langs->trans('ConfirmDeleteSocialContribution');
            print $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id, $langs->trans('DeleteSocialContribution'), $text, 'confirm_delete', '', '', 2);
        }
        if ($action == 'edit') {
            print "<form name=\"charge\" action=\"charges.php?id={$object->id}&amp;action=update\" method=\"post\">";
            print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
        }
        print '<table class="border" width="100%">';
}
$upload_dir = $conf->tax->dir_output . '/' . dol_sanitizeFileName($object->ref);
$modulepart = 'tax';
/*
 * Actions
 */
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
 * View
 */
$form = new Form($db);
$help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividendes|ES:M&oacute;dulo Impuestos y cargas sociales (IVA, impuestos)';
llxHeader("", $langs->trans("SocialContribution"), $help_url);
if ($object->id) {
    $alreadypayed = $object->getSommePaiement();
    $head = tax_prepare_head($object, $user);
    dol_fiche_head($head, 'documents', $langs->trans("SocialContribution"), 0, 'bill');
    // Construit liste des fichiers
    $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\\.meta|_preview\\.png)$', $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1);
    $totalsize = 0;
    foreach ($filearray as $key => $file) {
        $totalsize += $file['size'];
    }
    print '<table class="border" width="100%">';
    // Ref
    print '<tr><td width="25%">' . $langs->trans("Ref") . '</td><td>';
    print $form->showrefnav($object, 'id');
    print "</td></tr>";
    // Label
    if ($action == 'edit') {
        print '<tr><td>' . $langs->trans("Label") . '</td><td>';