diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index c240495c4a2..0a7e2fa2d17 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -256,7 +256,7 @@ if ($action == "create" || $action == "start") $sql .= " WHERE fk_account = ".$bankid; if ($syear && !$smonth) $sql .= " AND dateo < '".$db->idate(dol_get_first_day($syear, 1))."'"; elseif ($syear && $smonth && !$sday) $sql .= " AND dateo < '".$db->idate(dol_get_first_day($syear, $smonth))."'"; - elseif ($syear && $smonth && $sday) $sql .= " AND dateo < '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."'"; + elseif ($syear && $smonth && $sday) $sql .= " AND dateo < '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."'"; else dol_print_error('', 'Year not defined'); $resql = $db->query($sql); @@ -296,7 +296,7 @@ if ($action == "create" || $action == "start") } if ($syear && !$smonth) $sql .= " AND datef BETWEEN '".$db->idate(dol_get_first_day($syear, 1))."' AND '".$db->idate(dol_get_last_day($syear, 12))."'"; elseif ($syear && $smonth && !$sday) $sql .= " AND datef BETWEEN '".$db->idate(dol_get_first_day($syear, $smonth))."' AND '".$db->idate(dol_get_last_day($syear, $smonth))."'"; - elseif ($syear && $smonth && $sday) $sql .= " AND datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; + elseif ($syear && $smonth && $sday) $sql .= " AND datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; else dol_print_error('', 'Year not defined'); $resql = $db->query($sql); @@ -330,7 +330,7 @@ if ($action == "create" || $action == "start") print '
| '.$langs->trans("Module").' | '; - print ''.$langs->trans("CashDesk").' ID | '; + print ''.$langs->trans("Terminal").' | '; print ''.$langs->trans("Year").' | '; print ''.$langs->trans("Month").' | '; print ''.$langs->trans("Day").' | '; @@ -343,7 +343,11 @@ if ($action == "create" || $action == "start") print '||||||||||||||||||||||||
| '.$form->selectarray('posmodule', $arrayofposavailable, GETPOST('posmodule', 'alpha'), (count($arrayofposavailable) > 1 ? 1 : 0)).' | '; print '';
- $array = array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6", 7=>"7", 8=>"8", 9=>"9");
+
+ $array = array();
+ for($i = 1; $i <= max(1, $conf->global->TAKEPOS_NUM_TERMINALS); $i++) {
+ $array[$i] = $i;
+ }
$selectedposnumber = 0; $showempty = 1;
if ($conf->global->TAKEPOS_NUM_TERMINALS == '1')
{
@@ -502,92 +506,97 @@ if ($action == "create" || $action == "start")
if (empty($action) || $action == "view")
{
- $object->fetch($id);
+ $result = $object->fetch($id);
llxHeader('', $langs->trans("CashControl"));
- $head = array();
- $head[0][0] = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$object->id;
- $head[0][1] = $langs->trans("Card");
- $head[0][2] = 'cashcontrol';
-
- dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'cashcontrol');
-
- $linkback = ''.$langs->trans("BackToList").'';
-
- $morehtmlref = ' ';
- $morehtmlref .= ' ';
-
-
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);
-
- print '';
- print ' ';
- print '';
+ dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'cashcontrol');
- dol_fiche_end();
+ $linkback = ''.$langs->trans("BackToList").'';
- print '';
- print '';
- print ' ';
-
- print '
';
- print '';
- print ' ';
- print '
';
- print '';
- if ($object->status == CashControl::STATUS_DRAFT)
- {
- print '';
+ $morehtmlref = ' ';
- print '';
+ $morehtmlref .= ' ';
- print '';
- }
- print '';
+ print ' ';
+ print '';
+
+ dol_fiche_end();
+
+ print '';
+ print '';
+ print ' ';
+
+ print '
';
+ print '';
+ print ' ';
+ print '
';
+ print '';
+ if ($object->status == CashControl::STATUS_DRAFT)
+ {
+ print '';
+
+ print '';
+ }
+ print ' ';
+
+ print ' |