Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/hedera-web into test
gitea/hedera-web/pipeline/head This commit looks good Details
gitea/hedera-web/pipeline/pr-master This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-05-07 13:53:37 +02:00
commit e6cd88ee82
3 changed files with 11 additions and 11 deletions

View File

@ -26,8 +26,8 @@
<label><t>Realm</t></label>
<htk-combo form="lot" column="realm" not-null="false">
<db-model property="model">
SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
SELECT id, name FROM vn.itemCategory
WHERE display ORDER BY name
</db-model>
</htk-combo>
</div>

View File

@ -25,9 +25,9 @@
on-ready="this.onConfigChange()">
<db-model property="model">
SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family,
c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm
c.shelf, c.maxAmount, c.showPacking, c.stack, it.categoryFk realm
FROM shelfConfig c
JOIN vn2008.Tipos t ON t.tipo_id = c.family
JOIN vn.itemType it ON it.id = c.family
</db-model>
</htk-combo>
</div>
@ -39,8 +39,8 @@
<label><t>Reign</t></label>
<htk-combo form="lot" name="realm">
<db-model property="model">
SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
SELECT id, name FROM vn.itemCategory
WHERE display ORDER BY name
</db-model>
</htk-combo>
</div>
@ -48,8 +48,8 @@
<label><t>Family</t></label>
<htk-combo form="lot" name="family">
<db-model property="model" lot="lot">
SELECT tipo_id, Tipo FROM vn2008.Tipos
WHERE reino_id = #realm ORDER BY Tipo
SELECT id, name FROM vn.itemType
WHERE categoryFk = #realm ORDER BY name
</db-model>
</htk-combo>
</div>

View File

@ -6,14 +6,14 @@
*/
class ExchangeRate extends Vn\Lib\Method {
function run($db) {
$db->selectDb('vn2008');
$db->selectDb('vn');
// Indica la URL del archivo
$xml = new SimpleXMLElement(
'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml', 0, TRUE);
$date = $db->getValue("SELECT MAX(date) fecha FROM reference_rate");
$date = $db->getValue("SELECT MAX(dated) fecha FROM referenceRate");
$maxDate = $date ? DateTime::createFromFormat('Y-m-d', $date) : NULL;
foreach ($xml->Cube[0]->Cube as $cube) {
@ -29,7 +29,7 @@ class ExchangeRate extends Vn\Lib\Method {
'rate' => $subCube['rate']
];
$db->query(
'REPLACE INTO reference_rate(moneda_id, date, rate)
'REPLACE INTO referenceRate(currencyFk, dated, `value`)
VALUES(2, #date, #rate)',
$params
);