Revision 2a4516c1
Von Niclas Zimmermann vor fast 12 Jahren hinzugefügt
SL/AP.pm | ||
---|---|---|
237 | 237 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey, tax_id) | . |
238 | 238 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, | . |
239 | 239 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?),| . |
240 |
qq| (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|; |
|
240 |
qq| (SELECT tax_id| . |
|
241 |
qq| FROM taxkeys| . |
|
242 |
qq| WHERE chart_id= (SELECT id | . |
|
243 |
qq| FROM chart| . |
|
244 |
qq| WHERE accno = ?)| . |
|
245 |
qq| AND startdate <= ?| . |
|
246 |
qq| ORDER BY startdate DESC LIMIT 1))|; |
|
241 | 247 |
@values = ($form->{id}, $form->{AP_amounts}{payables}, $form->{payables}, |
242 | 248 |
conv_date($form->{transdate}), $form->{AP_amounts}{payables}, $form->{AP_amounts}{payables}, conv_date($form->{transdate})); |
243 | 249 |
do_query($form, $dbh, $query, @values); |
... | ... | |
286 | 292 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey, tax_id) | . |
287 | 293 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, | . |
288 | 294 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?),| . |
289 |
qq| (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|; |
|
295 |
qq| (SELECT tax_id| . |
|
296 |
qq| FROM taxkeys| . |
|
297 |
qq| WHERE chart_id= (SELECT id | . |
|
298 |
qq| FROM chart| . |
|
299 |
qq| WHERE accno = ?)| . |
|
300 |
qq| AND startdate <= ?| . |
|
301 |
qq| ORDER BY startdate DESC LIMIT 1))|; |
|
290 | 302 |
@values = ($form->{id}, $form->{AP_payables}, $amount, |
291 | 303 |
conv_date($form->{"datepaid_$i"}), $project_id, |
292 | 304 |
$form->{AP_payables}, $form->{AP_payables}, conv_date($form->{"datepaid_$i"})); |
... | ... | |
300 | 312 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, project_id, taxkey, tax_id) | . |
301 | 313 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, ?, | . |
302 | 314 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?), | . |
303 |
qq| (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|; |
|
315 |
qq| (SELECT tax_id| . |
|
316 |
qq| FROM taxkeys| . |
|
317 |
qq| WHERE chart_id= (SELECT id | . |
|
318 |
qq| FROM chart| . |
|
319 |
qq| WHERE accno = ?)| . |
|
320 |
qq| AND startdate <= ?| . |
|
321 |
qq| ORDER BY startdate DESC LIMIT 1))|; |
|
304 | 322 |
@values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"}, |
305 | 323 |
conv_date($form->{"datepaid_$i"}), $gldate, $form->{"source_$i"}, |
306 | 324 |
$form->{"memo_$i"}, $project_id, $form->{"AP_paid_account_$i"}, |
... | ... | |
316 | 334 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey, tax_id) | . |
317 | 335 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | . |
318 | 336 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?), | . |
319 |
qq| (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|; |
|
337 |
qq| (SELECT tax_id| . |
|
338 |
qq| FROM taxkeys| . |
|
339 |
qq| WHERE chart_id= (SELECT id | . |
|
340 |
qq| FROM chart| . |
|
341 |
qq| WHERE accno = ?)| . |
|
342 |
qq| AND startdate <= ?| . |
|
343 |
qq| ORDER BY startdate DESC LIMIT 1))|; |
|
320 | 344 |
@values = ($form->{id}, $form->{"AP_paid_account_$i"}, $amount, |
321 | 345 |
conv_date($form->{"datepaid_$i"}), $project_id, |
322 | 346 |
$form->{"AP_paid_account_$i"}, |
... | ... | |
335 | 359 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey, tax_id) | . |
336 | 360 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | . |
337 | 361 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?)| . |
338 |
qq| (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|; |
|
362 |
qq| (SELECT tax_id| . |
|
363 |
qq| FROM taxkeys| . |
|
364 |
qq| WHERE chart_id= (SELECT id | . |
|
365 |
qq| FROM chart| . |
|
366 |
qq| WHERE accno = ?)| . |
|
367 |
qq| AND startdate <= ?| . |
|
368 |
qq| ORDER BY startdate DESC LIMIT 1))|; |
|
339 | 369 |
@values = ($form->{id}, ($amount > 0) ? |
340 | 370 |
$form->{fxgain_accno} : $form->{fxloss_accno}, |
341 | 371 |
$amount, conv_date($form->{"datepaid_$i"}), $project_id, |
Auch abrufbar als: Unified diff
Bessere Formatierung
Verbessert die Formatierung von Commit 5c5e92bc37819dd9df952068b9e58b47dd0b0de2
(Großschreibung von SQL-Befehlen, Zeilenumbrüche bei langen Sub-Queries)