summaryrefslogtreecommitdiff
path: root/doc/bugs/links_from_sidebars
ModeNameSize
-rw-r--r--discussion.mdwn175logplain
li>
  • # with permission.
  • #
  • # This file contains source code included with or based on SQL-Ledger which
  • # is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed
  • # under the GNU General Public License version 2 or, at your option, any later
  • # version. For a full list including contact information of contributors,
  • # maintainers, and copyright holders, see the CONTRIBUTORS file.
  • #
  • # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork):
  • # Copyright (C) 2000
  • #
  • # Author: DWS Systems Inc.
  • # Web: http://www.sql-ledger.org
  • #
  • # Contributors: Jim Rawlings <jim@your-dba.com>
  • #`
  • #======================================================================
  • #
  • # This file has undergone whitespace cleanup.
  • #
  • #======================================================================
  • #
  • # Inventory invoicing module
  • #
  • #======================================================================
  • package IS;
  • use LedgerSMB::Tax;
  • use LedgerSMB::PriceMatrix;
  • use LedgerSMB::Sysconfig;
  • sub invoice_details {
  • use LedgerSMB::CP;
  • my ($self, $myconfig, $form) = @_;
  • $form->{duedate} = $form->{transdate} unless ($form->{duedate});
  • # connect to database
  • my $dbh = $form->{dbh};
  • my $query = qq|
  • SELECT ?::date - ?::date
  • AS terms, value
  • FROM defaults
  • WHERE setting_key = 'weightunit'/|;
  • my $sth = $dbh->prepare($query);
  • $sth->execute($form->{duedate}, $form->{transdate})
  • || $form->dberror($query);
  • ($form->{terms}, $form->{weightunit}) = $sth->fetchrow_array;
  • $sth->finish;
  • # this is for the template
  • $form->{invdate} = $form->{transdate};
  • my $tax = 0;
  • my $item;
  • my $i;
  • my @sortlist = ();
  • my $projectnumber;
  • my $projectdescription;
  • my $projectnumber_id;
  • my $translation;
  • my $partsgroup;
  • my @taxaccounts;
  • my %taxaccounts;
  • my $tax;
  • my $taxrate;
  • my $taxamount;
  • my %translations;
  • $query = qq|
  • SELECT p.description, t.description
  • FROM project p
  • LEFT JOIN translation t
  • ON (t.trans_id = p.id
  • AND t.language_code = ?)
  • WHERE id = ?|;
  • my $prh = $dbh->prepare($query) || $form->dberror($query);
  • $query = qq|
  • SELECT inventory_accno_id, income_accno_id,
  • expense_accno_id, assembly, weight FROM parts
  • WHERE id = ?|;
  • my $pth = $dbh->prepare($query) || $form->dberror($query);
  • my $sortby;
  • # sort items by project and partsgroup