Commit 02dc15b2 authored by Nigel Kukard's avatar Nigel Kukard

Merge branch 'nkupdates' into 'master'

Added end dates for client statements

See merge request !53
parents 1d831d47 2846ae05
Pipeline #5191 passed with stages
in 3 minutes and 28 seconds
# Statement functions
# Copyright (C) 2009-2014, AllWorldIT
# Copyright (C) 2009-2020, AllWorldIT
# Copyright (C) 2008, LinuxRulz
# Copyright (C) 2007 Nigel Kukard <nkukard@lbsd.net>
#
......@@ -51,14 +51,14 @@ our $pluginInfo = {
MenuItem => "Show",
Regex => "show",
Desc => "Display statement",
Help => 'show client="<client code>" [start="<start date>"]',
Help => 'show client="<client code>" [start="<start date>"] [end="yyyy-mm-dd"]',
Function => \&show,
},
{
MenuItem => "Send",
Regex => "send",
Desc => "Send statement",
Help => 'send client="<client code>" start="<yyyy-mm-dd>" [subject="<subject>"] sendto="<email[:addy1,addy2...] or file:filename>"',
Help => 'send client="<client code>" [start="<yyyy-mm-dd>"] [end="yyyy-mm-dd"] [subject="<subject>"] sendto="<email[:addy1,addy2...] or file:filename>"',
Function => \&send,
},
],
......@@ -86,6 +86,7 @@ sub show
my $detail;
$detail->{'ClientCode'} = $parms->{'client'};
$detail->{'StartDate'} = $parms->{'start'};
$detail->{'EndDate'} = $parms->{'end'};
my $res = soapCall($OUT,"wiaflos/server/api/Statements","getStatement",$detail);
if ($res->{'Result'} == RES_OK) {
......@@ -136,6 +137,7 @@ sub send
my $detail;
$detail->{'ClientCode'} = $parms->{'client'};
$detail->{'StartDate'} = $parms->{'start'};
$detail->{'EndDate'} = $parms->{'end'};
$detail->{'SendTo'} = $parms->{'sendto'};
$detail->{'Subject'} = $parms->{'subject'};
my $res = soapCall($OUT,"wiaflos/server/api/Statements","sendStatement",$detail);
......
# SOAP interface to Statements module
# Copyright (C) 2009-2014, AllWorldIT
# Copyright (C) 2009-2020, AllWorldIT
# Copyright (C) 2008, LinuxRulz
# Copyright (C) 2007 Nigel Kukard <nkukard@lbsd.net>
#
......@@ -53,6 +53,7 @@ sub init {
# Parameters:
# ClientCode - Client code
# StartDate - Start date
# EndDate - End date
sub getStatement {
my (undef,$data) = @_;
......@@ -67,6 +68,7 @@ sub getStatement {
my $detail;
$detail->{'ClientCode'} = $data->{'ClientCode'};
$detail->{'StartDate'} = $data->{'StartDate'};
$detail->{'EndDate'} = $data->{'EndDate'};
my $rawData = wiaflos::server::core::Statements::getStatement($detail);
if (ref $rawData ne "ARRAY") {
return SOAPResponse(RES_ERROR,$rawData,wiaflos::server::core::Statements::Error());
......@@ -97,6 +99,7 @@ sub getStatement {
# SendTo - Send statement to here
# Optional:
# StartDate - Start date
# EndDate - End date
# Subject - Statement subject
sub sendStatement {
my (undef,$data) = @_;
......@@ -118,6 +121,7 @@ sub sendStatement {
$detail->{'ClientCode'} = $data->{'ClientCode'};
$detail->{'SendTo'} = $data->{'SendTo'};
$detail->{'StartDate'} = $data->{'StartDate'};
$detail->{'EndDate'} = $data->{'EndDate'};
$detail->{'Subject'} = $data->{'Subject'};
my $res = wiaflos::server::core::Statements::sendStatement($detail);
......
# Statement functions
# Copyright (C) 2009-2014, AllWorldIT
# Copyright (C) 2009-2020, AllWorldIT
# Copyright (C) 2008, LinuxRulz
# Copyright (C) 2007 Nigel Kukard <nkukard@lbsd.net>
#
......@@ -138,6 +138,7 @@ sub getStatement
# Parameters:
# ClientCode - Client code
# StartDate - Start date
# EndDate - End date
# SendTo - Send to, email: , file: , return
# Optional:
# Subject - Subject of the statement
......@@ -156,6 +157,7 @@ sub sendStatement
my $data;
$data->{'ClientCode'} = $detail->{'ClientCode'};
$data->{'StartDate'} = $detail->{'StartDate'};
$data->{'EndDate'} = $detail->{'EndDate'};
my $entries = getStatement($data);
if (ref $entries ne "ARRAY") {
setError(Error());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment