Añadida la seccion Facturas

This commit is contained in:
Juan Ferrer Toribio 2015-09-04 01:28:07 +02:00
parent 56b43bb61d
commit 2a433ac80f
17 changed files with 355 additions and 37 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.211-deb8) stable; urgency=low
hedera-web (1.212-deb8) stable; urgency=low
* Initial Release.

View File

@ -33,7 +33,7 @@
<input type="file" name="image"/>
<input type="hidden" name="MAX_FILE_SIZE" id="photo-size"/>
</div>
<button class="button" id="submit">
<button class="flat" id="submit">
<t>Upload</t>
</button>
</form>

View File

@ -0,0 +1,36 @@
<?php
require_once ('vn/web/file.php');
require_once ('vn/hedera/web.php');
use Vn\Hedera\Web;
Web::init ();
try {
if (!Web::login ())
throw new Exception (s('Invalid login'));
if (!isset ($_GET['invoice']))
throw new Exception (s('Invoice id not sent by client'));
$query = file_get_contents (__DIR__ .'/get-invoice-path.sql');
if (empty ($query))
throw new Exception (s('Can not load query from file'));
$pdfPath = Web::$conn->getValue ($query, ['invoice' => (int) $_GET['invoice']]);
if (!$pdfPath)
throw new Exception (s('Invoice id not found'));
Vn\Web\printFile ($pdfPath);
}
catch (Exception $e)
{
error_log ($e->getMessage ());
header ('HTTP/1.0 500 Internal Server Error');
}
Web::deinit ();
?>

View File

