[freeside-commits] branch master updated. eb3b279f1a86fc3a371b38df8089935bd0ee1438

Ivan ivan at 420.am
Mon Jul 2 21:54:24 PDT 2012


The branch, master has been updated
       via  eb3b279f1a86fc3a371b38df8089935bd0ee1438 (commit)
       via  244c685b5ffd7bd39629bf924e55ecb2bf5abfda (commit)
       via  85e677b86fc37c54e6de2b06340351a28f5a5916 (commit)
       via  e5ab051ccdb7637d8dd2f0ed9b4fe9aaaf1d1100 (commit)
       via  fe15c4e613ec967e7fa5f95b3982b53364c24de9 (commit)
       via  53fe471803155c11f32d7d1626960f6951b618bc (commit)
       via  4b65016d2e366d5a8f0956ec99ecb6d7d85351d7 (commit)
       via  0f5c3c06074db3d1eae6c0cd73c13f5561fcf219 (commit)
       via  7a52dd12737022063571ecc0faecc953973e4575 (commit)
       via  c2fd718e7358c4b337f0aa1294c6eb38ea5c6c46 (commit)
      from  508c7c268254ef63f26bb8a59aa679a6e24f5019 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit eb3b279f1a86fc3a371b38df8089935bd0ee1438
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 21:54:19 2012 -0700

    fix ticket creation, RT#13852

diff --git a/rt/share/html/Ticket/Create.html b/rt/share/html/Ticket/Create.html
index f29dfbb..0419126 100755
--- a/rt/share/html/Ticket/Create.html
+++ b/rt/share/html/Ticket/Create.html
@@ -66,7 +66,6 @@
 
 <div id="ticket-create-metadata">
     <&| /Widgets/TitleBox, title => loc("Basics"), class=>'ticket-info-basics' &>
-    <input type="hidden" class="hidden" name="Queue" value="<% $QueueObj->Id %>" />
     <table width="100%" border="0">
     <& /Ticket/Elements/EditBasics,
         InTable => 1,

commit 244c685b5ffd7bd39629bf924e55ecb2bf5abfda
Merge: 85e677b 508c7c2
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 15:17:06 2012 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit 85e677b86fc37c54e6de2b06340351a28f5a5916
Merge: e5ab051 92aeddd
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 14:24:21 2012 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit e5ab051ccdb7637d8dd2f0ed9b4fe9aaaf1d1100
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 14:24:19 2012 -0700

    quotations, RT#16996

diff --git a/httemplate/edit/process/quotation.html b/httemplate/edit/process/quotation.html
new file mode 100644
index 0000000..7671c36
--- /dev/null
+++ b/httemplate/edit/process/quotation.html
@@ -0,0 +1,11 @@
+<% include( 'elements/process.html',
+               'table'       => 'quotation',
+               'redirect'    => $p.'view/quotation.html?',
+           )
+%>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation');
+
+</%init>
diff --git a/httemplate/edit/quotation.html b/httemplate/edit/quotation.html
new file mode 100644
index 0000000..f706425
--- /dev/null
+++ b/httemplate/edit/quotation.html
@@ -0,0 +1,15 @@
+<% include( 'elements/edit.html',
+                 'name'   => 'Quotation',
+                 'table'  => 'quotation',
+                 'labels' => { 
+                               'quotationnum' => 'Quotation number',
+                             },
+                 #XXX some way to disable the "view all"
+           )
+%>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation');
+
+</%init>
diff --git a/httemplate/view/quotation.html b/httemplate/view/quotation.html
new file mode 100755
index 0000000..2c2c6b7
--- /dev/null
+++ b/httemplate/view/quotation.html
@@ -0,0 +1,81 @@
+<& /elements/header.html, mt('Quotation View'), $menubar &>
+
+%#XXX link to order...
+
+<%doc>
+
+XXX resending quotations
+
+% if ( $curuser->access_right('Resend invoices') ) {
+
+    <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
+
+%   if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { 
+        | <A HREF="<% $p %>misc/send-invoice.cgi?method=email;<% $link %>"><% mt('Re-email this invoice') |h %></A>
+%   } 
+
+%   if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { 
+        | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
+%   } 
+
+    <BR><BR>
+
+% } 
+
+XXX view typset quotation
+
+% if ( $conf->exists('invoice_latex') ) { 
+
+  <A HREF="<% $p %>view/cust_bill-pdf.cgi?<% $link %>"><% mt('View typeset invoice PDF') |h %></A>
+  <BR><BR>
+% } 
+
+XXX actually show the quotation
+
+% if ( $conf->exists('invoice_html') ) { 
+  <% join('', $cust_bill->print_html(\%opt) ) %>
+% } else { 
+  <PRE><% join('', $cust_bill->print_text(\%opt) ) %></PRE>
+% } 
+
+</%doc>
+
+<& /elements/footer.html &>
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+#die "access denied"
+#  unless $curuser->access_right('View quotations');
+
+my $quotationnum;
+my($query) = $cgi->keywords;
+if ( $query =~ /^(\d+)$/ ) {
+  $quotationnum = $1;
+} else {
+  $quotationnum = $cgi->param('quotationnum');
+}
+
+#my $conf = new FS::Conf;
+
+my $quotation = qsearchs({
+  'select'    => 'quotation.*',
+  'table'     => 'quotation',
+  #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
+  'hashref'   => { 'quotationnum' => $quotationnum },
+  #'extra_sql' => ' AND '. $curuser->agentnums_sql,
+});
+die "Quotation #$quotationnum not found!" unless $quotation;
+
+if ( my $custnum = $quotation->custnum ) {
+  my $display_custnum = $quotation->cust_main->display_custnum;
+  $menubar = menubar(
+    emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum",
+  );
+} elsif ( my $prospectnum = $quotation->prospectnum ) {
+  $menubar = menubar(
+    emt("View this prospect (#[_1])",$prospectnum) => "${p}view/prospect_main.html?$prospectnum",
+  );
+}
+
+</%init>

