Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
192510316b | ||
|
|
6f83c8c6f3 | ||
|
|
8213756c37 | ||
|
|
a254412c61 | ||
|
|
cc1a3080d0 | ||
|
|
b5f887b3e4 | ||
|
|
694357d48e | ||
|
|
c4f80b4e71 | ||
|
|
ece9f3037a | ||
|
|
8dd44246b0 | ||
|
|
76470c9548 | ||
|
|
19be5f662d | ||
|
|
3eebbc0b14 | ||
|
|
d27c0b31fc | ||
|
|
a1534955a1 | ||
|
|
79371f66b0 | ||
|
|
4569cb82b2 | ||
|
|
04d33f4594 | ||
|
|
af6e95aa79 | ||
|
|
5d942c9d1a | ||
|
|
cc57d3dbc1 | ||
|
|
87b187bded | ||
|
|
df0b20aad3 | ||
|
|
e085c3989a | ||
|
|
e67c208b57 | ||
|
|
e13038dc30 | ||
|
|
744b84cb09 | ||
|
|
5c3b0847c2 | ||
|
|
f1af7ca2f2 | ||
|
|
035bc32323 | ||
|
|
400f6b244b | ||
|
|
1129222064 | ||
|
|
7cb657c991 |
@ -121,9 +121,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as l";
|
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||||
|
|
||||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
|
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
|
||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
|
|||||||
@ -93,87 +93,88 @@ if ($conf->accounting->enabled)
|
|||||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||||
print "<br>\n"; print "<br>\n";
|
if (!empty($user->rights->accounting->chartofaccount)){
|
||||||
|
print "<br>\n"; print "<br>\n";
|
||||||
|
|
||||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||||
print '<hr>';
|
print '<hr>';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
// STEPS
|
// STEPS
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
if (!empty($conf->tax->enabled))
|
if (!empty($conf->tax->enabled))
|
||||||
{
|
{
|
||||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
}
|
||||||
|
/*if (! empty($conf->salaries->enabled))
|
||||||
|
{
|
||||||
|
$step++;
|
||||||
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||||
|
// htdocs/admin/salaries.php
|
||||||
|
print "<br>\n";
|
||||||
|
print "<br>\n";
|
||||||
|
}*/
|
||||||
|
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||||
|
{
|
||||||
|
$step++;
|
||||||
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
||||||
|
print "<br>\n";
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (! empty($conf->loan->enabled))
|
||||||
|
{
|
||||||
|
$step++;
|
||||||
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||||
|
print "<br>\n";
|
||||||
|
}
|
||||||
|
if (! empty($conf->don->enabled))
|
||||||
|
{
|
||||||
|
$step++;
|
||||||
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||||
|
print "<br>\n";
|
||||||
|
}
|
||||||
|
if (! empty($conf->adherents->enabled))
|
||||||
|
{
|
||||||
|
$step++;
|
||||||
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||||
|
print "<br>\n";
|
||||||
|
}*/
|
||||||
|
|
||||||
|
$step++;
|
||||||
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
||||||
|
print "<br>\n";
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
/*if (! empty($conf->salaries->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
// htdocs/admin/salaries.php
|
|
||||||
print "<br>\n";
|
|
||||||
print "<br>\n";
|
|
||||||
}*/
|
|
||||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
|
||||||
print "<br>\n";
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if (! empty($conf->loan->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
print "<br>\n";
|
|
||||||
}
|
|
||||||
if (! empty($conf->don->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
print "<br>\n";
|
|
||||||
}
|
|
||||||
if (! empty($conf->adherents->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
print "<br>\n";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
|
||||||
print "<br>\n";
|
|
||||||
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
// Step A - E
|
// Step A - E
|
||||||
|
|
||||||
|
|||||||
@ -123,9 +123,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as l";
|
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||||
|
|
||||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
|
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
|
||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
|
|||||||
@ -72,7 +72,7 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$uselogfile = $conf->global->DEBUGBAR_USE_LOGFILE;
|
$uselogfile = $conf->global->DEBUGBAR_USE_LOG_FILE;
|
||||||
|
|
||||||
if ($uselogfile)
|
if ($uselogfile)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,6 +43,8 @@ create table llx_commande_fournisseur_dispatch_extrafields
|
|||||||
|
|
||||||
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
|
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
|
||||||
|
|
||||||
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1;
|
||||||
|
|
||||||
UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
|
UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
|
||||||
|
|
||||||
create table llx_c_shipment_package_type
|
create table llx_c_shipment_package_type
|
||||||
|
|||||||
@ -50,7 +50,7 @@ create table llx_product_fournisseur_price
|
|||||||
import_key varchar(14), -- Import key
|
import_key varchar(14), -- Import key
|
||||||
delivery_time_days integer,
|
delivery_time_days integer,
|
||||||
supplier_reputation varchar(10),
|
supplier_reputation varchar(10),
|
||||||
|
packaging double(24,8) DEFAULT 1,
|
||||||
fk_multicurrency integer,
|
fk_multicurrency integer,
|
||||||
multicurrency_code varchar(255),
|
multicurrency_code varchar(255),
|
||||||
multicurrency_tx double(24,8) DEFAULT 1,
|
multicurrency_tx double(24,8) DEFAULT 1,
|
||||||
|
|||||||
@ -150,7 +150,7 @@ if ($action == 'other')
|
|||||||
if ($value) {
|
if ($value) {
|
||||||
$sql_test = "SELECT count(desc_fourn) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
|
$sql_test = "SELECT count(desc_fourn) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
|
||||||
$resql = $db->query($sql_test);
|
$resql = $db->query($sql_test);
|
||||||
if (!$resql && $db->lasterrno == 'DB_ERROR_NOSUCHFIELD') // if the field does not exist, we create it
|
if (!$resql && $db->lasterrno() == 'DB_ERROR_NOSUCHFIELD') // if the field does not exist, we create it
|
||||||
{
|
{
|
||||||
$sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN desc_fourn text";
|
$sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN desc_fourn text";
|
||||||
$resql_new = $db->query($sql_new);
|
$resql_new = $db->query($sql_new);
|
||||||
@ -159,15 +159,6 @@ if ($action == 'other')
|
|||||||
|
|
||||||
$value = GETPOST('activate_useProdSupplierPackaging', 'alpha');
|
$value = GETPOST('activate_useProdSupplierPackaging', 'alpha');
|
||||||
$res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value, 'chaine', 0, '', $conf->entity);
|
||||||
if ($value) {
|
|
||||||
$sql_test = "SELECT count(packaging) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
|
|
||||||
$resql = $db->query($sql_test);
|
|
||||||
if (!$resql && $db->lasterrno == 'DB_ERROR_NOSUCHFIELD') // if the field does not exist, we create it
|
|
||||||
{
|
|
||||||
$sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1";
|
|
||||||
$resql_new = $db->query($sql_new);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'specimen') // For products
|
if ($action == 'specimen') // For products
|
||||||
|
|||||||
@ -1803,7 +1803,10 @@ class Product extends CommonObject
|
|||||||
$sql .= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code";
|
$sql .= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code";
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql .= ", pfp.packaging";
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql .= ", pfp.packaging";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
||||||
$sql .= " WHERE pfp.fk_product = ".$product_id;
|
$sql .= " WHERE 1 = 1";
|
||||||
|
if ($product_id > 0) {
|
||||||
|
$sql .= " AND pfp.fk_product = ".((int) $product_id);
|
||||||
|
}
|
||||||
if ($fourn_ref != 'none') { $sql .= " AND pfp.ref_fourn = '".$fourn_ref."'";
|
if ($fourn_ref != 'none') { $sql .= " AND pfp.ref_fourn = '".$fourn_ref."'";
|
||||||
}
|
}
|
||||||
if ($fk_soc > 0) { $sql .= " AND pfp.fk_soc = ".$fk_soc;
|
if ($fk_soc > 0) { $sql .= " AND pfp.fk_soc = ".$fk_soc;
|
||||||
|
|||||||
@ -531,11 +531,11 @@ class Productbatch extends CommonObject
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_lot as pl";
|
$sql .= " FROM ".MAIN_DB_PREFIX."product_lot as pl";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pl.fk_product";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pl.fk_product";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_batch AS pb ON pl.batch = pb.batch";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_batch AS pb ON pl.batch = pb.batch";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock AS ps ON ps.rowid = pb.fk_product_stock";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock AS ps ON ps.rowid = pb.fk_product_stock AND ps.fk_product = ".((int) $fk_product);
|
||||||
$sql .= " WHERE p.entity IN (".getEntity('product').")";
|
$sql .= " WHERE p.entity IN (".getEntity('product').")";
|
||||||
$sql .= " AND pl.fk_product = ".$fk_product;
|
$sql .= " AND pl.fk_product = ".((int) $fk_product);
|
||||||
if ($fk_warehouse > 0) {
|
if ($fk_warehouse > 0) {
|
||||||
$sql .= " AND ps.fk_entrepot = ".$fk_warehouse;
|
$sql .= " AND ps.fk_entrepot = ".((int) $fk_warehouse);
|
||||||
}
|
}
|
||||||
if ($qty_min !== null) {
|
if ($qty_min !== null) {
|
||||||
$sql .= " AND pb.qty > ".$qty_min;
|
$sql .= " AND pb.qty > ".$qty_min;
|
||||||
|
|||||||
@ -620,6 +620,11 @@ $restrictviewformytask = ((!isset($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSI
|
|||||||
|
|
||||||
// Get if user is available or not for each day
|
// Get if user is available or not for each day
|
||||||
$isavailable = array();
|
$isavailable = array();
|
||||||
|
|
||||||
|
// Assume from Monday to Friday if conf empty or badly formed
|
||||||
|
$numstartworkingday = 1;
|
||||||
|
$numendworkingday = 5;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
||||||
{
|
{
|
||||||
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
|
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
|
||||||
|
|||||||
@ -521,6 +521,11 @@ $startday = dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['
|
|||||||
|
|
||||||
// Get if user is available or not for each day
|
// Get if user is available or not for each day
|
||||||
$isavailable = array();
|
$isavailable = array();
|
||||||
|
|
||||||
|
// Assume from Monday to Friday if conf empty or badly formed
|
||||||
|
$numstartworkingday = 1;
|
||||||
|
$numendworkingday = 5;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
||||||
{
|
{
|
||||||
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
|
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
|
||||||
@ -530,7 +535,6 @@ if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
|||||||
$numendworkingday = $tmparray[1];
|
$numendworkingday = $tmparray[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($idw = 0; $idw < 7; $idw++)
|
for ($idw = 0; $idw < 7; $idw++)
|
||||||
{
|
{
|
||||||
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
|
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
|
||||||
|
|||||||
@ -327,7 +327,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
|||||||
$holiday->id = $objp->rowid;
|
$holiday->id = $objp->rowid;
|
||||||
$holiday->ref = $objp->rowid;
|
$holiday->ref = $objp->rowid;
|
||||||
$holiday->fk_type = $objp->fk_type;
|
$holiday->fk_type = $objp->fk_type;
|
||||||
$nbopenedday = num_open_day($db->jdate($objp->date_debut), $db->jdate($objp->date_fin), 0, 1, $objp->halfday);
|
$nbopenedday = num_open_day($db->jdate($objp->date_debut, 'gmt'), $db->jdate($objp->date_fin, 'gmt'), 0, 1, $objp->halfday);
|
||||||
|
|
||||||
print $holiday->getNomUrl(1);
|
print $holiday->getNomUrl(1);
|
||||||
print '</td><td class="right" width="80px">'.dol_print_date($db->jdate($objp->date_debut), 'day')."</td>\n";
|
print '</td><td class="right" width="80px">'.dol_print_date($db->jdate($objp->date_debut), 'day')."</td>\n";
|
||||||
|
|||||||
@ -1905,7 +1905,7 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||||
{
|
{
|
||||||
if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
|
if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
|
||||||
{
|
{
|
||||||
@ -1917,7 +1917,7 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($caneditpassword && !$object->ldap_sid &&
|
elseif ($caneditpassword && !$object->ldap_sid &&
|
||||||
(empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
(empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans("EditPassword").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans("EditPassword").'</a></div>';
|
||||||
}
|
}
|
||||||
@ -1930,7 +1930,7 @@ else
|
|||||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("ReinitPassword").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("ReinitPassword").'</a></div>';
|
||||||
}
|
}
|
||||||
elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
||||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=password">'.$langs->trans("ReinitPassword").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=password">'.$langs->trans("ReinitPassword").'</a></div>';
|
||||||
}
|
}
|
||||||
@ -1940,7 +1940,7 @@ else
|
|||||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||||
}
|
}
|
||||||
elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
||||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||||
{
|
{
|
||||||
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a></div>';
|
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||||
@ -1949,13 +1949,13 @@ else
|
|||||||
|
|
||||||
// Enable user
|
// Enable user
|
||||||
if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
|
if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
|
||||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable">'.$langs->trans("Reactivate").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable">'.$langs->trans("Reactivate").'</a></div>';
|
||||||
}
|
}
|
||||||
// Disable user
|
// Disable user
|
||||||
if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
|
if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
|
||||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a></div>';
|
||||||
}
|
}
|
||||||
@ -1968,7 +1968,7 @@ else
|
|||||||
}
|
}
|
||||||
// Delete
|
// Delete
|
||||||
if ($user->id <> $id && $candisableuser &&
|
if ($user->id <> $id && $candisableuser &&
|
||||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||||
{
|
{
|
||||||
if ($user->admin || !$object->admin) // If user edited is admin, delete is possible on for an admin
|
if ($user->admin || !$object->admin) // If user edited is admin, delete is possible on for an admin
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user