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

Conflicts:
	htdocs/admin/taxes.php
This commit is contained in:
Laurent Destailleur 2018-03-12 19:09:57 +01:00
commit 78b0585798
10 changed files with 74 additions and 38 deletions

View File

@ -141,7 +141,7 @@ else
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans("VATIntra").'</label></td><td>';
print '<input name="tva" id="intra_vat" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA : '') . '">';
@ -169,28 +169,29 @@ else
print '</table>';
print "<br>\n";
print '<br>';
print '<table class="noborder" width="100%">';
// Cas des parametres TAX_MODE_SELL/BUY_SERVICE/PRODUCT
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans('OptionVatMode').'</td><td>'.$langs->trans('Description').'</td>';
print '<td class="titlefield">'.$langs->trans('OptionVatMode').'</td><td>'.$langs->trans('Description').'</td>';
print "</tr>\n";
print '<tr class="oddeven"><td width="200"><input type="radio" name="tax_mode" value="0"'.($tax_mode != 1 ? ' checked' : '').'> '.$langs->trans('OptionVATDefault').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionVatDefaultDesc'));
print '<td>'.nl2br($langs->trans('OptionVatDefaultDesc'));
print "</td></tr>\n";
print '<tr class="oddeven"><td width="200"><input type="radio" name="tax_mode" value="1"'.($tax_mode == 1 ? ' checked' : '').'> '.$langs->trans('OptionVATDebitOption').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionVatDebitOptionDesc'))."</td></tr>\n";
print '<td>'.nl2br($langs->trans('OptionVatDebitOptionDesc'))."</td></tr>\n";
print "</table>\n";
print '<br>';
print load_fiche_titre($langs->trans("SummaryOfVatExigibilityUsedByDefault"),'','');
print ' -> '.$langs->trans("SummaryOfVatExigibilityUsedByDefault");
//print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>&nbsp;</td><td>'.$langs->trans("Buy").'</td><td>'.$langs->trans("Sell").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">&nbsp;</td><td>'.$langs->trans("Buy").'</td><td>'.$langs->trans("Sell").'</td></tr>';
// Products
print '<tr class="oddeven"><td>'.$langs->trans("Product").'</td>';
@ -235,12 +236,18 @@ else
print "<br>\n";
/*
* Others params
*/
print load_fiche_titre($langs->trans("OtherOptions"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>';
print '<td class="titlefield">' . $langs->trans('Parameters') . '</td>';
print '<td><td>';
print "</tr>\n";
foreach ($list as $key)

View File

@ -80,6 +80,8 @@ class AgendaEvents extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$result = $this->actioncomm->fetch_optionals();
$this->actioncomm->fetchObjectLinked();
return $this->_cleanObjectDatas($this->actioncomm);
}
@ -319,7 +321,6 @@ class AgendaEvents extends DolibarrApi
unset($object->usermod);
unset($object->libelle);
unset($object->array_options);
unset($object->context);
unset($object->canvas);
unset($object->contact);

View File

@ -89,8 +89,8 @@ $arrayfields=array(
'accountype'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
'b.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
'b.number'=>array('label'=>$langs->trans("AccountIdShort"), 'checked'=>1),
'b.account_number'=>array('label'=>$langs->trans("AccountAccounting"), 'checked'=>$conf->accountancy->enabled),
'b.fk_accountancy_journal'=>array('label'=>$langs->trans("AccountancyJournal"), 'checked'=>$conf->accountancy->enabled),
'b.account_number'=>array('label'=>$langs->trans("AccountAccounting"), 'checked'=>(! empty($conf->accounting->enabled) || ! empty($conf->accounting->enabled))),
'b.fk_accountancy_journal'=>array('label'=>$langs->trans("AccountancyJournal"), 'checked'=>(! empty($conf->accounting->enabled) || ! empty($conf->accounting->enabled))),
'toreconcile'=>array('label'=>$langs->trans("TransactionsToConciliate"), 'checked'=>1),
'b.currency_code'=>array('label'=>$langs->trans("Currency"), 'checked'=>0),
'b.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),

View File

@ -447,7 +447,7 @@ else
$ratiopaymentinvoice=1;
if ($modetax == 0)
{
if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
print '<td class="nowrap" align="right">';
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
if ($fields['payment_amount'] && $fields['ftotal_ttc'])

View File

@ -1078,9 +1078,10 @@ class Contact extends CommonObject
* @param int $maxlen Max length of
* @param string $moreparam Add more param into URL
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $notooltip 1=Disable tooltip
* @return string String with URL
*/
function getNomUrl($withpicto=0, $option='', $maxlen=0, $moreparam='', $save_lastsearch_value=-1)
function getNomUrl($withpicto=0, $option='', $maxlen=0, $moreparam='', $save_lastsearch_value=-1, $notooltip=0)
{
global $conf, $langs, $hookmanager;
@ -1112,13 +1113,16 @@ class Contact extends CommonObject
$linkstart = '<a href="'.$url.'"';
$linkclose="";
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowContact");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.= ' class="classfortooltip">';
if (empty($notooltip)) {
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowContact");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.= ' class="classfortooltip"';
}
$linkclose.='>';
if (! is_object($hookmanager))
{

View File

@ -100,7 +100,7 @@ class mailing_advthirdparties extends MailingTargets
'source_url' => $this->url($obj->id,'thirdparty'),
'source_id' => $obj->id,
'source_type' => 'thirdparty'
);
);
}
}
@ -289,11 +289,11 @@ class mailing_advthirdparties extends MailingTargets
if ($type=='thirdparty') {
$companystatic=new Societe($this->db);
$companystatic->fetch($id);
return $companystatic->getNomUrl(0);
return $companystatic->getNomUrl(0, '', 0, 1);
} elseif ($type=='contact') {
$contactstatic=new Contact($this->db);
$contactstatic->fetch($id);
return $contactstatic->getNomUrl(0);
return $contactstatic->getNomUrl(0, '', 0, '', -1, 0);
}
}

