Exemplo n.º 1
0
     $savdate = $object->date;
     if (!empty($conf->global->FAC_FORCE_DATE_VALIDATION)) {
         $object->date = dol_now();
         $object->date_lim_reglement = $object->calculate_date_lim_reglement();
     }
     $numref = $object->getNextNumRef($soc);
     // $object->date=$savdate;
 } else {
     $numref = $object->ref;
 }
 $text = $langs->trans('ConfirmValidateBill', $numref);
 if (!empty($conf->notification->enabled)) {
     require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
     $notify = new Notify($db);
     $text .= '<br>';
     $text .= $notify->confirmMessage('BILL_VALIDATE', $object->socid, $object);
 }
 $formquestion = array();
 $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 ($object->type != Facture::TYPE_DEPOSIT && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) {
     $langs->load("stocks");
     require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
     require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
     $formproduct = new FormProduct($db);
     $warehouse = new Entrepot($db);
     $warehouse_array = $warehouse->list_array();
Exemplo n.º 2
0
  * Confirmation de la validation
  */
 if ($action == 'validate') {
     // on verifie si l'objet est en numerotation provisoire
     $ref = substr($object->ref, 1, 4);
     if ($ref == 'PROV') {
         $numref = $object->getNextNumRef($soc);
     } else {
         $numref = $object->ref;
     }
     $text = $langs->trans('ConfirmValidateOrder', $numref);
     if ($conf->notification->enabled) {
         require_once DOL_DOCUMENT_ROOT . "/core/class/notify.class.php";
         $notify = new Notify($db);
         $text .= '<br>';
         $text .= $notify->confirmMessage('NOTIFY_VAL_ORDER', $object->socid);
     }
     $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', '', 0, 1);
 }
 /*
  * Confirmation de la cloture
  */
 if ($action == 'close') {
     $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close', '', 0, 1);
 }
 /*
  * Confirmation de l'annulation
  */
 if ($action == 'cancel') {
     $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel', '', 0, 1);
 }
Exemplo n.º 3
0
 /*
  * Confirmation de la validation
  */
 if ($action == 'valid') {
     $objectref = substr($object->ref, 1, 4);
     if ($objectref == 'PROV') {
         $numref = $object->getNextNumRef($soc);
     } else {
         $numref = $object->ref;
     }
     $text = $langs->trans("ConfirmValidateSending", $numref);
     if (!empty($conf->notification->enabled)) {
         require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
         $notify = new Notify($db);
         $text .= '<br>';
         $text .= $notify->confirmMessage('SHIPPING_VALIDATE', $object->socid, $object);
     }
     print $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id, $langs->trans('ValidateSending'), $text, 'confirm_valid', '', 0, 1);
 }
 /*
  * Confirmation de l'annulation
  */
 if ($action == 'annuler') {
     print $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id, $langs->trans('CancelSending'), $langs->trans("ConfirmCancelSending", $object->ref), 'confirm_cancel', '', 0, 1);
 }
 // Calculate true totalWeight and totalVolume for all products
 // by adding weight and volume of each product line.
 $totalWeight = '';
 $totalVolume = '';
 $weightUnit = 0;
 $volumeUnit = 0;
