在生成发票之前执行,以允许在汇总到期项目之前对存储的数据进行操作。
参数
变量 | 类型 | 注意 |
---|---|---|
这个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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。