Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts: htdocs/comm/propal.php htdocs/commande/class/commande.class.php htdocs/commande/fiche.php htdocs/compta/facture.php htdocs/product/class/product.class.php htdocs/projet/class/project.class.php
This commit is contained in:
commit
018e1d31e3
@ -107,6 +107,11 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
|
|||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
||||||
|
Fix: Question about warehouse must not be done when module stock is disabled.
|
||||||
|
Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented
|
||||||
|
(missing test at some places).
|
||||||
|
Fix: Renaming a project with uplaoded files failed.
|
||||||
|
Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error.
|
||||||
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
|
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
|
||||||
Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order.
|
Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order.
|
||||||
Fix: The object deliverycompany was not used anymore and output of
|
Fix: The object deliverycompany was not used anymore and output of
|
||||||
@ -136,6 +141,7 @@ Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a product (on su
|
|||||||
Fix: [ bug #1462, 1468, 1480, 1483, 1490, 1497] $this instead of $object
|
Fix: [ bug #1462, 1468, 1480, 1483, 1490, 1497] $this instead of $object
|
||||||
Fix: [ bug #1455 ] outstanding amount
|
Fix: [ bug #1455 ] outstanding amount
|
||||||
Fix: [ bug #1425 ]
|
Fix: [ bug #1425 ]
|
||||||
|
Fix: [ bug #1425 ] LINEBILL_SUPPLIER_DELETE failure trigger leads to an endless loop
|
||||||
|
|
||||||
***** ChangeLog for 3.5.3 compared to 3.5.2 *****
|
***** ChangeLog for 3.5.3 compared to 3.5.2 *****
|
||||||
Fix: Error on field accountancy code for export profile of invoices.
|
Fix: Error on field accountancy code for export profile of invoices.
|
||||||
|
|||||||
@ -291,13 +291,6 @@ class Commande extends CommonOrder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set new ref and current status
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
$this->ref = $num;
|
|
||||||
$this->statut = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
@ -308,6 +301,13 @@ class Commande extends CommonOrder
|
|||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set new ref and current status
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->ref = $num;
|
||||||
|
$this->statut = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|||||||
@ -862,9 +862,21 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
|
|||||||
else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->commande->valider) {
|
else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->commande->valider) {
|
||||||
$idwarehouse = GETPOST('idwarehouse');
|
$idwarehouse = GETPOST('idwarehouse');
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) {
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
if (! $idwarehouse || $idwarehouse == - 1) {
|
{
|
||||||
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$mesgs[]='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")).'</div>';
|
$mesgs[]='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")).'</div>';
|
||||||
$action='';
|
$action='';
|
||||||
@ -895,9 +907,21 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co
|
|||||||
else if ($action == 'confirm_modif' && $user->rights->commande->creer) {
|
else if ($action == 'confirm_modif' && $user->rights->commande->creer) {
|
||||||
$idwarehouse = GETPOST('idwarehouse');
|
$idwarehouse = GETPOST('idwarehouse');
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) {
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
if (! $idwarehouse || $idwarehouse == - 1) {
|
{
|
||||||
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$mesgs[]='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")).'</div>';
|
$mesgs[]='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")).'</div>';
|
||||||
$action='';
|
$action='';
|
||||||
@ -936,9 +960,21 @@ else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->com
|
|||||||
else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->commande->valider) {
|
else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->commande->valider) {
|
||||||
$idwarehouse = GETPOST('idwarehouse');
|
$idwarehouse = GETPOST('idwarehouse');
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) {
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
if (! $idwarehouse || $idwarehouse == - 1) {
|
{
|
||||||
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$mesgs[]='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")).'</div>';
|
$mesgs[]='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")).'</div>';
|
||||||
$action='';
|
$action='';
|
||||||
@ -1663,8 +1699,20 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
$text .= '<br>';
|
$text .= '<br>';
|
||||||
$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid);
|
$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) {
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
|
||||||
$formproduct = new FormProduct($db);
|
$formproduct = new FormProduct($db);
|
||||||
@ -1681,10 +1729,22 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Confirm back to draft status
|
// Confirm back to draft status
|
||||||
if ($action == 'modif') {
|
if ($action == 'modif')
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
$text=$langs->trans('ConfirmUnvalidateOrder',$object->ref);
|
$text=$langs->trans('ConfirmUnvalidateOrder',$object->ref);
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) {
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
|
||||||
$formproduct = new FormProduct($db);
|
$formproduct = new FormProduct($db);
|
||||||
@ -1710,10 +1770,22 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
/*
|
/*
|
||||||
* Confirmation de l'annulation
|
* Confirmation de l'annulation
|
||||||
*/
|
*/
|
||||||
if ($action == 'cancel') {
|
if ($action == 'cancel')
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
$text=$langs->trans('ConfirmCancelOrder',$object->ref);
|
$text=$langs->trans('ConfirmCancelOrder',$object->ref);
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1)) {
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
|
||||||
$formproduct = new FormProduct($db);
|
$formproduct = new FormProduct($db);
|
||||||
@ -1732,7 +1804,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
/*
|
/*
|
||||||
* Confirmation de la suppression d'une ligne produit
|
* Confirmation de la suppression d'une ligne produit
|
||||||
*/
|
*/
|
||||||
if ($action == 'ask_deleteline') {
|
if ($action == 'ask_deleteline')
|
||||||
|
{
|
||||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
|
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -597,8 +597,9 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
// Replacement invoice
|
// Replacement invoice
|
||||||
if ($_POST['type'] == Facture::TYPE_REPLACEMENT)
|
if ($_POST['type'] == Facture::TYPE_REPLACEMENT)
|
||||||
{
|
{
|
||||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
if (empty($datefacture)) {
|
if (empty($dateinvoice))
|
||||||
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
|
||||||
}
|
}
|
||||||
@ -613,7 +614,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
$result = $object->fetch($_POST['fac_replacement']);
|
$result = $object->fetch($_POST['fac_replacement']);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$object->date = $datefacture;
|
$object->date = $dateinvoice;
|
||||||
$object->note_public = trim($_POST['note_public']);
|
$object->note_public = trim($_POST['note_public']);
|
||||||
$object->note = trim($_POST['note']);
|
$object->note = trim($_POST['note']);
|
||||||
$object->ref_client = $_POST['ref_client'];
|
$object->ref_client = $_POST['ref_client'];
|
||||||
@ -644,8 +645,8 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), 'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
if (empty($datefacture))
|
if (empty($dateinvoice))
|
||||||
{
|
{
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->trans("Date")), 'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired", $langs->trans("Date")), 'errors');
|
||||||
@ -653,14 +654,9 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Si facture avoir
|
|
||||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
|
||||||
|
|
||||||
// $result=$object->fetch($_POST['fac_avoir']);
|
|
||||||
|
|
||||||
$object->socid = GETPOST('socid','int');
|
$object->socid = GETPOST('socid','int');
|
||||||
$object->number = $_POST['facnumber'];
|
$object->number = $_POST['facnumber'];
|
||||||
$object->date = $datefacture;
|
$object->date = $dateinvoice;
|
||||||
$object->note_public = trim($_POST['note_public']);
|
$object->note_public = trim($_POST['note_public']);
|
||||||
$object->note = trim($_POST['note']);
|
$object->note = trim($_POST['note']);
|
||||||
$object->ref_client = $_POST['ref_client'];
|
$object->ref_client = $_POST['ref_client'];
|
||||||
@ -737,8 +733,9 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
// Standard invoice or Deposit invoice created from a Predefined invoice
|
// Standard invoice or Deposit invoice created from a Predefined invoice
|
||||||
if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0)
|
if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0)
|
||||||
{
|
{
|
||||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
if (empty($datefacture)) {
|
if (empty($dateinvoice))
|
||||||
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
|
||||||
}
|
}
|
||||||
@ -748,7 +745,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
$object->socid = GETPOST('socid','int');
|
$object->socid = GETPOST('socid','int');
|
||||||
$object->type = $_POST['type'];
|
$object->type = $_POST['type'];
|
||||||
$object->number = $_POST['facnumber'];
|
$object->number = $_POST['facnumber'];
|
||||||
$object->date = $datefacture;
|
$object->date = $dateinvoice;
|
||||||
$object->note_public = trim($_POST['note_public']);
|
$object->note_public = trim($_POST['note_public']);
|
||||||
$object->note_private = trim($_POST['note_private']);
|
$object->note_private = trim($_POST['note_private']);
|
||||||
$object->ref_client = $_POST['ref_client'];
|
$object->ref_client = $_POST['ref_client'];
|
||||||
@ -771,8 +768,9 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
if (empty($datefacture)) {
|
if (empty($dateinvoice))
|
||||||
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
|
||||||
}
|
}
|
||||||
@ -783,7 +781,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
$object->socid = GETPOST('socid','int');
|
$object->socid = GETPOST('socid','int');
|
||||||
$object->type = GETPOST('type');
|
$object->type = GETPOST('type');
|
||||||
$object->number = $_POST['facnumber'];
|
$object->number = $_POST['facnumber'];
|
||||||
$object->date = $datefacture;
|
$object->date = $dateinvoice;
|
||||||
$object->note_public = trim($_POST['note_public']);
|
$object->note_public = trim($_POST['note_public']);
|
||||||
$object->note_private = trim($_POST['note_private']);
|
$object->note_private = trim($_POST['note_private']);
|
||||||
$object->ref_client = $_POST['ref_client'];
|
$object->ref_client = $_POST['ref_client'];
|
||||||
@ -795,6 +793,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
$object->amount = $_POST['amount'];
|
$object->amount = $_POST['amount'];
|
||||||
$object->remise_absolue = $_POST['remise_absolue'];
|
$object->remise_absolue = $_POST['remise_absolue'];
|
||||||
$object->remise_percent = $_POST['remise_percent'];
|
$object->remise_percent = $_POST['remise_percent'];
|
||||||
|
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
// If creation from another object of another module (Example: origin=propal, originid=1)
|
// If creation from another object of another module (Example: origin=propal, originid=1)
|
||||||
@ -1883,7 +1882,7 @@ if ($action == 'create')
|
|||||||
$mode_reglement_id = (! empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(! empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0));
|
$mode_reglement_id = (! empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(! empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0));
|
||||||
$remise_percent = (! empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(! empty($soc->remise_percent)?$soc->remise_percent:0));
|
$remise_percent = (! empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(! empty($soc->remise_percent)?$soc->remise_percent:0));
|
||||||
$remise_absolue = (! empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(! empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
$remise_absolue = (! empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(! empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
||||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:'';
|
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice);
|
||||||
|
|
||||||
// Replicate extrafields
|
// Replicate extrafields
|
||||||
$objectsrc->fetch_optionals($originid);
|
$objectsrc->fetch_optionals($originid);
|
||||||
@ -1897,7 +1896,7 @@ if ($action == 'create')
|
|||||||
$mode_reglement_id = $soc->mode_reglement_id;
|
$mode_reglement_id = $soc->mode_reglement_id;
|
||||||
$remise_percent = $soc->remise_percent;
|
$remise_percent = $soc->remise_percent;
|
||||||
$remise_absolue = 0;
|
$remise_absolue = 0;
|
||||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; // Do not set 0 here (0 for a date is 1970)
|
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970)
|
||||||
}
|
}
|
||||||
$absolute_discount = $soc->getAvailableDiscounts();
|
$absolute_discount = $soc->getAvailableDiscounts();
|
||||||
|
|
||||||
|
|||||||
@ -483,7 +483,7 @@ class FormFile
|
|||||||
|
|
||||||
// Language code (if multilang)
|
// Language code (if multilang)
|
||||||
$out.= '<th align="center" class="formdoc liste_titre">';
|
$out.= '<th align="center" class="formdoc liste_titre">';
|
||||||
if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang)
|
if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang && (! empty($modellist) || $showempty))
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||||
$formadmin=new FormAdmin($this->db);
|
$formadmin=new FormAdmin($this->db);
|
||||||
@ -509,6 +509,7 @@ class FormFile
|
|||||||
$genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated"));
|
$genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated"));
|
||||||
}
|
}
|
||||||
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton='';
|
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton='';
|
||||||
|
if (empty($modellist) && ! $showempty) $genbutton='';
|
||||||
$out.= $genbutton;
|
$out.= $genbutton;
|
||||||
$out.= '</th>';
|
$out.= '</th>';
|
||||||
|
|
||||||
|
|||||||
@ -485,7 +485,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourn
|
|||||||
setEventMessage($object->error, 'errors');
|
setEventMessage($object->error, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have permission, and if we don't need to provide th idwarehouse, we go directly on approved step
|
// If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step
|
||||||
if ($user->rights->fournisseur->commande->approuver && ! (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1)))
|
if ($user->rights->fournisseur->commande->approuver && ! (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1)))
|
||||||
{
|
{
|
||||||
$action='confirm_approve';
|
$action='confirm_approve';
|
||||||
@ -496,8 +496,18 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou
|
|||||||
{
|
{
|
||||||
$idwarehouse=GETPOST('idwarehouse', 'int');
|
$idwarehouse=GETPOST('idwarehouse', 'int');
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
if (! $idwarehouse || $idwarehouse == -1)
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
{
|
{
|
||||||
@ -1205,8 +1215,18 @@ elseif (! empty($object->id))
|
|||||||
*/
|
*/
|
||||||
if ($action == 'approve')
|
if ($action == 'approve')
|
||||||
{
|
{
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
|
|||||||
@ -131,7 +131,7 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourni
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change)
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
if (! $idwarehouse || $idwarehouse == -1)
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
@ -181,6 +181,8 @@ elseif ($action == 'confirm_delete_line' && $confirm == 'yes' && $user->rights->
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$object->error.'</div>';
|
$mesg='<div class="error">'.$object->error.'</div>';
|
||||||
|
/* Fix bug 1485 : Reset action to avoid asking again confirmation on failure */
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1508,7 +1510,17 @@ else
|
|||||||
}*/
|
}*/
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
|
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $object->hasProductsOrServices(1))
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
|
|||||||
@ -681,7 +681,7 @@ class Product extends CommonObject
|
|||||||
if (file_exists($olddir))
|
if (file_exists($olddir))
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
$res=@dol_move($olddir, $newdir);
|
$res=dol_move($olddir, $newdir);
|
||||||
if (! $res)
|
if (! $res)
|
||||||
{
|
{
|
||||||
$this->error='ErrorFailToMoveDir';
|
$this->error='ErrorFailToMoveDir';
|
||||||
|
|||||||
@ -249,7 +249,8 @@ class Project extends CommonObject
|
|||||||
$newdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
$newdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
||||||
if (file_exists($olddir))
|
if (file_exists($olddir))
|
||||||
{
|
{
|
||||||
$res=@dol_move($olddir, $newdir);
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
|
$res=dol_move($olddir, $newdir);
|
||||||
if (! $res)
|
if (! $res)
|
||||||
{
|
{
|
||||||
$this->error='ErrorFailToMoveDir';
|
$this->error='ErrorFailToMoveDir';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user