Fix requisitions (#4147)

* Fix data types on null values
* Fix receiving receipt image tag
* Fix error on Receiving Model
This commit is contained in:
El_Coloso
2025-01-26 21:21:40 -05:00
committed by jekkos
parent 9cc24f0c70
commit 7ad1bfa0fb
4 changed files with 6 additions and 5 deletions

View File

@@ -246,7 +246,7 @@ class Receiving_lib
* @param string $stock_destination
* @return void
*/
public function set_stock_destination(string $stock_destination): void
public function set_stock_destination(?string $stock_destination): void
{
$this->session->set('recv_stock_destination', $stock_destination);
}

View File

@@ -104,7 +104,7 @@ class Receiving extends Model
/**
* @throws ReflectionException
*/
public function save_value(array $items, int $supplier_id, int $employee_id, string $comment, string $reference, string $payment_type, int $receiving_id = NEW_ENTRY): int //TODO: $receiving_id gets overwritten before it's evaluated. It doesn't make sense to pass this here.
public function save_value(array $items, int $supplier_id, int $employee_id, string $comment, string $reference, ?string $payment_type, int $receiving_id = NEW_ENTRY): int //TODO: $receiving_id gets overwritten before it's evaluated. It doesn't make sense to pass this here.
{
$attribute = model(Attribute::class);
$inventory = model('Inventory');
@@ -187,7 +187,6 @@ class Receiving extends Model
$inventory->insert($inv_data, false);
$attribute->copy_attribute_links($item_data['item_id'], 'receiving_id', $receiving_id);
$supplier = $supplier->get_info($supplier_id); //TODO: supplier is never used after this.
}
$this->db->transComplete();

View File

@@ -37,7 +37,9 @@
if ($config['company_logo'] != '')
{
?>
<div id="company_name"><img id="image" src="<?= esc(base_url('uploads/' . $config['company_logo']), 'url') ?>" alt="company_logo" /></div>
<div id="company_name">
<img id="image" src="<?= base_url('uploads/' . esc($config['company_logo'], 'url')) ?>" alt="company_logo" />
</div>
<?php
}
?>

View File

@@ -219,7 +219,7 @@ if (isset($success))
{
?>
<td><?= $item['discount'] ?></td>
<?= form_hidden('discount', $item['discount']) ?>
<?= form_hidden('discount', (string)$item['discount']) ?>
<?php
}
?>