230 lines
6.0 KiB
XML
230 lines
6.0 KiB
XML
<vn>
|
|
<vn-group>
|
|
<vn-param id="method"/>
|
|
<vn-param id="date"/>
|
|
<vn-param id="agency"/>
|
|
<vn-param id="address" on-changed="onAddressChange"/>
|
|
<db-form id="defaults" on-ready="onValuesReady">
|
|
<db-model property="model">
|
|
<custom>
|
|
SELECT delivery_method, agency_id, address_id
|
|
FROM basket_defaults
|
|
</custom>
|
|
</db-model>
|
|
</db-form>
|
|
<db-form id="order-form" on-ready="onValuesReady">
|
|
<db-model property="model">
|
|
<custom>
|
|
SELECT v.code delivery_method, o.date_send, o.agency_id, o.address_id
|
|
FROM basket o
|
|
JOIN vn2008.Vistas v ON o.delivery_method_id = v.vista_id
|
|
</custom>
|
|
</db-model>
|
|
</db-form>
|
|
<db-model id="agencies"
|
|
auto-load="false"
|
|
result-index="1"
|
|
on-status-changed="onAgenciesReady">
|
|
<custom>
|
|
CALL vn.agencyListAvailable (#date, #address);
|
|
SELECT DISTINCT m.id, m.description
|
|
FROM tmp.agencyAvailable a
|
|
JOIN vn.agencyMode m
|
|
ON m.agencyFk = a.agencyFk
|
|
JOIN vn.deliveryMethod d
|
|
ON d.id = m.deliveryMethodFk
|
|
WHERE d.code IN ('AGENCY', 'DELIVERY')
|
|
ORDER BY m.description;
|
|
DROP TEMPORARY TABLE tmp.agencyAvailable;
|
|
</custom>
|
|
<sql-batch property="batch">
|
|
<custom>
|
|
<item name="address" param="address"/>
|
|
<item name="date" param="date"/>
|
|
</custom>
|
|
</sql-batch>
|
|
</db-model>
|
|
<db-model id="warehouses"
|
|
auto-load="false"
|
|
result-index="1"
|
|
on-status-changed="onWarehousesReady">
|
|
<custom>
|
|
CALL vn.agencyListAvailable (#date, #address);
|
|
SELECT DISTINCT m.id, m.description
|
|
FROM tmp.agencyAvailable a
|
|
JOIN vn.agencyMode m
|
|
ON m.agencyFk = a.agencyFk
|
|
JOIN vn.deliveryMethod d
|
|
ON d.id = m.deliveryMethodFk
|
|
WHERE d.code IN ('PICKUP')
|
|
ORDER BY m.description;
|
|
DROP TEMPORARY TABLE tmp.agencyAvailable;
|
|
</custom>
|
|
<sql-batch property="batch">
|
|
<custom>
|
|
<item name="address" param="address"/>
|
|
<item name="date" param="date"/>
|
|
</custom>
|
|
</sql-batch>
|
|
</db-model>
|
|
</vn-group>
|
|
<div id="title">
|
|
<h1><t>ConfigureOrder</t></h1>
|
|
</div>
|
|
<div id="actions">
|
|
<htk-bar-button
|
|
icon="close"
|
|
tip="_Cancel"
|
|
on-click="onCancelClick"/>
|
|
</div>
|
|
<div id="form" class="checkout">
|
|
<div class="box">
|
|
<div class="form">
|
|
<htk-assistant
|
|
id="assistant"
|
|
step-count="5"
|
|
step-func="stepFunc"
|
|
node="assistant-node"/>
|
|
<div id="assistant-node">
|
|
<div id="method-step">
|
|
<h2><t>DeliveryOrPickupQuestion</t></h2>
|
|
<div class="answers radio">
|
|
<htk-radio-group
|
|
id="rg-method"
|
|
param="method"
|
|
on-changed="onFieldChange"/>
|
|
<div>
|
|
<htk-radio radio-group="rg-method" value="AGENCY"/>
|
|
<label><t>Receive the order</t></label>
|
|
</div>
|
|
<div>
|
|
<htk-radio radio-group="rg-method" value="PICKUP"/>
|
|
<label><t>PickupInStore</t></label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="date-step">
|
|
<h2 id="date-question"/>
|
|
<div class="answers">
|
|
<htk-calendar
|
|
id="calendar"
|
|
class="thin-calendar"
|
|
param="date"
|
|
restrict-func="calendarRestrict"
|
|
on-changed="onFieldChange"/>
|
|
</div>
|
|
</div>
|
|
<div id="address-step">
|
|
<h2 id="address-question"/>
|
|
<db-form id="address-form" model="addresses"/>
|
|
<div class="answers target">
|
|
<htk-repeater
|
|
id="repeater"
|
|
form-id="iter"
|
|
on-change="onAddressChange"
|
|
renderer="addressRenderer">
|
|
<db-model property="model" id="addresses">
|
|
<custom>
|
|
SELECT a.id, a.nickname, p.name province, a.city, a.street, a.isActive, c.country
|
|
FROM myAddress a
|
|
LEFT JOIN vn.province p ON p.id = a.provinceFk
|
|
JOIN vn.country c ON c.id = p.countryFk
|
|
WHERE a.isActive
|
|
</custom>
|
|
</db-model>
|
|
<custom>
|
|
<div class="address" id="address">
|
|
<p class="consignee">
|
|
<htk-text form="iter" column="nickname"/>
|
|
</p>
|
|
<p>
|
|
<htk-text form="iter" column="street"/>
|
|
</p>
|
|
</div>
|
|
</custom>
|
|
</htk-repeater>
|
|
</div>
|
|
</div>
|
|
<div id="agency-step">
|
|
<h2><t>AgencyQuestion</t></h2>
|
|
<div class="answers target">
|
|
<htk-combo
|
|
id="agency-combo"
|
|
param="agency"
|
|
on-changed="onFieldChange"
|
|
model="agencies"/>
|
|
</div>
|
|
</div>
|
|
<div id="pickup-step">
|
|
<h2><t>PickupWarehouseQuestion</t></h2>
|
|
<div class="answers target">
|
|
<htk-combo
|
|
id="warehouse-combo"
|
|
param="agency"
|
|
on-changed="onFieldChange"
|
|
model="warehouses"/>
|
|
</div>
|
|
</div>
|
|
<div id="confirm-agency-step" class="confirm">
|
|
<h2><t>ConfirmToAccessCatalog</t></h2>
|
|
<div class="answers target">
|
|
<p>
|
|
<t>Arrival</t>
|
|
<htk-text format="%D" param="date"/>
|
|
</p>
|
|
<p>
|
|
<htk-text form="address-form" column="street"/>
|
|
</p>
|
|
<p>
|
|
<t>Agency</t>
|
|
<htk-text form="agency-combo" column="description"/>
|
|
</p>
|
|
<button id="confirm-agency" class="thin" on-click="onConfirmClick">
|
|
<t>Confirm</t>
|
|
</button>
|
|
<div class="clear"/>
|
|
</div>
|
|
</div>
|
|
<div id="confirm-delivery-step" class="confirm">
|
|
<h2><t>ConfirmToAccessCatalog</t></h2>
|
|
<div class="answers target">
|
|
<p>
|
|
<t>Arrival</t>
|
|
<htk-text format="%D" param="date"/>
|
|
</p>
|
|
<p>
|
|
<htk-text form="address-form" column="street"/>
|
|
</p>
|
|
<p>
|
|
<t>ReceiveThroughtRoute</t>
|
|
</p>
|
|
<button id="confirm-delivery" class="thin" on-click="onConfirmClick">
|
|
<t>Confirm</t>
|
|
</button>
|
|
<div class="clear"/>
|
|
</div>
|
|
</div>
|
|
<div id="confirm-pickup-step" class="confirm">
|
|
<h2><t>ConfirmToAccessCatalog</t></h2>
|
|
<div class="answers target">
|
|
<p>
|
|
<t>Pickup</t>
|
|
<htk-text format="%D" param="date"/>
|
|
</p>
|
|
<p>
|
|
<t>Warehouse</t>
|
|
<htk-text form="warehouse-combo" column="description"/>
|
|
</p>
|
|
<button id="confirm-pickup" class="thin" on-click="onConfirmClick">
|
|
<t>Confirm</t>
|
|
</button>
|
|
<div class="clear"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<htk-assistant-bar assistant="assistant"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</vn>
|