Merge remote-tracking branch 'origin/3.9' into develop
Conflicts: htdocs/fourn/facture/list.php htdocs/projet/card.php htdocs/societe/consumption.php
This commit is contained in:
commit
05384b2f88
@ -423,7 +423,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande
|
|||||||
$companystatic->code_client = $obj->code_client;
|
$companystatic->code_client = $obj->code_client;
|
||||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
$companystatic->canvas=$obj->canvas;
|
$companystatic->canvas=$obj->canvas;
|
||||||
print $companystatic->getNomUrl(1,'customer',16);
|
print $companystatic->getNomUrl(1,'supplier',16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||||
$i++;
|
$i++;
|
||||||
@ -729,7 +729,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
|||||||
$companystatic->code_client = $obj->code_client;
|
$companystatic->code_client = $obj->code_client;
|
||||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
$companystatic->canvas=$obj->canvas;
|
$companystatic->canvas=$obj->canvas;
|
||||||
print $companystatic->getNomUrl(1, 'company', 44);
|
print $companystatic->getNomUrl(1, 'customer', 44);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
|
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
|
||||||
@ -828,7 +828,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
$companystatic->code_client = $obj->code_client;
|
$companystatic->code_client = $obj->code_client;
|
||||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
$companystatic->canvas=$obj->canvas;
|
$companystatic->canvas=$obj->canvas;
|
||||||
print $companystatic->getNomUrl(1, 'company', 44);
|
print $companystatic->getNomUrl(1, 'customer', 44);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
|
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
|
||||||
|
|||||||
@ -36,10 +36,10 @@ $id=GETPOST('account');
|
|||||||
$ref=GETPOST('ref');
|
$ref=GETPOST('ref');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$fieldid = (! empty($ref)?$ref:$id);
|
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :''));
|
||||||
$fieldname = isset($ref)?'ref':'rowid';
|
$fieldtype = (! empty($ref) ? 'ref' :'rowid');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'banque',$fieldid,'bank_account','','',$fieldname);
|
$result=restrictedArea($user,'banque',$fieldvalue,'bank_account&bank_account','','',$fieldtype);
|
||||||
|
|
||||||
$year_start=GETPOST('year_start');
|
$year_start=GETPOST('year_start');
|
||||||
$year_current = strftime("%Y",time());
|
$year_current = strftime("%Y",time());
|
||||||
@ -146,7 +146,7 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("B
|
|||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
if ($_GET["account"])
|
if (!empty($id))
|
||||||
{
|
{
|
||||||
if (! preg_match('/,/', $id))
|
if (! preg_match('/,/', $id))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -919,7 +919,10 @@ class BonPrelevement extends CommonObject
|
|||||||
$row = $this->db->fetch_row($resql);
|
$row = $this->db->fetch_row($resql);
|
||||||
$ref = "T".$ref.str_pad(dol_substr("00".intval($row[0])+1,0,2),2,"0",STR_PAD_LEFT);
|
$ref = "T".$ref.str_pad(dol_substr("00".intval($row[0])+1,0,2),2,"0",STR_PAD_LEFT);
|
||||||
|
|
||||||
$this->filename = $conf->prelevement->dir_output.'/receipts/'.$ref.'.xml';
|
$dir=$conf->prelevement->dir_output.'/receipts';
|
||||||
|
if (! is_dir($dir)) dol_mkdir($dir);
|
||||||
|
|
||||||
|
$this->filename = $dir.'/receipts/'.$ref.'.xml';
|
||||||
|
|
||||||
// Create withdraw receipt in database
|
// Create withdraw receipt in database
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (";
|
||||||
@ -935,10 +938,6 @@ class BonPrelevement extends CommonObject
|
|||||||
{
|
{
|
||||||
$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
|
$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
|
||||||
$this->id = $prev_id;
|
$this->id = $prev_id;
|
||||||
|
|
||||||
$dir=$conf->prelevement->dir_output.'/receipts';
|
|
||||||
$file=$filebonprev;
|
|
||||||
if (! is_dir($dir)) dol_mkdir($dir);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1034,7 +1033,7 @@ class BonPrelevement extends CommonObject
|
|||||||
// Generation of SEPA file
|
// Generation of SEPA file
|
||||||
$this->generate();
|
$this->generate();
|
||||||
}
|
}
|
||||||
dol_syslog(__METHOD__."::End withdraw receipt, file ".$filebonprev, LOG_DEBUG);
|
dol_syslog(__METHOD__."::End withdraw receipt, file ".$this->filename, LOG_DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||||
|
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||||
|
|
||||||
* 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
|
||||||
@ -687,7 +688,7 @@ class FormFile
|
|||||||
*
|
*
|
||||||
* @param string $modulepart propal, facture, facture_fourn, ...
|
* @param string $modulepart propal, facture, facture_fourn, ...
|
||||||
* @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
|
* @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
|
||||||
* @param string $filedir Directory to scan
|
* @param string $filedir Full path to directory to scan
|
||||||
* @param string $filter Filter filenames on this regex string (Example: '\.pdf$')
|
* @param string $filter Filter filenames on this regex string (Example: '\.pdf$')
|
||||||
* @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles
|
* @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles
|
||||||
*/
|
*/
|
||||||
@ -720,9 +721,6 @@ class FormFile
|
|||||||
if ($modulepart == 'export') {
|
if ($modulepart == 'export') {
|
||||||
$relativepath = $file["name"];
|
$relativepath = $file["name"];
|
||||||
}
|
}
|
||||||
if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_fournisseur') {
|
|
||||||
$relativepath = get_exdir($modulesubdir, 2,0,0,null,'invoice_supplier'). $modulesubdir. "/" . $file["name"];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show file name with link to download
|
// Show file name with link to download
|
||||||
$out.= '<a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
$out.= '<a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
||||||
|
|||||||
@ -310,6 +310,7 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
|
|||||||
$expedition->id=$objp->sendingid;
|
$expedition->id=$objp->sendingid;
|
||||||
$expedition->fetchObjectLinked($expedition->id,$expedition->element);
|
$expedition->fetchObjectLinked($expedition->id,$expedition->element);
|
||||||
//var_dump($expedition->linkedObjects);
|
//var_dump($expedition->linkedObjects);
|
||||||
|
|
||||||
$receiving='';
|
$receiving='';
|
||||||
if (count($expedition->linkedObjects['delivery']) > 0) $receiving=reset($expedition->linkedObjects['delivery']); // Take first link
|
if (count($expedition->linkedObjects['delivery']) > 0) $receiving=reset($expedition->linkedObjects['delivery']); // Take first link
|
||||||
|
|
||||||
|
|||||||
@ -448,6 +448,18 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO move to DAO class
|
// TODO move to DAO class
|
||||||
|
$sql = "SELECT count(p.rowid) as total";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
||||||
|
$sql.= " WHERE p.fk_soc =".$object->id;
|
||||||
|
$sql.= " AND p.entity =".$conf->entity;
|
||||||
|
$sql.= " ORDER BY p.date_commande DESC";
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$object_count = $db->fetch_object($resql);
|
||||||
|
$num = $object_count->total;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total_ttc";
|
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total_ttc";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
||||||
$sql.= " WHERE p.fk_soc =".$object->id;
|
$sql.= " WHERE p.fk_soc =".$object->id;
|
||||||
@ -458,7 +470,6 @@ if ($object->id > 0)
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$i = 0 ;
|
$i = 0 ;
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
@ -474,7 +485,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num && $i <= $MAXLIST)
|
while ($i < $num && $i < $MAXLIST)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|||||||
@ -751,8 +751,11 @@ if ($resql)
|
|||||||
|
|
||||||
print $facturestatic->getNomUrl(1);
|
print $facturestatic->getNomUrl(1);
|
||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
|
|
||||||
$filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
|
||||||
print $formfile->getDocumentsLink('facture_fournisseur', $filename, $filedir);
|
$subdir = get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
|
||||||
|
print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir);
|
||||||
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|||||||
@ -666,8 +666,12 @@ else
|
|||||||
$filteronlist='';
|
$filteronlist='';
|
||||||
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
|
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
|
||||||
$text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), '', 0, 0, 'minwidth300');
|
$text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), '', 0, 0, 'minwidth300');
|
||||||
|
if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile))
|
||||||
|
{
|
||||||
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
|
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
|
||||||
print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2);
|
print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2);
|
||||||
|
}
|
||||||
|
else print $text;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1145,6 +1145,7 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
// Load source object
|
// Load source object
|
||||||
$clone_project->fetch($fromid);
|
$clone_project->fetch($fromid);
|
||||||
|
$clone_project->fetch_optionals();
|
||||||
$clone_project->fetch_thirdparty();
|
$clone_project->fetch_thirdparty();
|
||||||
|
|
||||||
$orign_dt_start=$clone_project->date_start;
|
$orign_dt_start=$clone_project->date_start;
|
||||||
|
|||||||
@ -53,7 +53,7 @@ $projectstatic = new Project($db);
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'addtimespent' && $user->rights->projet->creer)
|
if ($action == 'addtimespent' && $user->rights->projet->lire)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
|||||||
@ -276,7 +276,7 @@ if ($type_element == 'contract')
|
|||||||
$thirdTypeSelect='customer';
|
$thirdTypeSelect='customer';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sql_select)
|
if (!empty($sql_select))
|
||||||
{
|
{
|
||||||
$sql = $sql_select;
|
$sql = $sql_select;
|
||||||
$sql.= ' d.description as description,';
|
$sql.= ' d.description as description,';
|
||||||
|
|||||||
@ -141,8 +141,7 @@ class UserBankAccount extends Account
|
|||||||
$sql = "SELECT rowid, fk_user, entity, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,";
|
$sql = "SELECT rowid, fk_user, entity, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,";
|
||||||
$sql.= " owner_address, label, datec, tms as datem";
|
$sql.= " owner_address, label, datec, tms as datem";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user_rib";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user_rib";
|
||||||
if ($id) $sql.= " WHERE rowid = ".$id;
|
$sql.= " WHERE rowid = ".$id;
|
||||||
if ($socid) $sql.= " WHERE fk_user = ".$userid;
|
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user