Compare commits

...

94 Commits
14.0.4 ... 12.0

Author SHA1 Message Date
Laurent Destailleur
192510316b
Merge pull request #21013 from atm-greg/FIX_12.0_get_batch_only_for_same_fk_product
fix sql to avoid getting product_stock of another product with same batch
2022-05-24 21:23:02 +02:00
Laurent Destailleur
6f83c8c6f3
Update productbatch.class.php 2022-05-24 21:22:14 +02:00
atm-greg
8213756c37 fix sql to avoid getting product_stock of another product with same batch 2022-05-24 16:49:55 +02:00
Laurent Destailleur
a254412c61 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
Conflicts:
	htdocs/debugbar/class/DataCollector/DolLogsCollector.php
2022-05-03 11:54:28 +02:00
Laurent Destailleur
cc1a3080d0 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2022-05-03 11:53:23 +02:00
Laurent Destailleur
b5f887b3e4 Fix DEBUGBAR_USE_LOG_FILE 2022-05-03 11:52:32 +02:00
Laurent Destailleur
694357d48e
Merge pull request #19420 from marc-dll/12.0_FIX_project_activity_default_workingdays
FIX: project timesheets: assume Saturday and Sunday as default weekend days when working days conf is empty or badly formed
2022-04-14 23:23:12 +02:00
Laurent Destailleur
c4f80b4e71
Merge pull request #19424 from marc-dll/12.0_FIX_employee_tab_holiday_length
FIX: user employee tab: offset in open days messes up holiday length calculation
2022-04-14 22:59:20 +02:00
Laurent Destailleur
ece9f3037a
Merge pull request #19788 from OPEN-DSI/v12-fix-user-card-modify-transverse-rights
FIX user actions rights when multi-company transverse mode is enabled
2022-04-02 18:15:50 +02:00
Laurent Destailleur
8dd44246b0
Merge pull request #20348 from daraelmin/daraelmin-patch-5
Fix #20263 Accountancy setup displayed with right
2022-03-29 14:47:57 +02:00
Laurent Destailleur
76470c9548
Merge pull request #20297 from aspangaro/12p23
FIX #20279 Accountancy - PostGreSQL - Error on mass update lines already binded
2022-03-24 20:30:01 +01:00
stickler-ci
19be5f662d Fixing style errors. 2022-03-14 08:25:15 +00:00
daraelmin
3eebbc0b14
Fix #20263 Accountancy setup displayed with right
Fix #20263 Accountancy setup is displayed only for user with rights->accounting->chartofaccount
2022-03-14 09:24:26 +01:00
Laurent Destailleur
d27c0b31fc Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2022-03-10 15:54:08 +01:00
Laurent Destailleur
a1534955a1 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2022-03-10 15:52:50 +01:00
Laurent Destailleur
79371f66b0 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 10.0 2022-03-10 15:52:28 +01:00
Laurent Destailleur
4569cb82b2 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2022-03-10 15:52:04 +01:00
Laurent Destailleur
04d33f4594 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2022-03-10 15:51:42 +01:00
Laurent Destailleur
af6e95aa79 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/utils.class.php
2022-03-10 15:49:51 +01:00
Laurent Destailleur
5d942c9d1a Fix infinit logs 2022-03-10 15:46:00 +01:00
Laurent Destailleur
cc57d3dbc1 Fix phpcs 2022-03-09 22:25:29 +01:00
Alexandre SPANGARO
87b187bded FIX #20279 Accountancy - PostGreSQL - Error on mass update lines already binded 2022-03-08 03:43:40 +01:00
Laurent Destailleur
df0b20aad3
Merge pull request #20241 from noec764/12.0_Product_Fournisseur_Migration
Correction of the modification on the fly of the table llx_product_fournisseur_price
2022-03-07 15:01:40 +01:00
Laurent Destailleur
e085c3989a
Update product.php 2022-03-07 14:59:55 +01:00
Laurent Destailleur
e67c208b57
Merge pull request #20271 from rycks/12.0
fix #20270 : use product_id in sql only if product_id is defined
2022-03-07 14:07:27 +01:00
Laurent Destailleur
e13038dc30
Update product.class.php 2022-03-07 14:06:54 +01:00
Eric Seigne
744b84cb09 fix #20270 : use product_id in sql only if product_id is defined 2022-03-04 15:20:50 +01:00
stickler-ci
5c3b0847c2 Fixing style errors. 2022-03-01 15:20:28 +00:00
noec764
f1af7ca2f2
Update product.php 2022-03-01 16:17:32 +01:00
Noé Courtier
035bc32323 Correction of the modification on the fly of the table llx_product_fournisseur_price by an addition in the script creation of the table as well as in the script of version upgrade from 12 ->13 2022-03-01 16:14:31 +01:00
Laurent Destailleur
a70d45b3ab
Merge pull request #20148 from marc-dll/12.0_FIX_medias_blocked_when_logged_with_multicompany
FIX: viewimage.php blocks requests with multicompany from other enties
2022-02-25 14:32:49 +01:00
Marc de Lima Lucio
1574254dcf FIX: viewimage.php: bad call to dol_check_secure_access_document() caused images to be blocked with multicompany from entities > 1 2022-02-22 17:13:26 +01:00
Laurent Destailleur
1c129fd3ea
Merge pull request #20038 from atm-quentin/FIX_12_sort_ht_amount
FIX sort amount ht on cabyprodserv.php
2022-02-18 21:04:52 +01:00
Laurent Destailleur
97575854d0
Merge pull request #20094 from thomas-Ngr/12_fix_ticket_public_email_wrong_custom_url
fix ticket: wrong link sent to customer
2022-02-17 19:18:36 +01:00
Laurent Destailleur
2e744a4517
Update create_ticket.php 2022-02-17 19:18:22 +01:00
Thomas Negre
1ad8700810 empty commit to force travis try rebuild 2022-02-17 11:08:23 +01:00
Thomas Negre
1c8c98ac0f fix ticket public interface:
When sending an email to the customer,
If a custom URL had been provided for ticket public interface,
the link provided in the email did lead to the index of the public interface.
We want it to lead to /view.php
2022-02-17 09:53:36 +01:00
Laurent Destailleur
92cb95a184
Merge pull request #20064 from ATM-Consulting/FIX_uniformize_pdf_logo_behaviour
Fix uniformize pdf logo behaviour for supplier orders
2022-02-16 21:09:45 +01:00
atm-greg
96c7a9f77c fix pdf_cornas 2022-02-14 15:16:36 +01:00
atm-greg
3ebdb89133 fix pdf_mucadet 2022-02-14 15:11:26 +01:00
Quentin VIAL-GOUTEYRON
d819d427c3 FIX sort amount ht 2022-02-10 16:46:19 +01:00
Laurent Destailleur
db81b32a5d
Merge pull request #20028 from noec764/12.0_Fix_Double_CommandeFournisseurDet
Change of SQL request when fetching CommandeFournisseurLigne
2022-02-10 09:30:36 +01:00
Laurent Destailleur
793e43c7c6
Update fournisseur.commande.class.php 2022-02-10 09:29:11 +01:00
noec764
d9bac75a63
Merge branch '12.0' into 12.0_Fix_Double_CommandeFournisseurDet 2022-02-09 15:33:45 +01:00
Noé Courtier
e4c1978e12 Change of SQL request when fetching CommandeFournisseurLigne 2022-02-09 12:24:33 +01:00
Laurent Destailleur
a0154503f4
Merge pull request #19838 from OPEN-DSI/v12-fix-supplier-order-print-error
FIX replace print error with event message when error on update line …
2022-01-23 13:37:09 +01:00
lvessiller
a9c76f2e44 FIX replace print error with event message when error on update line in supplier order 2022-01-14 16:09:30 +01:00
Laurent Destailleur
5b6133ad62
Merge pull request #19821 from marc-dll/12.0_FIX_shipment_all_lines
FIX: order to shipment: debug hidden conf SHIPMENT_GETS_ALL_ORDER_PRODUCTS
2022-01-14 10:19:28 +01:00
Laurent Destailleur
90c3c90864
Merge pull request #19829 from OPEN-DSI/v12-fix-supplier-order-list-search-user
FIX search by user in supplier order list
2022-01-14 09:45:06 +01:00
lvessiller
cacff0c2d4 FIX cast int for search user 2022-01-13 16:18:57 +01:00
lvessiller
22f6d204a2 FIX search by user in supplier order list 2022-01-13 16:01:23 +01:00
Marc de Lima Lucio
b110ca6ead FIX: order to shipment: FIX hidden conf SHIPMENT_GETS_ALL_ORDER_PRODUCTS (still not working when not preselecting a warehouse) 2022-01-12 16:40:43 +01:00
lvessiller
400f6b244b FIX user actions rights when mulit-company transverse mode is enabled 2022-01-11 17:29:02 +01:00
Laurent Destailleur
cde290c78a
Merge pull request #19402 from atm-gauthier/fix_reorder_lines_after_delete_line_everywhere
FIX : reorder all lines when delete document line everywhere (4 documents were missing)
2022-01-10 21:23:23 +01:00
Laurent Destailleur
b23b82bd6f Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2022-01-07 15:49:09 +01:00
Laurent Destailleur
7dfb369a98 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2022-01-07 15:48:23 +01:00
Laurent Destailleur
265aeb76e6 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0
Conflicts:
	htdocs/core/class/utils.class.php
	htdocs/expensereport/class/expensereport.class.php
