From: ivan Date: Mon, 1 Mar 2010 22:18:12 +0000 (+0000) Subject: fixup editing w/manual inventory, RT#7010 X-Git-Tag: freeside_1_9_2~43 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=4a282fb5adb537703944f677cdd3a6c6cf211456 fixup editing w/manual inventory, RT#7010 --- diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html index 0ffb4319f..453d07f88 100644 --- a/httemplate/edit/elements/svc_Common.html +++ b/httemplate/edit/elements/svc_Common.html @@ -65,15 +65,20 @@ } elsif ( $flag eq 'A' ) { $f->{'type'} = 'hidden'; } elsif ( $flag eq 'M' ) { - $f->{'type'} = 'select-table'; - $f->{'table'} = 'inventory_item'; - $f->{'name_col'} = 'item'; - $f->{'value_col'} = 'item'; - $f->{'hashref'} = { - 'classnum' => $columndef->columnvalue, - 'svcnum' => '', - }; $f->{'empty_label'} = 'Select inventory item'; + $f->{'type'} = 'select-table'; + $f->{'table'} = 'inventory_item'; + $f->{'name_col'} = 'item'; + $f->{'value_col'} = 'item'; + $f->{'hashref'} = { + 'classnum'=>$columndef->columnvalue, + #'svcnum' => '', + }; + $f->{'extra_sql'} = 'AND ( svcnum IS NULL '; + $f->{'extra_sql'} .= ' OR svcnum = '. $object->svcnum + if $object->svcnum; + $f->{'extra_sql'} .= ' ) '; + $f->{'disable_empty'} = $object->svcnum ? 1 : 0, } if ( $f->{'type'} eq 'select-svc_pbx' ) {