Example #1
0
            }
        } else {
            $db->rollback();
            $mesg = '<div class="error">' . $localtax->error . '</div>';
        }
    } else {
        $mesg = '<div class="error">Error try do delete a line linked to a conciliated bank transaction</div>';
    }
}
/*
*	View
*/
llxHeader();
$form = new Form($db);
if ($id) {
    $vatpayment = new Localtax($db);
    $result = $vatpayment->fetch($id);
    if ($result <= 0) {
        dol_print_error($db);
        exit;
    }
}
if ($_GET["action"] == 'create') {
    print "<form name='add' action=\"card.php\" method=\"post\">\n";
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<input type="hidden" name="localTaxType" value="' . $lttype . '">';
    print '<input type="hidden" name="action" value="add">';
    print_fiche_titre($langs->transcountry($lttype == 2 ? "newLT2Payment" : "newLT1Payment", $mysoc->country_code));
    if ($mesg) {
        print $mesg;
    }
Example #2
0
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/compta/localtax/class/localtax.class.php';
$langs->load("compta");
$langs->load("compta");
// Security check
$socid = isset($_GET["socid"]) ? $_GET["socid"] : '';
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'tax', '', '', 'charges');
$ltt = $_REQUEST["localTaxType"];
/*
 * View
 */
llxHeader();
$localtax_static = new Localtax($db);
print_fiche_titre($langs->transcountry($ltt == 2 ? "LT2Payments" : "LT1Payments", $mysoc->country_code));
$sql = "SELECT rowid, amount, label, f.datev as dm";
$sql .= " FROM " . MAIN_DB_PREFIX . "localtax as f ";
$sql .= " WHERE f.entity = " . $conf->entity . " AND localtaxtype=" . $ltt;
$sql .= " ORDER BY dm DESC";
$result = $db->query($sql);
if ($result) {
    $num = $db->num_rows($result);
    $i = 0;
    $total = 0;
    print '<table class="noborder" width="100%">';
    print '<tr class="liste_titre">';
    print '<td class="nowrap" align="left">' . $langs->trans("Ref") . '</td>';
    print "<td>" . $langs->trans("Label") . "</td>";
    print '<td class="nowrap" align="left">' . $langs->trans("DatePayment") . '</td>';