Beispiel #1
0
	}
	$result=delivery_order_pdf_create($db, $delivery,$_REQUEST['model'],$outputlangs);
	if ($result <= 0)
	{
		dol_print_error($db,$result);
		exit;
	}
}

if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->expedition->livraison->supprimer)
{
	$delivery = new Livraison($db);
	$delivery->fetch($_GET["id"]);

	$db->begin();
	$result=$delivery->delete();

	if ($result > 0)
	{
		$db->commit();
		Header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
		exit;
	}
	else
	{
		$db->rollback();
	}
}

/*
 * Build document
            $ret = $object->fetch($id);
            // Reload to get new records
            $result = delivery_order_pdf_create($db, $object, $_REQUEST['model'], $outputlangs);
        }
        if ($result < 0) {
            dol_print_error($db, $result);
            exit;
        }
    }
}
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->livraison->supprimer) {
    $object = new Livraison($db);
    $object->fetch($id);
    $object->fetch_thirdparty();
    $db->begin();
    $result = $object->delete();
    if ($result > 0) {
        $db->commit();
        if (!empty($backtourl)) {
            header("Location: " . $backtourl);
        } else {
            header("Location: " . DOL_URL_ROOT . '/expedition/index.php');
        }
        exit;
    } else {
        $db->rollback();
    }
}
if ($action == 'setdate_livraison' && $user->rights->expedition->livraison->creer) {
    $object = new Livraison($db);
    $object->fetch($id);