コード例 #1
0
ファイル: note.php プロジェクト: Samara94/dolibarr
/**
 *   \file       htdocs/loan/note.php
 *   \brief      Tab for notes on loan
 *   \ingroup    loan
 */
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/loan/class/loan.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/loan.lib.php';
$action = GETPOST('action');
$langs->load('loan');
// Security check
$id = GETPOST('id', 'int');
$result = restrictedArea($user, 'loan', $id, '&loan');
$object = new Loan($db);
if ($id > 0) {
    $object->fetch($id);
}
$permissionnote = $user->rights->loan->write;
// Used by the include of actions_setnotes.inc.php
/*
 *  Actions
 */
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';
// Must be include, not include_once
/*
 *  View
 */
$form = new Form($db);
llxHeader('', $langs->trans("LoanArea") . ' - ' . $langs->trans("Notes"), '');
if ($id > 0) {
    /*
コード例 #2
0
ファイル: payment.php プロジェクト: TAASA/Dolibarr-ERP-3.8.1
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/loan/class/loan.class.php';
require_once DOL_DOCUMENT_ROOT . '/loan/class/paymentloan.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
$langs->load("bills");
$langs->load("loan");
$chid = GETPOST('id', 'int');
$action = GETPOST('action');
$cancel = GETPOST('cancel', 'alpha');
// Security check
$socid = 0;
if ($user->societe_id > 0) {
    $socid = $user->societe_id;
}
$loan = new Loan($db);
$loan->fetch($chid);
/*
 * Actions
 */
if ($action == 'add_payment') {
    $error = 0;
    if ($cancel) {
        $loc = DOL_URL_ROOT . '/loan/card.php?id=' . $chid;
        header("Location: " . $loc);
        exit;
    }
    $datepaid = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
    if (!GETPOST('paymenttype', 'int') > 0) {
        setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), 'errors');
        $error++;
    }
コード例 #3
0
ファイル: card.php プロジェクト: TAASA/Dolibarr-ERP-3.8.1
 print '<tr class="liste_titre">';
 print '<td>' . $langs->trans('Loan') . '</td>';
 print '<td>' . $langs->trans('Label') . '</td>';
 print '<td align="right">' . $langs->trans('ExpectedToPay') . '</td>';
 print '<td align="center">' . $langs->trans('Status') . '</td>';
 print '<td align="right">' . $langs->trans('PayedByThisPayment') . '</td>';
 print "</tr>\n";
 if ($num > 0) {
     $var = True;
     while ($i < $num) {
         $objp = $db->fetch_object($resql);
         $var = !$var;
         print '<tr ' . $bc[$var] . '>';
         // Ref
         print '<td>';
         $loan->fetch($objp->id);
         print $loan->getLinkUrl(1);
         print "</td>\n";
         // Label
         print '<td>' . $objp->label . '</td>';
         // Expected to pay
         print '<td align="right">' . price($objp->capital) . '</td>';
         // Status
         print '<td align="center">' . $loan->getLibStatut(4, $objp->amount_capital) . '</td>';
         // Amount payed
         print '<td align="right">' . price($objp->amount_capital) . '</td>';
         print "</tr>\n";
         if ($objp->paid == 1) {
             $disable_delete = 1;
         }
         $total = $total + $objp->amount_capital;
コード例 #4
0
ファイル: card.php プロジェクト: TAASA/Dolibarr-ERP-3.8.1
$action = GETPOST('action');
$confirm = GETPOST('confirm');
$cancel = GETPOST('cancel', 'alpha');
// Security check
$socid = GETPOST('socid', 'int');
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'loan', $id, '', '');
$object = new Loan($db);
/*
 * Actions
 */
// Classify paid
if ($action == 'confirm_paid' && $confirm == 'yes') {
    $object->fetch($id);
    $result = $object->set_paid($user);
    if ($result > 0) {
        setEventMessage($langs->trans('LoanPaid'));
    } else {
        setEventMessage($loan->error, 'errors');
    }
}
// Delete loan
if ($action == 'confirm_delete' && $confirm == 'yes') {
    $object->fetch($id);
    $result = $object->delete($user);
    if ($result > 0) {
        setEventMessage($langs->trans('LoanDeleted'));
        header("Location: index.php");
        exit;
コード例 #5
0
ファイル: note.php プロジェクト: NoisyBoy86/Dolibarr_test
 */

require '../main.inc.php';
require_once(DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';

$action = GETPOST('action');

$langs->load('loan');

// Security check
$id = GETPOST('id','int');
$result = restrictedArea($user, 'loan', $id, '&loan');

$object = new Loan($db);
if ($id > 0) $object->fetch($id);

$permissionnote=$user->rights->loan->write;  // Used by the include of actions_setnotes.inc.php


/*
 *  Actions
 */

include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once


/*
 *  View
 */
コード例 #6
0
ファイル: info.php プロジェクト: Samara94/dolibarr
$langs->load("compta");
$langs->load("bills");
$langs->load("loan");
$id = GETPOST('id', 'int');
$action = GETPOST("action");
// Security check
$socid = GETPOST('socid', 'int');
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'loan', $id, '', '');
/*
 * View
 */
$help_url = 'EN:Module_Loan|FR:Module_Emprunt';
llxHeader("", $langs->trans("Loan"), $help_url);
if ($id > 0) {
    $loan = new Loan($db);
    $loan->fetch($id);
    $loan->info($id);
    $head = loan_prepare_head($loan);
    dol_fiche_head($head, 'info', $langs->trans("Loan"), 0, 'bill');
    print '<table width="100%"><tr><td>';
    dol_print_object_info($loan);
    print '</td></tr></table>';
    print '</div>';
} else {
    // $id ?
}
llxFooter();
$db->close();