mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Update work
This commit is contained in:
parent
25433120e6
commit
aecb985659
|
|
@ -69,12 +69,12 @@ if ($action == 'confirm_delete' && $confirm == 'yes')
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Add loan
|
||||
if ($action == 'add' && $user->rights->loan->write)
|
||||
{
|
||||
$datestart=dol_mktime(12,0,0, $GETPOST("startmonth"), $GETPOST("startday"), $GETPOST("startyear"));
|
||||
$dateend=dol_mktime(12,0,0, $GETPOST("endmonth"), $GETPOST("endday"), $GETPOST("endyear"));
|
||||
$datestart=@dol_mktime(12,0,0, $_POST["startmonth"], $_POST["startday"], $_POST["startyear"]);
|
||||
$dateend=@dol_mktime(12,0,0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
|
||||
|
||||
if (! $datestart)
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateStart")), 'errors');
|
||||
|
|
@ -94,17 +94,17 @@ if ($action == 'add' && $user->rights->loan->write)
|
|||
{
|
||||
$object = new Loan($db);
|
||||
|
||||
$object->label = GETPOST("label");
|
||||
$object->fk_bank = GETPOST("accountid");
|
||||
$object->capital = GETPOST("capital");
|
||||
$object->datestart = $datestart;
|
||||
$object->dateend = $dateend;
|
||||
$object->nbterm = GETPOST("nbterm");
|
||||
$object->rate = GETPOST("rate");
|
||||
$object->label = $_POST["label"];
|
||||
$object->fk_bank = $_POST["accountid"];
|
||||
$object->capital = $_POST["capital"];
|
||||
$object->datestart = $datestart;
|
||||
$object->dateend = $dateend;
|
||||
$object->nbterm = $_POST["nbterm"];
|
||||
$object->rate = $_POST["rate"];
|
||||
|
||||
$object->account_capital = GETPOST("accountancy_account_capital");
|
||||
$object->account_insurance = GETPOST("accountancy_account_insurance");
|
||||
$object->account_interest = GETPOST("accountancy_account_interest");
|
||||
$object->account_capital = $_POST["accountancy_account_capital"];
|
||||
$object->account_insurance = $_POST["accountancy_account_insurance"];
|
||||
$object->account_interest = $_POST["accountancy_account_interest"];
|
||||
|
||||
$id=$object->create($user);
|
||||
if ($id <= 0)
|
||||
|
|
@ -173,7 +173,7 @@ if ($action == 'create')
|
|||
|
||||
$datec = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<form name="loan" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
|
|
|
|||
|
|
@ -45,8 +45,16 @@ if (! $sortfield) $sortfield="l.rowid";
|
|||
if (! $sortorder) $sortorder="DESC";
|
||||
$limit = $conf->liste_limit;
|
||||
|
||||
$search_ref=GETPOST('search_ref','int');
|
||||
$search_label=GETPOST('search_label','alpha');
|
||||
$filtre=$_GET["filtre"];
|
||||
$filtre=GETPOST("filtre");
|
||||
|
||||
if (GETPOST("button_removefilter"))
|
||||
{
|
||||
$search_ref="";
|
||||
$search_label="";
|
||||
$search_amount="";
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
|
|
@ -56,13 +64,14 @@ $loan = new Loan($db);
|
|||
|
||||
llxHeader();
|
||||
|
||||
$sql = "SELECT l.rowid as id, l.label, l.capital, l.datestart, l.dateend,";
|
||||
$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend,";
|
||||
$sql.= " SUM(pl.amount) as alreadypayed";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."loan as l,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."payment_loan as pl";
|
||||
$sql.= " WHERE pl.fk_loan = l.rowid";
|
||||
$sql.= " AND l.entity = ".$conf->entity;
|
||||
if (GETPOST("search_label")) $sql.=" AND l.label LIKE '%".$db->escape(GETPOST("search_label"))."%'";
|
||||
if (GETPOST("search_ref")) $sql.=" AND (l.rowid = ".$db->escape($search_ref).")";
|
||||
if (GETPOST("search_label")) $sql.=" AND l.label LIKE '%".$db->escape($search_label)."%'";
|
||||
|
||||
if ($filtre) {
|
||||
$filtre=str_replace(":","=",$filtre);
|
||||
|
|
@ -83,7 +92,7 @@ if ($resql)
|
|||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"id","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"l.rowid","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"l.label","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Capital"),$_SERVER["PHP_SELF"],"l.capital","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"l.datestart","",$param,'align="center"',$sortfield,$sortorder);
|
||||
|
|
@ -96,9 +105,11 @@ if ($resql)
|
|||
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_label" value="'.GETPOST("search_label").'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print "</td></tr>\n";
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=true;
|
||||
while ($i < min($num,$limit))
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ if ($action == 'create')
|
|||
$datesp=dol_get_first_day($pastmonthyear,$pastmonth,false); $dateep=dol_get_last_day($pastmonthyear,$pastmonth,false);
|
||||
}
|
||||
|
||||
print "<form name='add' action=\"card.php\" method=\"post\">\n";
|
||||
print '<form name="salary" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user