@ -0,0 +1,5 @@
SELECT CONCAT_WS('/', c.pdfs_dir, invoice_get_path (#invoice))
FROM config c
JOIN invoice_view i
WHERE i.invoice_id = #invoice;

View File

@ -0,0 +1,17 @@
Vn.Invoices = new Class
({
Extends: Vn.Module
,activate: function () {}
,onDownloadClick: function (column, invoiceId)
{
if (!invoiceId)
return;
var url = '//www.verdnatura.es/hedera-web/forms/ecomerce/invoices/download.php?invoice='+ invoiceId;
window.open (url, '_blank');
}
});

View File

@ -0,0 +1,14 @@
.invoices
{
padding: 1em;
}
.invoices .box
{
max-width: 40em;
}
.invoices .box > .header,
.invoices .htk-grid > thead > tr
{
background-color: #3F51B6;
}

View File

@ -0,0 +1,27 @@
<vn>
<div id="form" class="invoices">
<div class="box">
<div class="header">
<h1><t>Invoices</t></h1>
</div>
<div>
<htk-grid show-header="false">
<db-model id="tickets">
SELECT invoice_id, serial_num, issued, amount
FROM invoice_view
ORDER BY issued DESC
LIMIT 100
</db-model>
<htk-column-text title="_Serial" column="serial_num"/>
<htk-column-date title="_Date" column="issued" format="_%e %b %Y"/>
<htk-column-spin title="_Import" column="amount" unit="€" digits="2"/>
<htk-column-button
column="invoice_id"
image="image/download.svg"
tip="_Download PDF"
on-clicked="onDownloadClick"/>
</htk-grid>
</div>
</div>
</div>
</vn>

169
web/image/download.svg Normal file
View File

@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="folder-download-symbolic.svg"
inkscape:export-filename="/home/sam/dev/RESOURCES/gnome-icon-theme-symbolic/src/gnome-stencils.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
height="16"
id="svg7384"
version="1.1"
inkscape:version="0.91 r13725"
width="16">
<metadata
id="metadata90">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
inkscape:bbox-nodes="false"
inkscape:bbox-paths="true"
bordercolor="#666666"
borderopacity="1"
inkscape:current-layer="layer13"
inkscape:cx="8"
inkscape:cy="8"
gridtolerance="10"
inkscape:guide-bbox="true"
guidetolerance="10"
id="namedview88"
inkscape:object-nodes="false"
inkscape:object-paths="false"
objecttolerance="10"
pagecolor="#3a3b39"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
showborder="false"
showgrid="false"
showguides="true"
inkscape:snap-bbox="true"
inkscape:snap-bbox-midpoints="false"
inkscape:snap-global="true"
inkscape:snap-grids="true"
inkscape:snap-nodes="true"
inkscape:snap-others="false"
inkscape:snap-to-guides="true"
inkscape:window-height="1016"
inkscape:window-maximized="1"
inkscape:window-width="1920"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:zoom="51.5">
<inkscape:grid
empspacing="2"
enabled="true"
id="grid4866"
originx="-260px"
originy="-22px"
snapvisiblegridlinesonly="true"
spacingx="1px"
spacingy="1px"
type="xygrid"
visible="true" />
</sodipodi:namedview>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<defs
id="defs7386" />
<g
inkscape:groupmode="layer"
id="layer9"
inkscape:label="status"
style="display:inline"
transform="translate(-501.0002,-195)" />
<g
inkscape:groupmode="layer"
id="layer10"
inkscape:label="devices"
style="display:inline"
transform="translate(-501.0002,-195)" />
<g
inkscape:groupmode="layer"
id="layer11"
inkscape:label="apps"
transform="translate(-501.0002,-195)" />
<g
inkscape:groupmode="layer"
id="layer13"
inkscape:label="places"
style="display:inline"
transform="translate(-501.0002,-195)">
<path
inkscape:connector-curvature="0"
d="m 503.0002,203.00315 0,1 c -1.2e-4,0.0104 -4.6e-4,0.0208 0,0.0313 0.0112,0.25495 0.12858,0.50987 0.3125,0.6875 l 5.21875,5.28125 0.96875,-0.003 5.21875,-5.27805 c 0.18819,-0.18821 0.28125,-0.45351 0.28125,-0.7188 l 0,-1 -1.7071,0 c -0.26529,0 -0.53058,0.0931 -0.71875,0.28125 l -3.45027,3.7156 -0.10825,1.5 -0.12389,-1.5 -3.47883,-3.7156 c -0.19463,-0.21074 -0.46925,-0.30316 -0.75,-0.28125 z"
id="path11142"
sodipodi:nodetypes="ccscccccccccccccc"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono" />
<rect
height="2"
id="rect81861"
rx="0.5"
ry="0.5"
style="color:#000000;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
width="2"
x="508.00021"
y="202" />
<rect
height="2"
id="rect81863"
rx="1"
ry="1"
style="color:#000000;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
width="2"
x="508.00021"
y="196" />
<rect
height="2"
id="rect81886"
rx="0.6875"
ry="0.6875"
style="color:#000000;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.29999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
width="2"
x="508.00021"
y="199" />
</g>
<g
inkscape:groupmode="layer"
id="layer14"
inkscape:label="mimetypes"
transform="translate(-501.0002,-195)" />
<g
inkscape:groupmode="layer"
id="layer15"
inkscape:label="emblems"
style="display:inline"
transform="translate(-501.0002,-195)" />
<g
inkscape:groupmode="layer"
id="g71291"
inkscape:label="emotes"
style="display:inline"
transform="translate(-501.0002,-195)" />
<g
inkscape:groupmode="layer"
id="g4953"
inkscape:label="categories"
style="display:inline"
transform="translate(-501.0002,-195)" />
<g
inkscape:groupmode="layer"
id="layer12"
inkscape:label="actions"
style="display:inline"
transform="translate(-501.0002,-195)" />
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -0,0 +1,8 @@
{
"Invoices": "Factures"
,"Serial": "Sèrie"
,"Date": "Data"
,"Import": "Import"
,"Donwload PDF": "Descarregar PDF"
}

View File

@ -49,7 +49,6 @@ Vn.Locale.add
,"Remember": "Recordar"
,"Enter": "Entrar"
,"Exit": "Sortir"
,"Menu": "Menú"
,"ErrorLoadingForm": "Error al carregar formulari"
,"YoureVisitor": "Solament estàs de visita?"
,"NewVersionAvailable": "Hi ha una nova actualització, la pàgina recargargará automàticament per descarregar-la"
@ -58,23 +57,30 @@ Vn.Locale.add
,"ReturnToOldWebsite": "Web antiga"
,"TestTheNewWebsite": "Prova la nova web!"
,"Menu": "Menú"
,"Home": "Inici"
,"Orders": "Encàrrecs"
,"Basket": "Cistella"
,"Last orders": "Últims comandes"
,"Invoices": "Factures"
,"Catalog": "Catàleg"
,"Training": "Formació"
,"Configuration": "Configuració"
,"Account": "Compte"
,"Adresses": "Direccions"
,"About": "Coneix-nos"
,"Why": "Per què?"
,"About us": "Quant a"
,"Why": "Per què?"
,"Location": "Localització"
,"Administration": "Administració"
,"Users": "Usuaris"
,"Visits": "Visites"
,"Photos": "Fotos"
,"Agencies": "Agències"
,"News": "Noticies"
,"Control panel": "Panell de control"
,"Users": "Usuaris"
,"Visits": "Visites"
,"News": "Noticies"
,"Photos": "Fotos"
,"Contact": "Vull ser client"
,"Training": "Formació"
,"Agencies": "Agències"
,"Configuration": "Configuració"
,"Account": "Compte"
,"Addresses": "Direccions"
,"SessionExpired": "Has estat massa temps inactiu i la sessió ha expirat."
,"InvalidLogin": "Usuari o contrasenya incorrectes. Recorda que s'hi distingeix entre majúscula i minúscula."

View File

@ -0,0 +1,8 @@
{
"Invoices": "Facturas"
,"Serial": "Serie"
,"Date": "Fecha"
,"Import": "Importe"
,"Download PDF": "Descargar PDF"
}

View File

@ -49,7 +49,6 @@ Vn.Locale.add
,"Remember": "Recordar"
,"Enter": "Entrar"
,"Exit": "Salir"
,"Menu": "Menú"
,"ErrorLoadingForm": "Error al cargar formulario"
,"YoureVisitor": "¿Solo estás de visita?"
,"NewVersionAvailable": "Hay una nueva actualización, la página se recargargará automaticamente para descargarla"
@ -58,23 +57,30 @@ Vn.Locale.add
,"ReturnToOldWebsite": "Web antigua"
,"TestTheNewWebsite": "¡Prueba la nueva web!"
,"Menu": "Menú"
,"Home": "Inicio"
,"Orders": "Pedidos"
,"Basket": "Cesta"
,"Last orders": "Últimos pedidos"
,"Invoices": "Facturas"
,"Catalog": "Catálogo"
,"Training": "Formación"
,"Configuration": "Configuración"
,"Account": "Cuenta"
,"Adresses": "Direcciones"
,"About": "Conócenos"
,"Why": "¿Por qué?"
,"About us": "Sobre nosotros"
,"Why": "¿Por qué?"
,"Location": "Localización"
,"Administration": "Administración"
,"Users": "Usuarios"
,"Visits": "Visitas"
,"Photos": "Fotos"
,"Agencies": "Agencias"
,"News": "Noticias"
,"Control panel": "Panel de control"
,"Users": "Usuarios"
,"Visits": "Visitas"
,"News": "Noticias"
,"Photos": "Fotos"
,"Contact": "Quiero ser cliente"
,"Training": "Formación"
,"Agencies": "Agencias"
,"Configuration": "Configuración"
,"Account": "Cuenta"
,"Addresses": "Direcciones"
,"SessionExpired": "Has estado demasiado tiempo inactivo y la sesión ha expirado."
,"InvalidLogin": "Usuario o contraseña incorrectos. Recuerda que se hace distinción entre mayúsculas y minúsculas."

View File

@ -0,0 +1,8 @@
{
"Invoices": "Factures"
,"Serial": "Série"
,"Date": "Date"
,"Import": "Montant"
,"Donwload PDF": "Télécharger le PDF"
}

View File

@ -49,7 +49,6 @@ Vn.Locale.add
,"Remember": "Rappeler"
,"Enter": "entrer"
,"Exit": "Laisser"
,"Menu": "Menu"
,"ErrorLoadingForm": "Forme erreur de chargement"
,"YoureVisitor": "¿Solo estás de visita?"
,"NewVersionAvailable": "Il ya une nouvelle mise à jour, la page sera automatiquement recargargará pour télécharger"
@ -58,23 +57,30 @@ Vn.Locale.add
,"ReturnToOldWebsite": "Ancien site web"
,"TestTheNewWebsite": "Testez le nouveau site!"
,"Menu": "Menu"
,"Home": "Accueil"
,"Orders": "Commandes"
,"Basket": "Panier"
,"Last orders": "Dernières commandes"
,"Invoices": "Facturas"
,"Catalog": "Catalogue"
,"Training": "Formation"
,"Configuration": "Configuration"
,"Account": "Compte"
,"Adresses": "Adresses"
,"About": "Nous"
,"Why": "Pourquoi?"
,"About us": "A propos de nous"
,"Why": "Pourquoi?"
,"Location": "Emplacement"
,"Administration": "Administration"
,"Users": "Utilisateurs"
,"Visits": "Visites"
,"Photos": "Photos"
,"Agencies": "Agences"
,"News": "Nouvelles"
,"Control panel": "Panneau de contrôle"
,"Users": "Utilisateurs"
,"Visits": "Visites"
,"News": "Nouvelles"
,"Photos": "Photos"
,"Contact": "Je veux être client"
,"Training": "Formation"
,"Agencies": "Agences"
,"Configuration": "Configuration"
,"Account": "Compte"
,"Addresses": "Adresses"
,"SessionExpired": "Il a eu le temps de trop paresseux et votre session a expiré."
,"InvalidLogin": "Utilisateur ou mot de passe incorrect. N'oubliez pas de distinction entre majuscules et minuscules."

View File

@ -12,7 +12,7 @@
<div id="main">
<h1><?=s('Welcome to Verdnatura, where are you going?')?></h1>
<div>
<a href="?page=login">
<a href="https://test-www.verdnatura.es/">
<div>
<img src="pages/version-menu/new-web.svg" alt=""></img>
<p>
@ -26,7 +26,7 @@
</a>
</div>
<div>
<a href="https://www.verdnatura.es/">
<a href="?page=login">
<div>
<img src="pages/version-menu/old-web.svg" alt=""></img>
<p>

View File

@ -20,3 +20,7 @@ ul.submenu
background-color: white;
box-shadow: none;
}
.htk-toast
{
margin-left: -11em;
}

View File

@ -275,4 +275,8 @@ ul.submenu a
left: 15em;
overflow: auto;
}
.htk-toast
{
margin-left: -3em;
}