Skip to content

Commit

Permalink
Cashcontrol TakePOS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andreubisquerra committed Aug 18, 2019
1 parent 40f5bbc commit 063f19f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
15 changes: 3 additions & 12 deletions htdocs/compta/cashcontrol/cashcontrol_card.php
Expand Up @@ -88,7 +88,7 @@
$backurlforlist = dol_buildpath('/compta/cashcontrol/cashcontrol_list.php', 1);
$triggermodname = 'CACHCONTROL_MODIFY'; // Name of trigger action code to execute when we modify record

if (empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH))
if (empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH1))
{
setEventMessages($langs->trans("CashDesk")." - ".$langs->trans("NotConfigured"), null, 'errors');
}
Expand Down Expand Up @@ -132,16 +132,7 @@
$error=0;
foreach($arrayofpaymentmode as $key=>$val)
{
if (GETPOST($key.'_amount', 'alpha') == '')
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val)), null, 'errors');
$action='start';
$error++;
}
else
{
$object->$key = price2num(GETPOST($key.'_amount', 'alpha'));
}
$object->$key = price2num(GETPOST($key.'_amount', 'alpha'));
}

if (! $error)
Expand Down Expand Up @@ -235,7 +226,7 @@
$posmodule = GETPOST('posmodule', 'alpha');
$terminalid = GETPOST('posnumber', 'alpha');
$terminaltouse = $terminalid;
if ($terminaltouse == '1') $terminaltouse = '';
if ($terminaltouse == '1' && $posmodule=='cashdesk') $terminaltouse = '';

// Calculate $initialbalanceforterminal for terminal 0
foreach($arrayofpaymentmode as $key => $val)
Expand Down
16 changes: 12 additions & 4 deletions htdocs/compta/cashcontrol/report.php
Expand Up @@ -196,10 +196,18 @@
// Bank account
print '<td class="nowrap right">';
print $bankaccount->getNomUrl(1);
if ($conf->global->CASHDESK_ID_BANKACCOUNT_CASH==$bankaccount->id) $cash+=$objp->amount;
elseif ($conf->global->CASHDESK_ID_BANKACCOUNT_CB==$bankaccount->id) $bank+=$objp->amount;
elseif ($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE==$bankaccount->id) $cheque+=$objp->amount;
else $other+=$objp->amount;
if ($cashcontrol->posmodule=="takepos"){
if ($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$cashcontrol->posnumber}==$bankaccount->id) $cash+=$objp->amount;
elseif ($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$cashcontrol->posnumber}==$bankaccount->id) $bank+=$objp->amount;
elseif ($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$cashcontrol->posnumber}==$bankaccount->id) $cheque+=$objp->amount;
else $other+=$objp->amount;
}
else{
if ($conf->global->CASHDESK_ID_BANKACCOUNT_CASH==$bankaccount->id) $cash+=$objp->amount;
elseif ($conf->global->CASHDESK_ID_BANKACCOUNT_CB==$bankaccount->id) $bank+=$objp->amount;
elseif ($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE==$bankaccount->id) $cheque+=$objp->amount;
else $other+=$objp->amount;
}
print "</td>\n";
if (! $i) $totalarray['nbfield']++;

Expand Down

0 comments on commit 063f19f

Please sign in to comment.