Merge pull request #17215 from aspangaro/14a36
Work on split module fournisseur
This commit is contained in:
commit
58e87d935f
@ -486,7 +486,7 @@ $tabcond[16] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_
|
||||
$tabcond[17] = (!empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled));
|
||||
$tabcond[18] = !empty($conf->expedition->enabled) || !empty($conf->reception->enabled);
|
||||
$tabcond[19] = !empty($conf->societe->enabled);
|
||||
$tabcond[20] = (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled));
|
||||
$tabcond[20] = (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled);
|
||||
$tabcond[21] = !empty($conf->propal->enabled);
|
||||
$tabcond[22] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled));
|
||||
$tabcond[23] = true;
|
||||
|
||||
@ -61,7 +61,7 @@ $modules = array(
|
||||
$conditions = array(
|
||||
'SOCIETE' => 1,
|
||||
'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' => (!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)),
|
||||
'USERSIGN' => 1,
|
||||
'MAILING' => !empty($conf->mailing->enabled),
|
||||
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
|
||||
|
||||
@ -293,7 +293,7 @@ $found = 0;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ReStockOnBill").'</td>';
|
||||
print '<td class="right">';
|
||||
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)) {
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
@ -311,7 +311,7 @@ $found++;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>';
|
||||
print '<td class="right">';
|
||||
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)) {
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
@ -356,7 +356,7 @@ if (!empty($conf->reception->enabled)) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>';
|
||||
print '<td class="right">';
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
|
||||
@ -111,7 +111,7 @@ $workflowcodes = array(
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
|
||||
'family'=>'classify_supplier_proposal',
|
||||
'position'=>60,
|
||||
'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))),
|
||||
'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))),
|
||||
'picto'=>'propal',
|
||||
'warning'=>''
|
||||
),
|
||||
@ -120,7 +120,7 @@ $workflowcodes = array(
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
|
||||
'family'=>'classify_supplier_order',
|
||||
'position'=>62,
|
||||
'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
||||
'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
||||
'picto'=>'order',
|
||||
'warning'=>''
|
||||
),
|
||||
@ -129,7 +129,7 @@ $workflowcodes = array(
|
||||
'WORKFLOW_BILL_ON_RECEPTION'=>array(
|
||||
'family'=>'classify_reception',
|
||||
'position'=>64,
|
||||
'enabled'=>(!empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||
'enabled'=>(!empty($conf->reception->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||
'picto'=>'bill'
|
||||
),
|
||||
|
||||
|
||||
@ -201,10 +201,10 @@ class CActionComm
|
||||
if ($obj->module == 'propal' && empty($conf->propal->enabled) && empty($user->propale->lire)) {
|
||||
$qualified = 0;
|
||||
}
|
||||
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled)) && empty($user->fournisseur->facture->lire)) {
|
||||
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->facture->lire)) || (!empty($conf->supplier_invoice->enabled) && empty($user->supplier_invoice->lire)))) {
|
||||
$qualified = 0;
|
||||
}
|
||||
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled)) && empty($user->fournisseur->commande->lire)) {
|
||||
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->commande->lire)) || (empty($conf->supplier_order->enabled) && empty($user->supplier_order->lire)))) {
|
||||
$qualified = 0;
|
||||
}
|
||||
if ($obj->module == 'shipping' && empty($conf->expedition->enabled) && empty($user->expedition->lire)) {
|
||||
|
||||
@ -90,7 +90,7 @@ if (!empty($conf->supplier_proposal->enabled)) {
|
||||
if (!empty($conf->commande->enabled)) {
|
||||
$orderstatic = new Commande($db);
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
$supplierorderstatic = new CommandeFournisseur($db);
|
||||
}
|
||||
|
||||
@ -393,7 +393,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
/*
|
||||
* Draft purchase orders
|
||||
*/
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
|
||||
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
@ -588,7 +588,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
|
||||
/*
|
||||
* Last suppliers
|
||||
*/
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) {
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
@ -647,7 +647,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
{
|
||||
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>';
|
||||
}*/
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) {
|
||||
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>';
|
||||
}
|
||||
print $s;
|
||||
|
||||
@ -122,7 +122,7 @@ $usercancreateorder = $user->rights->commande->creer;
|
||||
$usercancreateinvoice = $user->rights->facture->creer;
|
||||
$usercancreatecontract = $user->rights->contrat->creer;
|
||||
$usercancreateintervention = $user->rights->ficheinter->creer;
|
||||
$usercancreatepurchaseorder = $user->rights->fournisseur->commande->creer;
|
||||
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||
|
||||
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||
@ -2534,7 +2534,7 @@ if ($action == 'create') {
|
||||
|
||||
// Create a purchase order
|
||||
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) {
|
||||
if (!empty($conf->fournisseur->enabled) && $object->statut == Propal::STATUS_SIGNED) {
|
||||
if ($object->statut == Propal::STATUS_SIGNED && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) {
|
||||
if ($usercancreatepurchaseorder) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddPurchaseOrder").'</a>';
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancr
|
||||
$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler)));
|
||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send);
|
||||
|
||||
$usercancreatepurchaseorder = $user->rights->fournisseur->commande->creer;
|
||||
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||
|
||||
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||
@ -2501,7 +2501,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
|
||||
// Create a purchase order
|
||||
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_SALE_ORDER)) {
|
||||
if (!empty($conf->fournisseur->enabled) && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
|
||||
if ($usercancreatepurchaseorder) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddPurchaseOrder").'</a>';
|
||||
}
|
||||
|
||||
@ -1631,7 +1631,7 @@ if ($resql) {
|
||||
}
|
||||
$stock_order = $generic_product->stats_commande['qty'];
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
|
||||
$generic_product->load_stats_commande_fournisseur(0, '3');
|
||||
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
|
||||
@ -1653,7 +1653,7 @@ if ($resql) {
|
||||
} else {
|
||||
$text_info .= '<span class="ok">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
$text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'<br>';
|
||||
} else {
|
||||
$text_info .= '<br>';
|
||||
|
||||
@ -258,7 +258,7 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
||||
|
||||
|
||||
// Last modified supplier invoices
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
|
||||
$langs->load("boxes");
|
||||
$facstatic = new FactureFournisseur($db);
|
||||
|
||||
|
||||
@ -588,10 +588,10 @@ if (count($amount)) {
|
||||
if (!empty($conf->supplier_proposal->enabled) && $key > 0) {
|
||||
print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a> ';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && $key > 0) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $key > 0) {
|
||||
print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a> ';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && $key > 0) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $key > 0) {
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a> ';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -167,10 +167,10 @@ if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) {
|
||||
|
||||
if ($object->thirdparty->fournisseur) {
|
||||
$thirdTypeArray['supplier'] = $langs->trans("supplier");
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
|
||||
$elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
|
||||
}
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
|
||||
$elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADH
|
||||
$arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
|
||||
if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || !empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) {
|
||||
if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) {
|
||||
$arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
|
||||
@ -112,10 +112,10 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST
|
||||
if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire) {
|
||||
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED)) {
|
||||
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) {
|
||||
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST
|
||||
}
|
||||
|
||||
// Vendor payments
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) {
|
||||
$arrayresult['searchintovendorpayments'] = array(
|
||||
'position'=>175,
|
||||
'img'=>'object_payment',
|
||||
|
||||
@ -119,7 +119,11 @@ class box_dolibarr_state_board extends ModeleBoxes
|
||||
'members' => !empty($conf->adherent->enabled) && $user->rights->adherent->lire,
|
||||
'customers' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
|
||||
'prospects' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
|
||||
'suppliers' => !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
|
||||
'suppliers' => ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->lire)
|
||||
|| (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)
|
||||
|| (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)
|
||||
)
|
||||
&& empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
|
||||
'contacts' => !empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
|
||||
'products' => !empty($conf->product->enabled) && $user->rights->produit->lire,
|
||||
'services' => !empty($conf->service->enabled) && $user->rights->service->lire,
|
||||
|
||||
@ -432,7 +432,7 @@ class Conf
|
||||
$this->fournisseur->payment->dir_temp = $rootfortemp."/fournisseur/payment/temp"; // For backward compatibility
|
||||
|
||||
// To prepare split of module fournisseur into module 'fournisseur' + supplier_order + supplier_invoice
|
||||
if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) { // By default, if module supplier is on, and we don't use yet the new modules, we set artificialy the module properties
|
||||
if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) { // By default, if module supplier is on, and we don't use yet the new modules, we set artificially the module properties
|
||||
$this->supplier_order = new stdClass();
|
||||
$this->supplier_order->enabled = 1;
|
||||
$this->supplier_order->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande");
|
||||
|
||||
@ -187,7 +187,7 @@ function societe_prepare_head(Societe $object)
|
||||
}
|
||||
|
||||
// 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) || !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))
|
||||
&& empty($conf->global->THIRPARTIES_DISABLE_RELATED_OBJECT_TAB)) {
|
||||
$head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Referers");
|
||||
|
||||
@ -58,7 +58,7 @@ function contact_prepare_head(Contact $object)
|
||||
$tab++;
|
||||
|
||||
// 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) || !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)) {
|
||||
$head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id;
|
||||
$head[$tab][1] = $langs->trans("Referers");
|
||||
$head[$tab][2] = 'consumption';
|
||||
|
||||
@ -345,7 +345,7 @@ function getPurchaseInvoicePieChart($socid = 0)
|
||||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
|
||||
if (!(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
||||
if (!((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire))) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -1119,7 +1119,7 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0)
|
||||
|
||||
$result = '';
|
||||
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
|
||||
$facstatic = new FactureFournisseur($db);
|
||||
|
||||
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.type, ff.libelle as label, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye";
|
||||
|
||||
@ -58,7 +58,7 @@ function product_prepare_head($object)
|
||||
}
|
||||
|
||||
if (!empty($object->status_buy) || (!empty($conf->margin->enabled) && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->lire)
|
||||
if ((((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->lire)
|
||||
|| (!empty($conf->margin->enabled) && $user->rights->margin->liretous)
|
||||
) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
|
||||
@ -430,7 +430,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</tr>';
|
||||
}
|
||||
// Supplier orders
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
|
||||
$nblines++;
|
||||
$ret = $product->load_stats_commande_fournisseur($socid);
|
||||
if ($ret < 0) {
|
||||
@ -468,7 +468,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</tr>';
|
||||
}
|
||||
// Supplier invoices
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
|
||||
$nblines++;
|
||||
$ret = $product->load_stats_facture_fournisseur($socid);
|
||||
if ($ret < 0) {
|
||||
|
||||
@ -122,7 +122,7 @@ function project_prepare_head(Project $project)
|
||||
$h++;
|
||||
}
|
||||
|
||||
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->facture->enabled) || !empty($conf->contrat->enabled)
|
||||
|| !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled)) {
|
||||
|
||||
@ -371,7 +371,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
||||
$nbko++;
|
||||
}
|
||||
} elseif ($feature == 'commande_fournisseur') {
|
||||
if (!$user->rights->fournisseur->commande->creer) {
|
||||
if (!$user->rights->fournisseur->commande->creer || !$user->rights->supplier_order->creer) {
|
||||
$createok = 0;
|
||||
$nbko++;
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
|
||||
-- table llx_menu
|
||||
--
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || $conf->fournisseur->enabled || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', 16__+MAX_llx_menu__, __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__);
|
||||
@ -166,18 +166,18 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1652__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/list.php?leftmenu=supplier_proposals', 'List', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1653__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 2, __ENTITY__);
|
||||
-- Commercial - Supplier's orders
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5105__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=2', 'StatusOrderApprovedShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5106__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=3', 'StatusOrderOnProcessShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5107__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=4', 'StatusOrderReceivedPartiallyShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=5', 'StatusOrderReceivedAll', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=6,7', 'StatusOrderCanceled', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 8, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=9', 'StatusOrderRefused', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 9, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 6, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5105__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=2', 'StatusOrderApprovedShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5106__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=3', 'StatusOrderOnProcessShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5107__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=4', 'StatusOrderReceivedPartiallyShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->creer)', '', 2, 6, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=5', 'StatusOrderReceivedAll', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=6,7', 'StatusOrderCanceled', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 8, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=9', 'StatusOrderRefused', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 9, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__);
|
||||
-- Commercial - Contracts
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?mainmenu=commercial&leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&action=create&leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__);
|
||||
|
||||
@ -388,7 +388,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
|
||||
$nature = "sells";
|
||||
}
|
||||
if ($objp->nature == 3
|
||||
&& (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled))
|
||||
&& ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))
|
||||
&& empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
|
||||
$nature = "purchases";
|
||||
}
|
||||
|
||||
@ -122,9 +122,9 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
'enabled'=> ((!empty($conf->societe->enabled) &&
|
||||
(empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
|
||||
)
|
||||
|| (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
|
||||
|| ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
|
||||
),
|
||||
'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire)),
|
||||
'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->supplier_invoice->lire) || !empty($user->rights->supplier_proposal->lire)),
|
||||
'module'=>'societe|fournisseur'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
@ -852,10 +852,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
}
|
||||
|
||||
// Suppliers
|
||||
if (!empty($conf->societe->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->supplier_proposal->enabled))) {
|
||||
if (!empty($conf->societe->enabled) && (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->supplier_proposal->enabled))) {
|
||||
$langs->load("suppliers");
|
||||
$newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->rights->fournisseur->lire), '', $mainmenu, 'suppliers');
|
||||
$newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->rights->societe->creer && ($user->rights->fournisseur->lire));
|
||||
$newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers');
|
||||
$newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire));
|
||||
}
|
||||
|
||||
// Categories
|
||||
@ -873,7 +873,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
}
|
||||
// Categories suppliers
|
||||
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)) {
|
||||
$newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->rights->categorie->lire);
|
||||
}
|
||||
}
|
||||
@ -889,7 +889,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
|
||||
$newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire);
|
||||
}
|
||||
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)) {
|
||||
$newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire);
|
||||
}
|
||||
$newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->rights->societe->contact->lire);
|
||||
@ -1043,7 +1043,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
if (!empty($conf->societe->enabled) && !empty($conf->supplier_invoice->enabled)) {
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"'));
|
||||
$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create');
|
||||
$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), '', $mainmenu, 'suppliers_bills_create');
|
||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list');
|
||||
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) {
|
||||
@ -1201,7 +1201,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
if (!empty($conf->banque->enabled)) {
|
||||
$newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 70);
|
||||
}
|
||||
if (!empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled))) {
|
||||
if (!empty($conf->facture->enabled) || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) {
|
||||
$newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 80);
|
||||
}
|
||||
if (!empty($conf->tax->enabled)) {
|
||||
@ -1271,7 +1271,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$nature = "sells";
|
||||
}
|
||||
if ($objp->nature == 3
|
||||
&& (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled))
|
||||
&& ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))
|
||||
&& empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
|
||||
$nature = "purchases";
|
||||
}
|
||||
@ -1374,7 +1374,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') {
|
||||
$modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED
|
||||
}
|
||||
if ($modecompta && $conf->fournisseur->enabled) {
|
||||
if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) {
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
|
||||
$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->rights->accounting->comptarapport->lire);
|
||||
$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire);
|
||||
@ -1384,7 +1384,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
|
||||
$modecompta = 'RECETTES-DEPENSES';
|
||||
//if (! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED
|
||||
if ($modecompta && $conf->fournisseur->enabled) {
|
||||
if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) {
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
|
||||
$newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire);
|
||||
$newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire);
|
||||
@ -1548,7 +1548,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
$newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire);
|
||||
}
|
||||
if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) {
|
||||
if (!empty($conf->propal->enabled) || (!empty($conf->commande->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire);
|
||||
}
|
||||
|
||||
@ -1565,7 +1565,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"'));
|
||||
$newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
|
||||
$newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire);
|
||||
if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) {
|
||||
if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_oder->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire);
|
||||
}
|
||||
// Categories
|
||||
|
||||
@ -162,7 +162,7 @@ class modBanque extends DolibarrModules
|
||||
"s.nom"=>"company", "s.code_compta"=>"company", "s.code_compta_fournisseur"=>"company"
|
||||
);
|
||||
$this->export_special_array[$r] = array('-b.amount'=>'NULLIFNEG', 'b.amount'=>'NULLIFNEG');
|
||||
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)) {
|
||||
unset($this->export_fields_array[$r]['s.code_compta_fournisseur']);
|
||||
unset($this->export_entities_array[$r]['s.code_compta_fournisseur']);
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ class modCategorie extends DolibarrModules
|
||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||
$typeexample .= ($typeexample ? " / " : "")."0=Product-Service";
|
||||
}
|
||||
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)) {
|
||||
$typeexample .= ($typeexample ? "/" : "")."1=Supplier";
|
||||
}
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
@ -484,7 +484,7 @@ class modCategorie extends DolibarrModules
|
||||
}
|
||||
|
||||
// 1 Suppliers
|
||||
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)) {
|
||||
$r++;
|
||||
$this->import_code[$r] = $this->rights_class.'_1_'.Categorie::$MAP_ID_TO_CODE[1];
|
||||
$this->import_label[$r] = "CatSupLinks"; // Translation key
|
||||
|
||||
@ -203,7 +203,7 @@ class modProduct extends DolibarrModules
|
||||
if (is_object($mysoc) && $usenpr) {
|
||||
$this->export_fields_array[$r]['p.recuperableonly'] = 'NPR';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice'));
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
@ -216,7 +216,7 @@ class modProduct extends DolibarrModules
|
||||
$keyforelement = 'product';
|
||||
$keyforaliasextra = 'extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('s.nom'=>'Supplier', 'pf.ref_fourn'=>'SupplierRef', 'pf.quantity'=>'QtyMin', 'pf.remise_percent'=>'DiscountQtyMin', 'pf.unitprice'=>'BuyingPrice', 'pf.delivery_time_days'=>'NbDaysToDelivery'));
|
||||
}
|
||||
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
|
||||
@ -250,7 +250,7 @@ class modProduct extends DolibarrModules
|
||||
if (!empty($conf->barcode->enabled)) {
|
||||
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text'));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric'));
|
||||
}
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
@ -269,7 +269,7 @@ class modProduct extends DolibarrModules
|
||||
if (!empty($conf->barcode->enabled)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product'));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
|
||||
}
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
@ -284,7 +284,7 @@ class modProduct extends DolibarrModules
|
||||
if (!empty($conf->barcode->enabled)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product'));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
|
||||
}
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
@ -305,7 +305,7 @@ class modProduct extends DolibarrModules
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid';
|
||||
}
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object';
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc';
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
@ -609,7 +609,7 @@ class modProduct extends DolibarrModules
|
||||
));
|
||||
}
|
||||
|
||||
if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) {
|
||||
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.cost_price'=>'CostPrice'));
|
||||
}
|
||||
if (is_object($mysoc) && $usenpr) {
|
||||
@ -702,7 +702,7 @@ class modProduct extends DolibarrModules
|
||||
'p.desiredstock' => ''
|
||||
));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) {
|
||||
$import_sample = array_merge($import_sample, array('p.cost_price'=>'90'));
|
||||
}
|
||||
if (is_object($mysoc) && $usenpr) {
|
||||
@ -741,7 +741,7 @@ class modProduct extends DolibarrModules
|
||||
$this->import_updatekeys_array[$r] = array_merge($this->import_updatekeys_array[$r], array('p.barcode'=>'BarCode')); //only show/allow barcode as update key if Barcode module enabled
|
||||
}
|
||||
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
// Import suppliers prices (note: this code is duplicated in module Service)
|
||||
$r++;
|
||||
$this->import_code[$r] = $this->rights_class.'_supplierprices';
|
||||
|
||||
@ -168,7 +168,7 @@ class modService extends DolibarrModules
|
||||
if (is_object($mysoc) && $usenpr) {
|
||||
$this->export_fields_array[$r]['p.recuperableonly'] = 'NPR';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice'));
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
@ -181,7 +181,7 @@ class modService extends DolibarrModules
|
||||
$keyforelement = 'product';
|
||||
$keyforaliasextra = 'extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('s.nom'=>'Supplier', 'pf.ref_fourn'=>'SupplierRef', 'pf.quantity'=>'QtyMin', 'pf.remise_percent'=>'DiscountQtyMin', 'pf.unitprice'=>'BuyingPrice', 'pf.delivery_time_days'=>'NbDaysToDelivery'));
|
||||
}
|
||||
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
|
||||
@ -213,7 +213,7 @@ class modService extends DolibarrModules
|
||||
if (!empty($conf->barcode->enabled)) {
|
||||
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text'));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric'));
|
||||
}
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
@ -232,7 +232,7 @@ class modService extends DolibarrModules
|
||||
if (!empty($conf->barcode->enabled)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product'));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
|
||||
}
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
@ -247,7 +247,7 @@ class modService extends DolibarrModules
|
||||
if (!empty($conf->barcode->enabled)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product'));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
|
||||
}
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
@ -268,7 +268,7 @@ class modService extends DolibarrModules
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid';
|
||||
}
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object';
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc';
|
||||
}
|
||||
$this->export_sql_end[$r] .= ' WHERE p.fk_product_type = 1 AND p.entity IN ('.getEntity('product').')';
|
||||
@ -564,7 +564,7 @@ class modService extends DolibarrModules
|
||||
));
|
||||
}
|
||||
|
||||
if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) {
|
||||
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.cost_price'=>'CostPrice'));
|
||||
}
|
||||
if (is_object($mysoc) && $usenpr) {
|
||||
@ -655,7 +655,7 @@ class modService extends DolibarrModules
|
||||
'p.desiredstock' => ''
|
||||
));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->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->margin->enabled)) {
|
||||
$import_sample = array_merge($import_sample, array('p.cost_price'=>'90'));
|
||||
}
|
||||
if (is_object($mysoc) && $usenpr) {
|
||||
@ -698,7 +698,7 @@ class modService extends DolibarrModules
|
||||
}
|
||||
|
||||
if (empty($conf->product->enabled)) { // We enable next import templates only if module product not already enabled (to avoid duplicate entries)
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
// Import suppliers prices (note: this code is duplicated in module Service)
|
||||
$r++;
|
||||
$this->import_code[$r] = $this->rights_class.'_supplierprices';
|
||||
|
||||
@ -384,7 +384,7 @@ class modSociete extends DolibarrModules
|
||||
's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", 's.phone'=>"company", 's.email'=>"company",
|
||||
't.libelle'=>"company"
|
||||
); // We define here only fields that use another picto
|
||||
if (empty($conf->fournisseur->enabled)) {
|
||||
if (empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
unset($this->export_fields_array[$r]['s.code_fournisseur']);
|
||||
unset($this->export_entities_array[$r]['s.code_fournisseur']);
|
||||
}
|
||||
|
||||
@ -49,10 +49,10 @@ if (!empty($conf->facture->enabled)) {
|
||||
if (!empty($conf->commande->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
}
|
||||
if (!empty($conf->contrat->enabled)) {
|
||||
@ -964,13 +964,13 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
'title' => "ListSupplierOrdersAssociatedProject",
|
||||
'table' => 'commande_fournisseur',
|
||||
'class' => 'CommandeFournisseur',
|
||||
'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire
|
||||
'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)
|
||||
),
|
||||
'invoice_supplier' => array(
|
||||
'title' => "ListSupplierInvoicesAssociatedProject",
|
||||
'table' => 'facture_fourn',
|
||||
'class' => 'FactureFournisseur',
|
||||
'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire
|
||||
'test' => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)
|
||||
),
|
||||
'contract' => array(
|
||||
'title' => "ListContractAssociatedProject",
|
||||
|
||||
@ -400,7 +400,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
'class'=>'CommandeFournisseur',
|
||||
'table'=>'commande_fournisseur',
|
||||
'datefieldname'=>'date_commande',
|
||||
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire,
|
||||
'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire),
|
||||
'lang'=>'orders'),
|
||||
'invoice_supplier'=>array(
|
||||
'name'=>"BillsSuppliers",
|
||||
@ -409,7 +409,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
'margin'=>'minus',
|
||||
'table'=>'facture_fourn',
|
||||
'datefieldname'=>'datef',
|
||||
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire,
|
||||
'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire),
|
||||
'lang'=>'bills'),
|
||||
'contract'=>array(
|
||||
'name'=>"Contracts",
|
||||
|
||||
@ -50,10 +50,10 @@ if (!empty($conf->facture->enabled)) {
|
||||
if (!empty($conf->commande->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
}
|
||||
if (!empty($conf->contrat->enabled)) {
|
||||
|
||||
@ -879,7 +879,7 @@ class pdf_squille extends ModelePdfReception
|
||||
$origin_id = $object->origin_id;
|
||||
|
||||
// TODO move to external function
|
||||
if (!empty($conf->fournisseur->enabled)) { // commonly $origin='commande'
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { // commonly $origin='commande'
|
||||
$outputlangs->load('orders');
|
||||
|
||||
$classname = 'CommandeFournisseur';
|
||||
|
||||
@ -44,9 +44,17 @@ if ($module == 'propal') {
|
||||
} elseif ($module == 'fichinter') {
|
||||
$permission = $user->rights->ficheinter->creer;
|
||||
} elseif ($module == 'order_supplier') {
|
||||
$permission = $user->rights->fournisseur->commande->creer;
|
||||
} elseif ($module == 'invoice_supplier') {
|
||||
$permission = $user->rights->fournisseur->facture->creer;
|
||||
if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
|
||||
$permission = $user->rights->fournisseur->commande->creer;
|
||||
} else {
|
||||
$permission = $user->rights->supplier_order->creer;
|
||||
}
|
||||
} elseif ($module == 'invoice_supplier' && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
|
||||
if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
|
||||
$permission = $user->rights->fournisseur->facture->creer;
|
||||
} else {
|
||||
$permission = $user->rights->supplier_invoice->creer;
|
||||
}
|
||||
} elseif ($module == 'project') {
|
||||
$permission = $user->rights->projet->creer;
|
||||
} elseif ($module == 'action') {
|
||||
|
||||
@ -162,10 +162,18 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
||||
$permok = !empty($user->rights->$keyforperm->creer) || !empty($user->rights->$keyforperm->create) || !empty($user->rights->$keyforperm->write);
|
||||
}
|
||||
if ($object->element == 'order_supplier') {
|
||||
$permok = $user->rights->fournisseur->commande->creer;
|
||||
if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
|
||||
$permok = $user->rights->fournisseur->commande->creer;
|
||||
} else {
|
||||
$permok = $user->rights->supplier_order->creer;
|
||||
}
|
||||
}
|
||||
if ($object->element == 'invoice_supplier') {
|
||||
$permok = $user->rights->fournisseur->facture->creer;
|
||||
if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
|
||||
$permok = $user->rights->fournisseur->facture->creer;
|
||||
} else {
|
||||
$permok = $user->rights->supplier_invoice->creer;
|
||||
}
|
||||
}
|
||||
if ($object->element == 'shipping') {
|
||||
$permok = $user->rights->expedition->creer;
|
||||
|
||||
@ -70,9 +70,17 @@ if ($module == 'propal') {
|
||||
} elseif ($module == 'project_task') {
|
||||
$permission = $user->rights->projet->creer;
|
||||
} elseif ($module == 'invoice_supplier') {
|
||||
$permission = $user->rights->fournisseur->facture->creer;
|
||||
if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
|
||||
$permission = $user->rights->fournisseur->facture->creer;
|
||||
} else {
|
||||
$permission = $user->rights->supplier_invoice->creer;
|
||||
}
|
||||
} elseif ($module == 'order_supplier') {
|
||||
$permission = $user->rights->fournisseur->commande->creer;
|
||||
if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
|
||||
$permission = $user->rights->fournisseur->commande->creer;
|
||||
} else {
|
||||
$permission = $user->rights->supplier_order->creer;
|
||||
}
|
||||
} elseif ($module == 'societe') {
|
||||
$permission = $user->rights->societe->creer;
|
||||
} elseif ($module == 'contact') {
|
||||
|
||||
@ -192,7 +192,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
// First classify billed the order to allow the proposal classify process
|
||||
if (!empty($conf->fournisseur->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER)) {
|
||||
$object->fetchObjectLinked('', 'order_supplier', $object->id, $object->element);
|
||||
if (!empty($object->linkedObjects)) {
|
||||
$totalonlinkedelements = 0;
|
||||
|
||||
@ -132,9 +132,9 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
$element = $obj->elementtype;
|
||||
|
||||
// Exclude events if related module is disabled
|
||||
if ($element == 'order_supplier' && empty($conf->fournisseur->enabled)) {
|
||||
if ($element == 'order_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))) {
|
||||
$qualified = 0;
|
||||
} elseif ($element == 'invoice_supplier' && empty($conf->fournisseur->enabled)) {
|
||||
} elseif ($element == 'invoice_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled))) {
|
||||
$qualified = 0;
|
||||
} elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) {
|
||||
$qualified = 0;
|
||||
|
||||
@ -330,11 +330,11 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
||||
if (!empty($conf->supplier_proposal->enabled)) {
|
||||
$langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
|
||||
}
|
||||
if (!empty($conf->tax->enabled)) {
|
||||
$langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
|
||||
|
||||
@ -128,11 +128,11 @@ if (!empty($conf->facture->enabled)) {
|
||||
if (!empty($conf->supplier_proposal->enabled)) {
|
||||
$langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
|
||||
}
|
||||
if (!empty($conf->tax->enabled)) {
|
||||
$langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
|
||||
|
||||
@ -326,7 +326,7 @@ if ($object->id > 0) {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) {
|
||||
print '<tr class="nowrap">';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("OrderMinAmount", 'supplier_order_min_amount', $object->supplier_order_min_amount, $object, $user->rights->societe->creer);
|
||||
@ -406,7 +406,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
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)) {
|
||||
// Box proposals
|
||||
$tmp = $object->getOutstandingOrders('supplier');
|
||||
$outstandingOpened = $tmp['opened'];
|
||||
@ -427,7 +427,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
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_invoice->enabled)) {
|
||||
$tmp = $object->getOutstandingBills('supplier');
|
||||
$outstandingOpened = $tmp['opened'];
|
||||
$outstandingTotal = $tmp['total_ht'];
|
||||
@ -832,7 +832,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->fournisseur->commande->creer) {
|
||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
||||
$langs->load("orders");
|
||||
if ($object->status == 1) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
||||
@ -841,7 +841,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->fournisseur->facture->creer) {
|
||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
||||
if (!empty($orders2invoice) && $orders2invoice > 0) {
|
||||
if ($object->status == 1) {
|
||||
// Company is open
|
||||
@ -854,7 +854,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->fournisseur->facture->creer) {
|
||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
||||
$langs->load("bills");
|
||||
if ($object->status == 1) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
||||
|
||||
@ -224,7 +224,7 @@ class SupplierOrders extends DolibarrApi
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
||||
if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
}
|
||||
// Check mandatory fields
|
||||
@ -260,7 +260,7 @@ class SupplierOrders extends DolibarrApi
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
||||
if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -340,7 +340,7 @@ class SupplierOrders extends DolibarrApi
|
||||
*/
|
||||
public function validate($id, $idwarehouse = 0, $notrigger = 0)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
||||
if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
$result = $this->order->fetch($id);
|
||||
|
||||
@ -571,7 +571,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
dol_syslog(get_class($this)."::valid");
|
||||
$result = 0;
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->creer))
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->commande->creer) || !empty($user->rights->supplier_order->creer)))
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))) {
|
||||
$this->db->begin();
|
||||
|
||||
@ -2374,7 +2374,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
*/
|
||||
public function setDeliveryDate($user, $delivery_date, $notrigger = 0)
|
||||
{
|
||||
if ($user->rights->fournisseur->commande->creer) {
|
||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
@ -2433,7 +2433,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
public function set_id_projet($user, $id_projet, $notrigger = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->rights->fournisseur->commande->creer) {
|
||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
@ -3229,7 +3229,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
|
||||
|
||||
$qtydelivered = array();
|
||||
|
||||
@ -122,24 +122,24 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Common permissions
|
||||
$usercanread = $user->rights->fournisseur->commande->lire;
|
||||
$usercancreate = $user->rights->fournisseur->commande->creer;
|
||||
$usercandelete = $user->rights->fournisseur->commande->supprimer;
|
||||
$usercanread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire);
|
||||
$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||
$usercandelete = ($user->rights->fournisseur->commande->supprimer || $user->rights->supplier_order->supprimer);
|
||||
|
||||
// Advanced permissions
|
||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate)));
|
||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate)));
|
||||
|
||||
// Additional area permissions
|
||||
$usercanapprove = $user->rights->fournisseur->commande->approuver;
|
||||
$usercanapprovesecond = $user->rights->fournisseur->commande->approve2;
|
||||
$usercanorder = $user->rights->fournisseur->commande->commander;
|
||||
$usercanapprovesecond = $user->rights->fournisseur->commande->approve2;
|
||||
$usercanorder = $user->rights->fournisseur->commande->commander;
|
||||
$usercanreceived = $user->rights->fournisseur->commande->receptionner;
|
||||
|
||||
// Permissions for includes
|
||||
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||
$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php
|
||||
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php
|
||||
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||
$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php
|
||||
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php
|
||||
|
||||
|
||||
/*
|
||||
@ -2438,7 +2438,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
if (in_array($object->statut, array(3, 4, 5))) {
|
||||
if ($conf->fournisseur->enabled && $usercanreceived) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $usercanreceived) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id.'">'.$labelofbutton.'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$labelofbutton.'</a></div>';
|
||||
@ -2464,8 +2464,8 @@ if ($action == 'create') {
|
||||
// Create bill
|
||||
//if (! empty($conf->facture->enabled))
|
||||
//{
|
||||
if (!empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled
|
||||
if ($user->rights->fournisseur->facture->creer) {
|
||||
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) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
}
|
||||
@ -2477,7 +2477,7 @@ if ($action == 'create') {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
|
||||
} else {
|
||||
if (!empty($object->linkedObjectsIds['invoice_supplier'])) {
|
||||
if ($user->rights->fournisseur->facture->creer) {
|
||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -53,7 +53,7 @@ $object = new CommandeFournisseur($db);
|
||||
* Add a new contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer) {
|
||||
if ($action == 'addcontact' && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if ($result > 0 && $id > 0) {
|
||||
@ -73,14 +73,14 @@ if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer) {
|
||||
} elseif ($action == 'swapstatut' && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) {
|
||||
// Toggle the status of a contact
|
||||
if ($object->fetch($id)) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
} elseif ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer) {
|
||||
} elseif ($action == 'deletecontact' && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) {
|
||||
// Deleting a contact
|
||||
$object->fetch($id);
|
||||
$result = $object->delete_contact(GETPOST("lineid", 'int'));
|
||||
@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->fournisseur->commande->creer) {
|
||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
|
||||
@ -545,7 +545,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->fournisseur->commande->creer) {
|
||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
|
||||
@ -129,7 +129,7 @@ if ($object->id > 0) {
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->fournisseur->commande->creer) {
|
||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
@ -176,8 +176,8 @@ if ($object->id > 0) {
|
||||
|
||||
|
||||
$modulepart = 'commande_fournisseur';
|
||||
$permission = $user->rights->fournisseur->commande->creer;
|
||||
$permtoedit = $user->rights->fournisseur->commande->creer;
|
||||
$permission = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||
$permtoedit = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
|
||||
@ -172,7 +172,7 @@ if ($resql) {
|
||||
* Draft orders
|
||||
*/
|
||||
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
$sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
|
||||
@ -141,7 +141,7 @@ $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->ge
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->fournisseur->commande->creer) {
|
||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
|
||||
@ -459,7 +459,7 @@ if (empty($reshook)) {
|
||||
// Fac builddoc
|
||||
$donotredirect = 1;
|
||||
$upload_dir = $conf->fournisseur->facture->dir_output;
|
||||
$permissiontoadd = $user->rights->fournisseur->facture->creer;
|
||||
$permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
|
||||
//include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
}
|
||||
|
||||
@ -880,7 +880,7 @@ if ($resql) {
|
||||
'builddoc'=>$langs->trans("PDFMerge"),
|
||||
'presend'=>$langs->trans("SendByMail"),
|
||||
);
|
||||
if ($user->rights->fournisseur->facture->creer) {
|
||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
||||
$arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier");
|
||||
}
|
||||
if ($user->rights->fournisseur->commande->supprimer) {
|
||||
@ -895,7 +895,7 @@ if ($resql) {
|
||||
if (!empty($socid)) {
|
||||
$url .= '&socid='.$socid;
|
||||
}
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $user->rights->fournisseur->commande->creer);
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer));
|
||||
|
||||
// Lines of title fields
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -1594,8 +1594,8 @@ if ($resql) {
|
||||
$urlsource .= str_replace('&', '&', $param);
|
||||
|
||||
$filedir = $diroutputmassaction;
|
||||
$genallowed = $user->rights->fournisseur->commande->lire;
|
||||
$delallowed = $user->rights->fournisseur->commande->creer;
|
||||
$genallowed = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire);
|
||||
$delallowed = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||
|
||||
print $formfile->showdocuments('massfilesarea_supplier_order', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||
} else {
|
||||
|
||||
@ -48,7 +48,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'com
|
||||
$object = new CommandeFournisseur($db);
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
$permissionnote = $user->rights->fournisseur->commande->creer; // Used by the include of actions_setnotes.inc.php
|
||||
$permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
|
||||
/*
|
||||
@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->fournisseur->commande->creer) {
|
||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
|
||||
@ -111,9 +111,9 @@ $isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', 'rowid', $isdraft);
|
||||
|
||||
// Common permissions
|
||||
$usercanread = $user->rights->fournisseur->facture->lire;
|
||||
$usercancreate = $user->rights->fournisseur->facture->creer;
|
||||
$usercandelete = $user->rights->fournisseur->facture->supprimer;
|
||||
$usercanread = ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire);
|
||||
$usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
|
||||
$usercandelete = ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer);
|
||||
|
||||
// Advanced permissions
|
||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate)));
|
||||
@ -395,7 +395,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'settransportmode' && $user->rights->fournisseur->facture->creer) {
|
||||
if ($action == 'settransportmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
||||
// transport mode
|
||||
$result = $object->setTransportMode(GETPOST('transport_mode_id', 'int'));
|
||||
} elseif ($action == 'setlabel' && $usercancreate) {
|
||||
@ -2894,7 +2894,7 @@ if ($action == 'create') {
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('IntracommReportTransportMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) {
|
||||
if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
|
||||
@ -53,7 +53,7 @@ $object = new FactureFournisseur($db);
|
||||
* Ajout d'un nouveau contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) {
|
||||
if ($action == 'addcontact' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
||||
$result = $object->fetch($id, $ref);
|
||||
|
||||
if ($result > 0 && $id > 0) {
|
||||
@ -73,14 +73,14 @@ if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer) {
|
||||
} elseif ($action == 'swapstatut' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
||||
// bascule du statut d'un contact
|
||||
if ($object->fetch($id)) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
} elseif ($action == 'deletecontact' && $user->rights->fournisseur->facture->creer) {
|
||||
} elseif ($action == 'deletecontact' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
||||
// Efface un contact
|
||||
$object->fetch($id);
|
||||
$result = $object->delete_contact(GETPOST("lineid", 'int'));
|
||||
|
||||
@ -251,8 +251,8 @@ if ($object->id > 0) {
|
||||
|
||||
|
||||
$modulepart = 'facture_fournisseur';
|
||||
$permission = $user->rights->fournisseur->facture->creer;
|
||||
$permtoedit = $user->rights->fournisseur->facture->creer;
|
||||
$permission = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
|
||||
$permtoedit = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
|
||||
$param = '&facid='.$object->id;
|
||||
|
||||
$defaulttpldir = '/core/tpl';
|
||||
|
||||
@ -274,9 +274,9 @@ if (empty($reshook)) {
|
||||
// Mass actions
|
||||
$objectclass = 'FactureFournisseur';
|
||||
$objectlabel = 'SupplierInvoices';
|
||||
$permissiontoread = $user->rights->fournisseur->facture->lire;
|
||||
$permissiontoadd = $user->rights->fournisseur->facture->creer;
|
||||
$permissiontodelete = $user->rights->fournisseur->facture->supprimer;
|
||||
$permissiontoread = ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire);
|
||||
$permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
|
||||
$permissiontodelete = ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer);
|
||||
$uploaddir = $conf->fournisseur->facture->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
@ -878,7 +878,7 @@ if ($resql) {
|
||||
if (!empty($socid)) {
|
||||
$url .= '&socid='.$socid;
|
||||
}
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->rights->fournisseur->facture->creer);
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer));
|
||||
|
||||
$i = 0;
|
||||
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
@ -48,7 +48,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
|
||||
$object = new FactureFournisseur($db);
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
$permissionnote = $user->rights->fournisseur->facture->creer; // Used by the include of actions_setnotes.inc.php
|
||||
$permissionnote = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
|
||||
/*
|
||||
@ -58,7 +58,7 @@ $permissionnote = $user->rights->fournisseur->facture->creer; // Used by the inc
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
|
||||
|
||||
// Set label
|
||||
if ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) {
|
||||
if ($action == 'setlabel' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
||||
$object->label = $_POST['label'];
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) {
|
||||
@ -103,7 +103,7 @@ if ($object->id > 0) {
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->fournisseur->commande->creer) {
|
||||
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
|
||||
if ($action != 'classify') {
|
||||
// $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
|
||||
@ -99,7 +99,7 @@ if ($resql) {
|
||||
|
||||
|
||||
// Draft orders
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
$langs->load("orders");
|
||||
|
||||
$sql = "SELECT cf.rowid, cf.ref, cf.total_ttc,";
|
||||
@ -157,7 +157,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP
|
||||
}
|
||||
|
||||
// Draft invoices
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
||||
$sql = "SELECT ff.ref_supplier, ff.rowid, ff.total_ttc, ff.type";
|
||||
$sql .= ", s.nom as name, s.rowid as socid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
|
||||
|
||||
@ -62,7 +62,7 @@ if ($socid && $socid != $object->thirdparty->id) {
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'setnote' && $user->rights->fournisseur->facture->creer) {
|
||||
if ($action == 'setnote' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
||||
$db->begin();
|
||||
|
||||
$object->fetch($id);
|
||||
@ -92,7 +92,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse
|
||||
}
|
||||
|
||||
if ($action == 'confirm_validate' && $confirm == 'yes' &&
|
||||
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer))
|
||||
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->facture->creer) || !empty($user->rights->supplier_invoice->creer)))
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
|
||||
) {
|
||||
$db->begin();
|
||||
@ -182,9 +182,9 @@ if ($result > 0) {
|
||||
print '</td></tr>';*/
|
||||
|
||||
// Date of payment
|
||||
print '<tr><td class="titlefield">'.$form->editfieldkey("Date", 'datep', $object->date, $object, $object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td>';
|
||||
print '<tr><td class="titlefield">'.$form->editfieldkey("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)).'</td>';
|
||||
print '<td>';
|
||||
print $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && $user->rights->fournisseur->facture->creer, 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded'));
|
||||
print $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Payment mode
|
||||
@ -241,9 +241,9 @@ if ($result > 0) {
|
||||
}
|
||||
|
||||
// Note
|
||||
print '<tr><td>'.$form->editfieldkey("Comments", 'note', $object->note, $object, $user->rights->fournisseur->facture->creer).'</td>';
|
||||
print '<tr><td>'.$form->editfieldkey("Comments", 'note', $object->note, $object, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)).'</td>';
|
||||
print '<td>';
|
||||
print $form->editfieldval("Note", 'note', $object->note, $object, $user->rights->fournisseur->facture->creer, 'textarea');
|
||||
print $form->editfieldval("Note", 'note', $object->note, $object, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'textarea');
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -336,7 +336,7 @@ if ($result > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
|
||||
if ($user->socid == 0 && $object->statut == 0 && $action == '') {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer))
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->facture->creer) || !empty($user->rights->supplier_invoice->creer)))
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=validate">'.$langs->trans('Valid').'</a>';
|
||||
}
|
||||
@ -363,8 +363,8 @@ if ($result > 0) {
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$genallowed = $user->rights->fournisseur->facture->lire;
|
||||
$delallowed = $user->rights->fournisseur->facture->creer;
|
||||
$genallowed = ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire);
|
||||
$delallowed = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
|
||||
$modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (empty($conf->global->SUPPLIER_PAYMENT_ADDON_PDF) ? '' : $conf->global->SUPPLIER_PAYMENT_ADDON_PDF));
|
||||
|
||||
print $formfile->showdocuments('supplier_payment', $ref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 40, 0, '', '', '', $societe->default_lang);
|
||||
|
||||
@ -112,10 +112,10 @@ if ($user->socid) {
|
||||
// require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
// $object = new PaiementFourn($db);
|
||||
// restrictedArea($user, $object->element);
|
||||
if (empty($conf->fournisseur->enabled)) {
|
||||
if ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled)) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (!$user->rights->fournisseur->facture->lire) {
|
||||
if (!$user->rights->fournisseur->facture->lire || !$user->rights->supplier_invoice->lire) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ if ($socid > 0) {
|
||||
dol_banner_tab($societe, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom');
|
||||
print dol_get_fiche_end();
|
||||
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->facture->lire) {
|
||||
if ((!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
|
||||
// Invoice list
|
||||
print load_fiche_titre($langs->trans("SupplierPreview"));
|
||||
|
||||
|
||||
@ -2286,7 +2286,7 @@ function top_menu_quickadd()
|
||||
';
|
||||
}
|
||||
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->creer) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->creer) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->creer)) {
|
||||
$langs->load("orders");
|
||||
$dropDownQuickAddHtml .= '
|
||||
<!-- Supplier order link -->
|
||||
@ -2299,7 +2299,7 @@ function top_menu_quickadd()
|
||||
';
|
||||
}
|
||||
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->creer) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->creer) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->creer)) {
|
||||
$langs->load("bills");
|
||||
$dropDownQuickAddHtml .= '
|
||||
<!-- Supplier invoice link -->
|
||||
|
||||
@ -120,7 +120,7 @@ if ($socid > 0) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {
|
||||
if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('SupplierCode').'</td><td colspan="3">';
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
|
||||
|
||||
@ -682,7 +682,7 @@ if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
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)) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("UseProductFournDesc").'</td>';
|
||||
print '<td class="right">';
|
||||
|
||||
@ -5128,7 +5128,7 @@ class Product extends CommonObject
|
||||
}
|
||||
$stock_sending_client = $this->stats_expedition['qty'];
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
$filterStatus = '1,2,3,4';
|
||||
if (isset($includedraftpoforvirtual)) {
|
||||
$filterStatus = '0,'.$filterStatus;
|
||||
@ -5139,7 +5139,7 @@ class Product extends CommonObject
|
||||
}
|
||||
$stock_commande_fournisseur = $this->stats_commande_fournisseur['qty'];
|
||||
}
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->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->reception->enabled)) {
|
||||
$filterStatus = '4';
|
||||
if (isset($includedraftpoforvirtual)) {
|
||||
$filterStatus = '0,'.$filterStatus;
|
||||
@ -5150,7 +5150,7 @@ class Product extends CommonObject
|
||||
}
|
||||
$stock_reception_fournisseur = $this->stats_reception['qty'];
|
||||
}
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->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->reception->enabled)) {
|
||||
$filterStatus = '4';
|
||||
if (isset($includedraftpoforvirtual)) {
|
||||
$filterStatus = '0,'.$filterStatus;
|
||||
|
||||
@ -1579,7 +1579,7 @@ if ($resql) {
|
||||
//print price($obj->minsellprice).' '.$langs->trans("HT");
|
||||
if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) {
|
||||
if ($product_fourn->product_fourn_price_id > 0) {
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) {
|
||||
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) {
|
||||
$htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1);
|
||||
print '<span class="amount">'.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).'</span>';
|
||||
} else {
|
||||
|
||||
@ -701,7 +701,7 @@ if ($id > 0 || $ref) {
|
||||
}
|
||||
|
||||
// Number of supplier order running
|
||||
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)) {
|
||||
if ($found) {
|
||||
$helpondiff .= '<br>';
|
||||
} else {
|
||||
@ -717,7 +717,7 @@ if ($id > 0 || $ref) {
|
||||
}
|
||||
|
||||
// Number of product from supplier order already received (partial receipt)
|
||||
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)) {
|
||||
if ($found) {
|
||||
$helpondiff .= '<br>';
|
||||
} else {
|
||||
|
||||
@ -396,7 +396,7 @@ if ($usevirtualstock) {
|
||||
$sqlExpeditionsCli = '0';
|
||||
}
|
||||
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
$sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
|
||||
$sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,";
|
||||
$sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3";
|
||||
|
||||
@ -1270,11 +1270,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
$langs->load("supplier_proposal");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddSupplierProposal").'</a>';
|
||||
}
|
||||
if (!empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->creer) {
|
||||
if (!empty($conf->supplier_order->enabled) && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) {
|
||||
$langs->load("suppliers");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddSupplierOrder").'</a>';
|
||||
}
|
||||
if (!empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->creer) {
|
||||
if (!empty($conf->supplier_invoice->enabled) && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
||||
$langs->load("suppliers");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddSupplierInvoice").'</a>';
|
||||
}
|
||||
|
||||
@ -50,10 +50,10 @@ if (!empty($conf->commande->enabled)) {
|
||||
if (!empty($conf->supplier_proposal->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
}
|
||||
if (!empty($conf->contrat->enabled)) {
|
||||
@ -425,8 +425,8 @@ $listofreferent = array(
|
||||
'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
|
||||
'lang'=>'suppliers',
|
||||
'buttonnew'=>'AddSupplierOrder',
|
||||
'testnew'=>$user->rights->fournisseur->commande->creer,
|
||||
'test'=>$conf->supplier_order->enabled && $user->rights->fournisseur->commande->lire),
|
||||
'testnew'=>($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer),
|
||||
'test'=>$conf->supplier_order->enabled && ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)),
|
||||
'invoice_supplier'=>array(
|
||||
'name'=>"BillsSuppliers",
|
||||
'title'=>"ListSupplierInvoicesAssociatedProject",
|
||||
@ -437,8 +437,8 @@ $listofreferent = array(
|
||||
'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
|
||||
'lang'=>'suppliers',
|
||||
'buttonnew'=>'AddSupplierInvoice',
|
||||
'testnew'=>$user->rights->fournisseur->facture->creer,
|
||||
'test'=>$conf->supplier_invoice->enabled && $user->rights->fournisseur->facture->lire),
|
||||
'testnew'=>($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer),
|
||||
'test'=>$conf->supplier_invoice->enabled && ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire)),
|
||||
'contract'=>array(
|
||||
'name'=>"Contracts",
|
||||
'title'=>"ListContractAssociatedProject",
|
||||
|
||||
@ -50,7 +50,7 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||
if (!empty($conf->propal->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
|
||||
}
|
||||
@ -745,7 +745,7 @@ if ($action == 'create') {
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">';
|
||||
if ($origin == 'supplierorder' && !empty($conf->fournisseur->enabled)) {
|
||||
if ($origin == 'supplierorder' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) {
|
||||
print $langs->trans("RefOrder").'</td><td colspan="3"><a href="'.DOL_URL_ROOT.'/fourn/commande/card.php?id='.$object->id.'">'.img_object($langs->trans("ShowOrder"), 'order').' '.$object->ref;
|
||||
}
|
||||
if ($origin == 'propal' && !empty($conf->propal->enabled)) {
|
||||
@ -1270,7 +1270,7 @@ if ($action == 'create') {
|
||||
$objectsrc = new Propal($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
}
|
||||
if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && !empty($conf->fournisseur->enabled)) {
|
||||
if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) {
|
||||
$objectsrc = new CommandeFournisseur($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
}
|
||||
@ -1982,8 +1982,8 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Create bill
|
||||
if (!empty($conf->fournisseur->enabled) && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) {
|
||||
if ($user->rights->fournisseur->facture->creer) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) {
|
||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
||||
// TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_RECEPTION))
|
||||
// If we do that, we must also make this option official.
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
@ -1996,7 +1996,7 @@ if ($action == 'create') {
|
||||
if ($user->rights->reception->creer && $object->statut > 0 && !$object->billed) {
|
||||
$label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received
|
||||
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on receptions instead of orders
|
||||
if (!empty($conf->fournisseur->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 (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->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 ?
|
||||
$label = "ClassifyBilled";
|
||||
$paramaction = 'classifybilled';
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Linked documents
|
||||
if ($origin == 'order_supplier' && $object->$typeobject->id && !empty($conf->fournisseur->enabled)) {
|
||||
if ($origin == 'order_supplier' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) {
|
||||
$objectsrc = new CommandeFournisseur($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
}
|
||||
@ -209,7 +209,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
// Linked documents
|
||||
if ($origin == 'order_supplier' && $object->$typeobject->id && !empty($conf->fournisseur->enabled)) {
|
||||
if ($origin == 'order_supplier' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) {
|
||||
print '<tr><td class="titlefield">';
|
||||
$objectsrc = new CommandeFournisseur($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
|
||||
@ -384,7 +384,7 @@ if (empty($reshook)) {
|
||||
// Fac builddoc
|
||||
$donotredirect = 1;
|
||||
$upload_dir = $conf->fournisseur->facture->dir_output;
|
||||
$permissiontoadd = $user->rights->fournisseur->facture->creer;
|
||||
$permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
}
|
||||
|
||||
@ -596,7 +596,7 @@ $arrayofmassactions = array(
|
||||
// 'presend'=>$langs->trans("SendByMail"),
|
||||
);
|
||||
|
||||
if ($user->rights->fournisseur->facture->creer) {
|
||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
||||
$arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier");
|
||||
}
|
||||
if ($massaction == 'createbills') {
|
||||
|
||||
@ -186,7 +186,7 @@ abstract class ActionsCardCommon
|
||||
$s = $modCodeClient->getToolTip($langs, $this->object, 0);
|
||||
$this->tpl['help_customercode'] = $form->textwithpicto('', $s, 1);
|
||||
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$this->tpl['supplier_enabled'] = 1;
|
||||
|
||||
// Load object modCodeFournisseur
|
||||
|
||||
@ -980,7 +980,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (GETPOST("type") == 'p') {
|
||||
$object->client = 2;
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) {
|
||||
$object->fournisseur = 1;
|
||||
}
|
||||
|
||||
@ -1282,7 +1282,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr></table>';
|
||||
print '</td></tr>';
|
||||
|
||||
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire))
|
||||
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))
|
||||
|| (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) {
|
||||
// Supplier
|
||||
print '<tr>';
|
||||
@ -1300,11 +1300,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) {
|
||||
print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0);
|
||||
}
|
||||
print '</td><td>';
|
||||
if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) {
|
||||
print '<table class="nobordernopadding"><tr><td>';
|
||||
$tmpcode = $object->code_fournisseur;
|
||||
if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) {
|
||||
@ -1585,7 +1585,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Supplier
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
print '<tr class="visibleifsupplier"><td class="toptd">'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).'</td><td colspan="3">';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1);
|
||||
print img_picto('', 'category').$form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
@ -1964,7 +1964,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr>';
|
||||
|
||||
// Supplier
|
||||
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire))
|
||||
if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)))
|
||||
|| (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) {
|
||||
print '<tr>';
|
||||
print '<td>'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).'</td>';
|
||||
@ -1975,7 +1975,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</tr><tr>';
|
||||
}
|
||||
print '<td>';
|
||||
if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) {
|
||||
print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0);
|
||||
}
|
||||
print '</td>';
|
||||
@ -2256,7 +2256,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print "</td></tr>";
|
||||
|
||||
// Supplier
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) {
|
||||
print '<tr class="visibleifsupplier"><td>'.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).'</td>';
|
||||
print '<td colspan="3">';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1);
|
||||
@ -2460,7 +2460,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Supplier code
|
||||
if (!empty($conf->fournisseur->enabled) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {
|
||||
if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) {
|
||||
print '<tr><td>';
|
||||
print $langs->trans('SupplierCode').'</td><td>';
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
|
||||
@ -2667,7 +2667,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Supplier
|
||||
if (!empty($conf->fournisseur->enabled) && $object->fournisseur) {
|
||||
if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) {
|
||||
print '<tr><td>'.$langs->trans("SuppliersCategoriesShort").'</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1);
|
||||
|
||||
@ -2636,7 +2636,7 @@ class Societe extends CommonObject
|
||||
}
|
||||
}
|
||||
if (empty($option) || preg_match('/supplier/', $option)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur) {
|
||||
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,13 +192,13 @@ if ($object->fournisseur) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nbCmdsFourn = $obj->nb;
|
||||
$thirdTypeArray['supplier'] = $langs->trans("supplier");
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) {
|
||||
if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
|
||||
$elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
|
||||
}
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) {
|
||||
if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
|
||||
$elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
|
||||
}
|
||||
if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) {
|
||||
if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire) {
|
||||
$elementTypeArray['supplier_proposal'] = $langs->transnoentitiesnoconv('SupplierProposals');
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ if ($result) {
|
||||
if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) {
|
||||
$found = 1; $third['customer']++;
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) {
|
||||
if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) {
|
||||
$found = 1; $third['supplier']++;
|
||||
}
|
||||
if (!empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) {
|
||||
@ -144,7 +144,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) +
|
||||
if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
|
||||
$dataseries[] = array($langs->trans("Customers"), round($third['customer']));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
|
||||
if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
|
||||
$dataseries[] = array($langs->trans("Suppliers"), round($third['supplier']));
|
||||
}
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
@ -171,7 +171,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) +
|
||||
$statstring .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=c">'.$langs->trans("Customers").'</a></td><td class="right">'.round($third['customer']).'</td>';
|
||||
$statstring .= "</tr>";
|
||||
}
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire) {
|
||||
if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
|
||||
$statstring2 = "<tr>";
|
||||
$statstring2 .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=f">'.$langs->trans("Suppliers").'</a></td><td class="right">'.round($third['supplier']).'</td>';
|
||||
$statstring2 .= "</tr>";
|
||||
|
||||
@ -226,9 +226,9 @@ $arrayfields = array(
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>3, 'checked'=>1),
|
||||
's.barcode'=>array('label'=>"Gencod", 'position'=>5, 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))),
|
||||
's.code_client'=>array('label'=>"CustomerCodeShort", 'position'=>10, 'checked'=>$checkedcustomercode),
|
||||
's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'position'=>11, 'checked'=>$checkedsuppliercode, 'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||
's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'position'=>11, 'checked'=>$checkedsuppliercode, 'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||
's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'position'=>13, 'checked'=>$checkedcustomeraccountcode),
|
||||
's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'position'=>14, 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||
's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'position'=>14, 'checked'=>$checkedsupplieraccountcode, 'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||
's.address'=>array('label'=>"Address", 'position'=>19, 'checked'=>0),
|
||||
's.zip'=>array('label'=>"Zip", 'position'=>20, 'checked'=>1),
|
||||
's.town'=>array('label'=>"Town", 'position'=>21, 'checked'=>0),
|
||||
|
||||
@ -178,7 +178,7 @@ if ($result > 0) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (!empty($conf->fournisseur->enabled) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('SupplierCode').'</td><td colspan="3">';
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
|
||||
|
||||
@ -112,7 +112,7 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->
|
||||
|
||||
// Additional area permissions
|
||||
$usercanclose = $user->rights->supplier_proposal->cloturer;
|
||||
$usercancreateorder = $user->rights->fournisseur->commande->creer;
|
||||
$usercancreateorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||
|
||||
// Permissions for includes
|
||||
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||
@ -1859,7 +1859,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Create an order
|
||||
if (!empty($conf->fournisseur->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) {
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $object->statut == SupplierProposal::STATUS_SIGNED) {
|
||||
if ($usercancreateorder) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddOrder").'</a></div>';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user