Skip to content

Commit d0fa7d2

Browse files
committed
Version 3.2.7 (Nov 17, 2018)
- fixed inventory bug when converting an order to an invoice - added option to limit sales to inventory on hand - added option to hide closed accounts - added lot and expiry date for parts and assemblies - added option to force using a warehouse - fixed missing function call for printing timecards - added storescards for batch printing and queueing - fixed display for first selected customer/vendor on payment screen - added upload image function - added make and model to selection screen and forms - changed cookie to allow space in login names - fixed subtotals on payroll report - added missing module link for batch printing - fixed totals on invoices with kits
1 parent 764b22e commit d0fa7d2

File tree

1,853 files changed

+113434
-81790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,853 files changed

+113434
-81790
lines changed

SL/.htaccess

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
AuthType basic
2-
AuthName "Unauthorized"
3-
AuthUserFile /dev/null
4-
Require valid-user
1+
deny from all

SL/AA.pm

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,68 +1579,6 @@ sub vc_links {
15791579
}
15801580

15811581

1582-
sub consolidate {
1583-
my ($self, $myconfig, $form) = @_;
1584-
1585-
# connect to database
1586-
my $dbh = $form->dbconnect($myconfig);
1587-
1588-
my %defaults = $form->get_defaults($dbh, \@{['precision', 'company']});
1589-
for (keys %defaults) { $form->{$_} = $defaults{$_} }
1590-
1591-
my $invoice = ($form->{type} eq 'invoice') ? 1 : 0;
1592-
my $arap = lc $form->{ARAP};
1593-
my $vc = ($form->{ARAP} eq 'AR') ? 'customer' : 'vendor';
1594-
1595-
my $query = qq|SELECT a.*, c.prec
1596-
FROM $arap a
1597-
LEFT JOIN curr c ON (c.curr = a.curr)
1598-
WHERE amount != paid
1599-
AND invoice = '$invoice'
1600-
AND approved = '1'
1601-
AND onhold = '0'|;
1602-
1603-
my @sf = (transdate);
1604-
my %ordinal = $form->ordinal_order($dbh, $query);
1605-
$query .= qq| ORDER BY | .$form->sort_order(\@sf, \%ordinal);
1606-
1607-
my $sth = $dbh->prepare($query);
1608-
$sth->execute || $form->dberror($query);
1609-
1610-
$query = qq|SELECT c.name, a.city
1611-
FROM $vc c
1612-
JOIN address a ON (a.trans_id = c.id)
1613-
WHERE c.id = ?|;
1614-
my $cth = $dbh->prepare($query);
1615-
1616-
$query = qq|SELECT c.accno
1617-
FROM acc_trans ac
1618-
JOIN chart c ON (c.id = ac.chart_id)
1619-
WHERE ac.trans_id = ?
1620-
AND c.link = '$form->{ARAP}'|;
1621-
my $ath = $dbh->prepare($query);
1622-
1623-
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
1624-
$cth->execute($ref->{"${vc}_id"});
1625-
($ref->{name}, $ref->{city}) = $cth->fetchrow_array;
1626-
$cth->finish;
1627-
1628-
$ath->execute($ref->{id});
1629-
($arap) = $ath->fetchrow_array;
1630-
$ath->finish;
1631-
1632-
$form->{$ref->{curr}}++;
1633-
1634-
push @{ $form->{all_transactions}{$ref->{curr}}{$arap}{$ref->{name}} }, $ref;
1635-
}
1636-
$sth->finish;
1637-
1638-
$dbh->disconnect;
1639-
1640-
}
1641-
1642-
1643-
16441582
1;
16451583

16461584
=encoding utf8
@@ -1666,10 +1604,6 @@ L<SL::AA> implements the following functions:
16661604
16671605
AA->company_details($myconfig, $form, $dbh);
16681606
1669-
=head2 consolidate
1670-
1671-
AA->consolidate($myconfig, $form);
1672-
16731607
=head2 delete_transaction
16741608
16751609
AA->delete_transaction($myconfig, $form, $dbh);

