Work on cash fence
This commit is contained in:
parent
1c49599a47
commit
2bfc5fe235
@ -38,6 +38,7 @@ $id=GETPOST('id');
|
|||||||
if (!$user->rights->banque->configurer)
|
if (!$user->rights->banque->configurer)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
$id=GETPOST('id','int');
|
||||||
$categid = GETPOST('categid');
|
$categid = GETPOST('categid');
|
||||||
$label = GETPOST("label");
|
$label = GETPOST("label");
|
||||||
|
|
||||||
@ -55,15 +56,17 @@ if (! $sortfield) $sortfield='b.label';
|
|||||||
if (! $sortorder) $sortorder='ASC';
|
if (! $sortorder) $sortorder='ASC';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add category
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action=="start")
|
if ($action=="start")
|
||||||
{
|
{
|
||||||
$cashcontrol= new CashControl($db);
|
$cashcontrol= new CashControl($db);
|
||||||
$cashcontrol->opening=GETPOST('opening');
|
$cashcontrol->opening=GETPOST('opening');
|
||||||
if (GETPOST('posmodule')==0) $cashcontrol->posmodule="cashdesk";
|
if (GETPOST('posmodule')=='cashdesk') $cashcontrol->posmodule="cashdesk";
|
||||||
else if (GETPOST('posmodule')==1) $cashcontrol->posmodule="takepos";
|
else if (GETPOST('posmodule')=='takepos') $cashcontrol->posmodule="takepos";
|
||||||
$cashcontrol->posnumber=GETPOST('posnumber');
|
$cashcontrol->posnumber=GETPOST('posnumber');
|
||||||
$id=$cashcontrol->create($user);
|
$id=$cashcontrol->create($user);
|
||||||
$action="view";
|
$action="view";
|
||||||
@ -77,7 +80,6 @@ if ($action=="close")
|
|||||||
$action="view";
|
$action="view";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($action=="create")
|
if ($action=="create")
|
||||||
{
|
{
|
||||||
llxHeader();
|
llxHeader();
|
||||||
@ -92,7 +94,7 @@ if ($action=="create")
|
|||||||
print '<input type="hidden" name="action" value="start">';
|
print '<input type="hidden" name="action" value="start">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("InitialBankBalance").'</td><td>'.$langs->trans("Module").'</td><td>'.$langs->trans("CashDesk").' ID</td><td>,</td>';
|
print '<td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("InitialBankBalance").'</td><td>'.$langs->trans("Module").'</td><td>'.$langs->trans("CashDesk").' ID</td><td></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td> </td><td><input name="opening" type="text" size="10" value="0"></td>';
|
print '<td> </td><td><input name="opening" type="text" size="10" value="0"></td>';
|
||||||
@ -103,7 +105,7 @@ if ($action=="create")
|
|||||||
print '</table></form>';
|
print '</table></form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action=="view")
|
if (empty($action) || $action=="view")
|
||||||
{
|
{
|
||||||
$cashcontrol= new CashControl($db);
|
$cashcontrol= new CashControl($db);
|
||||||
$cashcontrol->fetch($id);
|
$cashcontrol->fetch($id);
|
||||||
|
|||||||
@ -68,10 +68,10 @@ class CashControl extends CommonObject
|
|||||||
'year_close' =>array('type'=>'integer', 'label'=>'Year close', 'enabled'=>1, 'visible'=>1, 'notnul'=>1, 'position'=>60),
|
'year_close' =>array('type'=>'integer', 'label'=>'Year close', 'enabled'=>1, 'visible'=>1, 'notnul'=>1, 'position'=>60),
|
||||||
'posmodule' =>array('type'=>'varchar(30)', 'label'=>'Module', 'enabled'=>1, 'visible'=>1, 'notnul'=>1, 'position'=>65),
|
'posmodule' =>array('type'=>'varchar(30)', 'label'=>'Module', 'enabled'=>1, 'visible'=>1, 'notnul'=>1, 'position'=>65),
|
||||||
'posnumber' =>array('type'=>'varchar(30)', 'label'=>'CashDesk', 'enabled'=>1, 'visible'=>1, 'notnul'=>1, 'position'=>70),
|
'posnumber' =>array('type'=>'varchar(30)', 'label'=>'CashDesk', 'enabled'=>1, 'visible'=>1, 'notnul'=>1, 'position'=>70),
|
||||||
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>80),
|
|
||||||
'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||||
'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>505),
|
'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>505),
|
||||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>510),
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>510),
|
||||||
|
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated')),
|
||||||
);
|
);
|
||||||
|
|
||||||
public $id;
|
public $id;
|
||||||
@ -123,7 +123,7 @@ class CashControl extends CommonObject
|
|||||||
//$sql .= "'(PROV)', ";
|
//$sql .= "'(PROV)', ";
|
||||||
$sql .= $conf->entity;
|
$sql .= $conf->entity;
|
||||||
$sql .= ", ".$this->opening;
|
$sql .= ", ".$this->opening;
|
||||||
$sql .= ",1";
|
$sql .= ", 0"; // Draft by default
|
||||||
$sql .= ", '".$this->db->idate(dol_now())."'";
|
$sql .= ", '".$this->db->idate(dol_now())."'";
|
||||||
$sql .= ", '".$this->posmodule."'";
|
$sql .= ", '".$this->posmodule."'";
|
||||||
$sql .= ", '".$this->posnumber."'";
|
$sql .= ", '".$this->posnumber."'";
|
||||||
|
|||||||
@ -1249,8 +1249,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
if (! empty($conf->takepos->enabled) || ! empty($conf->cashdesk->enabled))
|
if (! empty($conf->takepos->enabled) || ! empty($conf->cashdesk->enabled))
|
||||||
{
|
{
|
||||||
$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list",$langs->trans("CashControl"),0,1, '', $mainmenu, 'cashcontrol');
|
$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list",$langs->trans("CashControl"),0,1, '', $mainmenu, 'cashcontrol');
|
||||||
|
$newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create",$langs->trans("NewCashFence"),1,1);
|
||||||
$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list",$langs->trans("List"),1,1);
|
$newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list",$langs->trans("List"),1,1);
|
||||||
$newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create",$langs->trans("New"),1,1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user