Skip to content

Commit

Permalink
Merge branch '1.3' of https://github.com/ledgersmb/LedgerSMB into led…
Browse files Browse the repository at this point in the history
…gersmb-1.3

Github cannot automatically merge latest commits from central, so, I have to do it manually.
  • Loading branch information
pongraczi committed Oct 16, 2014
2 parents a423916 + d66af6a commit 2ac2161
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 25 deletions.
5 changes: 5 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Changelog for 1.3.45
* Fixed pricematrix prices not respected for vendors (Chris T, bug 1230)
* Added tests for Sysconfig (Chris T, bug 1232)
* Added first-rate starman/plack support (Chris T)
* Fixed bug 1239, reopening on previous close throws error (Chris T)
* Quieted some of the test cases (Chris T)
* Fixed bug 1244, manually entered tax crashes invoice on edit (Chris T)
* Fixed bug 1251, some backports failing due to misplacing db cnx (Chris T)
* Fixed bug 1241, join projection, amounts in invoice details report (Chris T)

Chris T is Chris Travers

Expand Down
10 changes: 5 additions & 5 deletions LedgerSMB/AA.pm
Original file line number Diff line number Diff line change
Expand Up @@ -890,12 +890,12 @@ sub transactions {

if ( !$form->{summary} and !$form->{outstanding} ) {
$acc_trans_flds = qq|
, c.accno, ac.source,
p.projectnumber, ac.memo AS description,
ac.amount AS linetotal,
, c.accno,
p.projectnumber,
((1 - i.discount) * i.qty * i.sellprice) as linetotal,
i.description AS linedescription|;
$group_by_fields = qq|, c.accno, ac.source, p.projectnumber, ac.memo,
ac.amount, i.description |;
$group_by_fields = qq|, c.accno, p.projectnumber,
i.discount, i.qty, i.sellprice, i.description |;

$acc_trans_join = qq|
JOIN acc_trans ac ON (a.id = ac.trans_id)
Expand Down
2 changes: 2 additions & 0 deletions LedgerSMB/DBObject.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ package LedgerSMB::DBObject;
use Scalar::Util;
use base qw(LedgerSMB);
use LedgerSMB::Log;
use LedgerSMB::App_State;
use strict;
use warnings;

Expand Down Expand Up @@ -107,6 +108,7 @@ sub exec_method {
my $self = shift @_;
my %args = (ref($_[0]) eq 'HASH')? %{$_[0]}: @_;
my $funcname = $args{funcname};
$self->{dbh} ||= $LedgerSMB::App_State::DBH;

my $schema = $args{schema} || $LedgerSMB::Sysconfig::db_namespace;

Expand Down
4 changes: 2 additions & 2 deletions UI/Contact/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
label = text('Threshold')
class = "numeric"
} ?>
<td> <?lsmb IF pricegroups.size > 0 ?>
<td> <?lsmb IF pricegroups.size ?>
<div id="pricegroup-div">
<?lsmb pricegroups.unshift({});
INCLUDE select element_data = {
Expand All @@ -607,7 +607,7 @@
<tr id="taxform-threshold-row">


<td><?lsmb IF taxform_list.size > 0 ?>
<td><?lsmb IF taxform_list.size ?>
<?lsmb taxform_list.unshift({});
INCLUDE select element_data = {
name = "taxform_id"
Expand Down
6 changes: 3 additions & 3 deletions bin/is.pl
Original file line number Diff line number Diff line change
Expand Up @@ -744,15 +744,15 @@ sub form_footer {
<th align=right>$form->{"${taccno}_description"}</th>
<td><input type="text" name="mt_amount_$item"
id="mt-amount-$item" value="|
.$form->format_amount($form->{"mt_amount_$item"})
.$form->format_amount(\%myconfig, $form->{"mt_amount_$item"})
.qq|" size="10"/></td>
<td><input type="text" name="mt_rate_$item"
id="mt-rate-$item" value="|
.$form->format_amount($form->{"mt_rate_$item"})
.$form->format_amount(\%myconfig, $form->{"mt_rate_$item"})
.qq|" size="4"/></td>
<td><input type="text" name="mt_basis_$item"
id="mt-basis-$item" value="|
.$form->format_amount($form->{"mt_basis_$item"})
.$form->format_amount(\%myconfig, $form->{"mt_basis_$item"})
.qq|" size="10"/></td>
<td><input type="text" name="mt_ref_$item"
id="mt-ref-$item" value="|
Expand Down
36 changes: 21 additions & 15 deletions sql/modules/EndOfYear.sql
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,27 @@ $$ LANGUAGE PLPGSQL;
COMMENT ON FUNCTION eoy_reopen_books(in_end_date date) IS
$$ Removes checkpoints and reverses yearend transactions on in_end_date$$;

CREATE OR REPLACE FUNCTION eoy__reopen_books_at(in_reopen_date date)
RETURNS BOOL
LANGUAGE SQL AS
$$

SELECT eoy_reopen_books(end_date)
FROM (SELECT end_date
FROM account_checkpoint
WHERE end_date >= $1
GROUP BY end_date) eoy_dates
ORDER BY end_date;

SELECT CASE WHEN (SELECT count(*) > 0 from account_checkpoint
where end_date = $1 - 1)
THEN true
ELSE eoy_create_checkpoint($1 - 1) > 0
END;

$$;


CREATE OR REPLACE FUNCTION account__obtain_balance
(in_transdate date, in_account_id int)
RETURNS numeric AS
Expand Down Expand Up @@ -222,19 +243,4 @@ COMMENT ON FUNCTION eoy_earnings_accounts() IS
$$ Lists equity accounts for the retained earnings dropdown.$$;


CREATE OR REPLACE FUNCTION eoy__reopen_books_at(in_reopen_date date)
RETURNS BOOL
LANGUAGE SQL AS
$$

SELECT eoy_reopen_books(end_date)
FROM (SELECT end_date
FROM account_checkpoint
WHERE end_date >= $1
GROUP BY end_date) eoy_dates
ORDER BY end_date;

SELECT eoy_create_checkpoint($1 - 1) > 0;

$$;
COMMIT;

0 comments on commit 2ac2161

Please sign in to comment.