Example #1
0
            }
        } else {
            $db->rollback();
            setEventMessage($object->error, 'errors');
        }
    } else {
        setEventMessage('Error try do delete a line linked to a conciliated bank transaction', 'errors');
    }
}
/*
 *	View
 */
llxHeader();
$form = new Form($db);
if ($id) {
    $object = new PaymentSalary($db);
    $result = $object->fetch($id);
    if ($result <= 0) {
        dol_print_error($db);
        exit;
    }
}
// Formulaire saisie salaire
if ($action == 'create') {
    $year_current = strftime("%Y", dol_now());
    $pastmonth = strftime("%m", dol_now()) - 1;
    $pastmonthyear = $year_current;
    if ($pastmonth == 0) {
        $pastmonth = 12;
        $pastmonthyear--;
    }
Example #2
0
    $result = $accline->fetch(GETPOST("rowid"));
    $result = $accline->delete();
}
/*
 * View
 */
llxHeader('', $langs->trans("FinancialAccount") . '-' . $langs->trans("Transactions"));
$societestatic = new Societe($db);
$userstatic = new User($db);
$chargestatic = new ChargeSociales($db);
$loanstatic = new Loan($db);
$memberstatic = new Adherent($db);
$paymentstatic = new Paiement($db);
$paymentsupplierstatic = new PaiementFourn($db);
$paymentvatstatic = new TVA($db);
$paymentsalstatic = new PaymentSalary($db);
$donstatic = new Don($db);
$expensereportstatic = new ExpenseReport($db);
$bankstatic = new Account($db);
$banklinestatic = new AccountLine($db);
$form = new Form($db);
if ($id > 0 || !empty($ref)) {
    if ($vline) {
        $viewline = $vline;
    } else {
        $viewline = empty($conf->global->MAIN_SIZE_LISTE_LIMIT) ? 20 : $conf->global->MAIN_SIZE_LISTE_LIMIT;
    }
    $result = $object->fetch($id, $ref);
    // Chargement des categories bancaires dans $options
    $nbcategories = 0;
    $sql = "SELECT rowid, label";
Example #3
0
}
//$limit = $conf->liste_limit;
//$offset = $limit * $page ;
if (!$sortfield) {
    $sortfield = "cs.date_ech";
}
if (!$sortorder) {
    $sortorder = "DESC";
}
/*
 * View
 */
$tva_static = new Tva($db);
$socialcontrib = new ChargeSociales($db);
$payment_sc_static = new PaymentSocialContribution($db);
$sal_static = new PaymentSalary($db);
llxHeader('', $langs->trans("SpecialExpensesArea"));
$title = $langs->trans("SpecialExpensesArea");
if ($_GET["mode"] == 'sconly') {
    $title = $langs->trans("SocialContributionsPayments");
}
$param = '';
if (GETPOST("mode") == 'sconly') {
    $param = '&mode=sconly';
}
if ($sortfield) {
    $param .= '&sortfield=' . $sortfield;
}
if ($sortorder) {
    $param .= '&sortorder=' . $sortorder;
}
Example #4
0
    }
} else {
    $typeid = $_REQUEST['typeid'];
}
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
    $search_ref = "";
    $search_label = "";
    $search_amount = "";
    $typeid = "";
}
/*
 * View
 */
llxHeader();
$form = new Form($db);
$salstatic = new PaymentSalary($db);
$userstatic = new User($db);
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev as dm, s.fk_typepayment as type, s.num_payment,";
$sql .= " pst.code as payment_code";
$sql .= " FROM " . MAIN_DB_PREFIX . "payment_salary as s";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as pst ON s.fk_typepayment = pst.id,";
$sql .= " " . MAIN_DB_PREFIX . "user as u";
$sql .= " WHERE u.rowid = s.fk_user";
$sql .= " AND s.entity = " . $conf->entity;
// Search criteria
if ($search_ref) {
    $sql .= " AND s.rowid=" . $search_ref;
}
if ($search_label) {
    $sql .= " AND s.label LIKE '%" . $db->escape($search_label) . "%'";
}
Example #5
0
if (!empty($conf->multicompany->enabled)) {
    $sql .= " AND ba.entity = " . $conf->entity;
}
if ($date_start && $date_end) {
    $sql .= " AND b.dateo >= '" . $db->idate($date_start) . "' AND b.dateo <= '" . $db->idate($date_end) . "'";
}
$sql .= " ORDER BY b.datev";
$object = new Account($db);
$paymentstatic = new Paiement($db);
$paymentsupplierstatic = new PaiementFourn($db);
$societestatic = new Societe($db);
$userstatic = new User($db);
$chargestatic = new ChargeSociales($db);
$paymentdonstatic = new PaymentDonation($db);
$paymentvatstatic = new TVA($db);
$paymentsalstatic = new PaymentSalary($db);
// Get code of finance journal
$bank_code_journal = new Account($db);
$result = $bank_code_journal->fetch($id_bank_account);
$journal = $bank_code_journal->accountancy_journal;
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
    $num = $db->num_rows($result);
    // Variables
    $cptfour = !empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef");
    $cptcli = !empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef");
    $accountancy_account_salary = !empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef");
    $accountancy_account_pay_vat = !empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef");
    $accountancy_account_pay_donation = !empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef");
    $tabpay = array();
Example #6
0
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int');
if ($page == -1) {
    $page = 0;
}
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) {
    $sortorder = "ASC";
}
if (!$sortfield) {
    $sortfield = "name";
}
$object = new PaymentSalary($db);
$object->fetch($id, $ref);
$upload_dir = $conf->salaries->dir_output . '/' . dol_sanitizeFileName($object->id);
$modulepart = 'salaries';
/*
 * Actions
 */
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
 * View
 */
$form = new Form($db);
llxHeader("", "", $langs->trans("SalaryPayment"));
if ($object->id) {
    $object->fetch_thirdparty();
    $head = salaries_prepare_head($object);
Example #7
0
require_once DOL_DOCUMENT_ROOT . '/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
$langs->load("compta");
$langs->load("banks");
$langs->load("bills");
$langs->load("users");
$langs->load("salaries");
$id = GETPOST("id", 'int');
$action = GETPOST('action');
// Security check
$socid = GETPOST("socid", "int");
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'salaries', '', '', '');
$sal = new PaymentSalary($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('salarycard', 'globalcard'));
/**
 * Actions
 */
if ($_POST["cancel"] == $langs->trans("Cancel")) {
    header("Location: index.php");
    exit;
}
if ($action == 'add' && $_POST["cancel"] != $langs->trans("Cancel")) {
    $error = 0;
    $datev = dol_mktime(12, 0, 0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
    $datep = dol_mktime(12, 0, 0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
    $datesp = dol_mktime(12, 0, 0, $_POST["datespmonth"], $_POST["datespday"], $_POST["datespyear"]);
    $dateep = dol_mktime(12, 0, 0, $_POST["dateepmonth"], $_POST["dateepday"], $_POST["dateepyear"]);