Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
7fd2247297
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -26,6 +26,8 @@
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
@ -38,6 +40,8 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
$search_ref = GETPOST('search_ref','int');
|
||||
$search_label = GETPOST('search_label','alpha');
|
||||
$search_amount = GETPOST('search_amount','alpha');
|
||||
$month = GETPOST("month","int");
|
||||
$year = GETPOST("year","int");
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
@ -71,6 +75,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_ref="";
|
||||
$search_label="";
|
||||
$search_amount="";
|
||||
$year="";
|
||||
$month="";
|
||||
$typeid="";
|
||||
}
|
||||
|
||||
@ -81,6 +87,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
$tva_static = new Tva($db);
|
||||
|
||||
$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dm, t.fk_typepayment as type, t.num_payment, pst.code as payment_code";
|
||||
@ -90,6 +97,17 @@ $sql.= " WHERE t.entity = ".$conf->entity;
|
||||
if ($search_ref) $sql.=" AND t.rowid=".$search_ref;
|
||||
if ($search_label) $sql.=" AND t.label LIKE '%".$db->escape($search_label)."%'";
|
||||
if ($search_amount) $sql.=" AND t.amount='".$db->escape(price2num(trim($search_amount)))."'";
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0)
|
||||
$sql.= " AND t.datev BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
|
||||
else
|
||||
$sql.= " AND date_format(t.datev, '%m') = '$month'";
|
||||
}
|
||||
else if ($year > 0)
|
||||
{
|
||||
$sql.= " AND t.datev BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
if ($filtre) {
|
||||
$filtre=str_replace(":","=",$filtre);
|
||||
$sql .= " AND ".$filtre;
|
||||
@ -119,7 +137,7 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("");
|
||||
@ -128,7 +146,11 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="4" name="search_ref" value="'.$search_ref.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$search_label.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" colspan="1" align="center">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
$syear = $year;
|
||||
$formother->select_year($syear?$syear:-1,'year',1, 20, 5);
|
||||
print '</td>';
|
||||
// Type
|
||||
print '<td class="liste_titre" align="left">';
|
||||
$form->select_types_paiements($typeid,'typeid','',0,0,1,16);
|
||||
@ -158,7 +180,7 @@ if ($result)
|
||||
$tva_static->ref=$obj->rowid;
|
||||
print "<td>".$tva_static->getNomUrl(1)."</td>\n";
|
||||
print "<td>".dol_trunc($obj->label,40)."</td>\n";
|
||||
print '<td align="left">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
|
||||
// Type
|
||||
print $type;
|
||||
// Amount
|
||||
|
||||
@ -50,7 +50,7 @@ abstract class CommonObject
|
||||
/**
|
||||
* @var string[] Array of error strings
|
||||
*/
|
||||
public $errors;
|
||||
public $errors=array();
|
||||
|
||||
/**
|
||||
* @var string Can be used to pass information when only object is provied to method
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -853,7 +854,7 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
$vat1=get_default_localtax($companyes,$companyes,1,0);
|
||||
$vat2=get_default_localtax($companyes,$companyes,2,0);
|
||||
$this->assertEquals(5.2,$vat1);
|
||||
$this->assertEquals(-21,$vat2);
|
||||
$this->assertEquals(-19,$vat2);
|
||||
|
||||
// Test RULE ES-IT
|
||||
$vat1=get_default_localtax($companyes,$companyit,1,0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user