2022-01-07 15:48:13 +01:00
Laurent Destailleur
5ee74d7c07 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 10.0 2022-01-07 15:45:51 +01:00
Laurent Destailleur
1541e20870 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/class/utils.class.php
2022-01-07 15:43:28 +01:00
Laurent Destailleur
53709cf509 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/class/utils.class.php
2022-01-07 15:40:05 +01:00
Laurent Destailleur
10e32c056e FIX avoid infinite loop on dump with popen 2022-01-07 15:35:33 +01:00
Laurent Destailleur
8728ad2eff
Merge pull request #19730 from fmarcet/12.0
Fix: Correctly display product translations
2022-01-06 10:57:47 +01:00
Laurent Destailleur
5de6c193ff
Merge pull request #19745 from daraelmin/patch-1
Fix #19723 - Belgium provinces incorrect mapping
2022-01-06 10:41:19 +01:00
daraelmin
1f6e9a1a9e
Fix install - Belgium provinces incorrect mapping 2022-01-04 18:46:29 +01:00
Ferran Marcet
26c6908f66 Fix: Correctly display product translations 2022-01-03 13:22:07 +01:00
Ferran Marcet
08685cc6b0 Fix: Correctly display product translations 2022-01-03 13:14:40 +01:00
Laurent Destailleur
7bdfc998bf Fix regression 2021-12-30 17:49:53 +01:00
Laurent Destailleur
76a0caf116
Merge pull request #19717 from OPEN-DSI/fix-company-list-title-on-nature-of
FIX title for nature of third party in company list
2021-12-30 17:25:08 +01:00
Laurent Destailleur
c57dc82eaa
Merge pull request #19688 from atm-maxime/fix_modbuilder_numbering_model
Fix modulebuilder params for updatemask action
2021-12-30 17:07:27 +01:00
lvessiller
f16166c47c FIX title for nature of third party in company list 2021-12-30 15:35:49 +01:00
Maxime Kohlhaas
d82c1f34e0 Fix modulebuilder params for updatemask action 2021-12-25 11:33:26 +01:00
Laurent Destailleur
0a72aed3d7 Fix missing space before union 2021-12-23 13:35:38 +01:00
Laurent Destailleur
856b010a45 FIX #19651 2021-12-21 15:56:59 +01:00
Laurent Destailleur
9d6ddced56
Merge pull request #19607 from fbosman/patch-1
Update functions.lib.php
2021-12-16 17:33:13 +01:00
Laurent Destailleur
36ba158a8b
Merge pull request #19637 from atm-john/12.0_fix_get_prev_progress
FIX : test of method exist on wrong object
2021-12-16 16:49:59 +01:00
Laurent Destailleur
140cca7596
Merge pull request #19640 from atm-kevin/FIX_Holidays_Filter
FIX Holiday month report
2021-12-16 16:36:54 +01:00
kevin
a5b8d0cd4b FIX Take into consideration work leave over serveral months 2021-12-16 15:41:13 +01:00
John BOTELLA
d149596043 fix test of method exist on wrong object 2021-12-16 10:33:53 +01:00
Frans Bosman
cf05f38e54
Update functions.lib.php
Change exists to isset in price2num
2021-12-13 19:56:06 +01:00
Laurent Destailleur
57ebcf94c0
Merge pull request #19554 from atm-quentin/FIX_setoptionalfrompost
FIX set optional from post, we cant untick boolean field on product card
2021-12-08 16:27:41 +01:00
Quentin VIAL-GOUTEYRON
826bde0656 FIX set optional from post 2021-12-06 11:19:12 +01:00
Laurent Destailleur
d84d09556c Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2021-11-30 15:55:57 +01:00
Laurent Destailleur
7937a798b7
Merge pull request #18331 from marc-dll/12.0_FIX_invoice_multicurrency_discount
FIX: multicurrency: fields in discount unitialized when creating deposit
2021-11-30 14:23:37 +01:00
Laurent Destailleur
ce8312c744
Merge pull request #19464 from atm-quentin/FIX_11_TAB_INVOICE
FIX : Urgent onglet contact inaccessible depuis une facture
2021-11-30 11:45:56 +01:00
Laurent Destailleur
cf4beafb68
Merge pull request #19484 from aspangaro/12p23
FIX Option MAIN_DIRECT_STATUS_UPDATE broken. Ajax on/off not saving value in DB after updating to version >=12
2021-11-30 11:39:44 +01:00
Laurent Destailleur
9a72f147d1
Merge pull request #19500 from marc-dll/12.0_FIX_holiday_massdelete
FIX: holiday list: only mass delete if leave request is not in draft, canceled or refused, like in card
2021-11-30 11:31:59 +01:00
Marc de Lima Lucio
f5343c55c3 FIX: holiday mass deletion: correct return of record deleted 2021-11-26 18:23:31 +01:00
Marc de Lima Lucio
1361abffe5 FIX: holiday list: only mass delete if leave request is not in draft, canceled or refused, like in card 2021-11-26 18:22:31 +01:00
Alexandre SPANGARO
9d2fb782fa FIX Option MAIN_DIRECT_STATUS_UPDATE broken. Ajax on/off not saving value in DB after updating to version >=12 2021-11-25 15:41:28 +01:00
Quentin VIAL-GOUTEYRON
632147ad88 object->id is always empty 2021-11-24 12:04:18 +01:00
Marc de Lima Lucio
1129222064 FIX: user employee tab: offset in open days messes up holiday length calculation 2021-11-19 15:59:34 +01:00
Marc de Lima Lucio
7cb657c991 FIX: project timesheets: assume Saturday and Sunday are default weekend days when working days conf is empty or badly formed 2021-11-19 14:49:11 +01:00
Gauthier PC portable 024
23249751d5 FIX : reorder all lines when delete document line everywhere 2021-11-17 12:10:12 +01:00
Marc de Lima Lucio
9d234a8541 FIX: multicurrency: fields in discount unitialized when creating deposit 2021-08-03 18:32:22 +02:00
54 changed files with 308 additions and 213 deletions