commit fe15c4e613ec967e7fa5f95b3982b53364c24de9
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 14:23:49 2012 -0700

    quotations, RT#16996

diff --git a/FS/t/Quotable_Mixin.t b/FS/t/Quotable_Mixin.t
new file mode 100644
index 0000000..cb0a561
--- /dev/null
+++ b/FS/t/Quotable_Mixin.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::Quotable_Mixin;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/quotation.t b/FS/t/quotation.t
new file mode 100644
index 0000000..effcac6
--- /dev/null
+++ b/FS/t/quotation.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::quotation;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/quotation_pkg.t b/FS/t/quotation_pkg.t
new file mode 100644
index 0000000..5164c7e
--- /dev/null
+++ b/FS/t/quotation_pkg.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::quotation_pkg;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/quotation_pkg_discount.t b/FS/t/quotation_pkg_discount.t
new file mode 100644
index 0000000..a1c5f53
--- /dev/null
+++ b/FS/t/quotation_pkg_discount.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::quotation_pkg_discount;
+$loaded=1;
+print "ok 1\n";

commit 53fe471803155c11f32d7d1626960f6951b618bc
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 14:23:30 2012 -0700

    quotations, RT#16996

diff --git a/FS/FS/quotation_pkg_discount.pm b/FS/FS/quotation_pkg_discount.pm
new file mode 100644
index 0000000..34e13a6
--- /dev/null
+++ b/FS/FS/quotation_pkg_discount.pm
@@ -0,0 +1,128 @@
+package FS::quotation_pkg_discount;
+
+use strict;
+use base qw( FS::Record );
+use FS::Record qw( qsearch qsearchs );
+
+=head1 NAME
+
+FS::quotation_pkg_discount - Object methods for quotation_pkg_discount records
+
+=head1 SYNOPSIS
+
+  use FS::quotation_pkg_discount;
+
+  $record = new FS::quotation_pkg_discount \%hash;
+  $record = new FS::quotation_pkg_discount { 'column' => 'value' };
+
+  $error = $record->insert;
+
+  $error = $new_record->replace($old_record);
+
+  $error = $record->delete;
+
+  $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::quotation_pkg_discount object represents a quotation package discount.
+FS::quotation_pkg_discount inherits from FS::Record.  The following fields are
+currently supported:
+
+=over 4
+
+=item quotationpkgdiscountnum
+
+primary key
+
+=item quotationpkgnum
+
+quotationpkgnum
+
+=item discountnum
+
+discountnum
+
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new quotation package discount.  To add the quotation package
+discount to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to.  You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'quotation_pkg_discount'; }
+
+=item insert
+
+Adds this record to the database.  If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database.  If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid quotation package discount.
+If there is an error, returns the error, otherwise returns false.
+Called by the insert and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+  my $self = shift;
+
+  my $error = 
+    $self->ut_numbern('quotationpkgdiscountnum')
+    || $self->ut_foreign_key('quotationpkgnum', 'quotation_pkg', 'quotationpkgnum' )
+    || $self->ut_foreign_key('discountnum', 'discount', 'discountnum' )
+  ;
+  return $error if $error;
+
+  $self->SUPER::check;
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+

