[% PROCESS 'elements.html' %] [% PROCESS 'dynatable.html' %] [% account_class = entity_class %]
[% text('Pricelist') %] [% pricematrix.length %]
[% columns = [ { col_id = 'parts_id', type = 'hidden' }, { col_id = 'int_partnumber' name = text('Partnumber') type = 'text' }, { col_id = 'description' name = text('Description') type = 'text' } ]; IF account_class == 1; columns.push( {col_id = 'lastcost' name = text('Last Cost') #' type = 'text_input'}, {col_id = 'partnumber', name = text('Vendor Partnumber') #' type = 'text_input'}, {col_id = 'leadtime', name = text('Lead Time') #' type = 'input_text'} ); ELSE; columns.push( {col_id = 'sellprice' name = text('Sell Price') #' type = 'input_text'}, {col_id = 'validfrom', name = text('Valid From') #' type = 'input_text'}, {col_id = 'validto', name = text('Valid To') #' type = 'input_text'}, {col_id = 'qty', name = text('Min Qty') #' type = 'input_text'}, ); END; columns.push({col_id = 'currency', name = text('Currency'), type = 'text'}, {col_id = 'delete', name = ' ', type = 'href', href_base = script _ '?action=delete_pricelist&credit_id=' _ id _ '&entry_id=' } ); FOREACH pm IN pricematrix; pm.delete = '[' _ text('Delete') _ ']'; pm.row_id = pm.entry_id; END %] [% PROCESS input element_data = { type="hidden" name="entity_class" value=account_class } %] [% PROCESS input element_data = { type="hidden" name="credit_id" value=credit_id } %] [% PROCESS input element_data = { type="hidden" name="entity_id" value=entity_id } %][% PROCESS dynatable attributes = { id = 'pricematrix' } tbody = { rows = pricematrix } tfoot = { coltypes = { int_partnumber = 'input_text', description = 'text', }, dojo_type = { int_partnumber = "lsmb/parts/PartSelector" }, dojo_props = { int_partnumber = "required: false" }, rows = [{}]} %] [% PROCESS button element_data = { type = "submit" class = "submit" name = "__action" value = "save_pricelist" text = text('Save') 'data-lsmb-doing' = text('Saving...') 'data-lsmb-done' = text('Saved') } ; FORMATS = LIST_FORMATS(); IF FORMATS.grep('PDF').size() %] [[% text('PDF') %]] [% END; IF FORMATS.grep('XLS').size() %] [[% text('XLS') %]] [% END; IF FORMATS.grep('XLSX').size() %] [[% text('XLSX') %]] [% END; IF FORMATS.grep('ODS').size() %] [[% text('ODS') %]] [% END %] [[% text('CSV') %]] [% IF pricematrix_pricegroup; PROCESS dynatable attributes = { id = 'pricematrixgroup' input_prefix = 'grp_' } tbody = { rows = pricematrix_pricegroup }; END %]