Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sorting linked objects by creation date and type #399

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
30ec5df
FIX TakePOS receipt preview in admin #25648
Max13 Aug 19, 2023
658b3cc
Merge pull request #25651 from Max13/16.0
eldy Aug 21, 2023
ebed221
FIX reception odt dir output path
lvessiller-opendsi Aug 23, 2023
e9273ea
Fix javascript error
eldy Aug 23, 2023
c065675
FIX Bad calculation of localtax when price_base_type not defined.
eldy Aug 23, 2023
e179660
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Aug 23, 2023
e52bde9
Fix php 5.6 compat broken
eldy Aug 23, 2023
5047fc2
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Aug 23, 2023
4ae0e6e
Merge branch '17.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Aug 23, 2023
a8ac1f4
Merge pull request #25659 from Easya-Solutions/14.0_fix-reception-odt…
eldy Aug 24, 2023
4f3b090
sorting linked objects by creation date and type
samifilali Aug 25, 2023
3b00c76
FIX avoid php8 warnings
hregis Aug 25, 2023
9b16c56
Fix warning
eldy Aug 26, 2023
9e3312b
Merge pull request #25684 from hregis/fix_extrafield
eldy Aug 26, 2023
4302a6b
Fix empty on getDolGlobal
eldy Aug 27, 2023
459e3a5
Merge branch '17.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Aug 27, 2023
3b6b966
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Aug 27, 2023
5c03db3
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Aug 27, 2023
cd960d3
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Aug 27, 2023
a38e779
add total for contrats
samifilali Aug 28, 2023
bac3c36
Fix warning
eldy Aug 28, 2023
ce09a59
sort linkedObjectBlock in html.form.class to factorize
samifilali Aug 28, 2023
b3b852b
delete empty line
samifilali Aug 29, 2023
9be43d5
delete empty line
samifilali Aug 29, 2023
f82331b
Delete linkedobjectblock.tpl.php
samifilali Aug 29, 2023
3413794
delete empty line
samifilali Aug 29, 2023
03cc195
Merge branch '17.0_FIX_sorting_objects_linked' of github.com:atm-sami…
samifilali Aug 29, 2023
36ec0b3
delete empty lines
samifilali Aug 29, 2023
f058154
delete empty lines
samifilali Aug 29, 2023
9eb13e1
Merge branch '17.0' of github.com:ATM-Consulting/dolibarr into 17.0_F…
samifilali Aug 30, 2023
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
2 changes: 1 addition & 1 deletion htdocs/admin/mails.php
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ function change_smtp_auth_method() {
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
// Force e-mail recipient
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO');
if (!empty(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) {
if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) {
if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) {
print img_warning($langs->trans("ErrorBadEMail"));
} else {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@

// Method
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
$text = empty(getDolGlobalString('MAIN_SMS_SENDMODE')) ? '' : $listofmethods[getDolGlobalString('MAIN_SMS_SENDMODE')];
$text = getDolGlobalString('MAIN_SMS_SENDMODE') ? $listofmethods[getDolGlobalString('MAIN_SMS_SENDMODE')] : '';
if (empty($text)) {
$text = $langs->trans("Undefined").' '.img_warning();
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/ticket_public.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
// Check if email exists
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailMustExist").'</td>';
print '<td class="left">';
if (empty(getDolGlobalInt('TICKET_EMAIL_MUST_EXISTS'))) {
if (!getDolGlobalInt('TICKET_EMAIL_MUST_EXISTS')) {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
} else {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
Expand All @@ -334,7 +334,7 @@
/*
print '<tr class="oddeven"><td>'.$langs->trans("TicketCreateThirdPartyWithContactIfNotExist").'</td>';
print '<td class="left">';
if (empty(getDolGlobalInt('TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST'))) {
if (!getDolGlobalInt('TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST')) {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
} else {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/asset/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
echo '</td>';
echo "</tr>\n";
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
echo '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : '').'">';
echo '<td>'.$langs->trans("Total").'</td>';
echo '<td></td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
print '<td class="linkedcol-action right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
print "</tr>\n";
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
print '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : '').'">';
print '<td>'.$langs->trans("Total").'</td>';
print '<td></td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
echo '</td>';
echo "</tr>\n";
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
echo '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : '').'">';
echo '<td>'.$langs->trans("Total").'</td>';
echo '<td></td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/card-rec.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@
$pu_ht = $datapriceofproduct['pu_ht'];
$pu_ttc = $datapriceofproduct['pu_ttc'];
$price_min = $datapriceofproduct['price_min'];
$price_base_type = $datapriceofproduct['price_base_type'];
$price_base_type = empty($datapriceofproduct['price_base_type']) ? 'HT' : $datapriceofproduct['price_base_type'];
$tva_tx = $datapriceofproduct['tva_tx'];
$tva_npr = $datapriceofproduct['tva_npr'];

Expand Down
3 changes: 1 addition & 2 deletions htdocs/compta/facture/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -2161,8 +2161,7 @@
$pu_ttc = $datapriceofproduct['pu_ttc'];
$price_min = $datapriceofproduct['price_min'];
$price_min_ttc = (isset($datapriceofproduct['price_min_ttc'])) ? $datapriceofproduct['price_min_ttc'] : null;
$price_base_type = $datapriceofproduct['price_base_type'];

$price_base_type = empty($datapriceofproduct['price_base_type']) ? 'HT' : $datapriceofproduct['price_base_type'];
$tva_tx = $datapriceofproduct['tva_tx'];
$tva_npr = $datapriceofproduct['tva_npr'];

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
print '<td class="linkedcol-action right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
print "</tr>\n";
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
print '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : '').'">';
print '<td>'.$langs->trans("Total").'</td>';
print '<td></td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</tr>
<?php
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
?>
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
<td><?php echo $langs->trans("Total"); ?></td>
Expand Down
12 changes: 12 additions & 0 deletions htdocs/contrat/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,16 @@
<?php
}

if (count($linkedObjectBlock)) {
print '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : '').'">';
print '<td>'.$langs->trans("Total").'</td>';
print '<td></td>';
print '<td class="center"></td>';
print '<td class="center"></td>';
print '<td class="right">'.price($total).'</td>';
print '<td class="right"></td>';
print '<td class="right"></td>';
print '</tr>';
}

print "<!-- END PHP TEMPLATE -->\n";
1 change: 1 addition & 0 deletions htdocs/core/class/html.form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8773,6 +8773,7 @@ public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleI
}

global $linkedObjectBlock;
usort($objects, function ($a, $b) { return $b->id - $a->id; });
$linkedObjectBlock = $objects;

// Output template part (modules that overwrite templates must declare this into descriptor)
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/lib/admin.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1330,14 +1330,14 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab

// We discard modules according to features level (PS: if module is activated we always show it)
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
if ($objMod->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && empty(getDolGlobalString($const_name))) {
if ($objMod->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && !getDolGlobalString($const_name)) {
$modulequalified = 0;
}
if ($objMod->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && empty(getDolGlobalString($const_name))) {
if ($objMod->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && !getDolGlobalString($const_name)) {
$modulequalified = 0;
}
//If module is not activated disqualified
if (empty(getDolGlobalString($const_name))) {
// If module is not activated disqualified
if (!getDolGlobalString($const_name)) {
$modulequalified = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/invoice.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function invoice_admin_prepare_head()
$head[$h][2] = 'attributeslinesrec';
$h++;

if (!empty($conf->global->INVOICE_USE_SITUATION)) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable
if (getDolGlobalInt('INVOICE_USE_SITUATION') > 0) { // Warning, implementation with value 1 is seriously bugged and a new one not compatible is expected to become stable
$head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
$head[$h][1] = $langs->trans("InvoiceSituation");
$head[$h][2] = 'situation';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails

$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));

if ($conf->reception->dir_output."/reception") {
if ($conf->reception->dir_output) {
// If $object is id instead of object
if (!is_object($object)) {
$id = $object;
Expand All @@ -253,7 +253,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails

$object->fetch_thirdparty();

$dir = $conf->reception->dir_output."/reception";
$dir = !empty($conf->reception->multidir_output[$object->entity]) ? $conf->reception->multidir_output[$object->entity] : $conf->reception->dir_output;
$objectref = dol_sanitizeFileName($object->ref);
if (!preg_match('/specimen/i', $objectref)) {
$dir .= "/".$objectref;
Expand Down Expand Up @@ -426,7 +426,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
$linenumber = 0;
foreach ($object->lines as $line) {
$linenumber++;
$tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs);
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/objectline_create.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ function(data) {
}
options += '<option value="'+this.id+'" price="'+this.price+'">'+this.label+'</option>';
});
options += '<option value="inputprice" price="'+defaultprice+'"><?php echo $langs->trans("InputPrice").'...'; ?></option>';
options += '<option value="inputprice" price="'+defaultprice+'"><?php echo dol_escape_js($langs->trans("InputPrice").'...'); ?></option>';

console.log("finally selected defaultkey="+defaultkey+" defaultprice for buying price="+defaultprice);

Expand Down
2 changes: 1 addition & 1 deletion htdocs/don/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
print '<td class="right">'.$objectlink->getLibStatut(3).'</td>';
print '</tr>';

if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
?>
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
<td><?php echo $langs->trans("Total"); ?></td>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expedition/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</tr>
<?php
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
?>
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
<td><?php echo $langs->trans("Total"); ?></td>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</tr>
<?php
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
?>
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
<td><?php echo $langs->trans("Total"); ?></td>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/facture/card-rec.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@
$pu_ht = $datapriceofproduct['pu_ht'];
$pu_ttc = $datapriceofproduct['pu_ttc'];
$price_min = $datapriceofproduct['price_min'];
$price_base_type = $datapriceofproduct['price_base_type'];
$price_base_type = empty($datapriceofproduct['price_base_type']) ? 'HT' : $datapriceofproduct['price_base_type'];
$tva_tx = $datapriceofproduct['tva_tx'];
$tva_npr = $datapriceofproduct['tva_npr'];

Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</tr>
<?php
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
?>
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
<td><?php echo $langs->trans("Total"); ?></td>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/knowledgemanagement/knowledgerecord_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
if (!empty($moreforfilter)) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
$parameters = array('type'=>$type);
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
Expand Down
18 changes: 10 additions & 8 deletions htdocs/product/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,18 @@
if ($result < 0) {
dol_print_error($db, $object->error, $object->errors);
}
$entity = (!empty($object->entity) ? $object->entity : $conf->entity);
if (isModEnabled("product")) {
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
$upload_dir = $conf->product->multidir_output[$entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
} elseif (isModEnabled("service")) {
$upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
$upload_dir = $conf->service->multidir_output[$entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
}

if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { // For backward compatiblity, we scan also old dirs
if (isModEnabled("product")) {
$upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
$upload_dirold = $conf->product->multidir_output[$entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
} else {
$upload_dirold = $conf->service->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
$upload_dirold = $conf->service->multidir_output[$entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
}
}
}
Expand Down Expand Up @@ -497,10 +498,11 @@
if (!$error) {
$units = GETPOST('units', 'int');

$object->ref = $ref;
$object->label = GETPOST('label', $label_security_check);
$object->price_base_type = GETPOST('price_base_type', 'aZ09');
$object->mandatory_period = !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0;
$object->entity = $conf->entity;
$object->ref = $ref;
$object->label = GETPOST('label', $label_security_check);
$object->price_base_type = GETPOST('price_base_type', 'aZ09');
$object->mandatory_period = !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0;
if ($object->price_base_type == 'TTC') {
$object->price_ttc = GETPOST('price');
} else {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/class/product.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ public function create($user, $notrigger = 0)
$sql .= ", mandatory_period";
$sql .= ") VALUES (";
$sql .= "'".$this->db->idate($now)."'";
$sql .= ", ".((int) $conf->entity);
$sql .= ", ".(!empty($this->entity) ? (int) $this->entity : (int) $conf->entity);
$sql .= ", '".$this->db->escape($this->ref)."'";
$sql .= ", ".(!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null");
$sql .= ", ".price2num($price_min_ht);
Expand Down
3 changes: 2 additions & 1 deletion htdocs/reception/class/reception.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public function fetch($id, $ref = '', $ref_ext = '')
return -1;
}

$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_supplier, e.ref_ext, e.fk_user_author, e.fk_statut";
$sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_supplier, e.ref_ext, e.fk_user_author, e.fk_statut";
$sql .= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height";
$sql .= ", e.date_reception as date_reception, e.model_pdf, e.date_delivery";
$sql .= ", e.fk_shipping_method, e.tracking_number";
Expand Down Expand Up @@ -410,6 +410,7 @@ public function fetch($id, $ref = '', $ref_ext = '')
$obj = $this->db->fetch_object($result);

$this->id = $obj->rowid;
$this->entity = $obj->entity;
$this->ref = $obj->ref;
$this->socid = $obj->socid;
$this->ref_supplier = $obj->ref_supplier;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/reception/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</tr>
<?php
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
?>
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
<td><?php echo $langs->trans("Total"); ?></td>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</tr>
<?php
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
?>
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
<td><?php echo $langs->trans("Total"); ?></td>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/takepos/invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ function fail($message)
$price = $datapriceofproduct['pu_ht'];
$price_ttc = $datapriceofproduct['pu_ttc'];
//$price_min = $datapriceofproduct['price_min'];
$price_base_type = $datapriceofproduct['price_base_type'];
$price_base_type = empty($datapriceofproduct['price_base_type']) ? 'HT' : $datapriceofproduct['price_base_type'];
$tva_tx = $datapriceofproduct['tva_tx'];
$tva_npr = $datapriceofproduct['tva_npr'];

Expand Down
20 changes: 10 additions & 10 deletions htdocs/takepos/receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@
<br>
<p class="left">
<?php
$constFreeText = 'TAKEPOS_HEADER'.$_SESSION['takeposterminal'];
if (!empty($conf->global->TAKEPOS_HEADER) || getDolGlobalString($constFreeText)) {
$constFreeText = 'TAKEPOS_HEADER'.(empty($_SESSION['takeposterminal']) ? '0' : $_SESSION['takeposterminal']);
if (getDolGlobalString('TAKEPOS_HEADER') || getDolGlobalString($constFreeText)) {
$newfreetext = '';
$substitutionarray = getCommonSubstitutionArray($langs);
if (!empty($conf->global->TAKEPOS_HEADER)) {
$newfreetext .= make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
if (getDolGlobalString('TAKEPOS_HEADER')) {
$newfreetext .= make_substitutions(getDolGlobalString('TAKEPOS_HEADER'), $substitutionarray);
}
if (getDolGlobalString($constFreeText)) {
$newfreetext .= make_substitutions(getDolGlobalString($constFreeText), $substitutionarray);
Expand Down Expand Up @@ -336,15 +336,15 @@
<br>
<br>
<?php
$constFreeText = 'TAKEPOS_FOOTER'.$_SESSION['takeposterminal'];
if (!empty($conf->global->TAKEPOS_FOOTER) || !empty($conf->global->{$constFreeText})) {
$constFreeText = 'TAKEPOS_FOOTER'.(empty($_SESSION['takeposterminal']) ? '0' : $_SESSION['takeposterminal']);
if (getDolGlobalString('TAKEPOS_FOOTER') || getDolGlobalString($constFreeText)) {
$newfreetext = '';
$substitutionarray = getCommonSubstitutionArray($langs);
if (!empty($conf->global->{$constFreeText})) {
$newfreetext .= make_substitutions($conf->global->{$constFreeText}, $substitutionarray);
if (getDolGlobalString($constFreeText)) {
$newfreetext .= make_substitutions(getDolGlobalString($constFreeText), $substitutionarray);
}
if (!empty($conf->global->TAKEPOS_FOOTER)) {
$newfreetext .= make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray);
if (getDolGlobalString('TAKEPOS_FOOTER')) {
$newfreetext .= make_substitutions(getDolGlobalString('TAKEPOS_FOOTER'), $substitutionarray);
}
print $newfreetext;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/ticket/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</tr>
<?php
}
if (count($linkedObjectBlock) > 1) {
if (count($linkedObjectBlock)) {
?>
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
<td><?php echo $langs->trans("Total"); ?></td>
Expand Down
Loading