TASKPM/libreplan-webapp/src/main/webapp/expensesheet/expenseSheet.zul
2012-05-11 10:53:48 +02:00

195 lines
10 KiB
Text

<!--
This file is part of LibrePlan
Copyright (C) 2012 WirelessGalicia, S.L.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
<?page title="${i18n:_('LibrePlan: Expense Sheet')}" id="expense_sheet_admin"?>
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="shortcut icon" href="/common/img/favicon.ico" type="image/x-icon"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<zk>
<window self="@{define(content)}"
apply="org.libreplan.web.expensesheet.ExpenseSheetCRUDController">
<vbox id="messagesContainer"></vbox>
<window id="listWindow" title="${i18n:_('Expense Sheet List')}">
<div align="left">
<hbox align="center">
<!-- Create new Expense Sheet -->
<button label="${i18n:_('New expense sheet')}"
onClick="controller.goToCreateForm()"/>
</hbox>
</div>
<separator bar="false" spacing="10px" orient="horizontal"/>
<grid id="listing" mold="paging" pageSize="10"
model="@{controller.expenseSheets}" sclass="clickable-rows">
<columns sizable="true">
<column id="columnFirstExpense" label="${i18n:_('First expense')}"
sort="auto(firstExpense, lastExpense)"
sortDirection="ascending"
width="200px"/>
<column id="columnLastExpense" label="${i18n:_('Last expense')}"
sort="auto(lastExpense, firstExpense)"
sortDirection="ascending"
width="200px"/>
<column label="${i18n:_('Total')}"
sort="auto(total)"
sortDirection="ascending"
width="200px"/>
<column label="${i18n:_('Code')}"
sort="auto(code)"
sortDirection="ascending"
width="260px"/>
<column label="${i18n:_('Description')}" width="286px"/>
<column label="${i18n:_('Actions')}" width="80px" align="center"/>
</columns>
<rows>
<row self="@{each='expensesheet'}" value="@{expensesheet}" onClick="controller.goToEditForm(self.value);">
<label value="@{expensesheet.firstExpense, converter='org.libreplan.web.common.typeconverters.LocalDateConverter'}" />
<label value="@{expensesheet.lastExpense, converter='org.libreplan.web.common.typeconverters.LocalDateConverter'}"/>
<hbox>
<label value="@{expensesheet.total}" />
<label value="@{controller.currencySymbol}" />
</hbox>
<label value="@{expensesheet.code}" />
<label value="@{expensesheet.description}" />
<hbox>
<button sclass="icono" image="/common/img/ico_editar1.png"
hoverImage="/common/img/ico_editar.png"
tooltiptext="${i18n:_('Edit')}"
onClick="controller.goToEditForm(self.parent.parent.value);">
</button>
<button sclass="icono" image="/common/img/ico_borrar1.png"
hoverImage="/common/img/ico_borrar.png"
tooltiptext="${i18n:_('Delete')}"
onClick="controller.confirmDelete(self.parent.parent.value);">
</button>
</hbox>
</row>
</rows>
</grid>
</window>
<window id="editWindow">
<caption id="caption" sclass="caption-title" />
<groupbox closable="false" width="600px">
<caption label="${i18n:_('Identification')}" />
<separator bar="false" spacing="5px" orient="horizontal"/>
<vbox>
<hbox>
<label value="${i18n:_('Code')}" />
<textbox id="txtExpenseCode" width="350px" value="@{controller.expenseSheet.code}"
constraint="@{controller.checkConstraintExpendeCode}"
disabled="@{controller.expenseSheet.codeAutogenerated}" />
<checkbox id="generateCode" label="${i18n:_('Generate code')}"
onCheck="controller.onCheckGenerateCode(event)"
checked="@{controller.expenseSheet.codeAutogenerated}" />
</hbox>
<hbox>
<label value="${i18n:_('Description')}" />
<textbox width="500px" value="@{controller.expenseSheet.description}"/>
</hbox>
</vbox>
</groupbox>
<separator bar="false" spacing="5px" orient="horizontal"/>
<groupbox closable="false" width="600px">
<caption label="${i18n:_('Expense properties')}" />
<separator bar="false" spacing="5px" orient="horizontal"/>
<vbox>
<hbox>
<label value="${i18n:_('Task of project')}" />
<bandboxSearch id="bandboxSelectOrder"
finder="OrderInExpenseSheetBandboxFinder"
widthBandbox="480px"
widthListbox="500px"
model="@{controller.orders}"
selectedElement="@{controller.projectDefault}"/>
</hbox>
<hbox>
<label value="${i18n:_('Expense date')}" />
<datebox id="dateboxExpenseDate" width="150px"
value="@{controller.expenseSheetLineDate}"/>
</hbox>
</vbox>
</groupbox>
<separator bar="false" spacing="5px" orient="horizontal"/>
<groupbox closable="false">
<caption label="${i18n:_('Expenses lines')}" />
<hbox>
<label value="${i18n:_('Task')}"/>
<bandboxSearch id="bandboxTasks"
widthBandbox="285px"
widthListbox="400px"
finder="OrderElementInExpenseSheetBandboxFinder"
model="@{controller.tasks}"
selectedElement="@{controller.expenseSheetLineDTO.orderElement}"/>
<separator bar="false" spacing="10px" orient="vertical"/>
<label value="${i18n:_('Value')}" />
<decimalbox id="dboxValue"
value="@{controller.expenseSheetLineDTO.value}"
scale="2"
constraint="@{controller.checkConstraintExpenseValue}"/>
<separator bar="false" spacing="10px" orient="vertical"/>
<label value="${i18n:_('Concept')}" />
<textbox id="tbConcept" width="200px" value="@{controller.expenseSheetLineDTO.concept}" />
<separator bar="false" spacing="10px" orient="vertical"/>
<label value="${i18n:_('Resource')}" />
<bandboxSearch id="bandboxResource"
widthBandbox="285px"
widthListbox="400px"
finder="ResourceInExpenseSheetBandboxFinder"
selectedElement="@{controller.expenseSheetLineDTO.resource}"/>
<separator bar="false" spacing="10px" orient="vertical"/>
<button onClick="controller.addExpenseSheetLine();" label="${i18n:_('New')}"/>
</hbox>
<separator bar="false" spacing="10px" orient="horizontal"/>
<grid id="gridExpenseLines" mold="paging" pageSize="10"
model="@{controller.expenseSheetLines}" width="100%"
rowRenderer="@{controller.expenseSheetLineRenderer}">
<columns>
<column label="${i18n:_('Task')}" width="275px"/>
<column label="${i18n:_('Value')}" width="100px"/>
<column label="${i18n:_('Concept')}" width="172px"/>
<column label="${i18n:_('Date')}" width="118px"/>
<column label="${i18n:_('Resource')}" width="275px"/>
<column label="${i18n:_('Code')}" width="182px"/>
<column label="${i18n:_('Operation')}" align="center"/>
</columns>
</grid>
</groupbox>
<button onClick="controller.saveAndExit();"
label="${i18n:_('Save')}" sclass="save-button global-action"/>
<button onClick="controller.saveAndContinue();"
label="${i18n:_('Save &amp; Continue')}" sclass="saveandcontinue-button global-action"/>
<button onClick="controller.cancelForm();"
label="${i18n:_('Cancel')}" sclass="cancel-button global-action"/>
</window>
</window>
</zk>