forked from Wavyzz/dolibarr
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
103
htdocs/admin/export.php
Normal file
103
htdocs/admin/export.php
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/admin/expedition.php
|
||||||
|
* \ingroup expedition
|
||||||
|
* \brief Page d'administration/configuration du module Expedition
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
|
|
||||||
|
$langs->load("admin");
|
||||||
|
$langs->load("exports");
|
||||||
|
|
||||||
|
$langs->load('other');
|
||||||
|
|
||||||
|
if (! $user->admin)
|
||||||
|
accessforbidden();
|
||||||
|
|
||||||
|
$action=GETPOST('action','alpha');
|
||||||
|
$value=GETPOST('value','alpha');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$page_name = "ExportSetup";
|
||||||
|
llxHeader('', $langs->trans($page_name));
|
||||||
|
|
||||||
|
// Subheader
|
||||||
|
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">'
|
||||||
|
. $langs->trans("BackToModuleList") . '</a>';
|
||||||
|
print_fiche_titre($langs->trans($page_name), $linkback);
|
||||||
|
|
||||||
|
// Configuration header
|
||||||
|
|
||||||
|
dol_fiche_head(
|
||||||
|
$head,
|
||||||
|
'settings',
|
||||||
|
$langs->trans("ExportsArea"),
|
||||||
|
0,
|
||||||
|
"exports"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Setup page goes here
|
||||||
|
$form=new Form($db);
|
||||||
|
$var=false;
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("ExportModel").'</td>'."\n";
|
||||||
|
print '<td align="center" width="20"> </td>';
|
||||||
|
print '<td align="center" width="100"></td>'."\n";
|
||||||
|
|
||||||
|
|
||||||
|
// Example with a yes / no select
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td>'.$langs->trans("set_EXPORTS_SHARE_MODELS").'</td>';
|
||||||
|
print '<td align="center" width="20"> </td>';
|
||||||
|
print '<td align="center" width="100">';
|
||||||
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="set_EXPORTS_SHARE_MODELS">';
|
||||||
|
echo ajax_constantonoff('EXPORTS_SHARE_MODELS');
|
||||||
|
print '</form>';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -670,6 +671,38 @@ class Tva extends CommonObject
|
|||||||
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
|
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return amount of payments already done
|
||||||
|
*
|
||||||
|
* @return int Amount of payment already done, <0 if KO
|
||||||
|
*/
|
||||||
|
function getSommePaiement()
|
||||||
|
{
|
||||||
|
$table='paiementcharge';
|
||||||
|
$field='fk_charge';
|
||||||
|
|
||||||
|
$sql = 'SELECT sum(amount) as amount';
|
||||||
|
$sql.= ' FROM '.MAIN_DB_PREFIX.$table;
|
||||||
|
$sql.= ' WHERE '.$field.' = '.$this->id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG);
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$amount=0;
|
||||||
|
|
||||||
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
if ($obj) $amount=$obj->amount?$obj->amount:0;
|
||||||
|
|
||||||
|
$this->db->free($resql);
|
||||||
|
return $amount;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Informations of vat payment object
|
* Informations of vat payment object
|
||||||
|
|||||||
177
htdocs/compta/tva/document.php
Normal file
177
htdocs/compta/tva/document.php
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
<?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) 2018 Philippe Grand <philippe.grand@atoo-net.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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/compta/tva/document.php
|
||||||
|
* \ingroup tax
|
||||||
|
* \brief Page with attached files on social contributions
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.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/vat.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
$langs->load("other");
|
||||||
|
$langs->load("companies");
|
||||||
|
$langs->load("compta");
|
||||||
|
$langs->load("bills");
|
||||||
|
|
||||||
|
$id = GETPOST('id','int');
|
||||||
|
$action = GETPOST('action','aZ09');
|
||||||
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
$result = restrictedArea($user, 'tax', $id, 'vat','charges');
|
||||||
|
|
||||||
|
|
||||||
|
// Get parameters
|
||||||
|
$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 Tva($db);
|
||||||
|
if ($id > 0) $object->fetch($id);
|
||||||
|
|
||||||
|
$upload_dir = $conf->tax->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
|
$modulepart='tax';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
|
||||||
|
|
||||||
|
if ($action == 'setlib' && $user->rights->tax->charges->creer)
|
||||||
|
{
|
||||||
|
$object->fetch($id);
|
||||||
|
$result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
|
||||||
|
if ($result < 0)
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
|
||||||
|
|
||||||
|
$title = $langs->trans("VATPayment") . ' - ' . $langs->trans("Documents");
|
||||||
|
$help_url='EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividendes|ES:Módulo Impuestos y cargas sociales (IVA, impuestos)';
|
||||||
|
llxHeader("",$title,$help_url);
|
||||||
|
|
||||||
|
if ($object->id)
|
||||||
|
{
|
||||||
|
$alreadypayed=$object->getSommePaiement();
|
||||||
|
|
||||||
|
$head=vat_prepare_head($object);
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'documents', $langs->trans("VATPayment"), -1, 'bill');
|
||||||
|
|
||||||
|
$morehtmlref='<div class="refidno">';
|
||||||
|
// Label of social contribution
|
||||||
|
$morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
|
||||||
|
$morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
|
||||||
|
// Project
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' : ';
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||||
|
$morehtmlref.=$proj->ref;
|
||||||
|
$morehtmlref.='</a>';
|
||||||
|
} else {
|
||||||
|
$morehtmlref.='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/tva/index.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
|
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
// Construit liste des fichiers
|
||||||
|
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||||
|
$totalsize=0;
|
||||||
|
foreach($filearray as $key => $file)
|
||||||
|
{
|
||||||
|
$totalsize+=$file['size'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '<div class="clearboth"></div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
$modulepart = 'tax';
|
||||||
|
$permission = $user->rights->tax->charges->creer;
|
||||||
|
$permtoedit = $user->rights->fournisseur->facture->creer;
|
||||||
|
$param = '&id=' . $object->id;
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("ErrorUnknown");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@@ -607,7 +607,15 @@ else
|
|||||||
// State
|
// State
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
||||||
{
|
{
|
||||||
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
|
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="state_id">'.$langs->trans('Region-State').'</label></td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
|
||||||
if ($object->country_id)
|
if ($object->country_id)
|
||||||
{
|
{
|
||||||
print $formcompany->select_state(GETPOST("state_id",'alpha')?GETPOST("state_id",'alpha'):$object->state_id,$object->country_code,'state_id');
|
print $formcompany->select_state(GETPOST("state_id",'alpha')?GETPOST("state_id",'alpha'):$object->state_id,$object->country_code,'state_id');
|
||||||
@@ -852,7 +860,15 @@ else
|
|||||||
// State
|
// State
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
||||||
{
|
{
|
||||||
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="state_id">'.$langs->trans('Region-State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
|
||||||
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id,'state_id');
|
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id,'state_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,10 +266,10 @@ class FormCompany
|
|||||||
$out.= '<option value="'.$obj->rowid.'">';
|
$out.= '<option value="'.$obj->rowid.'">';
|
||||||
}
|
}
|
||||||
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
|
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
|
||||||
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE) && $conf->global->MAIN_SHOW_REGION_IN_STATE == 2) {
|
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2) {
|
||||||
$out.= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
|
$out.= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
|
||||||
}
|
}
|
||||||
else if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE) && $conf->global->MAIN_SHOW_REGION_IN_STATE == 1) {
|
else if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1) {
|
||||||
$out.= $obj->region_name . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
|
$out.= $obj->region_name . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -61,13 +61,15 @@ class FormOther
|
|||||||
* @param string $htmlname Nom de la zone select
|
* @param string $htmlname Nom de la zone select
|
||||||
* @param string $type Type des modeles recherches
|
* @param string $type Type des modeles recherches
|
||||||
* @param int $useempty Affiche valeur vide dans liste
|
* @param int $useempty Affiche valeur vide dans liste
|
||||||
|
* @param int $fk_user Utilisateur créant le modèle
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0)
|
function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0, $fk_user=null)
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, label";
|
$sql = "SELECT rowid, label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
||||||
$sql.= " WHERE type = '".$type."'";
|
$sql.= " WHERE type = '".$type."'";
|
||||||
|
if(!empty($fk_user))$sql.=" AND fk_user=".$fk_user;
|
||||||
$sql.= " ORDER BY rowid";
|
$sql.= " ORDER BY rowid";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@@ -6310,7 +6310,7 @@ function dol_validElement($element)
|
|||||||
* Return img flag of country for a language code or country code
|
* Return img flag of country for a language code or country code
|
||||||
*
|
*
|
||||||
* @param string $codelang Language code (en_IN, fr_CA...) or Country code (IN, FR)
|
* @param string $codelang Language code (en_IN, fr_CA...) or Country code (IN, FR)
|
||||||
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
|
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
|
||||||
* @return string HTML img string with flag.
|
* @return string HTML img string with flag.
|
||||||
*/
|
*/
|
||||||
function picto_from_langcode($codelang, $moreatt = '')
|
function picto_from_langcode($codelang, $moreatt = '')
|
||||||
@@ -6323,7 +6323,7 @@ function picto_from_langcode($codelang, $moreatt = '')
|
|||||||
|
|
||||||
if ($codelang == 'auto')
|
if ($codelang == 'auto')
|
||||||
{
|
{
|
||||||
return img_picto_common($langs->trans('AutoDetectLang'), 'flags/int.png', $moreatt);
|
return '<span class="fa fa-globe"></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$langtocountryflag = array(
|
$langtocountryflag = array(
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
/* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -45,6 +46,17 @@ function vat_prepare_head($object)
|
|||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $tab,'vat');
|
complete_head_from_modules($conf, $langs, $object, $head, $tab,'vat');
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||||
|
$upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
|
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
|
||||||
|
$nbLinks=Link::count($db, $object->element, $object->id);
|
||||||
|
$head[$tab][0] = DOL_URL_ROOT.'/compta/tva/document.php?id='.$object->id;
|
||||||
|
$head[$tab][1] = $langs->trans("Documents");
|
||||||
|
if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
|
||||||
|
$head[$tab][2] = 'documents';
|
||||||
|
$tab++;
|
||||||
|
|
||||||
$head[$tab][0] = DOL_URL_ROOT.'/compta/tva/info.php?id='.$object->id;
|
$head[$tab][0] = DOL_URL_ROOT.'/compta/tva/info.php?id='.$object->id;
|
||||||
$head[$tab][1] = $langs->trans("Info");
|
$head[$tab][1] = $langs->trans("Info");
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class modExport extends DolibarrModules
|
|||||||
$this->dirs = array("/export/temp");
|
$this->dirs = array("/export/temp");
|
||||||
|
|
||||||
// Config pages
|
// Config pages
|
||||||
$this->config_page_url = array();
|
$this->config_page_url = array("export.php");
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
$this->depends = array();
|
$this->depends = array();
|
||||||
|
|||||||
@@ -697,11 +697,13 @@ class Export
|
|||||||
$sql.= 'label,';
|
$sql.= 'label,';
|
||||||
$sql.= 'type,';
|
$sql.= 'type,';
|
||||||
$sql.= 'field,';
|
$sql.= 'field,';
|
||||||
|
$sql.= 'fk_user,';
|
||||||
$sql.= 'filter';
|
$sql.= 'filter';
|
||||||
$sql.= ') VALUES (';
|
$sql.= ') VALUES (';
|
||||||
$sql.= "'".$this->db->escape($this->model_name)."',";
|
$sql.= "'".$this->db->escape($this->model_name)."',";
|
||||||
$sql.= "'".$this->db->escape($this->datatoexport)."',";
|
$sql.= "'".$this->db->escape($this->datatoexport)."',";
|
||||||
$sql.= "'".$this->db->escape($this->hexa)."',";
|
$sql.= "'".$this->db->escape($this->hexa)."',";
|
||||||
|
$sql.= "'".$user->id."',";
|
||||||
$sql.= "'".$this->db->escape($this->hexafiltervalue)."'";
|
$sql.= "'".$this->db->escape($this->hexafiltervalue)."'";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
|
|||||||
@@ -551,7 +551,8 @@ if ($step == 2 && $datatoexport)
|
|||||||
print '<input type="hidden" name="datatoexport" value="'.$datatoexport.'">';
|
print '<input type="hidden" name="datatoexport" value="'.$datatoexport.'">';
|
||||||
print '<table><tr><td colspan="2">';
|
print '<table><tr><td colspan="2">';
|
||||||
print $langs->trans("SelectExportFields").' ';
|
print $langs->trans("SelectExportFields").' ';
|
||||||
$htmlother->select_export_model($exportmodelid,'exportmodelid',$datatoexport,1);
|
if(empty($conf->global->EXPORTS_SHARE_MODELS))$htmlother->select_export_model($exportmodelid,'exportmodelid',$datatoexport,1,$user->id);
|
||||||
|
else $htmlother->select_export_model($exportmodelid,'exportmodelid',$datatoexport,1);
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Select").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Select").'">';
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
@@ -1082,6 +1083,7 @@ if ($step == 4 && $datatoexport)
|
|||||||
$sql = "SELECT rowid, label";
|
$sql = "SELECT rowid, label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
||||||
$sql.= " WHERE type = '".$datatoexport."'";
|
$sql.= " WHERE type = '".$datatoexport."'";
|
||||||
|
if(empty($conf->global->EXPORTS_SHARE_MODELS))$sql.=" AND fk_user=".$user->id;
|
||||||
$sql.= " ORDER BY rowid";
|
$sql.= " ORDER BY rowid";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ Address=Address
|
|||||||
State=State/Province
|
State=State/Province
|
||||||
StateShort=State
|
StateShort=State
|
||||||
Region=Region
|
Region=Region
|
||||||
|
Region-State=Region - State
|
||||||
Country=Country
|
Country=Country
|
||||||
CountryCode=Country code
|
CountryCode=Country code
|
||||||
CountryId=Country id
|
CountryId=Country id
|
||||||
|
|||||||
@@ -131,3 +131,7 @@ KeysToUseForUpdates=Clé à utiliser pour mettre à jour les données
|
|||||||
NbInsert=Nombre de lignes insérées: %s
|
NbInsert=Nombre de lignes insérées: %s
|
||||||
NbUpdate=Nombre de lignes mises à jour: %s
|
NbUpdate=Nombre de lignes mises à jour: %s
|
||||||
MultipleRecordFoundWithTheseFilters=Plusieurs enregistrements ont été trouvés avec ces filtres: %s
|
MultipleRecordFoundWithTheseFilters=Plusieurs enregistrements ont été trouvés avec ces filtres: %s
|
||||||
|
## setup page
|
||||||
|
ExportSetup=Configuration du module Export
|
||||||
|
ExportModel = Modèle d'export
|
||||||
|
set_EXPORTS_SHARE_MODELS = Partager tous les profils d'export
|
||||||
@@ -56,6 +56,7 @@ Address=Direcção
|
|||||||
State=Distrito
|
State=Distrito
|
||||||
StateShort=Estado
|
StateShort=Estado
|
||||||
Region=Região
|
Region=Região
|
||||||
|
Region-State=Distrito - Concelho
|
||||||
Country=País
|
Country=País
|
||||||
CountryCode=Código país
|
CountryCode=Código país
|
||||||
CountryId=ID país
|
CountryId=ID país
|
||||||
|
|||||||
@@ -1143,7 +1143,15 @@ else
|
|||||||
// State
|
// State
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.fieldLabel('State','state_id').'</td><td colspan="3" class="maxwidthonsmartphone">';
|
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
||||||
|
{
|
||||||
|
print '<tr><td>'.fieldLabel('Region-State','state_id').'</td><td colspan="3" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td>'.fieldLabel('State','state_id').'</td><td colspan="3" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
|
||||||
if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code);
|
if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code);
|
||||||
else print $countrynotdefined;
|
else print $countrynotdefined;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@@ -1700,7 +1708,15 @@ else
|
|||||||
// State
|
// State
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.fieldLabel('State','state_id').'</td><td colspan="3">';
|
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
||||||
|
{
|
||||||
|
print '<tr><td>'.fieldLabel('Region-State','state_id').'</td><td colspan="3">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td>'.fieldLabel('State','state_id').'</td><td colspan="3">';
|
||||||
|
}
|
||||||
|
|
||||||
print $formcompany->select_state($object->state_id,$object->country_code);
|
print $formcompany->select_state($object->state_id,$object->country_code);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user