SL/AM.pm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3369,19 +3369,18 @@ sub audit_log {
33693369
$dateformat =~ s/yy$/yyyy/;
33703370
$dateformat =~ s/yyyyyy/yyyy/;
33713371

3372-
my %datestyle = ( Pg => "set DateStyle to SQL, US" );
3373-
3374-
my $query = qq|$datestyle{$myconfig->{dbdriver}};
3372+
my $query = qq|
33753373
SELECT a.*, e.name, e.employeenumber, e.login,
3376-
to_char(a.transdate, '$dateformat') AS transdate,
3374+
a.transdate,
3375+
to_char(a.transdate, '$dateformat') AS transdatea,
33773376
to_char(a.transdate, 'HH24:MI:SS') AS transtime
33783377
FROM audittrail a
33793378
LEFT JOIN employee e ON (e.id = a.employee_id)
33803379
$where|;
33813380

33823381
$form->{sort} ||= "transdate";
33833382
my @sf;
3384-
push @sf, ($form->{sort} eq 'transdate') ? qw(transdate transtime) : $form->{sort};
3383+
push @sf, $form->{sort};
33853384
my %ordinal = $form->ordinal_order($dbh, $query);
33863385
my $sortorder = $form->sort_order(\@sf, \%ordinal);
33873386

@@ -3396,6 +3395,8 @@ sub audit_log {
33963395

33973396
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
33983397
$ref->{login} = 'admin' if $ref->{employee_id} == 0;
3398+
$ref->{transdate} = $ref->{transdatea};
3399+
delete $ref->{transdatea};
33993400
push @{ $form->{ALL} }, $ref;
34003401
}
34013402
$sth->finish;

SL/BP.pm

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ sub get_vc {
3131
sales_quotation => { oe => customer },
3232
request_quotation => { oe => vendor },
3333
timecard => { jcitems => employee },
34+
storescard => { jcitems => employee },
3435
);
3536

3637
my $query;
@@ -146,7 +147,7 @@ sub get_vc {
146147
$form->all_years($myconfig, $dbh);
147148

148149
if ($form->{type} =~ /(timecard|storescard)/) {
149-
$form->all_projects($myconfig, $dbh);
150+
$form->all_projects($myconfig, $dbh, undef, ($form->{type} eq 'storescard'));
150151
}
151152

152153
$dbh->disconnect;
@@ -191,11 +192,8 @@ sub get_spoolfiles {
191192

192193
my $where;
193194

194-
if ($form->{type} eq 'timecard') {
195-
my $dateformat = $myconfig->{dateformat};
196-
197-
$dateformat =~ s/yy/yyyy/;
198-
$dateformat =~ s/yyyyyy/yyyy/;
195+
if ($form->{type} =~ /(timecard|storescard)/) {
196+
my $dateformat = 'YYYY-MM-DD';
199197

200198
$invnumber = 'id';
201199
$where = "1=1";
@@ -206,7 +204,7 @@ sub get_spoolfiles {
206204
j.id AS invnumber,
207205
to_char(j.checkedin, '$dateformat') AS transdate,
208206
'' AS ordnumber, '' AS quonumber, '0' AS invoice,
209-
'jc' AS module, s.spoolfile, j.description,
207+
'jcitems' AS tablename, s.spoolfile, j.description,
210208
j.sellprice * j.qty AS amount, ad.city, e.id AS employee_id
211209
FROM jcitems j
212210
JOIN employee e ON (e.id = j.employee_id)
@@ -244,7 +242,7 @@ sub get_spoolfiles {
244242
j.id AS invnumber,
245243
to_char(j.checkedin, '$dateformat') AS transdate,
246244
'' AS ordnumber, '' AS quonumber, '0' AS invoice,
247-
'jc' AS module, '' AS spoolfile, j.description,
245+
'jcitems' AS tablename, '' AS spoolfile, j.description,
248246
j.sellprice * j.qty AS amount, ad.city, e.id AS employee_id
249247
FROM jcitems j
250248
JOIN employee e ON (e.id = j.employee_id)
@@ -318,7 +316,7 @@ sub get_spoolfiles {
318316
vc.$arap{$form->{type}}{$item}number AS vcnumber,
319317
a.$invnumber AS invnumber, a.transdate,
320318
a.ordnumber, a.quonumber, $invoice AS invoice,
321-
'$item' AS module, s.spoolfile, a.description, a.amount,
319+
'$item' AS tablename, s.spoolfile, a.description, a.amount,
322320
ad.city, vc.email, '$arap{$form->{type}}{$item}' AS db,
323321
vc.id AS vc_id
324322
FROM $item a
@@ -329,7 +327,6 @@ sub get_spoolfiles {
329327
AND s.spoolfile <> ''
330328
AND s.formname LIKE '$wildcard$form->{type}'|;
331329
} else {
332-
333330
if ($item ne 'oe' && $form->{onhold}) {
334331
$form->{open} = "Y";
335332
$form->{closed} = "";
@@ -375,10 +372,9 @@ sub get_spoolfiles {
375372
}
376373
}
377374
}
378-
} else {
379-
$where .= qq| AND a.id = 0|;
375+
} else {
376+
$where .= qq| AND a.id = 0|;
380377
}
381-
382378
}
383379

384380
$query .= qq|
@@ -387,7 +383,7 @@ sub get_spoolfiles {
387383
vc.$arap{$form->{type}}{$item}number AS vcnumber,
388384
a.$invnumber AS invnumber, a.transdate,
389385
a.ordnumber, a.quonumber, $invoice AS invoice,
390-
'$item' AS module, '' AS spoolfile, a.description, a.amount,
386+
'$item' AS tablename, '' AS spoolfile, a.description, a.amount,
391387
'$arap{$form->{type}}{$item}' AS vc,
392388
ad.city, vc.email, '$arap{$form->{type}}{$item}' AS db,
393389
vc.id AS vc_id
@@ -459,7 +455,7 @@ sub get_spoolfiles {
459455
AND s.spoolfile IS NOT NULL
460456
AND s.spoolfile <> ''|;
461457

462-
if ($form->{type} eq 'timecard') {
458+
if ($form->{type} =~ /(timecard|storescard)/) {
463459
$query .= qq|AND s.trans_id NOT IN (SELECT id FROM jcitems)|;
464460

465461
} else {
@@ -518,7 +514,7 @@ sub delete_spool {
518514
$sth->execute($form->{"spoolfile_$i"}) || $form->dberror;
519515
$sth->finish;
520516

521-
%audittrail = ( tablename => $form->{module},
517+
%audittrail = ( tablename => $form->{"tablename_$i"},
522518
reference => $form->{"reference_$i"},
523519
formname => $formname,
524520
action => 'dequeued',
@@ -589,7 +585,7 @@ sub print_spool {
589585
$sth->execute($form->{spoolfile}) || $form->dberror;
590586
$sth->finish;
591587

592-
%audittrail = ( tablename => $form->{module},
588+
%audittrail = ( tablename => $form->{tablename},
593589
reference => $form->{reference},
594590
formname => $formname,
595591
action => 'printed',

SL/CA.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sub all_accounts {
2424

2525
my $ref;
2626

27-
my %defaults = $form->get_defaults($dbh, \@{['precision', 'company']});
27+
my %defaults = $form->get_defaults($dbh, \@{['precision', 'company', 'hideaccounts']});
2828
for (keys %defaults) { $form->{$_} = $defaults{$_} }
2929

3030
my $query = qq|SELECT c.accno,

SL/CP.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ sub get_openvc {
128128

129129
my $dbh = $form->dbconnect($myconfig);
130130

131+
$form->remove_locks($myconfig, $dbh, $form->{arap});
132+
$form->{redo} = 1;
133+
$form->{locks_removed} = 1;
134+
131135
my $where = qq|a.amount != a.paid
132136
AND a.approved = '1'
133137
AND a.onhold = '0'
@@ -236,6 +240,8 @@ sub get_openvc {
236240

237241
my %vc;
238242

243+
@{ $form->{name_list} } = ();
244+
239245
foreach $ref (@transactions) {
240246

241247
next if $vc{$ref->{id}};
@@ -540,6 +546,8 @@ sub get_openinvoices {
540546

541547
$sth->finish;
542548

549+
$form->{PR} = ();
550+
543551
foreach $ref (@transactions) {
544552
if ($form->{vc} eq 'vendor') {
545553
if ($ref->{threshold} > 0) {

0 commit comments

Comments
 (0)