Administrátor nyní může na formuláři objednávky upravovat množství,

jednotkovou cenu nebo celkovou cenu položky. Změnou hodnoty se vyvolá
přepočet částky ve formuláři.
Pro ostatní jsou položky objednávky pouze pro čtení.

closes #150
This commit is contained in:
2014-10-09 11:47:09 +02:00
parent a06b2cbb14
commit 6e62ea2070
4 changed files with 185 additions and 10 deletions
@@ -1,4 +1,6 @@
<?page title="${labels.Order}" contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?taglib uri="/WEB-INF/security.tld" prefix="sec"?>
<zk>
<window
id="editWin"
@@ -493,7 +495,7 @@
<listbox
vflex="1"
selectedItem="@bind(vm.selectedItem)"
model="@load(fx.items)">
model="@load(vm.syncOrderItems)">
<listhead menupopup="auto">
<listheader
hflex="7"
@@ -536,10 +538,34 @@
<listcell label="@load(each.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.textItem)" />
<listcell label="@load(each.quantity) @converter(vm.standardBigDecimalConverter)" />
<listcell>
<textbox
inplace="true"
sclass="grid-textbox-max-right"
readonly="${not sec:isAllGranted('ROLE_ADMIN')}"
onFocus="@command('onFocusItem', item=each, ctrl=self)"
onChange="@command('recalculate', form=fx, changed='quantity')"
value="@bind(each.quantity) @converter(vm.standardBigDecimalConverter)" />
</listcell>
<listcell label="@load(each.munit.name)" />
<listcell label="@load(each.unitPrice) @converter(vm.standardBigDecimalConverter)" />
<listcell label="@load(each.total) @converter(vm.standardBigDecimalConverter)" />
<listcell>
<textbox
inplace="true"
sclass="grid-textbox-max-right"
readonly="${not sec:isAllGranted('ROLE_ADMIN')}"
onFocus="@command('onFocusItem', item=each, ctrl=self)"
onChange="@command('recalculate', form=fx, changed='unitPrice')"
value="@bind(each.unitPrice) @converter(vm.standardBigDecimalConverter)" />
</listcell>
<listcell>
<textbox
inplace="true"
sclass="grid-textbox-max-right"
readonly="${not sec:isAllGranted('ROLE_ADMIN')}"
onFocus="@command('onFocusItem', item=each, ctrl=self)"
onChange="@command('recalculate', form=fx, changed='total')"
value="@bind(each.total) @converter(vm.standardBigDecimalConverter)" />
</listcell>
<listcell label="@load(each.description)" />
</listitem>
</template>