dev → test #58

Merged
guillermo merged 7 commits from dev into test 2024-05-07 11:51:01 +00:00
3 changed files with 11 additions and 11 deletions

View File

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

View File

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

View File

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