Revision c1c68d32
Von Philip Reetz vor fast 19 Jahren hinzugefügt
bin/mozilla/gl.pl | ||
---|---|---|
122 | 122 |
$lxdebug->enter_sub(); |
123 | 123 |
|
124 | 124 |
GL->transaction(\%myconfig, \%$form); |
125 |
|
|
126 | 125 |
map { |
127 |
if ($form->{debitaccno} eq $_->{accno}) { |
|
128 |
$form->{debitchart} .= |
|
129 |
"<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}"; |
|
130 |
} |
|
131 |
} @{ $form->{chart} }; |
|
132 |
map { |
|
133 |
if ($form->{creditaccno} eq $_->{accno}) { |
|
134 |
$form->{creditchart} .= |
|
135 |
"<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}"; |
|
136 |
} |
|
126 |
$chart .= |
|
127 |
"<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}</option>" |
|
137 | 128 |
} @{ $form->{chart} }; |
129 |
|
|
138 | 130 |
map { |
139 | 131 |
$tax .= |
140 | 132 |
qq|<option value="$_->{taxkey}--$_->{rate}">$_->{taxdescription} | |
... | ... | |
145 | 137 |
|
146 | 138 |
$form->{taxchart} = $tax; |
147 | 139 |
|
148 |
if ($form->{tax} < 0) { |
|
149 |
$form->{tax} = $form->{tax} * (-1); |
|
150 |
} |
|
151 |
|
|
152 | 140 |
$form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2); |
153 | 141 |
|
154 | 142 |
# departments |
... | ... | |
162 | 150 |
} (@{ $form->{all_departments} }); |
163 | 151 |
} |
164 | 152 |
|
165 |
$i = 1; |
|
153 |
my $i = 1; |
|
154 |
my $tax = 0; |
|
155 |
my $taxaccno = ""; |
|
166 | 156 |
foreach $ref (@{ $form->{GL} }) { |
167 |
$form->{"accno_$i"} = "$ref->{accno}--$ref->{description}"; |
|
168 |
|
|
169 | 157 |
$form->{"projectnumber_$i"} = "$ref->{projectnumber}--$ref->{project_id}"; |
170 |
for (qw(fx_transaction source memo)) { $form->{"${_}_$i"} = $ref->{$_} } |
|
171 | 158 |
|
172 |
if ($ref->{amount} < 0) { |
|
173 |
$form->{totaldebit} -= $ref->{amount}; |
|
174 |
$form->{"debit_$i"} = $ref->{amount} * -1; |
|
159 |
$j = $i - 1; |
|
160 |
if ($tax && ($ref->{accno} eq $taxaccno)) { |
|
161 |
$form->{"tax_$j"} = abs($ref->{amount}); |
|
162 |
$form->{"taxchart_$j"} = $ref->{taxkey} . "--" . $ref->{taxrate}; |
|
175 | 163 |
} else { |
176 |
$form->{totalcredit} += $ref->{amount}; |
|
177 |
$form->{"credit_$i"} = $ref->{amount}; |
|
164 |
$form->{"accno_$i"} = "$ref->{accno}--$ref->{accnotaxkey}"; |
|
165 |
for (qw(fx_transaction source memo)) { $form->{"${_}_$i"} = $ref->{$_} } |
|
166 |
if ($ref->{amount} < 0) { |
|
167 |
$form->{totaldebit} -= $ref->{amount}; |
|
168 |
$form->{"debit_$i"} = $ref->{amount} * -1; |
|
169 |
} else { |
|
170 |
$form->{totalcredit} += $ref->{amount}; |
|
171 |
$form->{"credit_$i"} = $ref->{amount}; |
|
172 |
} |
|
173 |
$i++; |
|
174 |
} |
|
175 |
if ($ref->{taxaccno} && !$tax) { |
|
176 |
$taxaccno = $ref->{taxaccno}; |
|
177 |
$tax = 1; |
|
178 |
} else { |
|
179 |
$taxaccno = ""; |
|
180 |
$tax = 0; |
|
178 | 181 |
} |
179 | 182 |
|
180 |
$i++; |
|
181 | 183 |
} |
182 | 184 |
|
183 | 185 |
$form->{rowcount} = $i; |
... | ... | |
227 | 229 |
$button1 = qq| |
228 | 230 |
<td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}"> |
229 | 231 |
<input type=button name=datefrom id="trigger1" value=| |
230 |
. $locale->text('button') |
|
231 |
. qq|></td> |
|
232 |
. $locale->text('button') . qq|></td> |
|
232 | 233 |
|; |
233 | 234 |
$button2 = qq| |
234 | 235 |
<td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}"> |
235 | 236 |
<input type=button name=dateto id="trigger2" value=| |
236 |
. $locale->text('button') |
|
237 |
. qq|></td> |
|
237 |
. $locale->text('button') . qq|></td> |
|
238 | 238 |
|; |
239 | 239 |
|
240 | 240 |
#write Trigger |
... | ... | |
465 | 465 |
. $locale->date(\%myconfig, $form->{dateto}, 1); |
466 | 466 |
} |
467 | 467 |
|
468 |
@columns = |
|
469 |
$form->sort_columns( |
|
468 |
@columns = $form->sort_columns( |
|
470 | 469 |
qw(transdate id reference description notes source debit debit_accno credit credit_accno debit_tax debit_tax_accno credit_tax credit_tax_accno accno gifi_accno) |
471 |
);
|
|
470 |
); |
|
472 | 471 |
|
473 | 472 |
if ($form->{accno} || $form->{gifi_accno}) { |
474 | 473 |
@columns = grep !/(accno|gifi_accno)/, @columns; |
... | ... | |
1000 | 999 |
|
1001 | 1000 |
$source = qq| |
1002 | 1001 |
<td><input name="source_$i" value="$form->{"source_$i"}" tabindex=| |
1003 |
. ($i + 11 + (($i - 1) * 8)) |
|
1004 |
. qq|></td>|; |
|
1002 |
. ($i + 11 + (($i - 1) * 8)) . qq|></td>|; |
|
1005 | 1003 |
$memo = qq| |
1006 | 1004 |
<td><input name="memo_$i" value="$form->{"memo_$i"}" tabindex=| |
1007 |
. ($i + 12 + (($i - 1) * 8)) |
|
1008 |
. qq|></td>|; |
|
1005 |
. ($i + 12 + (($i - 1) * 8)) . qq|></td>|; |
|
1009 | 1006 |
|
1010 | 1007 |
if ($init) { |
1011 | 1008 |
$accno = qq| |
1012 | 1009 |
<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:300px" tabindex=| |
1013 |
. ($i + 5 + (($i - 1) * 8)) |
|
1014 |
. qq|>$form->{chartinit}</select></td>|; |
|
1010 |
. ($i + 5 + (($i - 1) * 8)) . qq|>$form->{chartinit}</select></td>|; |
|
1015 | 1011 |
$tax = |
1016 | 1012 |
qq|<td><select id="taxchart_$i" name="taxchart_$i" tabindex=| |
1017 | 1013 |
. ($i + 10 + (($i - 1) * 8)) |
... | ... | |
1087 | 1083 |
|
1088 | 1084 |
$accno = qq| |
1089 | 1085 |
<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:300px" tabindex=| |
1090 |
. ($i + 5 + (($i - 1) * 8)) |
|
1091 |
. qq|>$chart</select></td>|; |
|
1086 |
. ($i + 5 + (($i - 1) * 8)) . qq|>$chart</select></td>|; |
|
1092 | 1087 |
$tax = qq| |
1093 | 1088 |
<td><select id="taxchart_$i" name="taxchart_$i" tabindex=| |
1094 |
. ($i + 10 + (($i - 1) * 8)) |
|
1095 |
. qq|>$taxchart</select></td>|; |
|
1089 |
. ($i + 10 + (($i - 1) * 8)) . qq|>$taxchart</select></td>|; |
|
1096 | 1090 |
if ($form->{selectprojectnumber}) { |
1097 | 1091 |
$project = qq| |
1098 | 1092 |
<td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|; |
... | ... | |
1113 | 1107 |
$accno |
1114 | 1108 |
$fx_transaction |
1115 | 1109 |
<td><input name="debit_$i" size=10 value="$form->{"debit_$i"}" accesskey=$i tabindex=| |
1116 |
. ($i + 6 + (($i - 1) * 8)) |
|
1117 |
. qq|></td> |
|
1110 |
. ($i + 6 + (($i - 1) * 8)) . qq|></td> |
|
1118 | 1111 |
<td><input name="credit_$i" size=10 value="$form->{"credit_$i"}" tabindex=| |
1119 |
. ($i + 7 + (($i - 1) * 8)) |
|
1120 |
. qq|></td> |
|
1112 |
. ($i + 7 + (($i - 1) * 8)) . qq|></td> |
|
1121 | 1113 |
<td><input name="tax_$i" size=8 value="$form->{"tax_$i"}" tabindex=| |
1122 |
. ($i + 8 + (($i - 1) * 8)) |
|
1123 |
. qq|></td> |
|
1114 |
. ($i + 8 + (($i - 1) * 8)) . qq|></td> |
|
1124 | 1115 |
$korrektur |
1125 | 1116 |
$tax |
1126 | 1117 |
$source |
... | ... | |
1189 | 1180 |
$taxincluded = "checked"; |
1190 | 1181 |
} |
1191 | 1182 |
|
1192 |
$amount = |
|
1193 |
qq|<input name=amount size=20 value="$form->{amount}" tabindex="4" $readonly>|; |
|
1194 |
|
|
1195 | 1183 |
$department = qq| |
1196 | 1184 |
<tr> |
1197 | 1185 |
<th align=right nowrap>| . $locale->text('Department') . qq|</th> |
... | ... | |
1214 | 1202 |
$button1 = qq| |
1215 | 1203 |
<td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate} tabindex="2" $readonly> |
1216 | 1204 |
<input type=button name=transdate id="trigger1" value=| |
1217 |
. $locale->text('button') |
|
1218 |
. qq|></td> |
|
1205 |
. $locale->text('button') . qq|></td> |
|
1219 | 1206 |
|; |
1220 | 1207 |
|
1221 | 1208 |
#write Trigger |
... | ... | |
1287 | 1274 |
<tr> |
1288 | 1275 |
<th align=right>| . $locale->text('Description') . qq|</th> |
1289 | 1276 |
<td>$description</td> |
1277 |
<td> |
|
1278 |
<table> |
|
1279 |
<tr> |
|
1280 |
<th align=left>| . $locale->text('MwSt. inkl.') . qq|</th> |
|
1281 |
<td><input type=checkbox name=taxincluded value=1 tabindex="5" $taxincluded></td> |
|
1282 |
</tr> |
|
1283 |
</table> |
|
1284 |
</td> |
|
1290 | 1285 |
<td align=left> |
1291 | 1286 |
<table width=100%> |
1292 | 1287 |
<tr> |
... | ... | |
1301 | 1296 |
<tr> |
1302 | 1297 |
<th align=right>| . $locale->text('Description') . qq|</th> |
1303 | 1298 |
<td colspan=2>$description</td> |
1304 |
</tr>|; |
|
1305 |
} |
|
1306 |
print qq| |
|
1307 |
<tr> |
|
1308 |
<th align=right>| . $locale->text('Betrag') . qq|</th> |
|
1309 |
<td>$amount</td> |
|
1310 |
<td align=left> |
|
1299 |
<td> |
|
1311 | 1300 |
<table> |
1312 | 1301 |
<tr> |
1313 | 1302 |
<th align=left>| . $locale->text('MwSt. inkl.') . qq|</th> |
... | ... | |
1315 | 1304 |
</tr> |
1316 | 1305 |
</table> |
1317 | 1306 |
</td> |
1318 |
</tr> |
|
1307 |
</tr>|; |
|
1308 |
} |
|
1309 |
print qq| |
|
1319 | 1310 |
<tr> |
1320 | 1311 |
<table width=100%> |
1321 | 1312 |
<tr class=listheading> |
1322 | 1313 |
<th class=listheading style="width:15%">| |
1323 |
. $locale->text('Account') |
|
1324 |
. qq|</th> |
|
1314 |
. $locale->text('Account') . qq|</th> |
|
1325 | 1315 |
<th class=listheading style="width:10%">| |
1326 |
. $locale->text('Debit') |
|
1327 |
. qq|</th> |
|
1316 |
. $locale->text('Debit') . qq|</th> |
|
1328 | 1317 |
<th class=listheading style="width:10%">| |
1329 |
. $locale->text('Credit') |
|
1330 |
. qq|</th> |
|
1318 |
. $locale->text('Credit') . qq|</th> |
|
1331 | 1319 |
<th class=listheading style="width:10%">| |
1332 |
. $locale->text('Tax') |
|
1333 |
. qq|</th> |
|
1320 |
. $locale->text('Tax') . qq|</th> |
|
1334 | 1321 |
<th class=listheading style="width:5%">| |
1335 |
. $locale->text('Korrektur') |
|
1336 |
. qq|</th> |
|
1322 |
. $locale->text('Korrektur') . qq|</th> |
|
1337 | 1323 |
<th class=listheading style="width:10%">| |
1338 |
. $locale->text('Taxkey') |
|
1339 |
. qq|</th> |
|
1324 |
. $locale->text('Taxkey') . qq|</th> |
|
1340 | 1325 |
<th class=listheading style="width:20%">| |
1341 |
. $locale->text('Source') |
|
1342 |
. qq|</th> |
|
1326 |
. $locale->text('Source') . qq|</th> |
|
1343 | 1327 |
<th class=listheading style="width:20%">| . $locale->text('Memo') . qq|</th> |
1344 | 1328 |
$project |
1345 | 1329 |
</tr> |
... | ... | |
1388 | 1372 |
if (!$form->{locked} && $radieren) { |
1389 | 1373 |
print qq| |
1390 | 1374 |
<input class=submit type=submit name=action value="| |
1391 |
. $locale->text('Post') |
|
1392 |
. qq|" accesskey="b"> |
|
1375 |
. $locale->text('Post') . qq|" accesskey="b"> |
|
1393 | 1376 |
<input class=submit type=submit name=action value="| |
1394 | 1377 |
. $locale->text('Delete') . qq|">|; |
1395 | 1378 |
} |
Auch abrufbar als: Unified diff
Aenderungen fuer die Unterstuetzung von Splitbuchungen beim Dialogbuchen