View File

@ -71,73 +71,88 @@ class modAccounting extends DolibarrModules
$this->langfiles = array("accountancy","compta");
// Constants
// List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
// );
$this->const = array();
$this->const[1] = array(
"MAIN_COMPANY_CODE_ALWAYS_REQUIRED",
"chaine",
"1",
"With this constants on, third party code is always required whatever is numbering module behaviour"
"With this constants on, third party code is always required whatever is numbering module behaviour", 0, 'current', 0
);
$this->const[2] = array(
"MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED",
"chaine",
"1",
"With this constants on, bank account number is always required"
"With this constants on, bank account number is always required", 0, 'current', 1
);
$this->const[3] = array(
"ACCOUNTING_ACCOUNT_SUSPENSE",
"chaine",
"471"
"471",
"", 0, 'current', 0
);
$this->const[4] = array(
"ACCOUNTING_ACCOUNT_TRANSFER_CASH",
"chaine",
"58"
"58",
"", 0, 'current', 0
);
$this->const[5] = array(
"CHARTOFACCOUNTS",
"chaine",
"2"
"2",
"", 0, 'current', 0
);
$this->const[6] = array(
"ACCOUNTING_EXPORT_MODELCSV",
"chaine",
"1"
"1",
"", 0, 'current', 0
);
$this->const[7] = array(
"ACCOUNTING_LENGTH_GACCOUNT",
"chaine",
""
"",
"", 0, 'current', 0
);
$this->const[8] = array(
"ACCOUNTING_LENGTH_AACCOUNT",
"chaine",
""
"",
"", 0, 'current', 0
);
$this->const[9] = array(
"ACCOUNTING_LIST_SORT_VENTILATION_TODO",
"yesno",
"1"
"1",
"", 0, 'current', 0
);
$this->const[10] = array(
"ACCOUNTING_LIST_SORT_VENTILATION_DONE",
"yesno",
"1"
"1",
"", 0, 'current', 0
);
$this->const[11] = array (
"ACCOUNTING_EXPORT_DATE",
"chaine",
"%d%m%Y"
"%d%m%Y",
"", 0, 'current', 0
);
$this->const[12] = array(
"ACCOUNTING_EXPORT_SEPARATORCSV",
"string",
","
",",
"", 0, 'current', 0
);
$this->const[13] = array(
"ACCOUNTING_EXPORT_FORMAT",
"chaine",
"csv"
"csv",
"", 0, 'current', 0
);
// Tabs

View File

@ -31,7 +31,7 @@ Credit=Credit
Piece=Accounting Doc.
AmountHTVATRealReceived=Net collected
AmountHTVATRealPaid=Net paid
VATToPay=VAT sells
VATToPay=Tax sales
VATReceived=Tax received
VATToCollect=Tax purchases
VATSummary=Tax Balance

View File

@ -158,6 +158,8 @@ if ($action == 'order' && isset($_POST['valid']))
$line->total_ttc = $line->total_ht + $line->total_tva;
$line->remise_percent = $obj->remise_percent;
$line->ref_fourn = $obj->ref_fourn;
$line->type = $product->type;
$line->fk_unit = $product->fk_unit;
$suppliers[$obj->fk_soc]['lines'][] = $line;
}
}
@ -202,7 +204,13 @@ if ($action == 'order' && isset($_POST['valid']))
$line->remise_percent,
'HT',
0,
$line->info_bits
$line->type,
0,
false,
null,
null,
0,
$line->fk_unit
);
}
if ($result < 0) {

View File

@ -10,6 +10,7 @@
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.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