[% PROCESS 'elements.html' %]
[% asset.title %]
[% PROCESS input element_data = { type = "hidden" name = "id" value = asset.id } %] [% default_asset_account = "{"; FOREACH a_class IN asset.asset_classes; default_asset_account = default_asset_account _ "'" _ a_class.id _ "': '" _ a_class.asset_account_id _ "',"; END; default_asset_account = default_asset_account _ "}"; %] [% default_depreciation_account = "{"; FOREACH a_class IN asset.asset_classes; default_depreciation_account = default_depreciation_account _ "'" _ a_class.id _ "': '" _ a_class.dep_account_id _ "',"; END; default_depreciation_account = default_depreciation_account _ "}"; %]
[% PROCESS input element_data = { type = "text" class = "control_code" name = "tag" value = asset.tag label = text('Tag:') size = 32 required = 1 } %]
[% PROCESS select element_data = { name = "asset_class" class = "class" options = asset.asset_classes default_values = [asset.asset_class_id] text_attr = "label" value_attr = "id" label = text("Asset Class:") #' "data-dojo-type" = "lsmb/PublishSelect" "data-dojo-props" = "topic:'ui/assets/class'" required = 1 } %]
[% PROCESS input element_data = { label = text("Description:") name = "description" class = "description" value = asset.description type = "text" } %]
[% PROCESS input element_data = { label = text("Purchase Date:") #' name = "purchase_date" class = "date" value = asset.purchase_date type = "date" size = 12 required = 1 } %] [% PROCESS input element_data = { label = text("Purchase Value:") #' name = "purchase_value" class = "money" value = asset.purchase_value type = "text" size = 16 required = 1 } %]
[% PROCESS input element_data = { label = text("Usable Life") #' name = "usable_life" value = asset.usable_life type = "text" size = 10 required = 1 } %] ([% text('Method Default') %]) [% PROCESS input element_data = { label = text("Salvage Value:") #' name = "salvage_value" class = "money" value = asset.salvage_value type = "text" size = 16 required = 1 } %]
[% PROCESS input element_data = { label = text("Depreciation Starts") #' name = "start_depreciation" value = asset.start_depreciation type = "date" size = 12 class = "date" required = 1 } %]
[% PROCESS select element_data = { name = "warehouse_id" options = asset.locations value_attr = "id" text_attr = "description" default_values = [asset.warehouse_id] label = text('Location') } %] [% PROCESS select element_data = { name = "department_id" options = asset.departments value_attr = "id" text_attr = "description" default_values = [asset.department_id] label = text('Department') } %]
[% PROCESS select element_data = { label = text('Asset Account') #' options = asset.asset_accounts name = "asset_account_id" default_values = [asset.asset_account_id] value_attr = 'id' text_attr = 'text' required = 1 "data-dojo-type" = "lsmb/SubscribeSelect" "data-dojo-props" = "topic:'ui/assets/class',topicMap:$default_asset_account" } %] [% PROCESS select element_data = { label = text('Depreciation Account') #' options = asset.dep_accounts name = "dep_account_id" default_values = [asset.dep_account_id] value_attr = 'id' text_attr = 'text' required = 1 "data-dojo-type" = "lsmb/SubscribeSelect" "data-dojo-props" = "topic:'ui/assets/class',topicMap:$default_depreciation_account" } %]
[% PROCESS select element_data = { name = "exp_account_id" class = "account" options = asset.exp_accounts text_attr = 'text' value_attr = 'id' required = 1 default_values = [asset.exp_account_id] label = text('Expense Account') #' } %]
[% PROCESS input element_data = { label = text('Vendor Number') #' type = "text" class = "identifier" size = 20 value = asset.meta_number name = "meta_number" } %] [% PROCESS input element_data = { label = text('Invoice Number') #' type = "text" class = "identifier" size = 20 value = asset.invnumber name = "invnumber" } %]
[% PROCESS button element_data = { text = text("Save") type = "submit" class = "submit" name = "__action" value = "asset_save" 'data-lsmb-doing' = text('Saving...') 'data-lsmb-done' = text('Saved') } %]