Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions htdocs/comm/propal/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Copyright (C) 2024-2025 MDW <[email protected]>
* Copyright (C) 2024 Alexandre Spangaro <[email protected]>
* Copyright (C) 2025 Benjamin Falière <[email protected]>
* Copyright (C) 2025 Anthony Berton <[email protected]>
*
* 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
Expand Down Expand Up @@ -159,6 +160,8 @@
}

$price_base_type = null;
$shipping_method_id = null;
$warehouse_id = null;

// Security check
if (!empty($user->socid)) {
Expand Down Expand Up @@ -2285,7 +2288,7 @@
$mode_reglement_id = empty($soc->mode_reglement_id) ? $mode_reglement_id : $soc->mode_reglement_id;
$fk_account = empty($soc->fk_account) ? $fk_account : $soc->fk_account;
$shipping_method_id = $soc->shipping_method_id;
$warehouse_id = $soc->fk_warehouse;
// $warehouse_id = $soc->fk_warehouse;
$remise_percent = $soc->remise_percent;

if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) {
Expand Down Expand Up @@ -2354,8 +2357,6 @@
// Third party
print '<tr class="field_socid">';
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans('Customer').'</td>';
$shipping_method_id = 0;
$warehouse_id = 0;
if ($socid > 0) {
print '<td class="valuefieldcreate">';
print $soc->getNomUrl(1, 'customer');
Expand All @@ -2364,7 +2365,6 @@
if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
$shipping_method_id = $soc->shipping_method_id;
}
//$warehouse_id = $soc->warehouse_id;
} else {
print '<td class="valuefieldcreate">';
$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
Expand Down Expand Up @@ -2410,6 +2410,9 @@
}

$newdatepropal = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');
if (empty($newdatepropal)) {
$newdatepropal = dol_now();
}
// Date
print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">'.$langs->trans('DatePropal').'</td><td class="valuefieldcreate">';
print img_picto('', 'action', 'class="pictofixedwidth"');
Expand Down Expand Up @@ -2462,7 +2465,7 @@
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">';
print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');

Check warning on line 2468 in htdocs/comm/propal/card.php

View workflow job for this annotation

GitHub Actions / phan / Run phan

card.php: PhanTypeMismatchArgumentNullable: Argument 1 ($selected) is $warehouse_id of type ?0|?int|?non-zero-int|?string but \FormProduct::selectWarehouses() takes ''|'-1'|'-2'|'ifone'|'ifonenodefault'|int|int[]|string defined at htdocs/product/class/html.formproduct.class.php:303 (expected type to be non-nullable)
print '</td></tr>';
}

Expand Down
Loading