36 |
|
|
37 |
$langs->load("banks"); |
$langs->load("banks"); |
38 |
|
|
|
llxHeader(); |
|
39 |
|
|
40 |
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; |
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; |
41 |
|
|
42 |
$html = new Form($db); |
$html = new Form($db); |
43 |
|
|
44 |
|
|
45 |
/* |
/* |
46 |
* Actions |
* Actions |
47 |
*/ |
*/ |
48 |
|
|
49 |
if ($_GET["action"] == 'dvnext') |
if ($_GET["action"] == 'dvnext') |
50 |
{ |
{ |
51 |
$ac = new Account($db); |
$ac = new Account($db); |
52 |
$ac->datev_next($_GET["rowid"]); |
$ac->datev_next($_GET["rowid"]); |
53 |
} |
} |
54 |
|
|
|
|
|
55 |
if ($_GET["action"] == 'dvprev') |
if ($_GET["action"] == 'dvprev') |
56 |
{ |
{ |
57 |
$ac = new Account($db); |
$ac = new Account($db); |
67 |
} |
} |
68 |
} |
} |
69 |
|
|
|
|
|
70 |
if ($_POST["action"] == 'class') |
if ($_POST["action"] == 'class') |
71 |
{ |
{ |
72 |
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_POST["cat1"]; |
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_POST["cat1"]; |
122 |
} |
} |
123 |
|
|
124 |
|
|
125 |
|
/* |
126 |
|
* Affichage fiche ligne ecriture en mode edition |
127 |
|
*/ |
128 |
|
|
129 |
|
llxHeader(); |
130 |
|
|
131 |
// On initialise la liste des categories |
// On initialise la liste des categories |
132 |
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;"; |
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;"; |
133 |
$result = $db->query($sql); |
$result = $db->query($sql); |
146 |
$db->free($result); |
$db->free($result); |
147 |
} |
} |
148 |
|
|
149 |
|
$var=False; |
150 |
|
$h=0; |
151 |
|
|
152 |
|
|
153 |
print_titre("Edition de l'écriture bancaire"); |
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$_GET["rowid"]; |
154 |
|
$head[$h][1] = $langs->trans('Card'); |
155 |
|
$hselected=$h; |
156 |
|
$h++; |
157 |
|
|
158 |
if ($_GET["action"] == 'delete_categ') |
dolibarr_fiche_head($head, $hselected, $langs->trans('LineRecord').' : '.$_GET["rowid"]); |
|
{ |
|
|
$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"],"Supprimer dans la catégorie","Etes-vous sûr de vouloir supprimer le classement dans la catégorie ?","confirm_delete_categ"); |
|
|
} |
|
|
|
|
|
$var=False; |
|
159 |
|
|
|
print '<table class="border" width="100%">'; |
|
160 |
|
|
161 |
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,"; |
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,"; |
162 |
$sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account"; |
$sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account"; |
166 |
$result = $db->query($sql); |
$result = $db->query($sql); |
167 |
if ($result) |
if ($result) |
168 |
{ |
{ |
169 |
$i = 0; $total = 0; |
$i = 0; $total = 0; |
170 |
if ($db->num_rows($result)) |
if ($db->num_rows($result)) |
171 |
{ |
{ |
|
$objp = $db->fetch_object($result); |
|
|
$total = $total + $objp->amount; |
|
|
|
|
|
$acct=new Account($db,$objp->fk_account); |
|
|
$acct->fetch($objp->fk_account); |
|
|
$account = $acct->id; |
|
|
|
|
|
// Account |
|
|
print "<tr><td>".$langs->trans("Account")."</td><td colspan=\"3\"><a href=\"account.php?account=$account\">".$acct->label."</a></td></tr>"; |
|
|
|
|
|
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">"; |
|
|
print "<input type=\"hidden\" name=\"action\" value=\"update\">"; |
|
|
|
|
|
// Date |
|
|
if (! $objp->rappro) |
|
|
{ |
|
|
print "<tr><td>".$langs->trans("Date")."</td><td colspan=\"3\">"; |
|
|
$html->select_date($objp->do); |
|
|
//print '<input name="date" value="'.strftime("%Y%m%d",$objp->do).'">'; |
|
|
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>'; |
|
|
print "</tr>"; |
|
|
} |
|
172 |
|
|
173 |
// Value date |
// Confirmations |
174 |
print "<tr>"; |
if ($_GET["action"] == 'delete_categ') |
175 |
print '<td colspan="2">'.$langs->trans("DateValue").'</td><td colspan="2">'.strftime("%d %b %Y",$objp->dv)." "; |
{ |
176 |
print '<a href="ligne.php?action=dvprev&account='.$_GET["account"].'&rowid='.$objp->rowid.'">'; |
$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"],"Supprimer dans la catégorie","Etes-vous sûr de vouloir supprimer le classement dans la catégorie ?","confirm_delete_categ"); |
177 |
print img_edit_remove() . "</a> "; |
print '<br>'; |
178 |
print '<a href="ligne.php?action=dvnext&account='.$_GET["account"].'&rowid='.$objp->rowid.'">'; |
} |
179 |
print img_edit_add() ."</a></td>"; |
|
180 |
print '</tr>'; |
print '<table class="border" width="100%">'; |
181 |
|
|
182 |
// Description |
$objp = $db->fetch_object($result); |
183 |
print "<tr><td>".$langs->trans("Label")."</td><td colspan=\"3\">"; |
$total = $total + $objp->amount; |
184 |
print '<input name="label" value="'.$objp->label.'" size="50">'; |
|
185 |
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>'; |
$acct=new Account($db,$objp->fk_account); |
186 |
print "</tr>"; |
$acct->fetch($objp->fk_account); |
187 |
|
$account = $acct->id; |
188 |
// Amount |
|
189 |
if (! $objp->rappro) |
// Account |
190 |
{ |
print "<tr><td>".$langs->trans("Account")."</td><td colspan=\"3\"><a href=\"account.php?account=$account\">".$acct->label."</a></td></tr>"; |
191 |
print "<tr><td>".$langs->trans("Amount")."</td><td colspan=\"3\">"; |
|
192 |
print '<input name="amount" value="'.price($objp->amount).'">'; |
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">"; |
193 |
|
print "<input type=\"hidden\" name=\"action\" value=\"update\">"; |
194 |
|
|
195 |
|
// Date |
196 |
|
if (! $objp->rappro) |
197 |
|
{ |
198 |
|
print "<tr><td>".$langs->trans("Date")."</td><td colspan=\"3\">"; |
199 |
|
$html->select_date($objp->do); |
200 |
|
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>'; |
201 |
|
print "</tr>"; |
202 |
|
} |
203 |
|
|
204 |
|
// Value date |
205 |
|
print "<tr>"; |
206 |
|
print '<td colspan="2">'.$langs->trans("DateValue").'</td><td colspan="2">'.strftime("%d %b %Y",$objp->dv)." "; |
207 |
|
print '<a href="ligne.php?action=dvprev&account='.$_GET["account"].'&rowid='.$objp->rowid.'">'; |
208 |
|
print img_edit_remove() . "</a> "; |
209 |
|
print '<a href="ligne.php?action=dvnext&account='.$_GET["account"].'&rowid='.$objp->rowid.'">'; |
210 |
|
print img_edit_add() ."</a></td>"; |
211 |
|
print '</tr>'; |
212 |
|
|
213 |
|
// Description |
214 |
|
print "<tr><td>".$langs->trans("Label")."</td><td colspan=\"3\">"; |
215 |
|
print '<input name="label" class="flat" value="'.$objp->label.'" size="50">'; |
216 |
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>'; |
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>'; |
217 |
print "</tr>"; |
print "</tr>"; |
|
} |
|
218 |
|
|
219 |
print "</form>"; |
// Amount |
220 |
|
if (! $objp->rappro) |
221 |
|
{ |
222 |
|
print "<tr><td>".$langs->trans("Amount")."</td><td colspan=\"3\">"; |
223 |
|
print '<input name="amount" class="flat" value="'.price($objp->amount).'">'; |
224 |
|
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>'; |
225 |
|
print "</tr>"; |
226 |
|
} |
227 |
|
|
228 |
|
print "</form>"; |
229 |
|
|
230 |
|
// Type paiement |
231 |
|
print "<tr><td>".$langs->trans("Type")."</td><td colspan=\"3\">"; |
232 |
|
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">"; |
233 |
|
print '<input type="hidden" name="action" value="type">'; |
234 |
|
print $html->select_types_paiements($objp->fk_type,"value",'',2); |
235 |
|
print '<input type="text" class="flat" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">'; |
236 |
|
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'">'; |
237 |
|
print "</form>"; |
238 |
|
print "</td></tr>"; |
239 |
|
|
240 |
|
// Author |
241 |
|
print "<tr><td>".$langs->trans("Author")."</td>"; |
242 |
|
if ($objp->fk_user_author) { |
243 |
|
$author=new User($db,$objp->fk_user_author); |
244 |
|
$author->fetch(); |
245 |
|
print "<td colspan=\"3\">".$author->fullname."</td>"; |
246 |
|
} else { |
247 |
|
print "<td colspan=\"3\"> </td>"; |
248 |
|
} |
249 |
|
print "</tr>"; |
250 |
|
|
251 |
|
$i++; |
252 |
|
} |
253 |
|
|
254 |
|
// Releve rappro |
255 |
|
if ($acct->rappro) |
256 |
|
{ |
257 |
|
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">"; |
258 |
|
print '<input type="hidden" name="action" value="num_releve">'; |
259 |
|
print "<tr><td>".$langs->trans("Conciliation")."</td><td colspan=\"3\">"; |
260 |
|
print $langs->trans("AccountStatement").' <input name="num_rel" class="flat" value="'.$objp->num_releve.'">'; |
261 |
|
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>'; |
262 |
|
print "</tr>"; |
263 |
|
print "</form>"; |
264 |
|
} |
265 |
|
|
266 |
// Type paiement |
print "</table>"; |
|
print "<tr><td>".$langs->trans("Type")."</td><td colspan=\"3\">"; |
|
|
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">"; |
|
|
print '<input type="hidden" name="action" value="type">'; |
|
|
print $html->select_types_paiements($objp->fk_type,"value",'',2); |
|
|
print '<input type="text" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">'; |
|
|
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'">'; |
|
|
print "</form>"; |
|
|
print "</td></tr>"; |
|
|
|
|
|
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">"; |
|
|
print '<input type="hidden" name="action" value="num_releve">'; |
|
|
print "<tr><td>".$langs->trans("AccountStatement")."</td><td colspan=\"3\">"; |
|
|
print '<input name="num_rel" value="'.$objp->num_releve.'">'; |
|
|
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>'; |
|
|
print "</tr>"; |
|
|
print "</form>"; |
|
|
|
|
|
// Author |
|
|
print "<tr><td>".$langs->trans("Author")."</td>"; |
|
|
if ($objp->fk_user_author) { |
|
|
$author=new User($db,$objp->fk_user_author); |
|
|
$author->fetch(); |
|
|
print "<td colspan=\"3\">".$author->fullname."</td>"; |
|
|
} else { |
|
|
print "<td colspan=\"3\"> </td>"; |
|
|
} |
|
|
print "</tr>"; |
|
267 |
|
|
268 |
$i++; |
$db->free($result); |
269 |
} |
} |
270 |
$db->free($result); |
print '</div>'; |
|
} |
|
|
print "</table>"; |
|
271 |
|
|
272 |
print '<br>'; |
print '<br>'; |
273 |
|
|