Continue to work
This commit is contained in:
parent
f51df9da70
commit
c53663c885
@ -153,7 +153,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->loan->write)
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$help_url='EN:Module_Loan|FR:Module Emprunt';
|
||||
$help_url='EN:Module_Loan|FR:Module_Emprunt';
|
||||
llxHeader("",$langs->trans("Loan"),$help_url);
|
||||
|
||||
|
||||
@ -268,7 +268,7 @@ if ($action == 'create')
|
||||
if ($id > 0)
|
||||
{
|
||||
$object = new Loan($db);
|
||||
$result=$object->fetch($id);
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
@ -313,101 +313,41 @@ if ($id > 0)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$object->label.'</td></tr>';
|
||||
}
|
||||
|
||||
// Capital
|
||||
print '<tr><td>'.$langs->trans("Capital").'</td><td>'.price($object->capital,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
$rowspan=5;
|
||||
print '<td rowspan="'.$rowspan.'" valign="top">';
|
||||
|
||||
/*
|
||||
* Payments
|
||||
*/
|
||||
$sql = "SELECT p.rowid, p.num_payment, datep as dp, p.amount,";
|
||||
$sql.= "c.libelle as paiement_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_loan as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."loan as l";
|
||||
$sql.= " WHERE p.fk_loan = ".$id;
|
||||
$sql.= " AND p.fk_loan = l.rowid";
|
||||
$sql.= " AND l.entity = ".$conf->entity;
|
||||
$sql.= " AND p.fk_typepayment = c.id";
|
||||
$sql.= " ORDER BY dp DESC";
|
||||
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0; $total = 0;
|
||||
echo '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("RefPayment").'</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print "<td>".$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($object->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\" bgcolor=\"#d0d0d0\">".price($object->amount)."</td><td bgcolor=\"#d0d0d0\"> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
|
||||
$resteapayer = $object->amount - $totalpaye;
|
||||
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
||||
print "<td align=\"right\" bgcolor=\"#f0f0f0\"><b>".price($resteapayer)."</b></td><td bgcolor=\"#f0f0f0\"> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print "</tr>";
|
||||
|
||||
// Period end date
|
||||
print "<tr><td>".$langs->trans("PeriodEndDate")."</td>";
|
||||
// Date start
|
||||
print "<tr><td>".$langs->trans("DateStart")."</td>";
|
||||
print "<td>";
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print $form->select_date($object->periode, 'period', 0, 0, 0, 'charge', 1);
|
||||
print $form->select_date($object->datestart, 'start', 0, 0, 0, 'update', 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print dol_print_date($object->periode,"day");
|
||||
print dol_print_date($object->datestart,"day");
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
// Due date
|
||||
// Date end
|
||||
print "<tr><td>".$langs->trans("DateEnd")."</td>";
|
||||
print "<td>";
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td>";
|
||||
print $form->select_date($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
|
||||
print "</td></tr>";
|
||||
print $form->select_date($object->dateend, 'end', 0, 0, 0, 'update', 1);
|
||||
}
|
||||
else {
|
||||
print "<tr><td>".$langs->trans("DateDue")."</td><td>".dol_print_date($object->date_ech,'day')."</td></tr>";
|
||||
else
|
||||
{
|
||||
print dol_print_date($object->dateend,"day");
|
||||
}
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
print "</td></tr>";
|
||||
|
||||
// Nbterms
|
||||
print '<tr><td>'.$langs->trans("Nbterms").'</td><td>'.$object->nbterm.'</td></tr>';
|
||||
|
||||
// Rate
|
||||
print '<tr><td>'.$langs->trans("Rate").'</td><td>'.$object->rate.'</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>';
|
||||
@ -461,6 +401,74 @@ if ($id > 0)
|
||||
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>';
|
||||
|
||||
/*
|
||||
* Payments
|
||||
*/
|
||||
$sql = "SELECT p.rowid, p.num_payment, datep as dp, p.amount,";
|
||||
$sql.= "c.libelle as paiement_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_loan as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."loan as l";
|
||||
$sql.= " WHERE p.fk_loan = ".$id;
|
||||
$sql.= " AND p.fk_loan = l.rowid";
|
||||
$sql.= " AND l.entity = ".$conf->entity;
|
||||
$sql.= " AND p.fk_typepayment = c.id";
|
||||
$sql.= " ORDER BY dp DESC";
|
||||
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0; $total = 0;
|
||||
echo '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("RefPayment").'</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print "<td>".$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($object->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td> ".$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\"> ".$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\"> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "</td></tr>";
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -47,6 +47,9 @@ class Loan extends CommonObject
|
||||
var $date_creation;
|
||||
var $date_modification;
|
||||
var $date_validation;
|
||||
var $fk_bank;
|
||||
var $fk_user_creat;
|
||||
var $fk_user_modif;
|
||||
|
||||
|
||||
/**
|
||||
@ -68,8 +71,7 @@ class Loan extends CommonObject
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
$sql = "SELECT l.rowid, l.datestart,";
|
||||
$sql.= " l.label, l.capital";
|
||||
$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.nbterm, l.rate, l.note";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."loan as l";
|
||||
$sql.= " WHERE l.rowid = ".$id;
|
||||
|
||||
@ -84,8 +86,12 @@ class Loan extends CommonObject
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->datestart = $this->db->jdate($obj->datestart);
|
||||
$this->dateend = $this->db->jdate($obj->dateend);
|
||||
$this->label = $obj->label;
|
||||
$this->capital = $obj->capital;
|
||||
$this->nbterm = $obj->nbterm;
|
||||
$this->rate = $obj->rate;
|
||||
$this->note = $obj->note;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -112,9 +118,20 @@ class Loan extends CommonObject
|
||||
function create($user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
// clean parameters
|
||||
$newcapital=price2num($this->capital,'MT');
|
||||
if (isset($this->note)) $this->note = trim($this->note);
|
||||
if (isset($this->account_capital)) $this->account_capital = trim($this->account_capital);
|
||||
if (isset($this->account_insurance)) $this->account_insurance = trim($this->account_insurance);
|
||||
if (isset($this->account_interest)) $this->account_interest = trim($this->account_interest);
|
||||
if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank);
|
||||
if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat);
|
||||
if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
|
||||
|
||||
// Check parameters
|
||||
if (! $newcapital > 0 || empty($this->datestart) || empty($this->dateend))
|
||||
@ -122,14 +139,31 @@ class Loan extends CommonObject
|
||||
$this->error="ErrorBadParameter";
|
||||
return -2;
|
||||
}
|
||||
if (($conf->accounting->enabled) && empty($this->account_capital) && empty($this->account_insurance) && empty($this->account_interest))
|
||||
{
|
||||
$this->error="ErrorAccountingParameter";
|
||||
return -2;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."loan (label, date_ech, periode, amount, entity)";
|
||||
$sql.= " VALUES ('".$this->db->escape($this->label)."',";
|
||||
$sql.= " '".$this->db->idate($this->datestart)."','".$this->db->idate($this->dateend)."',";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."loan (label, fk_bank, capital, datestart, dateend, nbterm, rate, note";
|
||||
$sql.= " ,accountancy_account_capital, accountancy_account_insurance, accountancy_account_interest, entity";
|
||||
$sql.= " ,datec, fk_user_author)";
|
||||
$sql.= " VALUES ('".$this->db->escape($this->label)."',";
|
||||
$sql.= " '".$this->db->escape($this->fk_bank)."',";
|
||||
$sql.= " '".price2num($newcapital)."',";
|
||||
$sql.= " ".$conf->entity;
|
||||
$sql.= " '".$this->db->idate($this->datestart)."',";
|
||||
$sql.= " '".$this->db->idate($this->dateend)."',";
|
||||
$sql.= " '".$this->db->escape($this->nbterm)."',";
|
||||
$sql.= " '".$this->db->escape($this->rate)."',";
|
||||
$sql.= " '".$this->db->escape($this->note)."',";
|
||||
$sql.= " '".$this->db->escape($this->account_capital)."',";
|
||||
$sql.= " '".$this->db->escape($this->account_insurance)."',";
|
||||
$sql.= " '".$this->db->escape($this->account_interest)."',";
|
||||
$sql.= " ".$conf->entity.",";
|
||||
$sql.= " '".$this->db->idate($now)."',";
|
||||
$sql.= " ".$user->id;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
@ -440,7 +474,7 @@ class Loan extends CommonObject
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
$sql = "SELECT l.rowid, l.tms as datem, l.datec as datec";
|
||||
$sql = "SELECT l.rowid, l.tms as datem, l.fk_user_author as user_author, l.datec as datec";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."loan as l";
|
||||
$sql.= " WHERE l.rowid = ".$id;
|
||||
|
||||
@ -454,10 +488,10 @@ class Loan extends CommonObject
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
|
||||
if ($obj->fk_user_author) {
|
||||
if ($obj->user_author) {
|
||||
$cuser = new User($this->db);
|
||||
$cuser->fetch($obj->fk_user_author);
|
||||
$this->user_creation = $cuser;
|
||||
$cuser->fetch($obj->user_author);
|
||||
$this->user_creation = $cuser;
|
||||
}
|
||||
|
||||
$this->date_creation = $this->db->jdate($obj->datec);
|
||||
|
||||
@ -28,10 +28,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
/** \class PaymentSocialContribution
|
||||
* \brief Class to manage payments of social contributions
|
||||
*/
|
||||
class PaymentSocialContribution extends CommonObject
|
||||
class PaymentLoan extends CommonObject
|
||||
{
|
||||
public $element='paiementcharge'; //!< Id that identify managed objects
|
||||
public $table_element='paiementcharge'; //!< Name of table without prefix where object is stored
|
||||
public $element='payment_loan'; //!< Id that identify managed objects
|
||||
public $table_element='payment_loan'; //!< Name of table without prefix where object is stored
|
||||
|
||||
var $id;
|
||||
var $ref;
|
||||
|
||||
@ -1,11 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@ -22,22 +16,23 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/sociales/document.php
|
||||
* \ingroup tax
|
||||
* \brief Page with attached files on social contributions
|
||||
* \file htdocs/compta/loan/document.php
|
||||
* \ingroup loan
|
||||
* \brief Page with attached files on loan
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/loan/class/loan.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
|
||||
$langs->load("other");
|
||||
$langs->load("companies");
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("loan");
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$action = GETPOST("action");
|
||||
@ -45,8 +40,7 @@ $confirm = GETPOST('confirm', 'alpha');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'tax', $id, 'chargesociales','charges');
|
||||
|
||||
$result = restrictedArea($user, 'loan', $id, '','');
|
||||
|
||||
// Get parameters
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@ -61,12 +55,11 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
|
||||
|
||||
$object = new ChargeSociales($db);
|
||||
$object = new Loan($db);
|
||||
if ($id > 0) $object->fetch($id);
|
||||
|
||||
$upload_dir = $conf->tax->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
$modulepart='tax';
|
||||
$upload_dir = $conf->loan->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
$modulepart='loan';
|
||||
|
||||
|
||||
/*
|
||||
@ -82,16 +75,16 @@ include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$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);
|
||||
$help_url='EN:Module_Loan|FR:Module_Emprunt';
|
||||
llxHeader("",$langs->trans("Loan"),$help_url);
|
||||
|
||||
if ($object->id)
|
||||
{
|
||||
$alreadypayed=$object->getSommePaiement();
|
||||
$alreadypayed=$object->getSumPayment();
|
||||
|
||||
$head=tax_prepare_head($object, $user);
|
||||
$head = loan_prepare_head($object, $user);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("SocialContribution"), 0, 'bill');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("Loan"), 0, 'bill');
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
@ -114,44 +107,44 @@ if ($object->id)
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>';
|
||||
print '<input type="text" name="label" size="40" value="'.$object->lib.'">';
|
||||
print '<input type="text" name="label" size="40" value="'.$object->label.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->lib.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
||||
}
|
||||
|
||||
// Type
|
||||
print "<tr><td>".$langs->trans("Type")."</td><td>".$object->type_libelle."</td></tr>";
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("Capital").'</td><td>'.price($object->capital,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
// Period end date
|
||||
print "<tr><td>".$langs->trans("PeriodEndDate")."</td>";
|
||||
// Date start
|
||||
print "<tr><td>".$langs->trans("Datestart")."</td>";
|
||||
print "<td>";
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print $form->select_date($object->periode, 'period', 0, 0, 0, 'charge', 1);
|
||||
print $form->select_date($object->datestart, 'start', 0, 0, 0, 'loan', 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print dol_print_date($object->periode,"day");
|
||||
print dol_print_date($object->datestart,"day");
|
||||
}
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
|
||||
// Due date
|
||||
// Date end
|
||||
print "<tr><td>".$langs->trans("Dateend")."</td>";
|
||||
print "<td>";
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td>";
|
||||
print $form->select_date($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
|
||||
print "</td></tr>";
|
||||
print $form->select_date($object->dateend, 'end', 0, 0, 0, 'loan', 1);
|
||||
}
|
||||
else {
|
||||
print "<tr><td>".$langs->trans("DateDue")."</td><td>".dol_print_date($object->date_ech,'day')."</td></tr>";
|
||||
else
|
||||
{
|
||||
print dol_print_date($object->dateend,"day");
|
||||
}
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4,$alreadypayed).'</td></tr>';
|
||||
@ -162,8 +155,8 @@ if ($object->id)
|
||||
|
||||
print '</div>';
|
||||
|
||||
$modulepart = 'tax';
|
||||
$permission = $user->rights->tax->charges->creer;
|
||||
$modulepart = 'loan';
|
||||
$permission = $user->rights->loan->write;
|
||||
$param = '&id=' . $object->id;
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.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
|
||||
@ -16,18 +16,19 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/sociales/info.php
|
||||
* \ingroup tax
|
||||
* \brief Page with info about social contribution
|
||||
* \file htdocs/compta/loan/info.php
|
||||
* \ingroup loan
|
||||
* \brief Page with info about loan
|
||||
*/
|
||||
|
||||
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.'/compta/loan/class/loan.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("loan");
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$action=GETPOST("action");
|
||||
@ -35,27 +36,27 @@ $action=GETPOST("action");
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'tax', $id, 'chargesociales','charges');
|
||||
$result = restrictedArea($user, 'loan', $id, '','');
|
||||
|
||||
|
||||
/*
|
||||
* 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);
|
||||
$help_url='EN:Module_Loan|FR:Module_Emprunt';
|
||||
llxHeader("",$langs->trans("Loan"),$help_url);
|
||||
|
||||
$chargesociales = new ChargeSociales($db);
|
||||
$chargesociales->fetch($id);
|
||||
$chargesociales->info($id);
|
||||
$loan = new Loan($db);
|
||||
$loan->fetch($id);
|
||||
$loan->info($id);
|
||||
|
||||
$head = tax_prepare_head($chargesociales);
|
||||
$head = loan_prepare_head($loan);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("SocialContribution"), 0, 'bill');
|
||||
dol_fiche_head($head, 'info', $langs->trans("Loan"), 0, 'bill');
|
||||
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
dol_print_object_info($chargesociales);
|
||||
dol_print_object_info($loan);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user