Skip to content

Commit ef41307

Browse files
committed
Merge branch 'master' of github.com:freeside/Freeside into Proj42404
2 parents 68a4a8e + d5067dd commit ef41307

8 files changed

Lines changed: 67 additions & 47 deletions

File tree

FS/FS/Conf.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3855,7 +3855,7 @@ and customer address. Include units.',
38553855
{
38563856
'key' => 'batchconfig-eft_canada',
38573857
'section' => 'billing',
3858-
'description' => 'Configuration for EFT Canada batching, four lines: 1. SFTP username, 2. SFTP password, 3. Transaction code, 4. Number of days to delay process date. If you are using separate per-agent batches (batch-spoolagent), you must set this option separately for each agent, as the global setting will be ignored.',
3858+
'description' => 'Configuration for EFT Canada batching, five lines: 1. SFTP username, 2. SFTP password, 3. Business transaction code, 4. Personal transaction code, 5. Number of days to delay process date. If you are using separate per-agent batches (batch-spoolagent), you must set this option separately for each agent, as the global setting will be ignored.',
38593859
'type' => 'textarea',
38603860
'per_agent' => 1,
38613861
},

FS/FS/cdr/cx3.pm

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,33 @@ use Date::Parse;
1010
%info = (
1111
'name' => '3CX',
1212
'weight' => 120,
13-
'header' => 1,
1413
'import_fields' => [
1514

1615

17-
sub {
18-
my ($cdr, $data, $conf, $param) = @_;
19-
$param->{skiprow} = 1 unless $data =~ 'CallDetail'; # skip non-detail records
16+
sub {
17+
my ($cdr, $data, $conf, $param) = @_;
18+
$param->{skiprow} = 1 unless $data =~ /Call\s/ ; # skip non-detail records
2019
}, # record type
21-
skip(2), # unknown, callid ( not unique )
22-
'src', # source
23-
'dst', # destination
24-
sub { my ($cdr, $calldate, $param) = @_;
25-
26-
if ($calldate =~ /^(\d{2})\/(\d{2})\/(\d{4})\s*(\d{2}):(\d{2}):(\d{2})$/){
20+
skip(1), # unknown, callid ( not unique )
21+
sub { my ($cdr, $duration) = @_;
22+
23+
my ($hour,$min,$sec) = split(/:/,$duration);
24+
$sec = sprintf ("%.0f", $sec);
25+
$sec += $min * 60;
26+
$sec += $hour * 60 * 60;
27+
$cdr->set('billsec', $sec);
28+
29+
}, # duration
30+
skip(1),
31+
sub { my ($cdr, $calldate, $param) = @_;
2732

2833
$cdr->set('calldate', $calldate);
29-
my $tmp_date = "$2/$1/$3 $4:$5:$6";
30-
31-
$tmp_date = str2time($tmp_date);
32-
$cdr->set('startdate', $tmp_date);
33-
}
3434
}, #date
35-
sub { my ($cdr, $duration) = @_;
36-
37-
my ($hour,$min,$sec) = split(/:/,$duration);
38-
$sec += $min * 60;
39-
$sec += $hour * 60 * 60;
40-
$sec = sprintf ("%.0f", $sec);
41-
$cdr->set('billsec', $sec);
42-
43-
}, #duration
44-
skip(1), # unknown
45-
'disposition', # call status
35+
skip(4),
4636
'accountcode', # AccountCode
37+
skip(6),
38+
'src', # source
39+
'dst', # destination
4740

4841
],
4942
);

FS/FS/pay_batch/eft_canada.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $name = 'eft_canada';
1515

1616
%import_info = ( filetype => 'NONE' ); # see FS/bin/freeside-eftca-download
1717

18-
my ($trans_code, $process_date);
18+
my ($business_trans_code, $personal_trans_code, $trans_code, $process_date);
1919

2020
#ref http://gocanada.about.com/od/canadatravelplanner/a/canada_holidays.htm
2121
my %holiday_yearly = (
@@ -66,7 +66,8 @@ my %holiday = (
6666
@config = $conf->config('batchconfig-eft_canada');
6767
}
6868
# SFTP login, password, trans code, delay time
69-
($trans_code) = $config[2];
69+
($business_trans_code) = $config[2];
70+
($personal_trans_code) = $config[3];
7071

7172
$process_date = time2str('%D', process_date($conf, $agentnum));
7273
},
@@ -82,12 +83,14 @@ my %holiday = (
8283
my $company = sprintf('%.64s', $cust_pay_batch->cust_main->company);
8384
if ( $company ) {
8485
push @fields, 'Business';
85-
push @fields, $company, ''
86+
push @fields, $company, '';
87+
$trans_code = $business_trans_code;
8688
}
8789
else {
8890
push @fields, 'Personal';
8991
push @fields, map { sprintf('%.64s', $_) }
9092
$cust_pay_batch->first, $cust_pay_batch->last;
93+
$trans_code = $personal_trans_code;
9194
}
9295
my ($account, $aba) = split('@', $cust_pay_batch->payinfo);
9396
my($bankno, $branch);

debian/rules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ install-stamp: build-stamp
160160

161161
# Install interfaces
162162
$(MAKE) -e DESTDIR=$(TMP)-webui install-docs
163+
164+
# Install tex
165+
install -D -o freeside -m 444 etc/longtable.sty \
166+
$(TMP)-lib/usr/local/share/texmf/tex/latex/longtable.sty
167+
texhash $(TMP)-lib/usr/local/share/texmf
163168

164169
# Create Apache configurations
165170
install -d $(APACHE_CONF)

httemplate/elements/calendar.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,17 @@ Date.parseDate = function(str, fmt) {
16351635
case "%M":
16361636
min = parseInt(a[i], 10);
16371637
break;
1638+
1639+
case "%r":
1640+
hr = parseInt(a[i], 10);
1641+
min = parseInt(a[++i], 10);
1642+
var sec = parseInt(a[++i], 10);
1643+
if (/pm/i.test(a[++i]) && hr < 12)
1644+
hr += 12;
1645+
else if (/am/i.test(a[i]) && hr >= 12)
1646+
hr -= 12;
1647+
break;
1648+
16381649
}
16391650
}
16401651
if (isNaN(y)) y = today.getFullYear();
@@ -1759,7 +1770,13 @@ Date.prototype.print = function (str) {
17591770
s["%n"] = "\n"; // a newline character
17601771
s["%p"] = pm ? "PM" : "AM";
17611772
s["%P"] = pm ? "pm" : "am";
1762-
// FIXME: %r : the time in am/pm notation %I:%M:%S %p
1773+
1774+
// %r : the time in am/pm notation %I:%M:%S %p
1775+
s["%r"] = ( (ir < 10) ? ("0" + ir ) : ir ) + ':'
1776+
+ ( (min < 10) ? ("0" + min) : min ) + ':'
1777+
+ ( (sec < 10) ? ("0" + sec) : sec ) + ' '
1778+
+ (pm ? "PM" : "AM" );
1779+
17631780
// FIXME: %R : the time in 24-hour notation %H:%M
17641781
s["%s"] = Math.floor(this.getTime() / 1000);
17651782
s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59
@@ -1790,6 +1807,7 @@ Date.prototype.print = function (str) {
17901807
return str;
17911808
};
17921809

1810+
if ( !Date.prototype.__msh_oldSetFullYear ) {
17931811
Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear;
17941812
Date.prototype.setFullYear = function(y) {
17951813
var d = new Date(this);
@@ -1798,6 +1816,7 @@ Date.prototype.setFullYear = function(y) {
17981816
this.setDate(28);
17991817
this.__msh_oldSetFullYear(y);
18001818
};
1819+
}
18011820

18021821
// END: DATE OBJECT PATCHES
18031822

httemplate/elements/calendar_stripped.js

Lines changed: 2 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

httemplate/elements/input-date-field.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
ifFormat: "<% $format %>",
1515
button: "<% $name %>_button",
1616
align: "BR"
17+
% if ( $format =~ /\%r/ ) {
18+
,
19+
showsTime: true,
20+
timeFormat: 12
21+
% }
1722
});
1823
</SCRIPT>
1924

httemplate/elements/tr-input-date-field.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<TR>
2828
<TD ALIGN="right"><% $label %></TD>
29-
<TD>
29+
<TD COLSPAN=<% $colspan %>>
3030
<INPUT TYPE="text" NAME="<% $name %>" ID="<% $name %>_text" VALUE="<% $value %>">
3131
<IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $name %>_button" STYLE="cursor: pointer" TITLE="<% mt('Select date') |h %>">
3232
</TD>
@@ -38,12 +38,17 @@
3838
ifFormat: "<% $format %>",
3939
button: "<% $name %>_button",
4040
align: "BR"
41+
% if ( $format =~ /\%r/ ) {
42+
,
43+
showsTime: true,
44+
timeFormat: 12
45+
% }
4146
});
4247
</SCRIPT>
4348

4449
<%init>
4550

46-
my($name, $value, $label, $format, $usedatetime, $noinit);
51+
my($name, $value, $label, $format, $usedatetime, $noinit, $colspan);
4752
if ( ref($_[0]) ) {
4853
my $opt = shift;
4954
$name = $opt->{'name'};
@@ -52,8 +57,10 @@
5257
$format = $opt->{'format'};
5358
$usedatetime = $opt->{'usedatetime'};
5459
$noinit = $opt->{'noinit'};
60+
$colspan = $opt->{'colspan'} || 1;
5561
} else {
5662
($name, $value, $label, $format, $usedatetime) = @_;
63+
$colspan = 1;
5764
}
5865

5966
my $conf = new FS::Conf;

0 commit comments

Comments
 (0)