Skip to content

Commit e350886

Browse files
committed
Merge branch '22.0' of [email protected]:Dolibarr/dolibarr.git into develop
2 parents 880eaa4 + 78316a5 commit e350886

File tree

22 files changed

+126
-68
lines changed

22 files changed

+126
-68
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "CI-RELEASE"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
trigger-docker:
9+
steps:
10+
- name: Generate a token
11+
id: generate-token
12+
uses: actions/create-github-app-token@v2
13+
with:
14+
app-id: ${{ vars.RELEASE_DOCKER_ID }}
15+
private-key: ${{ secrets.RELEASE_DOCKER_SECRET }}
16+
17+
- uses: peter-evans/repository-dispatch@v4
18+
with:
19+
token: ${{ steps.generate-token.outputs.token }}
20+
repository: Dolibarr/dolibarr-docker
21+
event-type: new-release
22+
client-payload: '{"version": "${{ github.event.release.tag_name }}"}'

htdocs/comm/propal/card.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Copyright (C) 2023 William Mead <[email protected]>
2020
* Copyright (C) 2024-2025 MDW <[email protected]>
2121
* Copyright (C) 2024 Alexandre Spangaro <[email protected]>
22+
* Copyright (C) 2025 Benjamin Falière <[email protected]>
2223
*
2324
* This program is free software; you can redistribute it and/or modify
2425
* it under the terms of the GNU General Public License as published by
@@ -1956,6 +1957,12 @@
19561957

19571958
$type = $product->type;
19581959
$price_base_type = $product->price_base_type;
1960+
1961+
// If base type TTc, we change pu value to define the TTC one
1962+
if ($price_base_type == 'TTC') {
1963+
$pu = $pu_ttc;
1964+
}
1965+
19591966
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
19601967

19611968
$price_min = $product->price_min;
@@ -3521,22 +3528,23 @@
35213528
if (empty($reshook)) {
35223529
if ($action != 'editline') {
35233530
// Subtotal
3524-
if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3531+
if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals')
3532+
&& (getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element)) || getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element)))) {
35253533
$langs->load('subtotals');
35263534

35273535
$url_button = array();
35283536

35293537
$url_button[] = array(
35303538
'lang' => 'subtotals',
3531-
'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3539+
'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
35323540
'perm' => (bool) $usercancreate,
35333541
'label' => $langs->trans('AddTitleLine'),
35343542
'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
35353543
);
35363544

35373545
$url_button[] = array(
35383546
'lang' => 'subtotals',
3539-
'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3547+
'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
35403548
'perm' => (bool) $usercancreate,
35413549
'label' => $langs->trans('AddSubtotalLine'),
35423550
'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()

htdocs/commande/card.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3450,22 +3450,23 @@
34503450
}
34513451

34523452
// Subtotal
3453-
if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3453+
if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals')
3454+
&& (getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element)) || getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element)))) {
34543455
$langs->load('subtotals');
34553456

34563457
$url_button = array();
34573458

34583459
$url_button[] = array(
34593460
'lang' => 'subtotals',
3460-
'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT),
3461+
'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
34613462
'perm' => (bool) $usercancreate,
34623463
'label' => $langs->trans('AddTitleLine'),
34633464
'url' => '/commande/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
34643465
);
34653466

34663467
$url_button[] = array(
34673468
'lang' => 'subtotals',
3468-
'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT),
3469+
'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
34693470
'perm' => (bool) $usercancreate,
34703471
'label' => $langs->trans('AddSubtotalLine'),
34713472
'url' => '/commande/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()

htdocs/compta/facture/card-rec.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,22 +2076,23 @@ function js_recalculate_revenuestamp(){
20762076
);
20772077

20782078
// Subtotal
2079-
if (empty($object->suspended) && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
2079+
if (empty($object->suspended) && isModEnabled('subtotals')
2080+
&& (getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element)) || getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element)))) {
20802081
$langs->load("subtotals");
20812082

20822083
$url_button = array();
20832084

20842085
$url_button[] = array(
20852086
'lang' => 'subtotals',
2086-
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT),
2087+
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
20872088
'perm' => (bool) $usercancreate,
20882089
'label' => $langs->trans('AddTitleLine'),
20892090
'url' => '/compta/facture/card-rec.php?id='.$object->id.'&action=add_title_line&token='.newToken()
20902091
);
20912092