Exemplo n.º 4
0
  * Confirmation de la validation
  */
 if ($action == 'validate') {
     // on verifie si l'objet est en numerotation provisoire
     $ref = substr($object->ref, 1, 4);
     if ($ref == 'PROV') {
         $numref = $object->getNextNumRef($soc);
     } else {
         $numref = $object->ref;
     }
     $text = $langs->trans('ConfirmValidateOrder', $numref);
     if (!empty($conf->notification->enabled)) {
         require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
         $notify = new Notify($db);
         $text .= '<br>';
         $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();
     if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
         $langs->load("stocks");
         require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
         $formproduct = new FormProduct($db);
         $formquestion = array(array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse') ? GETPOST('idwarehouse') : 'ifone', 'idwarehouse', '', 1)));
     }
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
Exemplo n.º 5
0
  * Confirmation de la validation
  */
 if ($action == 'valid') {
     $object->date_commande = dol_now();
     // We check if number is temporary number
     if (preg_match('/^[\\(]?PROV/i', $object->ref)) {
         $newref = $object->getNextNumRef($object->thirdparty);
     } else {
         $newref = $object->ref;
     }
     $text = $langs->trans('ConfirmValidateOrder', $newref);
     if (!empty($conf->notification->enabled)) {
         require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
         $notify = new Notify($db);
         $text .= '<br>';
         $text .= $notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid);
     }
     print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
 }
 /*
  * Confirmation de l'approbation
  */
 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();
     if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) {
Exemplo n.º 6
0
  * Confirmation de la validation
  */
 if ($action == 'valid') {
     $object->date_commande = gmmktime();
     // We check if number is temporary number
     if (preg_match('/^[\\(]?PROV/i', $object->ref)) {
         $newref = $object->getNextNumRef($soc);
     } else {
         $newref = $object->ref;
     }
     $text = $langs->trans('ConfirmValidateOrder', $newref);
     if ($conf->notification->enabled) {
         require_once DOL_DOCUMENT_ROOT . "/core/class/notify.class.php";
         $notify = new Notify($db);
         $text .= '<br>';
         $text .= $notify->confirmMessage(3, $object->socid);
     }
     $ret = $html->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
     if ($ret == 'html') {
         print '<br>';
     }
 }
 /*
  * Confirmation de l'approbation
  */
 if ($action == 'approve') {
     $ret = $html->form_confirm("fiche.php?id={$object->id}", $langs->trans("ApproveThisOrder"), $langs->trans("ConfirmApproveThisOrder", $object->ref), "confirm_approve", '', 1, 1);
     if ($ret == 'html') {
         print '<br>';
     }
 }
Exemplo n.º 7
0
                     $ref = substr($object->ref, 1, 4);
                     if ($ref == 'PROV') {
                         $numref = $object->getNextNumRef($soc);
                         if (empty($numref)) {
                             $error++;
                             dol_htmloutput_errors($object->error);
                         }
                     } else {
                         $numref = $object->ref;
                     }
                     $text = $langs->trans('ConfirmValidateProp', $numref);
                     if (!empty($conf->notification->enabled)) {
                         require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
                         $notify = new Notify($db);
                         $text .= '<br>';
                         $text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid);
                     }
                     if (!$error) {
                         $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1);
                     }
                 }
             }
         }
     }
 }
 if (!$formconfirm) {
     $parameters = array('lineid' => $lineid);
     $formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action);
     // Note that $action and $object may have been modified
     // by
     // hook
Exemplo n.º 8
0
		if ($ref == 'PROV')
		{
			$numref = $object->getNextNumRef($soc);
		}
		else
		{
			$numref = $object->ref;
		}

		$text=$langs->trans('ConfirmValidateProp',$numref);
		if ($conf->notification->enabled)
		{
			require_once(DOL_DOCUMENT_ROOT ."/core/class/notify.class.php");
			$notify=new Notify($db);
			$text.='<br>';
			$text.=$notify->confirmMessage('NOTIFY_VAL_PROPAL',$object->socid);
		}

		$formconfirm=$html->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1);
	}

	// Hook for external modules
	if (empty($formconfirm) && ! empty($object->hooks))
	{
		foreach($object->hooks as $hook)
		{
			if (! empty($hook['modules']))
			{
				foreach($hook['modules'] as $module)
				{
					if (empty($formconfirm) && method_exists($module,'formconfirm'))
Exemplo n.º 9
0
                     $ref = substr($object->ref, 1, 4);
                     if ($ref == 'PROV') {
                         $numref = $object->getNextNumRef($soc);
                         if (empty($numref)) {
                             $error++;
                             setEventMessage($object->error, 'errors');
                         }
                     } else {
                         $numref = $object->ref;
                     }
                     $text = $langs->trans('ConfirmValidateAsk', $numref);
                     if (!empty($conf->notification->enabled)) {
                         require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
                         $notify = new Notify($db);
                         $text .= '<br>';
                         $text .= $notify->confirmMessage('ASKPRICESUPPLIER_VALIDATE', $object->socid, $object);
                     }
                     if (!$error) {
                         $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateAsk'), $text, 'confirm_validate', '', 0, 1);
                     }
                 }
             }
         }
     }
 }
 if (!$formconfirm) {
     $parameters = array('lineid' => $lineid);
     $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action);
     // Note that $action and $object may have been modified by hook
     if (empty($reshook)) {
         $formconfirm .= $hookmanager->resPrint;
Exemplo n.º 10
0
		if ($ref == 'PROV') {
			$numref = $object->getNextNumRef($soc);
			if (empty($numref)) {
				$error ++;
				setEventMessages($object->error, $object->errors, 'errors');
			}
		} else {
			$numref = $object->ref;
		}

		$text = $langs->trans('ConfirmValidateAsk', $numref);
		if (! empty($conf->notification->enabled)) {
			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
			$notify = new Notify($db);
			$text .= '<br>';
			$text .= $notify->confirmMessage('SUPPLIER_PROPOSAL_VALIDATE', $object->socid, $object);
		}

		if (! $error)
			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateAsk'), $text, 'confirm_validate', '', 0, 1);
	}

	if (! $formconfirm) {
		$parameters = array('lineid' => $lineid);
		$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
		if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
		elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
	}

	// Print form confirm
	print $formconfirm;