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)
|
||||
accessforbidden();
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$categid = GETPOST('categid');
|
||||
$label = GETPOST("label");
|
||||
|
||||
@ -55,15 +56,17 @@ if (! $sortfield) $sortfield='b.label';
|
||||
if (! $sortorder) $sortorder='ASC';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Add category
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action=="start")
|
||||
{
|
||||
$cashcontrol= new CashControl($db);
|
||||
$cashcontrol->opening=GETPOST('opening');
|
||||
if (GETPOST('posmodule')==0) $cashcontrol->posmodule="cashdesk";
|
||||
else if (GETPOST('posmodule')==1) $cashcontrol->posmodule="takepos";
|
||||
if (GETPOST('posmodule')=='cashdesk') $cashcontrol->posmodule="cashdesk";
|
||||
else if (GETPOST('posmodule')=='takepos') $cashcontrol->posmodule="takepos";
|
||||
$cashcontrol->posnumber=GETPOST('posnumber');
|
||||
$id=$cashcontrol->create($user);
|
||||
$action="view";
|
||||
@ -77,7 +80,6 @@ if ($action=="close")
|
||||
$action="view";
|
||||
}
|
||||
|
||||
|
||||
if ($action=="create")
|
||||
{
|
||||
llxHeader();
|
||||
@ -92,7 +94,7 @@ if ($action=="create")
|
||||
print '<input type="hidden" name="action" value="start">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
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 class="oddeven">';
|
||||
print '<td> </td><td><input name="opening" type="text" size="10" value="0"></td>';
|
||||
@ -103,7 +105,7 @@ if ($action=="create")
|
||||
print '</table></form>';
|
||||
}
|
||||
|
||||
if ($action=="view")
|
||||
if (empty($action) || $action=="view")
|
||||
{
|
||||
$cashcontrol= new CashControl($db);
|
||||
$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),
|
||||
'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),
|
||||
'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),
|
||||
'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),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated')),
|
||||
);
|
||||
|
||||
public $id;
|
||||
@ -123,7 +123,7 @@ class CashControl extends CommonObject
|
||||
//$sql .= "'(PROV)', ";
|
||||
$sql .= $conf->entity;
|
||||
$sql .= ", ".$this->opening;
|
||||
$sql .= ",1";
|
||||
$sql .= ", 0"; // Draft by default
|
||||
$sql .= ", '".$this->db->idate(dol_now())."'";
|
||||
$sql .= ", '".$this->posmodule."'";
|
||||
$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))
|
||||
{
|
||||
$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_card.php?action=create",$langs->trans("New"),1,1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user