本文整理汇总了PHP中FactureFournisseur::hasProductsOrServices方法的典型用法代码示例。如果您正苦于以下问题:PHP FactureFournisseur::hasProductsOrServices方法的具体用法?PHP FactureFournisseur::hasProductsOrServices怎么用?PHP FactureFournisseur::hasProductsOrServices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FactureFournisseur
的用法示例。
在下文中一共展示了FactureFournisseur::hasProductsOrServices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
if ($result > 0) {
header("Location: " . $_SERVER['PHP_SELF'] . '?action=editref_supplier&id=' . $result);
exit;
} else {
$langs->load("errors");
$mesg = '<div class="error">' . $langs->trans($object->error) . '</div>';
$action = '';
}
}
} elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->facture->valider) {
$idwarehouse = GETPOST('idwarehouse');
$object->fetch($id);
$object->fetch_thirdparty();
$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);
}
// Check parameters
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
$langs->load("stocks");
if (!$idwarehouse || $idwarehouse == -1) {
$error++;
$errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse"));
$action = '';
}
}
if (!$error) {
$result = $object->validate($user, '', $idwarehouse);
if ($result < 0) {
示例2: header
$result = $object->createFromClone($id);
if ($result > 0) {
header("Location: " . $_SERVER['PHP_SELF'] . '?action=editfacnumber&id=' . $result);
exit;
} else {
$langs->load("errors");
$mesg = '<div class="error">' . $langs->trans($object->error) . '</div>';
$action = '';
}
}
} elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->facture->valider) {
$idwarehouse = GETPOST('idwarehouse');
$object->fetch($id);
$object->fetch_thirdparty();
// Check parameters
if (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $object->hasProductsOrServices(1)) {
$langs->load("stocks");
if (!$idwarehouse || $idwarehouse == -1) {
$error++;
$errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse"));
$action = '';
}
}
if (!$error) {
$result = $object->validate($user, '', $idwarehouse);
if ($result < 0) {
$mesg = '<div class="error">' . $object->error . '</div>';
}
}
} elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->facture->supprimer) {
$object->fetch($id);