20922093
$url_button[] = array(
20932094
'lang' => 'subtotals',
2094-
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT),
2095+
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
20952096
'perm' => (bool) $usercancreate,
20962097
'label' => $langs->trans('AddSubtotalLine'),
20972098
'url' => '/compta/facture/card-rec.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()

htdocs/compta/facture/card.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6560,22 +6560,23 @@ function js_recalculate_revenuestamp(){
65606560
}
65616561

65626562
// Subtotal
6563-
if ($object->status == Facture::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
6563+
if ($object->status == Facture::STATUS_DRAFT && isModEnabled('subtotals')
6564+
&& (getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element)) || getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element)))) {
65646565
$langs->load("subtotals");
65656566

65666567
$url_button = array();
65676568

65686569
$url_button[] = array(
65696570
'lang' => 'subtotals',
6570-
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT),
6571+
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
65716572
'perm' => (bool) $usercancreate,
65726573
'label' => $langs->trans('AddTitleLine'),
65736574
'url' => '/compta/facture/card.php?facid='.$object->id.'&action=add_title_line&token='.newToken()
65746575
);
65756576

65766577
$url_button[] = array(
65776578
'lang' => 'subtotals',
6578-
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT),
6579+
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
65796580
'perm' => (bool) $usercancreate,
65806581
'label' => $langs->trans('AddSubtotalLine'),
65816582
'url' => '/compta/facture/card.php?facid='.$object->id.'&action=add_subtotal_line&token='.newToken()

htdocs/contrat/class/api_contracts.class.php

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function get($id, $properties = '', $withLines = true)
8484
}
8585

8686
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
87-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
87+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
8888
}
8989

9090
$this->contract->fetchObjectLinked();
@@ -175,7 +175,6 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
175175
$sql .= $this->db->plimit($limit + 1, $offset);
176176
}
177177

178-
dol_syslog("API Rest request");
179178
$result = $this->db->query($sql);
180179

181180
if ($result) {
@@ -234,8 +233,19 @@ public function post($request_data = null)
234233
{
235234
global $conf;
236235
if (!DolibarrApiAccess::$user->hasRight('contrat', 'creer')) {
237-
throw new RestException(403, "Insufficient rights");
236+
throw new RestException(403, "Missing permission: Create/modify contracts/subscriptions");
238237
}
238+
239+
$socid = (int) $request_data['socid'];
240+
$thirdpartytmp = new Societe($this->db);
241+
$thirdparty_result = $thirdpartytmp->fetch($socid);
242+
if ($thirdparty_result < 1) {
243+
throw new RestException(404, 'Thirdparty with id='.$socid.' not found or not allowed');
244+
}
245+
if (!DolibarrApi::_checkAccessToResource('societe', $thirdpartytmp->id)) {
246+
throw new RestException(404, 'Thirdparty with id='.$thirdpartytmp->id.' not found or not allowed');
247+
}
248+
239249
// Check mandatory fields
240250
$result = $this->_validate($request_data);
241251

@@ -308,7 +318,7 @@ public function getLines($id, $sortfield = "d.rowid", $sortorder = 'ASC', $limit
308318
}
309319

310320
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
311-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
321+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
312322
}
313323

314324
$obj_ret = [];
@@ -340,7 +350,6 @@ public function getLines($id, $sortfield = "d.rowid", $sortorder = 'ASC', $limit
340350
$sql .= $this->db->plimit($limit + 1, $offset);
341351
}
342352

343-
dol_syslog("API Rest request");
344353
$result = $this->db->query($sql);
345354
if ($result) {
346355
$num = $this->db->num_rows($result);
@@ -400,7 +409,7 @@ public function postLine($id, $request_data = null)
400409
}
401410

402411
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
403-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
412+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
404413
}
405414

406415
$request_data = (object) $request_data;
@@ -460,7 +469,7 @@ public function putLine($id, $lineid, $request_data = null)
460469
}
461470

462471
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
463-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
472+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
464473
}
465474

