improve performance of package add/edit (don't pull up pricing info in add-on/supplem...
[freeside.git] / httemplate / edit / part_pkg.cgi
index b35dc02..c7d314c 100755 (executable)
@@ -48,6 +48,7 @@
                    'recur_cost'       => 'Recur cost',
                    'pay_weight'       => 'Payment weight',
                    'credit_weight'    => 'Credit weight',
+                   'agent_pkgpartid'  => 'External ID',
                    'agentnum'         => 'Agent',
                    'setup_fee'        => 'Setup fee',
                    'setup_show_zero'  => 'Show zero setup',
                      { type  => 'tablebreak-tr-title',
                        value => 'Cost tracking', #better name?
                      },
-                     { field=>'setup_cost', type=>'money', },
-                     { field=>'recur_cost', type=>'money', },
+
+                     ( $curuser->access_right('Edit package definition costs')
+                       ? ( { field=>'setup_cost', type=>'money', },
+                           { field=>'recur_cost', type=>'money', },
+                         )
+                       : ( { field=>'setup_cost', type=>'fixed', },
+                           { field=>'recur_cost', type=>'fixed', },
+                         )
+                     ),
 
                      ( $conf->exists('part_pkg-delay_start')
                        ? ( { type  => 'tablebreak-tr-title',
                                             ? "AND pkgpart != $pkgpart"
                                             : ''
                                          },
+                     'label_callback' => sub { shift->pkg_comment_only },
                      'm2_label'   => 'Include line item(s) from package',
                      'm2m_method' => 'bill_part_pkg_link',
                      'm2m_dstcol' => 'dst_pkgpart',
                                             ? "AND pkgpart != $pkgpart"
                                             : ''
                                          },
+                     'label_callback' => sub { shift->pkg_comment_only },
                      'm2_label'   => 'Include services of package: ',
                      'm2m_method' => 'svc_part_pkg_link',
                      'm2m_dstcol' => 'dst_pkgpart',
                    },
                    { 'field'       => 'supp_dst_pkgpart',
                      'type'        => 'select-part_pkg',
+                     'label_callback' => sub { shift->pkg_comment_only },
                      'm2_label'    => 'When ordering package, also order',
                      'm2m_method'  => 'supp_part_pkg_link',
                      'm2m_dstcol'  => 'dst_pkgpart',