本文整理匯總了PHP中DiscountAbsolute::unlink_invoice方法的典型用法代碼示例。如果您正苦於以下問題:PHP DiscountAbsolute::unlink_invoice方法的具體用法?PHP DiscountAbsolute::unlink_invoice怎麽用?PHP DiscountAbsolute::unlink_invoice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DiscountAbsolute
的用法示例。
在下文中一共展示了DiscountAbsolute::unlink_invoice方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: header
// Reload to get new records
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
if ($result >= 0) {
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
exit;
}
} else {
setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
} else {
if ($action == 'unlinkdiscount' && $user->rights->facture->creer) {
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(GETPOST("discountid"));
$discount->unlink_invoice();
} else {
if ($action == 'valid' && $user->rights->facture->creer) {
$object->fetch($id);
// On verifie signe facture
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
// Si avoir, le signe doit etre negatif
if ($object->total_ht >= 0) {
setEventMessages($langs->trans("ErrorInvoiceAvoirMustBeNegative"), null, 'errors');
$action = '';
}
} else {
// Si non avoir, le signe doit etre positif
if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ht < 0) {
setEventMessages($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), null, 'errors');
$action = '';