466475
$request_data = (object) $request_data;
@@ -611,7 +620,7 @@ public function activateLine($id, $lineid, $datestart, $dateend = null, $comment
611620
}
612621

613622
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
614-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
623+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
615624
}
616625

617626
$updateRes = $this->contract->active_line(DolibarrApiAccess::$user, $lineid, (int) $datestart, $dateend, $comment);
@@ -652,7 +661,7 @@ public function unactivateLine($id, $lineid, $datestart, $comment = null)
652661
}
653662

654663
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
655-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
664+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
656665
}
657666

658667
$updateRes = $this->contract->close_line(DolibarrApiAccess::$user, $lineid, (int) $datestart, $comment);
@@ -692,7 +701,7 @@ public function deleteLine($id, $lineid)
692701
}
693702

694703
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
695-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
704+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
696705
}
697706

698707
// TODO Check the lineid $lineid is a line of object
@@ -727,13 +736,24 @@ public function put($id, $request_data = null)
727736
if ($id == 0) {
728737
throw new RestException(400, 'No contract with id=0 can exist');
729738
}
739+
730740
$result = $this->contract->fetch($id);
731741
if (!$result) {
732742
throw new RestException(404, 'Contrat not found');
733743
}
734744

745+
$old_socid = $this->contract->socid;
746+
$oldthirdpartytmp = new Societe($this->db);
747+
$old_thirdparty_result = $oldthirdpartytmp->fetch($old_socid);
748+
if ($old_thirdparty_result < 1) {
749+
throw new RestException(404, 'Thirdparty with id='.$old_socid.' not found or not allowed');
750+
}
751+
if (!DolibarrApi::_checkAccessToResource('societe', $old_socid)) {
752+
throw new RestException(403, 'Access to old thirdparty='.$old_socid.' is not allowed for login '.DolibarrApiAccess::$user->login);
753+
}
754+
735755
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
736-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
756+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
737757
}
738758
foreach ($request_data as $field => $value) {
739759
if ($field == 'id') {
@@ -763,6 +783,18 @@ public function put($id, $request_data = null)
763783
continue;
764784
}
765785

786+
if ($field == 'socid') {
787+
$new_socid = (int) $value;
788+
$loopthirdpartytmp = new Societe($this->db);
789+
$new_thirdparty_result = $loopthirdpartytmp->fetch($new_socid);
790+
if ($new_thirdparty_result < 1) {
791+
throw new RestException(404, 'Thirdparty with id='.$new_socid.' not found or not allowed');
792+
}
793+
if (!DolibarrApi::_checkAccessToResource('societe', $new_socid)) {
794+
throw new RestException(403, 'Access to new thirdparty='.$new_socid.' is not allowed for login '.DolibarrApiAccess::$user->login);
795+
}
796+
}
797+
766798
$this->contract->$field = $this->_checkValForAPI($field, $value, $this->contract);
767799
}
768800

@@ -790,7 +822,7 @@ public function put($id, $request_data = null)
790822
public function delete($id)
791823
{
792824
if (!DolibarrApiAccess::$user->hasRight('contrat', 'supprimer')) {
793-
throw new RestException(403);
825+
throw new RestException(403, 'Missing permission: Delete contracts/subscriptions');
794826
}
795827
if ($id == 0) {
796828
throw new RestException(400, 'No contract with id=0 can exist');
@@ -801,7 +833,7 @@ public function delete($id)
801833
}
802834

803835
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
804-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
836+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
805837
}
806838

807839
if (!$this->contract->delete(DolibarrApiAccess::$user)) {
@@ -854,7 +886,7 @@ public function validate($id, $notrigger = 0)
854886
}
855887

856888
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
857-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
889+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
858890
}
859891

860892
$result = $this->contract->validate(DolibarrApiAccess::$user, '', $notrigger);
@@ -911,7 +943,7 @@ public function close($id, $notrigger = 0)
911943
}
912944

913945
if (!DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) {
914-
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
946+
throw new RestException(403, 'Access to this contract is not allowed for login '.DolibarrApiAccess::$user->login);
915947
}
916948

917949
$result = $this->contract->closeAll(DolibarrApiAccess::$user, $notrigger);

