Skip to content

Commit 0bb1847

Browse files
author
Mplus Software
committed
getCashCountList now only accepts ns__WorkplaceYearNumber as parameter in stead of ns__YearNumber
1 parent 552ba7e commit 0bb1847

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

Mplusqapiclient.php

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,10 +1000,10 @@ public function getFinancialJournalByCashCount($cashCountId, $reference=null)
10001000

10011001
//----------------------------------------------------------------------------
10021002

1003-
public function getCashCountList($fromFinancialDate, $throughFinancialDate, $sinceCashCountNumber=null)
1003+
public function getCashCountList($fromFinancialDate, $throughFinancialDate, $sinceCashCount=null)
10041004
{
10051005
try {
1006-
$result = $this->client->getCashCountList($this->parser->convertGetCashCountListRequest($fromFinancialDate, $throughFinancialDate, $sinceCashCountNumber));
1006+
$result = $this->client->getCashCountList($this->parser->convertGetCashCountListRequest($fromFinancialDate, $throughFinancialDate, $sinceCashCount));
10071007
return $this->parser->parseGetCashCountListResult($result);
10081008
} catch (SoapFault $e) {
10091009
throw new MplusQAPIException('SoapFault occurred: '.$e->getMessage(), 0, $e);
@@ -2944,15 +2944,15 @@ public function convertGetFinancialJournalByCashCountRequest($cashCountId, $refe
29442944

29452945
//----------------------------------------------------------------------------
29462946

2947-
public function convertGetCashCountListRequest($fromFinancialDate, $throughFinancialDate, $sinceCashCountNumber)
2947+
public function convertGetCashCountListRequest($fromFinancialDate, $throughFinancialDate, $sinceCashCount)
29482948
{
29492949
$fromFinancialDate = is_null($fromFinancialDate) ? null : $this->convertMplusDate($fromFinancialDate, 'fromFinancialDate');
29502950
$throughFinancialDate = is_null($throughFinancialDate) ? null : $this->convertMplusDate($throughFinancialDate, 'throughFinancialDate');
2951-
$sinceCashCountNumber = is_null($sinceCashCountNumber) ? null : $this->convertYearNumber($sinceCashCountNumber);
2951+
$sinceCashCount = is_null($sinceCashCount) ? null : $this->convertWorkplaceYearNumber($sinceCashCount);
29522952
$object = arrayToObject(array('request'=>array(
29532953
'fromFinancialDate'=>$fromFinancialDate,
29542954
'throughFinancialDate'=>$throughFinancialDate,
2955-
'sinceCashCountNumber'=>$sinceCashCountNumber,
2955+
'sinceCashCount'=>$sinceCashCount,
29562956
)));
29572957
return $object;
29582958
} // END convertGetCashCountListRequest()
@@ -3763,6 +3763,30 @@ public function convertYearNumber($year_number)
37633763

37643764
//----------------------------------------------------------------------------
37653765

3766+
public function convertWorkplaceYearNumber($workplace_year_number)
3767+
{
3768+
if (is_array($workplace_year_number) and count($workplace_year_number) >= 4) {
3769+
$workplace_year_number = array_values($workplace_year_number);
3770+
return array(
3771+
'branchNumber'=>(int)$workplace_year_number[0],
3772+
'workplaceNumber'=>(int)$workplace_year_number[1],
3773+
'year'=>(int)$workplace_year_number[2],
3774+
'number'=>(int)$workplace_year_number[3]);
3775+
} else {
3776+
$parts = explode('.', $workplace_year_number);
3777+
if (count($parts) >= 4) {
3778+
return array(
3779+
'branchNumber'=>(int)$parts[0],
3780+
'workplaceNumber'=>(int)$parts[1],
3781+
'year'=>(int)$parts[2],
3782+
'number'=>(int)$parts[3]);
3783+
}
3784+
}
3785+
return $workplace_year_number;
3786+
} // END convertWorkplaceYearNumber()
3787+
3788+
//----------------------------------------------------------------------------
3789+
37663790
public function convertGetWordAliasesRequest($locale)
37673791
{
37683792
$array = array('request'=>array(

0 commit comments

Comments
 (0)