在生成發票之前執行,以允許在匯總到期項目之前對存儲的數據進行操作。
參數
變量 | 類型 | 注意 |
---|---|---|
這個hook功能沒有參數。 |
響應
不支持響應
示例代碼
<?php
use WHMCS\Service\Service;
/**
* Prevent invoicing of any new services added to clientID 5
*/
add_hook('PreInvoicingGenerateInvoiceItems', 1, function() {
$services = Service::where('userid', 5)
->where('billingcycle', '!=', 'Free Account')
->get();
foreach ($services as $service) {
$service->billingcycle = 'Free Account';
$service->save();
}
});
相關用法
- PHP WHMCS PreAutomationTask用法及代碼示例
- PHP WHMCS PreModuleRenew用法及代碼示例
- PHP WHMCS PremiumPriceOverride用法及代碼示例
- PHP WHMCS PreModuleProvisionAddOnFeature用法及代碼示例
- PHP WHMCS PreRegistrarGetDNS用法及代碼示例
- PHP WHMCS PreRegistrarGetNameservers用法及代碼示例
- PHP WHMCS PreRegistrarSaveContactDetails用法及代碼示例
- PHP WHMCS PreEmailSendReduceRecipients用法及代碼示例
- PHP WHMCS PreRegistrarRenewDomain用法及代碼示例
- PHP WHMCS PreModuleCreate用法及代碼示例
- PHP WHMCS PreFraudCheck用法及代碼示例
- PHP WHMCS PreCalculateCartTotals用法及代碼示例
- PHP WHMCS PreRegistrarTransferDomain用法及代碼示例
- PHP WHMCS PreModuleSuspendAddOnFeature用法及代碼示例
- PHP WHMCS PreRegistrarGetContactDetails用法及代碼示例
- PHP WHMCS PreUpgradeCheckout用法及代碼示例
- PHP WHMCS PreModuleChangePassword用法及代碼示例
- PHP WHMCS PreRegistrarGetEPPCode用法及代碼示例
- PHP WHMCS PreShoppingCartCheckout用法及代碼示例
- PHP WHMCS PreModuleDeprovisionAddOnFeature用法及代碼示例
- PHP WHMCS PreModuleCustom用法及代碼示例
- PHP WHMCS PreDomainRegister用法及代碼示例
- PHP WHMCS PreServiceEdit用法及代碼示例
- PHP WHMCS PreModuleTerminate用法及代碼示例
- PHP WHMCS PreDeleteClient用法及代碼示例
注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 PreInvoicingGenerateInvoiceItems。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。