commit 4b65016d2e366d5a8f0956ec99ecb6d7d85351d7
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 14:23:11 2012 -0700

    quotations, RT#16996

diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm
new file mode 100644
index 0000000..48d5906
--- /dev/null
+++ b/FS/FS/quotation_pkg.pm
@@ -0,0 +1,133 @@
+package FS::quotation_pkg;
+
+use strict;
+use base qw( FS::Record );
+use FS::Record; # qw( qsearch qsearchs );
+use FS::part_pkg;
+use FS::cust_location;
+
+=head1 NAME
+
+FS::quotation_pkg - Object methods for quotation_pkg records
+
+=head1 SYNOPSIS
+
+  use FS::quotation_pkg;
+
+  $record = new FS::quotation_pkg \%hash;
+  $record = new FS::quotation_pkg { 'column' => 'value' };
+
+  $error = $record->insert;
+
+  $error = $new_record->replace($old_record);
+
+  $error = $record->delete;
+
+  $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::quotation_pkg object represents a quotation package.
+FS::quotation_pkg inherits from FS::Record.  The following fields are currently
+supported:
+
+=over 4
+
+=item quotationpkgnum
+
+primary key
+
+=item pkgpart
+
+pkgpart
+
+=item locationnum
+
+locationnum
+
+=item start_date
+
+start_date
+
+=item contract_end
+
+contract_end
+
+=item quantity
+
+quantity
+
+=item waive_setup
+
+waive_setup
+
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new quotation package.  To add the quotation package to the database,
+see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to.  You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'quotation_pkg'; }
+
+=item insert
+
+Adds this record to the database.  If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Delete this record from the database.
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database.  If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid quotation package.  If there is
+an error, returns the error, otherwise returns false.  Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+  my $self = shift;
+
+  my $error = 
+    $self->ut_numbern('quotationpkgnum')
+    || $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart' )
+    || $self->ut_foreign_keyn('locationnum', 'cust_location', 'locationnum' )
+    || $self->ut_numbern('start_date')
+    || $self->ut_numbern('contract_end')
+    || $self->ut_numbern('quantity')
+    || $self->ut_enum('waive_setup', [ '', 'Y'] )
+  ;
+  return $error if $error;
+
+  $self->SUPER::check;
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+

commit 0f5c3c06074db3d1eae6c0cd73c13f5561fcf219
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 14:23:05 2012 -0700

    quotations, RT#16996

diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm
new file mode 100644
index 0000000..4202335
--- /dev/null
+++ b/FS/FS/quotation.pm
@@ -0,0 +1,148 @@
+package FS::quotation;
+
+use strict;
+use base qw( FS::otaker_Mixin FS::Record );
+use FS::Record; # qw( qsearch qsearchs );
+use FS::cust_main;
+use FS::prospect_main;
+
+=head1 NAME
+
+FS::quotation - Object methods for quotation records
+
+=head1 SYNOPSIS
+
+  use FS::quotation;
+
+  $record = new FS::quotation \%hash;
+  $record = new FS::quotation { 'column' => 'value' };
+
+  $error = $record->insert;
+
+  $error = $new_record->replace($old_record);
+
+  $error = $record->delete;
+
+  $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::quotation object represents a quotation.  FS::quotation inherits from
+FS::Record.  The following fields are currently supported:
+
+=over 4
+
+=item quotationnum
+
+primary key
+
+=item prospectnum
+
+prospectnum
+
+=item custnum
+
+custnum
+
+=item _date
+
+_date
+
+=item disabled
+
+disabled
+
+=item usernum
+
+usernum
+
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new quotation.  To add the quotation to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to.  You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'quotation'; }
+
+=item insert
+
+Adds this record to the database.  If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Delete this record from the database.
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database.  If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid quotation.  If there is
+an error, returns the error, otherwise returns false.  Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+  my $self = shift;
+
+  my $error = 
+    $self->ut_numbern('quotationnum')
+    || $self->ut_foreign_keyn('prospectnum', 'prospect_main', 'prospectnum' )
+    || $self->ut_foreign_keyn('custnum', 'cust_main', 'custnum' )
+    || $self->ut_numbern('_date')
+    || $self->ut_enum('disabled', [ '', 'Y' ])
+    || $self->ut_numbern('usernum')
+  ;
+  return $error if $error;
+
+  $self->_date(time) unless $self->_date;
+
+  #XXX set usernum
+
+  $self->SUPER::check;
+}
+
+=item prospect_main
+
+=cut
+
+sub prospect_main {
+  my $self = shift;
+  qsearchs('prospect_main', { 'prospectnum' => $self->prospectnum } );
+}
+
+=item cust_main
+
+=cut
+
+sub cust_main {
+  my $self = shift;
+  qsearchs('cust_main', { 'custnum' => $self->custnum } );
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+

commit 7a52dd12737022063571ecc0faecc953973e4575
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 14:22:56 2012 -0700

    quotations, RT#16996

diff --git a/FS/FS/Quotable_Mixin.pm b/FS/FS/Quotable_Mixin.pm
new file mode 100644
index 0000000..dfd3ddd
--- /dev/null
+++ b/FS/FS/Quotable_Mixin.pm
@@ -0,0 +1,13 @@
+package FS::Quotable_Mixin;
+
+use strict;
+use FS::Record qw( qsearch ); #qsearchs );
+use FS::quotation;
+
+sub quotation {
+  my $self = shift;
+  my $pk = $self->primary_key;
+  qsearch('quotation', { $pk => $self->$pk() } );
+}
+
+1;

commit c2fd718e7358c4b337f0aa1294c6eb38ea5c6c46
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 2 14:22:10 2012 -0700

    quotations, RT#16996

diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index 6c4a1b8..2a0908a 100644
--- a/FS/FS/Mason.pm
+++ b/FS/FS/Mason.pm
@@ -309,6 +309,9 @@ if ( -e $addl_handler_use_file ) {
   use FS::contact_class;
   use FS::part_svc_class;
   use FS::ftp_target;
+  use FS::quotation;
+  use FS::quotation_pkg;
+  use FS::quotation_pkg_discount;
   # Sammath Naur
 
   if ( $FS::Mason::addl_handler_use ) {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Mason.pm                         |    3 +
 FS/FS/Quotable_Mixin.pm                |   13 +++
 FS/FS/quotation.pm                     |  148 ++++++++++++++++++++++++++++++++
 FS/FS/quotation_pkg.pm                 |  133 ++++++++++++++++++++++++++++
 FS/FS/quotation_pkg_discount.pm        |  128 +++++++++++++++++++++++++++
 FS/t/Quotable_Mixin.t                  |    5 +
 FS/t/quotation.t                       |    5 +
 FS/t/quotation_pkg.t                   |    5 +
 FS/t/quotation_pkg_discount.t          |    5 +
 httemplate/edit/process/quotation.html |   11 +++
 httemplate/edit/quotation.html         |   15 +++
 httemplate/view/quotation.html         |   81 +++++++++++++++++
 rt/share/html/Ticket/Create.html       |    1 -
 13 files changed, 552 insertions(+), 1 deletions(-)
 create mode 100644 FS/FS/Quotable_Mixin.pm
 create mode 100644 FS/FS/quotation.pm
 create mode 100644 FS/FS/quotation_pkg.pm
 create mode 100644 FS/FS/quotation_pkg_discount.pm
 create mode 100644 FS/t/Quotable_Mixin.t
 create mode 100644 FS/t/quotation.t
 create mode 100644 FS/t/quotation_pkg.t
 create mode 100644 FS/t/quotation_pkg_discount.t
 create mode 100644 httemplate/edit/process/quotation.html
 create mode 100644 httemplate/edit/quotation.html
 create mode 100755 httemplate/view/quotation.html




More information about the freeside-commits mailing list