+sub invoice {
+ my ($self, $invoice, %params) = @_;
+
+ if ( $invoice->is_sales ) {
+ if ( $invoice->invoice ) {
+ return _is_ir_record($self, $invoice, 'is', %params);
+ } else {
+ return _is_ir_record($self, $invoice, 'ar', %params);
+ }
+ } else {
+ if ( $invoice->invoice ) {
+ return _is_ir_record($self, $invoice, 'ir', %params);
+ } else {
+ return _is_ir_record($self, $invoice, 'ap', %params);
+ }
+ };
+};
+