1 <div id='sales_price_information_sales_order'></div>
2 <div id='sales_price_information_sales_quotation'></div>
3 <div id='parts_price_history'></div>
5 <script type='text/javascript'>
6 function get_report(target, source, data){
9 // beforeSend: function () { $(target).html('<img src="image/spinner.gif">') },
10 success: function (rsp) {
12 $(target).find('.paginate').find('a').click(function(event){ redirect_event(event, target) });
13 $(target).find('a.report-generator-header-link').click(function(event){ redirect_event(event, target) });
19 function redirect_event(event, target){
20 event.preventDefault();
21 get_report(target, event.target + '', {});
24 $('.tabwidget').on('tabsbeforeactivate', function(event, ui){
25 if (ui.newPanel.attr('id') == 'sales_price_information') {
26 get_report('#sales_price_information_sales_order', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_order' });
27 get_report('#sales_price_information_sales_quotation', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_quotation' });
28 get_report('#parts_price_history', 'controller.pl', { action: 'PartsPriceHistory/list', 'filter.part_id': [% id %] });