diff --git a/ChangeLog b/ChangeLog
index b5a787a8203..5e4291b727c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -115,8 +115,8 @@ NEW: class tool for converting units
NEW: Close #13011 Add button create thirdparty when creating intervention
NEW: Colorful theme for TakePOS
NEW: columns units in product list
-NEW: compatibility of translabel with more dict
-NEW: Confirm file delete on fracture card
+NEW: compatibility of translabel with more dictionaries
+NEW: Confirm file delete on invoice card
NEW: "contact_civility" for ODT templates
NEW: CUPS printing compatibility for TakePOS
NEW: Customer command list - Add date start & date end
@@ -124,16 +124,11 @@ NEW: display weight in shipment list
NEW: Documentation about PHP support in Dolibarr
NEW: Donation - Update FR CERFA to 11580*04
NEW: Easier way to setup the different types of tax. Better visibility.
-NEW: enable put for agendaevents api
NEW: Expedition list - Add date start & date end
NEW: Experiment supplier packaging with option PRODUCT_USE_SUPPLIER_PACKAGING: Using price according to the minimum quantity
NEW: Export module, add extrafields for Contract and Contract line
NEW: Extend retained warranty to be available for all invoices
-NEW: filter by product on supplier order API
NEW: French new regions
-NEW: get documents for categories with RESP API
-NEW: get proposal by ref with API
-NEW: Hidden option MAIN_TEMP_DIR
NEW: hook and data id
NEW: hook on ics generation to add more events in eventarray
NEW: hook on product load stats
@@ -206,7 +201,6 @@ NEW: API filter bankaccounts by category
NEW: API filter contacts by category
NEW: API filter members by category
NEW: API filter projects by category
-NEW: API filter thirdpartie by category
NEW: API filter thirdparty by category
NEW: API filter user by category
NEW: API filter warehouses by categorie
@@ -220,6 +214,11 @@ NEW: Bookkeeping by account - Add selectfields & hook
NEW: Can force position of legend of graph on right (instead of top)
NEW: Can change destination of "Back to list" using a "backtolist" parameter
NEW: add more category types from hook
+NEW: enable put for agendaevents api
+NEW: filter by product on supplier order API
+NEW: get documents for categories with RESP API
+NEW: get proposal by ref with API
+NEW: Hidden option MAIN_TEMP_DIR
WARNING:
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index d65a744398f..34d7b26bd8e 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -934,7 +934,7 @@ if ($object->id > 0)
$late = '';
foreach ($contrat->lines as $line) {
if ($contrat->statut == Contrat::STATUS_VALIDATED && $line->statut == ContratLigne::STATUS_OPEN) {
- if (($line->date_fin_validite + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late"));
+ if (((!empty($line->date_fin_validite)?$line->date_fin_validite:0) + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late"));
}
}
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 5b5b7d59711..3b2b4be54e4 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -192,7 +192,7 @@ if (empty($reshook))
}
}
- $result = $object->createFromClone($user, $socid);
+ $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : null));
if ($result > 0) {
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
exit();
@@ -1750,10 +1750,9 @@ if ($action == 'create')
print '
';
print '
'.$langs->trans("CreateEmptyPropal").'
';
+ print '';
}
- if (!empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) print '';
-
dol_fiche_end();
$langs->load("bills");
@@ -1796,11 +1795,11 @@ if ($action == 'create')
if ($action == 'clone') {
// Create an array for form
$formquestion = array(
- // 'text' => $langs->trans("ConfirmClone"),
- // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
- // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' =>
- // 1),
- array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)')));
+ // 'text' => $langs->trans("ConfirmClone"),
+ // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
+ // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
+ array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)'))
+ );
if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->date_livraison)) {
$formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->date_livraison);
}
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index cef7e3ee48e..72efdf89dc6 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1289,9 +1289,10 @@ class Propal extends CommonObject
*
* @param User $user User making the clone
* @param int $socid Id of thirdparty
+ * @param int $forceentity Entity id to force
* @return int New id of clone
*/
- public function createFromClone(User $user, $socid = 0)
+ public function createFromClone(User $user, $socid = 0, $forceentity = null)
{
global $conf, $hookmanager;
@@ -1345,6 +1346,7 @@ class Propal extends CommonObject
$object->id = 0;
$object->ref = '';
+ $object->entity = (! empty($forceentity) ? $forceentity : $object->entity);
$object->statut = self::STATUS_DRAFT;
// Clear fields
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 277b55ddb90..c62bb4fc1e7 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -1417,7 +1417,7 @@ if (empty($reshook))
$result = $srcobject->fetch($object->origin_id);
$typeamount = GETPOST('typedeposit', 'aZ09');
- $valuedeposit = GETPOST('valuedeposit', 'int');
+ $valuedeposit = price2num(GETPOST('valuedeposit', 'alpha'), 'MU');
// If deposit invoice
if ($_POST['type'] == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable')))
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index 50612fd2aad..951dc9ed059 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -48,13 +48,12 @@ $ref = GETPOST('ref', 'alpha');
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'alpha');
$type = GETPOST('type', 'aZ09');
-$mode = GETPOST('mode', 'aZ09');
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
-if ($mode == 'bank-transfer') {
+if ($type == 'bank-transfer') {
$object = new FactureFournisseur($db);
} else {
$object = new Facture($db);
@@ -94,6 +93,7 @@ if (empty($reshook))
$sourcetype = 'facture';
if ($type == 'bank-transfer') {
$sourcetype = 'supplier_invoice';
+ $newtype = 'bank-transfer';
}
$result = $object->demande_prelevement($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype);
@@ -117,7 +117,7 @@ if (empty($reshook))
$result = $object->demande_prelevement_delete($user, GETPOST('did', 'int'));
if ($result == 0)
{
- header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.'&mode='.$mode);
+ header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.'&type='.$type);
exit;
}
}
@@ -133,7 +133,7 @@ $form = new Form($db);
$now = dol_now();
-if ($mode == 'bank-transfer') {
+if ($type == 'bank-transfer') {
$title = $langs->trans('InvoiceSupplier')." - ".$langs->trans('CreditTransfer');
$helpurl = "";
} else {
@@ -168,7 +168,7 @@ if ($object->id > 0)
if ($object->paye) $resteapayer = 0;
$resteapayeraffiche = $resteapayer;
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this
$filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
$filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
@@ -202,7 +202,7 @@ if ($object->id > 0)
$author->fetch($object->user_author);
}
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
$head = facturefourn_prepare_head($object);
} else {
$head = facture_prepare_head($object);
@@ -211,7 +211,7 @@ if ($object->id > 0)
dol_fiche_head($head, 'standingorders', $title, -1, 'bill');
// Invoice content
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
$linkback = ''.$langs->trans("BackToList").'';
} else {
$linkback = ''.$langs->trans("BackToList").'';
@@ -219,7 +219,7 @@ if ($object->id > 0)
$morehtmlref = '
';
// Ref customer
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1);
} else {
@@ -228,7 +228,7 @@ if ($object->id > 0)
}
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ('.$langs->trans("OtherBills").')';
} else {
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ('.$langs->trans("OtherBills").')';
@@ -288,7 +288,7 @@ if ($object->id > 0)
}
if ($object->type == $object::TYPE_REPLACEMENT)
{
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
$facreplaced = new FactureFournisseur($db);
} else {
$facreplaced = new Facture($db);
@@ -298,7 +298,7 @@ if ($object->id > 0)
}
if ($object->type == $object::TYPE_CREDIT_NOTE)
{
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
$facusing = new FactureFournisseur($db);
} else {
$facusing = new Facture($db);
@@ -316,7 +316,7 @@ if ($object->id > 0)
{
if ($i == 0) print ' ';
else print ',';
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
$facavoir = new FactureFournisseur($db);
} else {
$facavoir = new Facture($db);
@@ -339,7 +339,7 @@ if ($object->id > 0)
// Discounts
print '
'.$langs->trans('Discounts').'
';
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
//$societe = new Fournisseur($db);
//$result = $societe->fetch($object->socid);
$thirdparty = $object->thirdparty;
@@ -355,7 +355,7 @@ if ($object->id > 0)
print '
';
// Label
- if ($mode == 'bank-transfer') {
+ if ($type == 'bank-transfer') {
print '