View File

@ -121,9 +121,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
{
$db->begin();
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as l";
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet";
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
$resql1 = $db->query($sql1);

View File

@ -93,6 +93,7 @@ if ($conf->accounting->enabled)
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
print "<br>\n";
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><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";
@ -172,8 +173,8 @@ if ($conf->accounting->enabled)
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

View File

@ -123,9 +123,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
{
$db->begin();
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as l";
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
$resql1 = $db->query($sql1);

View File

@ -326,7 +326,7 @@ if (empty($reshook))
$object->public = GETPOST("public", 'alpha');
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
// Check if we need to also synchronize user information

View File

@ -175,7 +175,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
$object->vote = (boolean) trim($vote);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
$ret = $object->update($user);

View File

@ -154,7 +154,7 @@ if ($action == 'update' && $user->rights->asset->write)
$object->note = trim($comment);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
$ret = $object->update($user);

View File

@ -102,7 +102,7 @@ if ($action == 'update' && $user->rights->categorie->creer)
}
if (!$error && empty($object->error))
{
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
if (!$error && $object->update($user) > 0)

View File

@ -529,7 +529,7 @@ if (empty($reshook) && $action == 'update')
}
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
if (!$error) {

View File

@ -216,6 +216,8 @@ if (empty($reshook))
$result = $object->deleteline($user, $lineid);
if ($result > 0)
{
// reorder lines
$object->line_order(true);
// Define output language
$outputlangs = $langs;
$newlang = '';

View File

@ -246,7 +246,7 @@ if ($action == 'update')
if (!$error)
{
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
}
if (!$error)

View File

@ -243,6 +243,8 @@ if (empty($reshook))
$result = $object->deleteline(GETPOST('lineid'));
if ($result > 0) {
// reorder lines
$object->line_order(true);
// Define output language
$outputlangs = $langs;
$newlang = '';
@ -1668,6 +1670,11 @@ if (empty($reshook))
$discount->tva_tx = $lines[$i]->tva_tx;
$discount->fk_user = $user->id;
$discount->description = $desc;
$discount->multicurrency_subprice = abs($lines[$i]->multicurrency_subprice);
$discount->multicurrency_amount_ht = abs($lines[$i]->multicurrency_total_ht);
$discount->multicurrency_amount_tva = abs($lines[$i]->multicurrency_total_tva);
$discount->multicurrency_amount_ttc = abs($lines[$i]->multicurrency_total_ttc);
$discountid = $discount->create($user);
if ($discountid > 0) {
$result = $object->insert_discount($discountid); // This include link_to_invoice

View File

@ -118,14 +118,6 @@ elseif ($action == 'deletecontact' && $user->rights->facture->creer)
* View
*/
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl);

View File

@ -375,7 +375,7 @@ if ($modecompta == 'CREANCES-DETTES')
$_SERVER["PHP_SELF"],
"amount",
"",
$classslink,
$paramslink,
'class="right"',
$sortfield,
$sortorder

View File

@ -421,7 +421,7 @@ if (empty($reshook))
$object->roles = GETPOST("roles", 'array');
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
if (!$error)

View File

@ -1280,6 +1280,12 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
continue;
}
if ($objectclass == 'Holiday' && ! in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) {
$nbignored++;
setEventMessage($langs->trans('ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted', $objecttmp->ref));
continue;
}
if ($objectclass == "Task" && $objecttmp->hasChildren() > 0)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id;
@ -1314,7 +1320,8 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
if (!$error)
{
if ($nbok > 1) setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
else setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
elseif ($nbok > 0) setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
else setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
$db->commit();
}
else

View File

@ -80,5 +80,9 @@ if (($action == 'set') && !empty($id)) {
$format = 'int';
$object->table_element = $tablename;
$object->id = $id;
$object->fields[$field] = array('type' => $format, 'enabled' => 1);
$object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey);
}

View File

@ -2055,7 +2055,8 @@ class ExtraFields
foreach ($extralabels as $key => $value)
{
if (!empty($onlykey) && $onlykey != '@GETPOSTISSET' && $key != $onlykey) continue;
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && ! GETPOSTISSET('options_'.$key)) continue;
//when unticking boolean field, it's not set in POST
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && ! GETPOSTISSET('options_'.$key) && $this->attributes[$object->table_element]['type'][$key] != 'boolean') continue;
$key_type = $this->attributes[$object->table_element]['type'][$key];
if ($key_type == 'separate') continue;

View File

@ -346,6 +346,7 @@ class Utils
{
$handlein = popen($fullcommandclear, 'r');
$i = 0;
if ($handlein) {
while (!feof($handlein))
{
$i++; // output line number
@ -358,6 +359,7 @@ class Utils
}
pclose($handlein);
}
}
if ($compression == 'none') fclose($handle);

View File

@ -4784,7 +4784,7 @@ function price2num($amount, $rounding = '', $option = 0)
$nbofdectoround = '';
if ($rounding == 'MU') $nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_UNIT;
elseif ($rounding == 'MT') $nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_TOT;
elseif ($rounding == 'MS') $nbofdectoround = empty($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK;
elseif ($rounding == 'MS') $nbofdectoround = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK;
elseif ($rounding == 'CR') $nbofdectoround = 8;
elseif (is_numeric($rounding)) $nbofdectoround = $rounding;
//print "RR".$amount.' - '.$nbofdectoround.'<br>';

View File

@ -1937,7 +1937,7 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
if ($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)
{
$prev_progress = 0;
if (method_exists($object, 'get_prev_progress'))
if (method_exists($object->lines[$i], 'get_prev_progress'))
{
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
}

View File

@ -1235,27 +1235,31 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$pdf->SetXY($this->marge_gauche, $posy);
// Logo
$logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
if ($this->emetteur->logo)
{
if (is_readable($logo))
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) {
if ($this->emetteur->logo) {
$logodir = $conf->mycompany->dir_output;
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo)) {
$height = pdf_getHeightForLogo($logo);
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
}
else
{
} else {
$pdf->SetTextColor(200, 0, 0);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
}
}
else
{
} else {
$text = $this->emetteur->name;
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
}
}
$pdf->SetFont('', 'B', $default_font_size + 3);
$pdf->SetXY($posx, $posy);

View File

@ -1151,27 +1151,29 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetXY($this->marge_gauche, $posy);
// Logo
$logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
if ($this->emetteur->logo)
{
if (is_readable($logo))
{
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) {
if ($this->emetteur->logo) {
$logodir = $conf->mycompany->dir_output;
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
$logo = $logodir . '/logos/thumbs/' . $this->emetteur->logo_small;
} else {
$logo = $logodir . '/logos/' . $this->emetteur->logo;
}
if (is_readable($logo)) {
$height = pdf_getHeightForLogo($logo);
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
}
else
{
} else {
$pdf->SetTextColor(200, 0, 0);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
}
}
else
{
} else {
$text = $this->emetteur->name;
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
}
}
$pdf->SetFont('', 'B', $default_font_size + 3);
$pdf->SetXY($posx, $posy);

View File

@ -72,7 +72,7 @@ class DolLogsCollector extends MessagesCollector
{
global $conf;
$uselogfile = $conf->global->DEBUGBAR_USE_LOGFILE;
$uselogfile = $conf->global->DEBUGBAR_USE_LOG_FILE;
if ($uselogfile)
{

View File

@ -118,7 +118,7 @@ if ($action == 'update')
$object->modepaymentid = GETPOST('modepayment', 'int');
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
if ($object->update($user) > 0)

View File

@ -1245,13 +1245,17 @@ if ($action == 'create')
{
// Quantity to send
print '<td class="center">';
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
if (GETPOST('qtyl'.$indiceAsked, 'int')) $deliverableQty = GETPOST('qtyl'.$indiceAsked, 'int');
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (GETPOST('qtyl'.$indiceAsked, 'int')) $deliverableQty = GETPOST('qtyl'.$indiceAsked, 'int');
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="text" size="4" value="'.$deliverableQty.'">';
} else {
if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) {
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
}
print $langs->trans("NA");
}
else print $langs->trans("NA");
print '</td>';
// Stock
@ -1420,8 +1424,13 @@ if ($action == 'create')
{
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'" type="text" size="4" value="'.$deliverableQty.'">';
print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_id.'">';
} else {
if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) {
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
}
print $langs->trans("NA");
}
else print $langs->trans("NA");
print '</td>';
// Stock

View File

@ -2235,7 +2235,7 @@ class ExpenseReport extends CommonObject
$sql = "SELECT DISTINCT ur.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."user_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd";
$sql .= " WHERE ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve';
$sql .= "UNION";
$sql .= " UNION";
$sql .= " SELECT DISTINCT ugu.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup_user as ugu, ".MAIN_DB_PREFIX."usergroup_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd";
$sql .= " WHERE ugu.fk_usergroup = ur.fk_usergroup AND ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve';

View File

@ -460,13 +460,18 @@ class CommandeFournisseur extends CommonOrder
$sql .= " l.date_start, l.date_end,";
$sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
$sql .= ", pfp.rowid as fk_pfp, pfp.packaging";
$sql .= ", pfp.rowid as fk_pfp, pfp.packaging, MAX(pfp.quantity) as max_qty";
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".$this->socid;
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".((int) $this->socid);
}
$sql .= " WHERE l.fk_commande = ".$this->id;
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$sql.= " AND l.qty >= pfp.quantity ";
$sql.= " GROUP BY l.rowid HAVING max_qty = MAX(pfp.quantity) ";
}
$sql .= " ORDER BY l.rang, l.rowid";
//print $sql;
@ -3488,12 +3493,15 @@ class CommandeFournisseurLigne extends CommonOrderLine
$sql .= ' cd.date_start, cd.date_end, cd.fk_unit,';
$sql .= ' cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
$sql .= ", pfp.rowid as fk_pfp, pfp.packaging";
$sql .= ", pfp.rowid as fk_pfp, pfp.packaging, MAX(pfp.quantity) as max_qty";
$sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON cd.fk_product = pfp.fk_product and cd.ref = pfp.ref_fourn";
$sql .= ' WHERE cd.rowid = '.$rowid;
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$sql .= " AND cd.qty >= pfp.quantity GROUP BY cd.rowid HAVING max_qty = MAX(pfp.quantity)";
}
$result = $this->db->query($sql);
if ($result)
{

View File

@ -792,8 +792,7 @@ if (empty($reshook))
{
$db->rollback();
dol_print_error($db, $object->error);
exit;
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -805,6 +804,8 @@ if (empty($reshook))
$result = $object->deleteline($lineid);
if ($result > 0)
{
// reorder lines
$object->line_order(true);
// Define output language
$outputlangs = $langs;
$newlang = '';

View File

@ -501,7 +501,7 @@ $help_url = '';
// llxHeader('',$title,$help_url);
$sql = 'SELECT';
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,';
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
@ -531,11 +531,6 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON cf.fk_user_author = u.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cf.fk_projet";
// We'll need this table joined to the select in order to filter by sale
if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if ($search_user > 0)
{
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
}
$sql .= ' WHERE cf.fk_soc = s.rowid';
$sql .= ' AND cf.entity IN ('.getEntity('supplier_order').')';
if ($socid > 0) $sql .= " AND s.rowid = ".$socid;
@ -561,7 +556,15 @@ if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
if ($search_company) $sql .= natural_search('s.nom', $search_company);
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$db->escape($search_sale);
if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='supplier_order' AND tc.source='internal' AND ec.element_id = cf.rowid AND ec.fk_socpeople = ".$db->escape($search_user);
if ($search_user > 0) {
$sql .= " AND EXISTS (";
$sql .= " SELECT ec.rowid ";
$sql .= " FROM " . MAIN_DB_PREFIX . "element_contact as ec";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "c_type_contact as tc ON tc.rowid = ec.fk_c_type_contact";
$sql .= " WHERE ec.element_id = cf.rowid AND ec.fk_socpeople = " . ((int) $search_user);
$sql .= " AND tc.element = 'order_supplier' AND tc.source = 'internal'";
$sql .= ")";
}
if ($search_total_ht != '') $sql .= natural_search('cf.total_ht', $search_total_ht, 1);
if ($search_total_vat != '') $sql .= natural_search('cf.tva', $search_total_vat, 1);
if ($search_total_ttc != '') $sql .= natural_search('cf.total_ttc', $search_total_ttc, 1);

View File

@ -253,6 +253,8 @@ if (empty($reshook))
$result = $object->deleteline($lineid);
if ($result > 0)
{
// reorder lines
$object->line_order(true);
// Define output language
/*$outputlangs = $langs;
$newlang = '';

View File

@ -84,7 +84,12 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid";
$sql .= " WHERE cp.rowid > 0";
$sql .= " AND cp.statut = 3"; // Approved
$sql .= " AND (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
$sql .= " AND (";
$sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
$sql .= " OR";
// For work leave over several months
$sql .= " (date_format(cp.date_debut, '%Y-%m') < '".$db->escape($year_month)."' AND date_format(cp.date_fin, '%Y-%m') > '".$db->escape($year_month)."') ";
$sql .= " )";
$sql .= " ORDER BY u.lastname, cp.date_debut";
$resql = $db->query($sql);

View File

@ -158,10 +158,10 @@ insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,no
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'05','',1,'FLANDRE-OCCIDENTALE','Flandre-Occidentale');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'06','',1,'FLANDRE-ORIENTALE','Flandre-Orientale');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'07','',2,'HAINAUT','Hainaut');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'08','',2,'LIEGE','Liège');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'08','',2,'LIEGE','Liège');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'09','',1,'LIMBOURG','Limbourg');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'10','',2,'LUXEMBOURG','Luxembourg');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'11','',2,'NAMUR','Namur');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'11','',2,'NAMUR','Namur');
-- Provinces Italy (id=3)
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AG',315,NULL,NULL,NULL,'AGRIGENTO');

View File

@ -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_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';
create table llx_c_shipment_package_type

View File

@ -50,7 +50,7 @@ create table llx_product_fournisseur_price
import_key varchar(14), -- Import key
delivery_time_days integer,
supplier_reputation varchar(10),
packaging double(24,8) DEFAULT 1,
fk_multicurrency integer,
multicurrency_code varchar(255),
multicurrency_tx double(24,8) DEFAULT 1,

View File

@ -132,3 +132,4 @@ FreeLegalTextOnHolidays=Free text on PDF
WatermarkOnDraftHolidayCards=Watermarks on draft leave requests
HolidaysToApprove=Holidays to approve
NobodyHasPermissionToValidateHolidays=Nobody has permission to validate holidays
ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted=Leave request %s must be draft, canceled or refused to be deleted

View File

@ -75,10 +75,12 @@ if ((float) DOL_VERSION >= 6)
if ($action == 'updateMask')
{
$maskconstorder = GETPOST('maskconstorder', 'alpha');
$maskorder = GETPOST('maskorder', 'alpha');
$maskconst = GETPOST('maskconst', 'alpha');
$maskvalue = GETPOST('maskvalue', 'alpha');
if ($maskconstorder) $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
if ($maskconst) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}
if (!$res > 0) $error++;

View File

@ -68,7 +68,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstBom" value="MYMODULE_MYOBJECT_ADVANCED_MASK">';
$texte .= '<input type="hidden" name="maskconst" value="MYMODULE_MYOBJECT_ADVANCED_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("MyObject"), $langs->transnoentities("MyObject"));
@ -79,7 +79,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject
// Parametrage du prefix
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskMyObject" value="'.$conf->global->MYMODULE_MYOBJECT_ADVANCED_MASK.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskvalue" value="'.$conf->global->MYMODULE_MYOBJECT_ADVANCED_MASK.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -729,6 +730,23 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
while ($i < ($limit ? min($num, $limit) : $num)) {
$objp = $db->fetch_object($resql);
// Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) // If multilang is enabled
{
$sql = "SELECT label";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product=".$objp->rowid;
$sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'";
$sql .= " LIMIT 1";
$result = $db->query($sql);
if ($result)
{
$objtp = $db->fetch_object($result);
if (!empty($objtp->label)) $objp->produit = $objtp->label;
}
}
$userstatic->id = $objp->fk_user_author;
$userstatic->login = $objp->login;
$userstatic->lastname = $objp->lastname;

View File

@ -150,7 +150,7 @@ if ($action == 'other')
if ($value) {
$sql_test = "SELECT count(desc_fourn) 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
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";
$resql_new = $db->query($sql_new);
@ -159,15 +159,6 @@ if ($action == 'other')
$value = GETPOST('activate_useProdSupplierPackaging', 'alpha');
$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

View File

@ -1803,7 +1803,10 @@ class Product extends CommonObject
$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";
$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 ($fk_soc > 0) { $sql .= " AND pfp.fk_soc = ".$fk_soc;

View File

@ -531,11 +531,11 @@ class Productbatch extends CommonObject
$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_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 .= " AND pl.fk_product = ".$fk_product;
$sql .= " AND pl.fk_product = ".((int) $fk_product);
if ($fk_warehouse > 0) {
$sql .= " AND ps.fk_entrepot = ".$fk_warehouse;
$sql .= " AND ps.fk_entrepot = ".((int) $fk_warehouse);
}
if ($qty_min !== null) {
$sql .= " AND pb.qty > ".$qty_min;

View File

@ -182,7 +182,7 @@ if (empty($reshook))
$object->fax = GETPOST("fax");
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
if (!$error) {

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -1001,6 +1001,23 @@ if ($resql)
{
$objp = $db->fetch_object($resql);
// Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) // If multilang is enabled
{
$sql = "SELECT label";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product=".$objp->rowid;
$sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'";
$sql .= " LIMIT 1";
$result = $db->query($sql);
if ($result)
{
$objtp = $db->fetch_object($result);
if (!empty($objtp->label)) $objp->produit = $objtp->label;
}
}
$userstatic->id = $objp->fk_user_author;
$userstatic->login = $objp->login;
$userstatic->lastname = $objp->lastname;

View File

@ -620,6 +620,11 @@ $restrictviewformytask = ((!isset($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSI
// Get if user is available or not for each day
$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))
{
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);

View File

@ -521,6 +521,11 @@ $startday = dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['
// Get if user is available or not for each day
$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))
{
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
@ -530,7 +535,6 @@ if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
$numendworkingday = $tmparray[1];
}
}
for ($idw = 0; $idw < 7; $idw++)
{
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0

View File

@ -276,7 +276,7 @@ if (empty($reshook))
$object->usage_organize_event = (GETPOST('usage_organize_event', 'alpha') == 'on' ? 1 : 0);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
}

View File

@ -102,7 +102,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->projet->creer)
$object->progress = $_POST['progress'];
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
if (!$error)

View File

@ -211,7 +211,7 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
$message .= ($conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody'))."\n\n";
$message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket')."\n";
$url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
$url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
$infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', '<a href="'.$url_public_ticket.'">'.$object->track_id.'</a>')."\n";
$infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl')."\n\n";

View File

@ -155,7 +155,7 @@ if (empty($reshook))
$object->country_id = $country_id;
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -985,7 +985,9 @@ if (!empty($arrayfields['s.idprof4']['checked'])) print_liste_field_titre
if (!empty($arrayfields['s.idprof5']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId5Short"), $textprofid[4], 1, 0), $_SERVER["PHP_SELF"], "s.idprof5", "", $param, '', $sortfield, $sortorder, 'nowrap ');
if (!empty($arrayfields['s.idprof6']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId6Short"), $textprofid[4], 1, 0), $_SERVER["PHP_SELF"], "s.idprof6", "", $param, '', $sortfield, $sortorder, 'nowrap ');
if (!empty($arrayfields['s.tva_intra']['checked'])) print_liste_field_titre($arrayfields['s.tva_intra']['label'], $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder, 'nowrap ');
if (!empty($arrayfields['customerorsupplier']['checked'])) print_liste_field_titre(''); // type of customer
if (!empty($arrayfields['customerorsupplier']['checked'])) {
print_liste_field_titre($arrayfields['customerorsupplier']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center '); // type of customer
}
if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'], $_SERVER["PHP_SELF"], "s.fk_prospectlevel", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'], $_SERVER["PHP_SELF"], "s.fk_stcomm", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['s2.nom']['checked'])) print_liste_field_titre($arrayfields['s2.nom']['label'], $_SERVER["PHP_SELF"], "s2.nom", "", $param, '', $sortfield, $sortorder, 'center ');

View File

@ -327,7 +327,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
$holiday->id = $objp->rowid;
$holiday->ref = $objp->rowid;
$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 '</td><td class="right" width="80px">'.dol_print_date($db->jdate($objp->date_debut), 'day')."</td>\n";

View File

@ -440,7 +440,7 @@ if (empty($reshook)) {
}
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}
@ -1259,7 +1259,7 @@ if ($action == 'create' || $action == 'adduserldap')
// Signature
print '<tr><td class="tdtop">'.$langs->trans("Signature").'</td>';
print '<td>';
print '<td class="wordbreak">';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%');
print $doleditor->Create(1);
@ -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))
{
@ -1917,7 +1917,7 @@ else
}
}
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.'&amp;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>';
}
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.'&amp;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>';
}
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.'&amp;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>';
@ -1949,13 +1949,13 @@ else
// Enable user
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.'&amp;action=enable">'.$langs->trans("Reactivate").'</a></div>';
}
// Disable user
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&amp;id='.$object->id.'">'.$langs->trans("DisableUser").'</a></div>';
}
@ -1968,7 +1968,7 @@ else
}
// Delete
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
{

View File

@ -219,7 +219,7 @@ if (empty($reshook)) {
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none')));
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) $object->entity = 0;

View File

@ -185,7 +185,7 @@ $refname = basename(dirname($original_file)."/");
// Security check
if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart', 0, 0, 1);
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname);
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $user, $refname);
$accessallowed = $check_access['accessallowed'];
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name