Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6834acd9

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID 6834acd9f95035050fc9bbe591bcbbd6d1c2a4f4
  • Vorgänger 373cec3f
  • Nachfolger 62bb3c51

Dokumentation

Conflicts:

SL/DB/Invoice.pm

Unterschiede anzeigen:

SL/DB/Invoice.pm
202 202
  }
203 203
}
204 204

  
205
>>>>>>> b6be290... Prototypisiertes Buchen von Rechnungen
206 205
1;
206

  
207
__END__
208

  
209
=pod
210

  
211
=head1 NAME
212

  
213
SL::DB::Invoice: Rose model for invoices (table "ar")
214

  
215
=head1 FUNCTIONS
216

  
217
=over 4
218

  
219
=item C<new_from $source>
220

  
221
Creates a new C<SL::DB::Invoice> instance and copies as much
222
information from C<$source> as possible. At the moment only sales
223
orders and sales quotations are supported as sources.
224

  
225
The conversion copies order items into invoice items. Dates are copied
226
as appropriate, e.g. the C<transdate> field from an order will be
227
copied into the invoice's C<orddate> field.
228

  
229
Amounts, prices and taxes are not
230
calculated. L<SL::DB::Helper::PriceTaxCalculator::calculate_prices_and_taxes>
231
can be used for this.
232

  
233
The object returned is not saved.
234

  
235
=item C<post %params>
236

  
237
Posts the invoice. Required parameters are:
238

  
239
=over 2
240

  
241
=item * C<ar_id>
242

  
243
The ID of the accounds receivable chart the invoices amounts are
244
posted to.
245

  
246
=back
247

  
248
This function implements several steps:
249

  
250
=over 2
251

  
252
=item 1. It calculates all prices, amounts and taxes by calling
253
L<SL::DB::Helper::PriceTaxCalculator::calculate_prices_and_taxes>.
254

  
255
=item 2. A new and unique invoice number is created.
256

  
257
=item 3. All amounts for costs of goods sold are recorded in
258
C<acc_trans>.
259

  
260
=item 4. All amounts for parts, services and assemblies are recorded
261
in C<acc_trans> with their respective charts. This is determined by
262
the part's buchungsgruppen.
263

  
264
=item 5. The total amount is posted to the accounts receivable chart
265
and recorded in C<acc_trans>.
266

  
267
=item 6. Items in C<invoice> are updated according to their allocation
268
status (regarding for costs of goold sold). Will only be done if
269
Lx-Office is not configured to use Einnahmenüberschussrechnungen
270
(C<$::eur>).
271

  
272
=item 7. The invoice and its items are saved.
273

  
274
=back
275

  
276
Returns C<$self> on success and C<undef> on failure.
277

  
278
=item C<basic_info $field>
279

  
280
See L<SL::DB::Object::basic_info>.
281

  
282
=back
283

  
284
=head1 AUTHOR
285

  
286
Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>
287

  
288
=cut

Auch abrufbar als: Unified diff