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

Conflicts:
	htdocs/admin/system/filecheck.php
	htdocs/compta/facture/class/facture.class.php
	htdocs/filefunc.inc.php
	htdocs/install/upgrade2.php
	htdocs/product/class/product.class.php
This commit is contained in:
Laurent Destailleur 2019-03-07 11:16:24 +01:00
commit a426c8e9bf
7 changed files with 43 additions and 17 deletions

View File

@ -339,8 +339,8 @@ if (! $error && $xml)
$out.='<td>'.$i.'</td>' . "\n";
$out.='<td>'.$file['filename'];
if (! preg_match('/^win/i', PHP_OS)) {
$htmltext=$langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.'/'.$file['filename']);
$out.=' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm');
$htmltext=$langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.$file['filename']); // The slash is included int file['filename']
$out.=' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm'.$i);
}
$out.='</td>' . "\n";
$out.='<td align="center">'.$file['expectedmd5'].'</td>' . "\n";

View File

@ -1131,7 +1131,7 @@ if (empty($reshook))
// Source facture
$object->fac_rec = GETPOST('fac_rec', 'int');
$id = $object->create($user); // This include recopy of links from recurring invoice and invoice lines
$id = $object->create($user); // This include recopy of links from recurring invoice and recurring invoice lines
}
}

View File

@ -723,7 +723,7 @@ class Facture extends CommonInvoice
}
/*
* Insert lines of predefined invoices
* Insert lines of template invoices
*/
if (! $error && $this->fac_rec > 0)
{
@ -749,7 +749,32 @@ class Facture extends CommonInvoice
$localtax1_tx = $_facrec->lines[$i]->localtax1_tx;
$localtax2_tx = $_facrec->lines[$i]->localtax2_tx;
$result_insert = $this->addline(
$fk_product_fournisseur_price = empty($_facrec->lines[$i]->fk_product_fournisseur_price)?null:$_facrec->lines[$i]->fk_product_fournisseur_price;
$buyprice = empty($_facrec->lines[$i]->buyprice)?0:$_facrec->lines[$i]->buyprice;
// If buyprice not defined from template invoice, we try to guess the best value
if (! $buyprice && $_facrec->lines[$i]->fk_product > 0)
{
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$producttmp = new ProductFournisseur($this->db);
$producttmp->fetch($_facrec->lines[$i]->fk_product);
// If margin module defined on costprice, we try the costprice
// If not defined or if module margin defined and pmp and stock module enabled, we try pmp price
// else we get the best supplier price
if ($conf->global->MARGIN_TYPE == 'costprice' && ! empty($producttmp->cost_price)) $buyprice = $producttmp->cost_price;
elseif (! empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && ! empty($producttmp->pmp)) $buyprice = $producttmp->pmp;
else {
if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0)
{
if ($producttmp->product_fourn_price_id > 0)
{
$buyprice = price2num($producttmp->fourn_unitprice * (1 - $producttmp->fourn_remise_percent/100) + $producttmp->fourn_remise, 'MU');
}
}
}
}
$result_insert = $this->addline(
$_facrec->lines[$i]->desc,
$_facrec->lines[$i]->subprice,
$_facrec->lines[$i]->qty,
@ -771,8 +796,8 @@ class Facture extends CommonInvoice
'',
0,
0,
null,
0,
$fk_product_fournisseur_price,
$buyprice,
$_facrec->lines[$i]->label,
empty($_facrec->lines[$i]->array_options)?null:$_facrec->lines[$i]->array_options,
$_facrec->lines[$i]->situation_percent,
@ -4273,9 +4298,9 @@ class Facture extends CommonInvoice
/**
* Function used to replace a thirdparty id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old thirdparty id
* @param int $dest_id New thirdparty id
* @param DoliDB $db Database handler
* @param int $origin_id Old thirdparty id
* @param int $dest_id New thirdparty id
* @return bool
*/
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)

View File

@ -6378,6 +6378,7 @@ abstract class CommonObject
}
if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
elseif($mode == 'view' && empty($visibility)) continue;
if (empty($perms)) continue;
// Load language if required

View File

@ -186,7 +186,7 @@ if (! GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'a
{
// Current version is $conf->global->MAIN_VERSION_LAST_UPGRADE
// Version to install is DOL_VERSION
$dolibarrlastupgradeversionarray=preg_split('/[\.-]/', isset($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_UPGRADE:$conf->global->MAIN_VERSION_LAST_INSTALL);
$dolibarrlastupgradeversionarray=preg_split('/[\.-]/', isset($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_UPGRADE:(isset($conf->global->MAIN_VERSION_LAST_INSTALL)?$conf->global->MAIN_VERSION_LAST_INSTALL:''));
// Chaque action de migration doit renvoyer une ligne sur 4 colonnes avec
// dans la 1ere colonne, la description de l'action a faire

View File

@ -14,9 +14,9 @@ OkCheckFingerprintValidityButChainIsKo=Archived log seems valid compared to prev
AddedByAuthority=Stored into remote authority
NotAddedByAuthorityYet=Not yet stored into remote authority
ShowDetails=Show stored details
logPAYMENT_VARIOUS_CREATE=Payment (not assigned to invoice) created
logPAYMENT_VARIOUS_MODIFY=Payment (not assigned to invoice) modified
logPAYMENT_VARIOUS_DELETE=Payment (not assigned to invoice) logical deletion
logPAYMENT_VARIOUS_CREATE=Payment (not assigned to an invoice) created
logPAYMENT_VARIOUS_MODIFY=Payment (not assigned to an invoice) modified
logPAYMENT_VARIOUS_DELETE=Payment (not assigned to an invoice) logical deletion
logPAYMENT_ADD_TO_BANK=Payment added to bank
logPAYMENT_CUSTOMER_CREATE=Customer payment created
logPAYMENT_CUSTOMER_DELETE=Customer payment logical deletion

View File

@ -1561,7 +1561,7 @@ class Product extends CommonObject
* @param Societe $thirdparty_buyer Buyer
* @param int $pqp Id of product per price if a selection was done of such a price
* @return array Array of price information
* @see get_buyprice()
* @see get_buyprice(), find_min_price_product_fournisseur()
*/
public function getSellPrice($thirdparty_seller, $thirdparty_buyer, $pqp = 0)
{
@ -1672,8 +1672,8 @@ class Product extends CommonObject
* @param int $product_id Filter on a particular product id
* @param string $fourn_ref Filter on a supplier price ref. 'none' to exclude ref in search.
* @param int $fk_soc If of supplier
* @return int <-1 if KO, -1 if qty not enough, 0 if OK but nothing found, id_product if OK and found. May also initialize some properties like (->ref_supplier, buyprice, fourn_pu, vatrate_supplier...)
* @see getSellPrice()
* @return int <-1 if KO, -1 if qty not enough, 0 if OK but nothing found, id_product if OK and found. May also initialize some properties like (->ref_supplier, buyprice, fourn_pu, vatrate_supplier...)
* @see getSellPrice(), find_min_price_product_fournisseur()
*/
public function get_buyprice($prodfournprice, $qty, $product_id = 0, $fourn_ref = '', $fk_soc = 0)
{