htdocs/core/lib/functions.lib.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto', $saverestore = '')
12611261
if ($hourTime === 'getpost' || $hourTime === 'getpostend') {
12621262
$hour = (GETPOSTISSET($prefix . 'hour') && GETPOSTINT($prefix . 'hour') >= 0) ? GETPOSTINT($prefix . 'hour') : ($hourTime === 'getpostend' ? 23 : 0);
12631263
$minute = (GETPOSTISSET($prefix . 'min') && GETPOSTINT($prefix . 'min') >= 0) ? GETPOSTINT($prefix . 'min') : ($hourTime === 'getpostend' ? 59 : 0);
1264-
$second = (GETPOSTISSET($prefix . 'second') && GETPOSTINT($prefix . 'second') >= 0) ? GETPOSTINT($prefix . 'second') : ($hourTime === 'getpostend' ? 59 : 0);
1264+
$second = (GETPOSTISSET($prefix . 'sec') && GETPOSTINT($prefix . 'sec') >= 0) ? GETPOSTINT($prefix . 'sec') : ($hourTime === 'getpostend' ? 59 : 0);
12651265
} elseif (preg_match('/^(\d\d):(\d\d):(\d\d)$/', $hourTime, $m)) {
12661266
$hour = intval($m[1]);
12671267
$minute = intval($m[2]);
@@ -16827,8 +16827,8 @@ function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto'
1682716827
if ($hourTime === 'getpost' || ($timestamp !== null && dol_print_date($timestamp, '%H:%M:%S') !== '00:00:00')) {
1682816828
$TParam = array_merge($TParam, array(
1682916829
$prefix . 'hour' => intval(dol_print_date($timestamp, '%H')),
16830-
$prefix . 'minute' => intval(dol_print_date($timestamp, '%M')),
16831-
$prefix . 'second' => intval(dol_print_date($timestamp, '%S'))
16830+
$prefix . 'min' => intval(dol_print_date($timestamp, '%M')),
16831+
$prefix . 'sec' => intval(dol_print_date($timestamp, '%S'))
1683216832
));
1683316833
}
1683416834

htdocs/core/lib/security.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,14 +1021,14 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
10211021
$checkonentitydone = 0;
10221022

10231023
// Array to define rules of checks to do
1024-
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales', 'knowledgemanagement'); // Test on entity only (Objects with no link to company)
1024+
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales', 'knowledgemanagement', 'stock'); // Test on entity only (Objects with no link to company)
10251025
$checksoc = array('societe'); // Test for object Societe
10261026
$checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
10271027
$checkproject = array('projet', 'project'); // Test for project object
10281028
$checktask = array('projet_task', 'project_task'); // Test for task object
10291029
$checkhierarchy = array('expensereport', 'holiday', 'hrm'); // check permission among the hierarchy of user
10301030
$checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null)
1031-
$nocheck = array('barcode', 'stock', 'webhook'); // No test
1031+
$nocheck = array('barcode', 'webhook'); // No test
10321032

10331033
//$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...).
10341034

htdocs/fichinter/card.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Copyright (C) 2023-2024 William Mead <[email protected]>
1414
* Copyright (C) 2024-2025 MDW <[email protected]>
1515
* Copyright (C) 2024 Alexandre Spangaro <[email protected]>
16+
* Copyright (C) 2025 Pierre Ardoin <[email protected]>
1617
*
1718
* This program is free software; you can redistribute it and/or modify
1819
* it under the terms of the GNU General Public License as published by

htdocs/fourn/class/fournisseur.orderline.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ public function insert($notrigger = 0)
359359
} else {
360360
$sql .= "null,";
361361
}
362-
$sql .= "'".$this->db->escape((string) $this->product_type)."',";
363-
$sql .= ((int) $this->special_code) . ",";
362+
$sql .= ((int) $this->product_type).",";
363+
$sql .= ((int) $this->special_code).",";
364364
$sql .= "'".$this->db->escape((string) $this->rang)."',";
365365
$sql .= "'".$this->db->escape((string) $this->qty)."', ";
366366
$sql .= " ".(empty($this->vat_src_code) ? "''" : "'".$this->db->escape((string) $this->vat_src_code)."'").",";

0 commit comments

Comments
 (0)