use isModEnabled function
This commit is contained in:
parent
51462a276a
commit
3fdbce7a31
@ -108,7 +108,7 @@ if ($action == 'set_default') {
|
|||||||
$res3 = dolibarr_set_const($db, 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN', GETPOST('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res3 = dolibarr_set_const($db, 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN', GETPOST('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
// Use vat for invoice creation
|
// Use vat for invoice creation
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||||
@ -241,10 +241,10 @@ $arraychoices = array('0'=>$langs->trans("None"));
|
|||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled)) {
|
||||||
$arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect");
|
$arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect");
|
||||||
}
|
}
|
||||||
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
|
||||||
$arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly");
|
$arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly");
|
||||||
}
|
}
|
||||||
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
|
||||||
$arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice");
|
$arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice");
|
||||||
}
|
}
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -256,7 +256,7 @@ print '</td>';
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Use vat for invoice creation
|
// Use vat for invoice creation
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
|
||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled)) {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -831,11 +831,11 @@ if ($rowid > 0) {
|
|||||||
$bankviainvoice = 1;
|
$bankviainvoice = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
|
||||||
$bankviainvoice = 1;
|
$bankviainvoice = 1;
|
||||||
} elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) {
|
} elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) {
|
||||||
$bankdirect = 1;
|
$bankdirect = 1;
|
||||||
} elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
} elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
|
||||||
$invoiceonly = 1;
|
$invoiceonly = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -982,7 +982,7 @@ if ($rowid > 0) {
|
|||||||
print '"></td></tr>';
|
print '"></td></tr>';
|
||||||
|
|
||||||
// Complementary action
|
// Complementary action
|
||||||
if ((!empty($conf->banque->enabled) || !empty($conf->facture->enabled)) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) {
|
if ((!empty($conf->banque->enabled) || isModEnabled('facture')) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) {
|
||||||
$company = new Societe($db);
|
$company = new Societe($db);
|
||||||
if ($object->fk_soc) {
|
if ($object->fk_soc) {
|
||||||
$result = $company->fetch($object->fk_soc);
|
$result = $company->fetch($object->fk_soc);
|
||||||
@ -1003,7 +1003,7 @@ if ($rowid > 0) {
|
|||||||
print '><label for="bankdirect"> '.$langs->trans("MoreActionBankDirect").'</label><br>';
|
print '><label for="bankdirect"> '.$langs->trans("MoreActionBankDirect").'</label><br>';
|
||||||
}
|
}
|
||||||
// Add invoice with no payments
|
// Add invoice with no payments
|
||||||
if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
if (!empty($conf->societe->enabled) && isModEnabled('facture')) {
|
||||||
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : '');
|
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : '');
|
||||||
//if (empty($object->fk_soc)) print ' disabled';
|
//if (empty($object->fk_soc)) print ' disabled';
|
||||||
print '><label for="invoiceonly"> '.$langs->trans("MoreActionInvoiceOnly");
|
print '><label for="invoiceonly"> '.$langs->trans("MoreActionInvoiceOnly");
|
||||||
@ -1033,7 +1033,7 @@ if ($rowid > 0) {
|
|||||||
print '</label><br>';
|
print '</label><br>';
|
||||||
}
|
}
|
||||||
// Add invoice with payments
|
// Add invoice with payments
|
||||||
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
|
||||||
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : '');
|
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : '');
|
||||||
//if (empty($object->fk_soc)) print ' disabled';
|
//if (empty($object->fk_soc)) print ' disabled';
|
||||||
print '><label for="bankviainvoice"> '.$langs->trans("MoreActionBankViaInvoice");
|
print '><label for="bankviainvoice"> '.$langs->trans("MoreActionBankViaInvoice");
|
||||||
|
|||||||
@ -494,8 +494,8 @@ $tabcond[8] = !empty($conf->societe->enabled);
|
|||||||
$tabcond[9] = true;
|
$tabcond[9] = true;
|
||||||
$tabcond[10] = true;
|
$tabcond[10] = true;
|
||||||
$tabcond[11] = (!empty($conf->societe->enabled));
|
$tabcond[11] = (!empty($conf->societe->enabled));
|
||||||
$tabcond[12] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled) || !empty($conf->supplier_order->enabled));
|
$tabcond[12] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || isModEnabled('facture') || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled) || !empty($conf->supplier_order->enabled));
|
||||||
$tabcond[13] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled) || !empty($conf->supplier_order->enabled));
|
$tabcond[13] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || isModEnabled('facture') || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled) || !empty($conf->supplier_order->enabled));
|
||||||
$tabcond[14] = (!empty($conf->product->enabled) && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY)));
|
$tabcond[14] = (!empty($conf->product->enabled) && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY)));
|
||||||
$tabcond[15] = true;
|
$tabcond[15] = true;
|
||||||
$tabcond[16] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS));
|
$tabcond[16] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS));
|
||||||
@ -508,12 +508,12 @@ $tabcond[22] = (!empty($conf->commande->enabled) || !empty($conf->propal->enable
|
|||||||
$tabcond[23] = true;
|
$tabcond[23] = true;
|
||||||
$tabcond[24] = !empty($conf->resource->enabled);
|
$tabcond[24] = !empty($conf->resource->enabled);
|
||||||
$tabcond[25] = !empty($conf->website->enabled);
|
$tabcond[25] = !empty($conf->website->enabled);
|
||||||
//$tabcond[26]= ! empty($conf->product->enabled);
|
//$tabcond[26]= !empty($conf->product->enabled);
|
||||||
$tabcond[27] = !empty($conf->societe->enabled);
|
$tabcond[27] = !empty($conf->societe->enabled);
|
||||||
$tabcond[28] = !empty($conf->holiday->enabled);
|
$tabcond[28] = !empty($conf->holiday->enabled);
|
||||||
$tabcond[29] = !empty($conf->projet->enabled);
|
$tabcond[29] = !empty($conf->projet->enabled);
|
||||||
$tabcond[30] = !empty($conf->label->enabled);
|
$tabcond[30] = !empty($conf->label->enabled);
|
||||||
//$tabcond[31]= ! empty($conf->accounting->enabled);
|
//$tabcond[31]= !empty($conf->accounting->enabled);
|
||||||
$tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled));
|
$tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled));
|
||||||
$tabcond[33] = !empty($conf->hrm->enabled);
|
$tabcond[33] = !empty($conf->hrm->enabled);
|
||||||
$tabcond[34] = !empty($conf->hrm->enabled);
|
$tabcond[34] = !empty($conf->hrm->enabled);
|
||||||
|
|||||||
@ -279,7 +279,7 @@ foreach ($object->fields as $key => $val) {
|
|||||||
$sql .= "t.".$db->escape($key).", ";
|
$sql .= "t.".$db->escape($key).", ";
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,10 +63,10 @@ $conditions = array(
|
|||||||
'NOTE_PRIVATE' => 1,
|
'NOTE_PRIVATE' => 1,
|
||||||
'SOCIETE' => 1,
|
'SOCIETE' => 1,
|
||||||
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
|
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
|
||||||
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
'DETAILS' => (isModEnabled('facture') || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
||||||
'USERSIGN' => 1,
|
'USERSIGN' => 1,
|
||||||
'MAILING' => !empty($conf->mailing->enabled),
|
'MAILING' => !empty($conf->mailing->enabled),
|
||||||
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
|
'MAIL' => (isModEnabled('facture') || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
|
||||||
'TICKET' => !empty($conf->ticket->enabled),
|
'TICKET' => !empty($conf->ticket->enabled),
|
||||||
);
|
);
|
||||||
// Picto
|
// Picto
|
||||||
|
|||||||
@ -196,7 +196,7 @@ if (!empty($conf->propal->enabled) && !empty($user->rights->propal->lire)) {
|
|||||||
if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) {
|
if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) {
|
||||||
$elementList['order_send'] = img_picto('', 'order', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendOrder'));
|
$elementList['order_send'] = img_picto('', 'order', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendOrder'));
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
|
||||||
$elementList['facture_send'] = img_picto('', 'bill', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendInvoice'));
|
$elementList['facture_send'] = img_picto('', 'bill', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendInvoice'));
|
||||||
}
|
}
|
||||||
if (!empty($conf->expedition->enabled)) {
|
if (!empty($conf->expedition->enabled)) {
|
||||||
|
|||||||
@ -120,7 +120,7 @@ if (!empty($conf->propal->enabled)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
print load_fiche_titre($langs->trans("Invoices"), '', '');
|
print load_fiche_titre($langs->trans("Invoices"), '', '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
|||||||
@ -209,7 +209,7 @@ $found = 0;
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("DeStockOnBill").'</td>';
|
print '<td>'.$langs->trans("DeStockOnBill").'</td>';
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
print ajax_constantonoff('STOCK_CALCULATE_ON_BILL', array(), null, 0, 0, 0, 2, 1);
|
print ajax_constantonoff('STOCK_CALCULATE_ON_BILL', array(), null, 0, 0, 0, 2, 1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -189,7 +189,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
|||||||
$param .= " -U ".$dolibarr_main_db_user;
|
$param .= " -U ".$dolibarr_main_db_user;
|
||||||
$paramcrypted = $param;
|
$paramcrypted = $param;
|
||||||
$paramclear = $param;
|
$paramclear = $param;
|
||||||
/*if (! empty($dolibarr_main_db_pass))
|
/*if (!empty($dolibarr_main_db_pass))
|
||||||
{
|
{
|
||||||
$paramcrypted.=" -p".preg_replace('/./i','*',$dolibarr_main_db_pass);
|
$paramcrypted.=" -p".preg_replace('/./i','*',$dolibarr_main_db_pass);
|
||||||
$paramclear.=" -p".$dolibarr_main_db_pass;
|
$paramclear.=" -p".$dolibarr_main_db_pass;
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
|
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
|
||||||
'family'=>'create',
|
'family'=>'create',
|
||||||
'position'=>20,
|
'position'=>20,
|
||||||
'enabled'=>(!empty($conf->commande->enabled) && !empty($conf->facture->enabled)),
|
'enabled'=>(!empty($conf->commande->enabled) && isModEnabled('facture')),
|
||||||
'picto'=>'bill'
|
'picto'=>'bill'
|
||||||
),
|
),
|
||||||
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
|
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
|
||||||
@ -91,7 +91,7 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
|
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
|
||||||
'family'=>'classify_proposal',
|
'family'=>'classify_proposal',
|
||||||
'position'=>31,
|
'position'=>31,
|
||||||
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->facture->enabled)),
|
'enabled'=>(!empty($conf->propal->enabled) && isModEnabled('facture')),
|
||||||
'picto'=>'propal',
|
'picto'=>'propal',
|
||||||
'warning'=>''
|
'warning'=>''
|
||||||
),
|
),
|
||||||
@ -112,7 +112,7 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
|
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
|
||||||
'family'=>'classify_order',
|
'family'=>'classify_order',
|
||||||
'position'=>42,
|
'position'=>42,
|
||||||
'enabled'=>(!empty($conf->facture->enabled) && !empty($conf->commande->enabled)),
|
'enabled'=>(isModEnabled('facture') && !empty($conf->commande->enabled)),
|
||||||
'picto'=>'order',
|
'picto'=>'order',
|
||||||
'warning'=>''
|
'warning'=>''
|
||||||
), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
|
), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
|
||||||
@ -165,7 +165,7 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
|
'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
|
||||||
'family' => 'classify_shipping',
|
'family' => 'classify_shipping',
|
||||||
'position' => 90,
|
'position' => 90,
|
||||||
'enabled' => ! empty($conf->expedition->enabled) && ! empty($conf->facture->enabled),
|
'enabled' => !empty($conf->expedition->enabled) && !empty($conf->facture->enabled),
|
||||||
'picto' => 'shipment'
|
'picto' => 'shipment'
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -173,13 +173,13 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_TICKET_LINK_CONTRACT' => array(
|
'WORKFLOW_TICKET_LINK_CONTRACT' => array(
|
||||||
'family' => 'link_ticket',
|
'family' => 'link_ticket',
|
||||||
'position' => 75,
|
'position' => 75,
|
||||||
'enabled' => ! empty($conf->ticket->enabled) && ! empty($conf->contract->enabled),
|
'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled),
|
||||||
'picto' => 'ticket'
|
'picto' => 'ticket'
|
||||||
),
|
),
|
||||||
'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
|
'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
|
||||||
'family' => 'link_ticket',
|
'family' => 'link_ticket',
|
||||||
'position' => 76,
|
'position' => 76,
|
||||||
'enabled' => ! empty($conf->ticket->enabled) && ! empty($conf->contract->enabled),
|
'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled),
|
||||||
'picto' => 'ticket'
|
'picto' => 'ticket'
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -140,7 +140,7 @@ class BlockedLog
|
|||||||
|
|
||||||
$this->trackedevents = array();
|
$this->trackedevents = array();
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE';
|
$this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE';
|
||||||
$this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE';
|
$this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE';
|
||||||
$this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL';
|
$this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL';
|
||||||
|
|||||||
@ -198,7 +198,7 @@ class CActionComm
|
|||||||
//var_dump($obj->type.' '.$obj->module.' '); var_dump($user->rights->facture->lire);
|
//var_dump($obj->type.' '.$obj->module.' '); var_dump($user->rights->facture->lire);
|
||||||
$qualified = 0;
|
$qualified = 0;
|
||||||
// Special cases
|
// Special cases
|
||||||
if ($obj->module == 'invoice' && !empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
if ($obj->module == 'invoice' && isModEnabled('facture') && !empty($user->rights->facture->lire)) {
|
||||||
$qualified = 1;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) {
|
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) {
|
||||||
|
|||||||
@ -40,10 +40,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
}
|
|
||||||
if (!empty($conf->facture->enabled)) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->propal->enabled)) {
|
if (!empty($conf->propal->enabled)) {
|
||||||
@ -77,7 +75,7 @@ if (!empty($conf->commande->enabled)) {
|
|||||||
if (!empty($conf->expedition->enabled)) {
|
if (!empty($conf->expedition->enabled)) {
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
}
|
}
|
||||||
if (!empty($conf->projet->enabled)) {
|
if (!empty($conf->projet->enabled)) {
|
||||||
@ -741,7 +739,7 @@ if ($object->id > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||||
// Box factures
|
// Box factures
|
||||||
$tmp = $object->getOutstandingBills('customer', 0);
|
$tmp = $object->getOutstandingBills('customer', 0);
|
||||||
$outstandingOpened = $tmp['opened'];
|
$outstandingOpened = $tmp['opened'];
|
||||||
@ -1311,7 +1309,7 @@ if ($object->id > 0) {
|
|||||||
/*
|
/*
|
||||||
* Latest invoices templates
|
* Latest invoices templates
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||||
$sql = 'SELECT f.rowid as id, f.titre as ref';
|
$sql = 'SELECT f.rowid as id, f.titre as ref';
|
||||||
$sql .= ', f.total_ht';
|
$sql .= ', f.total_ht';
|
||||||
$sql .= ', f.total_tva';
|
$sql .= ', f.total_tva';
|
||||||
@ -1406,7 +1404,7 @@ if ($object->id > 0) {
|
|||||||
/*
|
/*
|
||||||
* Latest invoices
|
* Latest invoices
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||||
$sql = 'SELECT f.rowid as facid, f.ref, f.type';
|
$sql = 'SELECT f.rowid as facid, f.ref, f.type';
|
||||||
$sql .= ', f.total_ht';
|
$sql .= ', f.total_ht';
|
||||||
$sql .= ', f.total_tva';
|
$sql .= ', f.total_tva';
|
||||||
@ -1569,7 +1567,7 @@ if ($object->id > 0) {
|
|||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddTrip").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddTrip").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled) && $object->status == 1) {
|
if (isModEnabled('facture') && $object->status == 1) {
|
||||||
if (empty($user->rights->facture->creer)) {
|
if (empty($user->rights->facture->creer)) {
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -696,7 +696,7 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
!$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on'
|
!$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on'
|
||||||
&& ! empty($deposit_percent_from_payment_terms) && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer)
|
&& ! empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)
|
||||||
) {
|
) {
|
||||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
@ -2001,7 +2001,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
|
$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
|
||||||
|
|
||||||
if (! empty($deposit_percent_from_payment_terms) && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer)) {
|
if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && ! empty($user->rights->facture->creer)) {
|
||||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
$object->fetchObjectLinked();
|
$object->fetchObjectLinked();
|
||||||
@ -2801,7 +2801,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Create an invoice and classify billed
|
// Create an invoice and classify billed
|
||||||
if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPOSAL_ARE_NOT_BILLABLE)) {
|
if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPOSAL_ARE_NOT_BILLABLE)) {
|
||||||
if (!empty($conf->facture->enabled) && $usercancreateinvoice) {
|
if (isModEnabled('facture') && $usercancreateinvoice) {
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2782,7 +2782,7 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
// Create bill and Classify billed
|
// Create bill and Classify billed
|
||||||
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
|
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
|
||||||
if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
|
if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
|
if (isModEnabled('facture') && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
|
||||||
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, '');
|
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, '');
|
||||||
}
|
}
|
||||||
if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) {
|
if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) {
|
||||||
|
|||||||
@ -1928,7 +1928,7 @@ if ($resql) {
|
|||||||
print $getNomUrl_cache[$obj->socid];
|
print $getNomUrl_cache[$obj->socid];
|
||||||
|
|
||||||
// If module invoices enabled and user with invoice creation permissions
|
// If module invoices enabled and user with invoice creation permissions
|
||||||
if (!empty($conf->facture->enabled) && !empty($conf->global->ORDER_BILLING_ALL_CUSTOMER)) {
|
if (isModEnabled('facture') && !empty($conf->global->ORDER_BILLING_ALL_CUSTOMER)) {
|
||||||
if ($user->rights->facture->creer) {
|
if ($user->rights->facture->creer) {
|
||||||
if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) {
|
if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) {
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$companystatic->id.'&search_billed=0&autoselectall=1">';
|
print ' <a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$companystatic->id.'&search_billed=0&autoselectall=1">';
|
||||||
|
|||||||
@ -127,7 +127,7 @@ if (empty($entity)) {
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$listofchoices = array(
|
$listofchoices = array(
|
||||||
'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled), 'perms' => !empty($user->rights->facture->lire)),
|
'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)),
|
||||||
'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled), 'perms' => !empty($user->rights->fournisseur->facture->lire)),
|
'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled), 'perms' => !empty($user->rights->fournisseur->facture->lire)),
|
||||||
'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)),
|
'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)),
|
||||||
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)),
|
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)),
|
||||||
|
|||||||
@ -5415,7 +5415,7 @@ class Facture extends CommonInvoice
|
|||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
if (empty($conf->facture->enabled)) { // Should not happen. If module disabled, cron job should not be visible.
|
if (!isModEnabled('facture')) { // Should not happen. If module disabled, cron job should not be visible.
|
||||||
$this->output .= $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture"));
|
$this->output .= $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,7 +121,7 @@ print '</div><div class="fichetwothirdright">';
|
|||||||
|
|
||||||
|
|
||||||
// Latest modified customer invoices
|
// Latest modified customer invoices
|
||||||
if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
|
||||||
$langs->load("boxes");
|
$langs->load("boxes");
|
||||||
$tmpinvoice = new Facture($db);
|
$tmpinvoice = new Facture($db);
|
||||||
|
|
||||||
@ -582,7 +582,7 @@ if (!empty($conf->tax->enabled) && !empty($user->rights->tax->charges->lire)) {
|
|||||||
/*
|
/*
|
||||||
* Customers orders to be billed
|
* Customers orders to be billed
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
|
if (isModEnabled('facture') && !empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
|
||||||
$commandestatic = new Commande($db);
|
$commandestatic = new Commande($db);
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
|||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ if ($id > 0) {
|
|||||||
dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1);
|
dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1);
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||||
// Invoice list
|
// Invoice list
|
||||||
print load_fiche_titre($langs->trans("CustomerPreview"));
|
print load_fiche_titre($langs->trans("CustomerPreview"));
|
||||||
|
|
||||||
|
|||||||
@ -212,7 +212,7 @@ if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
|
|||||||
|
|
||||||
$subtotal_ht = 0;
|
$subtotal_ht = 0;
|
||||||
$subtotal_ttc = 0;
|
$subtotal_ttc = 0;
|
||||||
if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
||||||
if ($modecompta == 'CREANCES-DETTES') {
|
if ($modecompta == 'CREANCES-DETTES') {
|
||||||
$sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
@ -269,7 +269,7 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod
|
|||||||
// Nothing from this table
|
// Nothing from this table
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
||||||
// On ajoute les paiements clients anciennes version, non lies par paiement_facture
|
// On ajoute les paiements clients anciennes version, non lies par paiement_facture
|
||||||
if ($modecompta != 'CREANCES-DETTES') {
|
if ($modecompta != 'CREANCES-DETTES') {
|
||||||
$sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm";
|
$sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm";
|
||||||
@ -324,7 +324,7 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod
|
|||||||
$subtotal_ht = 0;
|
$subtotal_ht = 0;
|
||||||
$subtotal_ttc = 0;
|
$subtotal_ttc = 0;
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
||||||
if ($modecompta == 'CREANCES-DETTES') {
|
if ($modecompta == 'CREANCES-DETTES') {
|
||||||
$sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||||
|
|||||||
@ -484,7 +484,7 @@ if (count($amount)) {
|
|||||||
if (!empty($conf->commande->enabled) && $key > 0) {
|
if (!empty($conf->commande->enabled) && $key > 0) {
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a> ';
|
print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a> ';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled) && $key > 0) {
|
if (isModEnabled('facture') && $key > 0) {
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a> ';
|
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a> ';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -658,7 +658,7 @@ if (count($amount)) {
|
|||||||
if (!empty($conf->commande->enabled) && $key > 0) {
|
if (!empty($conf->commande->enabled) && $key > 0) {
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a> ';
|
print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a> ';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled) && $key > 0) {
|
if (isModEnabled('facture') && $key > 0) {
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a> ';
|
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a> ';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -206,7 +206,7 @@ abstract class ActionsContactCardCommon
|
|||||||
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract");
|
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract");
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices");
|
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices");
|
||||||
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation ? $this->object->ref_facturation : $langs->trans("NoContactForAnyInvoice");
|
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation ? $this->object->ref_facturation : $langs->trans("NoContactForAnyInvoice");
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -1241,7 +1241,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
||||||
print $object->ref_facturation ? $object->ref_facturation : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyInvoice").'</span>');
|
print $object->ref_facturation ? $object->ref_facturation : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyInvoice").'</span>');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1511,7 +1511,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
||||||
print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice");
|
print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -159,7 +159,7 @@ if ($object->thirdparty->client) {
|
|||||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||||
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||||
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
||||||
}
|
}
|
||||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||||
|
|||||||
@ -2071,7 +2071,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled) && $object->statut > 0) {
|
if (isModEnabled('facture') && $object->statut > 0) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
if ($user->rights->facture->creer) {
|
if ($user->rights->facture->creer) {
|
||||||
print dolGetButtonAction($langs->trans('CreateBill'), '', 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params);
|
print dolGetButtonAction($langs->trans('CreateBill'), '', 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params);
|
||||||
|
|||||||
@ -105,7 +105,7 @@ if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUS
|
|||||||
if (!empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) {
|
if (!empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) {
|
||||||
$arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) {
|
||||||
$arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Customer payments
|
// Customer payments
|
||||||
if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) {
|
||||||
$arrayresult['searchintocustomerpayments'] = array(
|
$arrayresult['searchintocustomerpayments'] = array(
|
||||||
'position'=>170,
|
'position'=>170,
|
||||||
'img'=>'object_payment',
|
'img'=>'object_payment',
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class box_activity extends ModeleBoxes
|
|||||||
// FIXME: Pb into some status
|
// FIXME: Pb into some status
|
||||||
$this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments)
|
$this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments)
|
||||||
|
|
||||||
$this->hidden = !((!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
$this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire)
|
||||||
|| (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|| (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||||
|| (!empty($conf->propal->enabled) && $user->rights->propale->lire)
|
|| (!empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||||
);
|
);
|
||||||
@ -278,7 +278,7 @@ class box_activity extends ModeleBoxes
|
|||||||
|
|
||||||
|
|
||||||
// list the summary of the bills
|
// list the summary of the bills
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
$facturestatic = new Facture($this->db);
|
$facturestatic = new Facture($this->db);
|
||||||
|
|
||||||
|
|||||||
@ -126,7 +126,7 @@ class box_dolibarr_state_board extends ModeleBoxes
|
|||||||
'services' => !empty($conf->service->enabled) && $user->rights->service->lire,
|
'services' => !empty($conf->service->enabled) && $user->rights->service->lire,
|
||||||
'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire,
|
'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire,
|
||||||
'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire,
|
'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire,
|
||||||
'invoices' => !empty($conf->facture->enabled) && $user->rights->facture->lire,
|
'invoices' => isModEnabled('facture') && $user->rights->facture->lire,
|
||||||
'donations' => !empty($conf->don->enabled) && $user->rights->don->lire,
|
'donations' => !empty($conf->don->enabled) && $user->rights->don->lire,
|
||||||
'contracts' => !empty($conf->contrat->enabled) && $user->rights->contrat->lire,
|
'contracts' => !empty($conf->contrat->enabled) && $user->rights->contrat->lire,
|
||||||
'interventions' => !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire,
|
'interventions' => !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire,
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
$this->hidden = !(
|
$this->hidden = !(
|
||||||
(!empty($conf->facture->enabled) && !empty($user->rights->facture->lire))
|
(isModEnabled('facture') && !empty($user->rights->facture->lire))
|
||||||
|| (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire))
|
|| (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire))
|
||||||
|| (!empty($conf->propal->enabled) && !empty($user->rights->propale->lire))
|
|| (!empty($conf->propal->enabled) && !empty($user->rights->propale->lire))
|
||||||
);
|
);
|
||||||
@ -107,7 +107,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
$showinvoicenb = 1;
|
$showinvoicenb = 1;
|
||||||
$showordernb = 1;
|
$showordernb = 1;
|
||||||
}
|
}
|
||||||
if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) {
|
if (!isModEnabled('facture') || empty($user->rights->facture->lire)) {
|
||||||
$showinvoicenb = 0;
|
$showinvoicenb = 0;
|
||||||
}
|
}
|
||||||
if (empty($conf->propal->enabled) || empty($user->rights->propale->lire)) {
|
if (empty($conf->propal->enabled) || empty($user->rights->propale->lire)) {
|
||||||
@ -278,7 +278,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
|
||||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||||
if ($showinvoicenb) {
|
if ($showinvoicenb) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -372,7 +372,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
if (!empty($conf->commande->enabled) || !empty($user->rights->commande->lire)) {
|
if (!empty($conf->commande->enabled) || !empty($user->rights->commande->lire)) {
|
||||||
$stringtoshow .= '<input type="checkbox" name="'.$param_showordernb.'"'.($showordernb ? ' checked' : '').'> '.$langs->trans("ForCustomersOrders");
|
$stringtoshow .= '<input type="checkbox" name="'.$param_showordernb.'"'.($showordernb ? ' checked' : '').'> '.$langs->trans("ForCustomersOrders");
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled) || !empty($user->rights->facture->lire)) {
|
if (isModEnabled('facture') || !empty($user->rights->facture->lire)) {
|
||||||
$stringtoshow .= '<input type="checkbox" name="'.$param_showinvoicenb.'"'.($showinvoicenb ? ' checked' : '').'> '.$langs->trans("ForCustomersInvoices");
|
$stringtoshow .= '<input type="checkbox" name="'.$param_showinvoicenb.'"'.($showinvoicenb ? ' checked' : '').'> '.$langs->trans("ForCustomersInvoices");
|
||||||
$stringtoshow .= ' ';
|
$stringtoshow .= ' ';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8501,13 +8501,13 @@ class Form
|
|||||||
// To work with non standard path
|
// To work with non standard path
|
||||||
if ($objecttype == 'facture') {
|
if ($objecttype == 'facture') {
|
||||||
$tplpath = 'compta/'.$element;
|
$tplpath = 'compta/'.$element;
|
||||||
if (empty($conf->facture->enabled)) {
|
if (!isModEnabled('facture')) {
|
||||||
continue; // Do not show if module disabled
|
continue; // Do not show if module disabled
|
||||||
}
|
}
|
||||||
} elseif ($objecttype == 'facturerec') {
|
} elseif ($objecttype == 'facturerec') {
|
||||||
$tplpath = 'compta/facture';
|
$tplpath = 'compta/facture';
|
||||||
$tplname = 'linkedobjectblockForRec';
|
$tplname = 'linkedobjectblockForRec';
|
||||||
if (empty($conf->facture->enabled)) {
|
if (!isModEnabled('facture')) {
|
||||||
continue; // Do not show if module disabled
|
continue; // Do not show if module disabled
|
||||||
}
|
}
|
||||||
} elseif ($objecttype == 'propal') {
|
} elseif ($objecttype == 'propal') {
|
||||||
@ -8643,12 +8643,12 @@ class Form
|
|||||||
'label'=>'LinkToOrder',
|
'label'=>'LinkToOrder',
|
||||||
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'),
|
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'),
|
||||||
'invoice'=>array(
|
'invoice'=>array(
|
||||||
'enabled'=>(!empty($conf->facture->enabled) ? $conf->facture->enabled : 0),
|
'enabled'=>isModEnabled('facture'),
|
||||||
'perms'=>1,
|
'perms'=>1,
|
||||||
'label'=>'LinkToInvoice',
|
'label'=>'LinkToInvoice',
|
||||||
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'),
|
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'),
|
||||||
'invoice_template'=>array(
|
'invoice_template'=>array(
|
||||||
'enabled'=>(!empty($conf->facture->enabled) ? $conf->facture->enabled : 0),
|
'enabled'=>isModEnabled('facture'),
|
||||||
'perms'=>1,
|
'perms'=>1,
|
||||||
'label'=>'LinkToTemplateInvoice',
|
'label'=>'LinkToTemplateInvoice',
|
||||||
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'),
|
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'),
|
||||||
|
|||||||
@ -1618,7 +1618,7 @@ class FormMail extends Form
|
|||||||
if (!empty($conf->don->enabled)) {
|
if (!empty($conf->don->enabled)) {
|
||||||
$tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation';
|
$tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice';
|
$tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice';
|
||||||
}
|
}
|
||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
@ -1635,7 +1635,7 @@ class FormMail extends Form
|
|||||||
if (!empty($conf->don->enabled)) {
|
if (!empty($conf->don->enabled)) {
|
||||||
$tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation';
|
$tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice';
|
$tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice';
|
||||||
}
|
}
|
||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
|
|||||||
@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Related items
|
// Related items
|
||||||
if (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
if (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||||
$head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id;
|
$head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id;
|
||||||
$head[$tab][1] = $langs->trans("Referers");
|
$head[$tab][1] = $langs->trans("Referers");
|
||||||
$head[$tab][2] = 'consumption';
|
$head[$tab][2] = 'consumption';
|
||||||
|
|||||||
@ -254,7 +254,7 @@ function supplier_invoice_rec_prepare_head($object)
|
|||||||
function getNumberInvoicesPieChart($mode)
|
function getNumberInvoicesPieChart($mode)
|
||||||
{
|
{
|
||||||
global $conf, $db, $langs, $user;
|
global $conf, $db, $langs, $user;
|
||||||
if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
|
||||||
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
$now = date_create(date('Y-m-d', dol_now()));
|
$now = date_create(date('Y-m-d', dol_now()));
|
||||||
@ -882,7 +882,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0)
|
|||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
|
||||||
$tmpinvoice = new Facture($db);
|
$tmpinvoice = new Facture($db);
|
||||||
|
|
||||||
$sql = "SELECT f.rowid, f.ref, f.fk_statut as status, f.datef, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms";
|
$sql = "SELECT f.rowid, f.ref, f.fk_statut as status, f.datef, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms";
|
||||||
|
|||||||
@ -450,7 +450,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
// Customer invoices
|
// Customer invoices
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||||
$nblines++;
|
$nblines++;
|
||||||
$ret = $product->load_stats_facture($socid);
|
$ret = $product->load_stats_facture($socid);
|
||||||
if ($ret < 0) {
|
if ($ret < 0) {
|
||||||
|
|||||||
@ -126,7 +126,7 @@ function project_prepare_head(Project $project, $moreparam = '')
|
|||||||
|
|
||||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
|
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
|
||||||
|| !empty($conf->propal->enabled) || !empty($conf->commande->enabled)
|
|| !empty($conf->propal->enabled) || !empty($conf->commande->enabled)
|
||||||
|| !empty($conf->facture->enabled) || !empty($conf->contrat->enabled)
|
|| isModEnabled('facture') || !empty($conf->contrat->enabled)
|
||||||
|| !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) {
|
|| !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) {
|
||||||
$nbElements = 0;
|
$nbElements = 0;
|
||||||
// Enable caching of thirdrparty count Contacts
|
// Enable caching of thirdrparty count Contacts
|
||||||
@ -144,10 +144,10 @@ function project_prepare_head(Project $project, $moreparam = '')
|
|||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
$nbElements += $project->getElementCount('order', 'commande');
|
$nbElements += $project->getElementCount('order', 'commande');
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$nbElements += $project->getElementCount('invoice', 'facture');
|
$nbElements += $project->getElementCount('invoice', 'facture');
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$nbElements += $project->getElementCount('invoice_predefined', 'facture_rec');
|
$nbElements += $project->getElementCount('invoice_predefined', 'facture_rec');
|
||||||
}
|
}
|
||||||
if (!empty($conf->supplier_proposal->enabled)) {
|
if (!empty($conf->supplier_proposal->enabled)) {
|
||||||
|
|||||||
@ -40,10 +40,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
if (!empty($conf->propal->enabled)) {
|
if (!empty($conf->propal->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
|
|||||||
@ -41,10 +41,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
if (!empty($conf->propal->enabled)) {
|
if (!empty($conf->propal->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
|
|||||||
@ -52,7 +52,7 @@ if (!empty($conf->commande->enabled)) {
|
|||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
print '<div id="invoice"></div>';
|
print '<div id="invoice"></div>';
|
||||||
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice", $servicename).':</span><br>';
|
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice", $servicename).':</span><br>';
|
||||||
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'invoice')."</strong><br>\n";
|
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'invoice')."</strong><br>\n";
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||||||
// Order to invoice
|
// Order to invoice
|
||||||
if ($action == 'ORDER_CLOSE') {
|
if ($action == 'ORDER_CLOSE') {
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_ORDER_AUTOCREATE_INVOICE)) {
|
if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_ORDER_AUTOCREATE_INVOICE)) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
$newobject = new Facture($this->db);
|
$newobject = new Facture($this->db);
|
||||||
|
|
||||||
|
|||||||
@ -325,7 +325,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
|||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
$rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
|
$rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
|
$rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
|
||||||
}
|
}
|
||||||
if (!empty($conf->supplier_proposal->enabled)) {
|
if (!empty($conf->supplier_proposal->enabled)) {
|
||||||
|
|||||||
@ -128,7 +128,7 @@ if (!empty($conf->contrat->enabled)) {
|
|||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
|
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
|
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
|
||||||
}
|
}
|
||||||
if (!empty($conf->supplier_proposal->enabled)) {
|
if (!empty($conf->supplier_proposal->enabled)) {
|
||||||
|
|||||||
@ -2477,7 +2477,7 @@ if ($action == 'create') {
|
|||||||
// TODO add alternative status
|
// TODO add alternative status
|
||||||
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
|
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
|
||||||
if ($object->statut == Expedition::STATUS_CLOSED && $user->rights->expedition->creer) {
|
if ($object->statut == Expedition::STATUS_CLOSED && $user->rights->expedition->creer) {
|
||||||
if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
|
if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
|
||||||
print dolGetButtonAction('', $langs->trans('ClassifyUnbilled'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
|
print dolGetButtonAction('', $langs->trans('ClassifyUnbilled'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
|
||||||
} else {
|
} else {
|
||||||
print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
|
print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
|
||||||
@ -2496,7 +2496,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create bill
|
// Create bill
|
||||||
if (!empty($conf->facture->enabled) && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) {
|
if (isModEnabled('facture') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) {
|
||||||
if ($user->rights->facture->creer) {
|
if ($user->rights->facture->creer) {
|
||||||
// TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))
|
// TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))
|
||||||
// If we do that, we must also make this option official.
|
// If we do that, we must also make this option official.
|
||||||
@ -2514,7 +2514,7 @@ if ($action == 'create') {
|
|||||||
if ($user->rights->expedition->creer && $object->statut > 0 && !$object->billed) {
|
if ($user->rights->expedition->creer && $object->statut > 0 && !$object->billed) {
|
||||||
$label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received
|
$label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received
|
||||||
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
|
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
|
||||||
if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
|
if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
|
||||||
$label = "ClassifyBilled";
|
$label = "ClassifyBilled";
|
||||||
$paramaction = 'classifybilled';
|
$paramaction = 'classifybilled';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1659,7 +1659,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Invoicing
|
// Invoicing
|
||||||
if (!empty($conf->facture->enabled) && $object->statut > Fichinter::STATUS_DRAFT) {
|
if (isModEnabled('facture') && $object->statut > Fichinter::STATUS_DRAFT) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
if ($object->statut < Fichinter::STATUS_BILLED) {
|
if ($object->statut < Fichinter::STATUS_BILLED) {
|
||||||
if ($user->rights->facture->creer) {
|
if ($user->rights->facture->creer) {
|
||||||
|
|||||||
@ -2573,7 +2573,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create bill
|
// Create bill
|
||||||
//if (! empty($conf->facture->enabled))
|
//if (isModEnabled('facture'))
|
||||||
//{
|
//{
|
||||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled
|
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled
|
||||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
||||||
@ -2584,7 +2584,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not)
|
// Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not)
|
||||||
if ($usercancreate && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) { // statut 2 means approved
|
if ($usercancreate && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) { // statut 2 means approved
|
||||||
if (empty($conf->facture->enabled)) {
|
if (!isModEnabled('facture')) {
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'">'.$langs->trans("ClassifyBilled").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'">'.$langs->trans("ClassifyBilled").'</a>';
|
||||||
} else {
|
} else {
|
||||||
if (!empty($object->linkedObjectsIds['invoice_supplier'])) {
|
if (!empty($object->linkedObjectsIds['invoice_supplier'])) {
|
||||||
|
|||||||
@ -229,7 +229,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Number of invoices customers (paid)
|
// Number of invoices customers (paid)
|
||||||
if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->facture->lire) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
$board = new Facture($db);
|
$board = new Facture($db);
|
||||||
$dashboardlines[$board->element] = $board->load_board($user);
|
$dashboardlines[$board->element] = $board->load_board($user);
|
||||||
|
|||||||
@ -2011,7 +2011,7 @@ function migrate_modeles($db, $langs, $conf)
|
|||||||
|
|
||||||
dolibarr_install_syslog("upgrade2::migrate_modeles");
|
dolibarr_install_syslog("upgrade2::migrate_modeles");
|
||||||
|
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
|
||||||
$modellist = ModelePDFFactures::liste_modeles($db);
|
$modellist = ModelePDFFactures::liste_modeles($db);
|
||||||
if (count($modellist) == 0) {
|
if (count($modellist) == 0) {
|
||||||
|
|||||||
@ -2445,7 +2445,7 @@ function printDropdownQuickadd()
|
|||||||
"title" => "NewBill@bills",
|
"title" => "NewBill@bills",
|
||||||
"name" => "Bill@bills",
|
"name" => "Bill@bills",
|
||||||
"picto" => "object_bill",
|
"picto" => "object_bill",
|
||||||
"activation" => !empty($conf->facture->enabled) && $user->rights->facture->creer, // vs hooking
|
"activation" => isModEnabled('facture') && $user->rights->facture->creer, // vs hooking
|
||||||
"position" => 50,
|
"position" => 50,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
|||||||
@ -56,7 +56,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php'
|
|||||||
if (!empty($conf->propal->enabled)) {
|
if (!empty($conf->propal->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
@ -76,7 +76,7 @@ $langs->loadLangs(array('products', 'other'));
|
|||||||
if (!empty($conf->stock->enabled)) {
|
if (!empty($conf->stock->enabled)) {
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
}
|
}
|
||||||
if (!empty($conf->productbatch->enabled)) {
|
if (!empty($conf->productbatch->enabled)) {
|
||||||
@ -2814,7 +2814,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action ==
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Factures
|
// Factures
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->creer) {
|
if (isModEnabled('facture') && $user->rights->facture->creer) {
|
||||||
$invoice = new Facture($db);
|
$invoice = new Facture($db);
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|||||||
@ -1326,7 +1326,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '');
|
print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '');
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->creer) {
|
if (isModEnabled('facture') && $user->rights->facture->creer) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '');
|
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ if (!empty($conf->stock->enabled)) {
|
|||||||
if (!empty($conf->propal->enabled)) {
|
if (!empty($conf->propal->enabled)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ if (!empty($conf->mrp->enabled)) {
|
|||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta'));
|
$langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta'));
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
}
|
}
|
||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
|
|||||||
@ -533,11 +533,11 @@ if ($ispaymentok) {
|
|||||||
$emetteur_banque = '';
|
$emetteur_banque = '';
|
||||||
// Define default choice for complementary actions
|
// Define default choice for complementary actions
|
||||||
$option = '';
|
$option = '';
|
||||||
if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
|
||||||
$option = 'bankviainvoice';
|
$option = 'bankviainvoice';
|
||||||
} elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) {
|
} elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) {
|
||||||
$option = 'bankdirect';
|
$option = 'bankdirect';
|
||||||
} elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
} elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
|
||||||
$option = 'invoiceonly';
|
$option = 'invoiceonly';
|
||||||
}
|
}
|
||||||
if (empty($option)) {
|
if (empty($option)) {
|
||||||
@ -927,7 +927,7 @@ if ($ispaymentok) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
|
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
|
||||||
if (!empty($conf->facture->enabled)) {
|
if (isModEnabled('facture')) {
|
||||||
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0 ) {
|
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0 ) {
|
||||||
include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
$invoice = new Facture($db);
|
$invoice = new Facture($db);
|
||||||
|
|||||||
@ -2084,7 +2084,7 @@ if ($action == 'create') {
|
|||||||
// TODO add alternative status
|
// TODO add alternative status
|
||||||
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
|
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
|
||||||
if ($object->statut == Reception::STATUS_CLOSED && $user->rights->reception->creer) {
|
if ($object->statut == Reception::STATUS_CLOSED && $user->rights->reception->creer) {
|
||||||
if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
|
if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans("ClassifyUnbilled").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans("ClassifyUnbilled").'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans("ReOpen").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans("ReOpen").'</a>';
|
||||||
|
|||||||
@ -168,7 +168,7 @@ if ($object->client) {
|
|||||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||||
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||||
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
||||||
}
|
}
|
||||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||||
|
|||||||
@ -784,7 +784,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||||
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
||||||
}
|
}
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||||
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
||||||
}
|
}
|
||||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class FactureTest extends PHPUnit\Framework\TestCase
|
|||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
|
|
||||||
if (empty($conf->facture->enabled)) {
|
if (!isModEnabled('facture')) {
|
||||||
print __METHOD__." module customer invoice must be enabled.\n"; die(1);
|
print __METHOD__." module customer invoice must be enabled.\n"; die(1);
|
||||||
}
|
}
|
||||||
if (! empty($conf->ecotaxdeee->enabled)) {
|
if (! empty($conf->ecotaxdeee->enabled)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user