Skip to content
Snippets Groups Projects
Commit 34274132 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

parents 0805c693 6a82d9e6
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@zendsi.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
......@@ -305,16 +305,17 @@ if ($id)
dol_fiche_head($head, 'card', $langs->trans("VATPayment"), 0, 'payment');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/tva/reglement.php">'.$langs->trans("BackToList").'</a>';
print '<table class="border" width="100%">';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', '');
print "<tr>";
print '<td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="3">';
print $object->ref;
print '</td></tr>';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
print "<tr>";
print '<td>'.$langs->trans("DatePayment").'</td><td>';
......@@ -335,23 +336,25 @@ if ($id)
{
if ($object->fk_account > 0)
{
$bankline=new AccountLine($db);
$bankline->fetch($object->fk_bank);
$bankline=new AccountLine($db);
$bankline->fetch($object->fk_bank);
print '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
print '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
print '<td>';
print $bankline->getNomUrl(1,0,'showall');
print '</td>';
print '</tr>';
print '</td>';
print '</tr>';
}
}
// Other attributes
$reshook=$hookmanager->executeHooks('formObjectOptions','',$object,$action); // Note that $action and $object may have been modified by hook
// Other attributes
$reshook=$hookmanager->executeHooks('formObjectOptions','',$object,$action); // Note that $action and $object may have been modified by hook
print '</table>';
print '</div>';
dol_fiche_end();
/*
......
<?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@zendsi.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
......@@ -34,6 +34,7 @@ class Tva extends CommonObject
{
//public $element='tva'; //!< Id that identify managed objects
//public $table_element='tva'; //!< Name of table without prefix where object is stored
public $picto='payment';
var $tms;
var $datep;
......@@ -73,6 +74,7 @@ class Tva extends CommonObject
global $conf, $langs;
$error=0;
$now=dol_now();
// Clean parameters
$this->amount=trim($this->amount);
......@@ -89,7 +91,7 @@ class Tva extends CommonObject
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."tva(";
$sql.= "tms,";
$sql.= "datec,";
$sql.= "datep,";
$sql.= "datev,";
$sql.= "amount,";
......@@ -101,7 +103,7 @@ class Tva extends CommonObject
$sql.= ") VALUES (";
$sql.= " '".$this->db->idate($this->tms)."',";
$sql.= " '".$this->db->idate($now)."',";
$sql.= " '".$this->db->idate($this->datep)."',";
$sql.= " '".$this->db->idate($this->datev)."',";
$sql.= " '".$this->amount."',";
......@@ -677,46 +679,70 @@ class Tva extends CommonObject
* @param int $id Id of vat payment
* @return int <0 if KO, >0 if OK
*/
function info($id)
{
$sql = "SELECT t.rowid, t.tms as datec, t.fk_user_creat";
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
$sql.= " WHERE t.rowid = ".$id;
function info($id)
{
$sql = "SELECT t.rowid, t.tms, t.datec, t.fk_user_creat";
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
$sql.= " WHERE t.rowid = ".$id;
dol_syslog(get_class($this)."::info", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
dol_syslog(get_class($this)."::info", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->id = $obj->rowid;
if ($obj->fk_user_creat) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_creat);
$this->user_creation = $cuser;
}
if ($obj->fk_user_creat) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_creat);
$this->user_creation = $cuser;
}
if ($obj->fk_user_modif) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
if ($obj->fk_user_modif) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datec);
$this->import_key = $obj->import_key;
}
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->tms);
$this->import_key = $obj->import_key;
}
$this->db->free($result);
$this->db->free($result);
}
else
{
dol_print_error($this->db);
}
}
}
else
{
dol_print_error($this->db);
}
}
/**
* Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
*
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle
*/
function getLibStatut($mode=0)
{
return $this->LibStatut($this->statut,$mode);
}
/**
* Renvoi le libelle d'un statut donne
*
* @param int $status Statut
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle du statut
*/
function LibStatut($status,$mode=0)
{
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
return '';
}
}
<?php
/* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
/* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@zendsi.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
......@@ -53,12 +53,21 @@ $head = vat_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("VATPayment"), 0, 'payment');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/tva/reglement.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', '');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table width="100%"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
dol_fiche_end();
llxFooter();
$db->close();
......@@ -380,3 +380,4 @@ create table llx_loan_schedule
fk_user_modif integer
)ENGINE=innodb;
ALTER TABLE llx_tva ADD COLUMN datec date AFTER tms;
\ No newline at end of file
......@@ -21,6 +21,7 @@ create table llx_tva
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
datec datetime, -- Create date
datep date, -- date de paiement
datev date, -- date de valeur
amount real NOT NULL DEFAULT 0,
......
......@@ -1095,9 +1095,10 @@ class Project extends CommonObject
* @param int $mode 0=All project I have permission on (assigned to me and public), 1=Projects assigned to me only, 2=Will return list of all projects with no test on contacts
* @param int $list 0=Return array,1=Return string list
* @param int $socid 0=No filter on third party, id of third party
* @param string $filter additionnal filter on project (statut, ref, ...)
* @return array or string Array of projects id, or string with projects id separated with ","
*/
function getProjectsAuthorizedForUser($user, $mode=0, $list=0, $socid=0)
function getProjectsAuthorizedForUser($user, $mode=0, $list=0, $socid=0, $filter='')
{
$projects = array();
$temp = array();
......@@ -1149,6 +1150,8 @@ class Project extends CommonObject
{
// No filter. Use this if user has permission to see all project
}
$sql.= $filter;
//print $sql;
$resql = $this->db->query($sql);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment