if ($count_nongift_ds > 0) { my $detail = {}; $detail->{"deposit_date"} = $ds_date; $detail->{"batchid"} = $legacy->{"batch_number"}; $detail->{"transactionid"} = $legacy->{"transaction_number"}; $detail->{"giftdetailnum"} = 1; $detail->{"detail_gifttype"} = "RECUR"; $detail->{"detail_amount"} = $legacy->{"amount"}; $detail->{"detail_idtype"} = $second->{"source_idtype"}; $detail->{"detail_donorid"} = $legacy->{"emplid"}; $detail->{"detail_tendertype"} = "OGVSN"; $detail->{"detail_description"} = "[NOR][QPQ]"; $detail->{"designations"} = []; $detail->{"tributes"} = []; $detail->{"recognitions"} = []; # assemble the designations foreach my $d (@$nongift_designations) { my $des = {}; $des->{"depositdate"} = $legacy->{"deposit_date"}; $des->{"batchid"} = $legacy->{"batch_number"}; $des->{"transactionid"} = $legacy->{"transaction_number"}; $des->{"giftdetailnum"} = 1; $des->{"designation_designationnum"} = $d->{"designation_fund_code"}; $des->{"designation_cic"} = $d->{"designation_cic"}; # look for comma separated appeal codes. scenario 23 my $appeal_code = $r->{"appeal_code"}; if ($appeal_code =~ /,/) { my @ac = split ",",$appeal_code; $appeal_code = @ac[0]; } if ($appeal_code eq "") {$appeal_code = "CW0000000";} # scenario 22 $des->{"designation_appeal"} = $appeal_code; # need to calculate the designation amount: amount * designation_percent $des->{"designation_amount"} = sprintf("%.2f", $d->{"amount"} * $d->{"designation_percent"}/100); push @{$detail->{"designations"}}, $des; } # assemble a recognition for the hard credit my $rec = {}; $rec->{"depositdate"} = $legacy->{"deposit_date"}; $rec->{"batchid"} = $legacy->{"batch_number"}; $rec->{"transactionid"} = $legacy->{"transaction_number"}; $rec->{"giftdetailnum"} = 1; $rec->{"recognition_idtype"} = $second->{"source_idtype"}; $rec->{"recognition_id"} = $legacy->{"emplid"}; $rec->{"recognition_type"} = "H"; $rec->{"recognition_amount"} = $detail->{"detail_amount"}; push @{$detail->{"recognitions"}}, $rec; # assemble any tributes, look for 2 # first tribute if (($r->{"tribute_first_name_1"} ne "") || ($r->{"tribute_last_name_1"} ne "") || ($r->{"tribute_species_1"} ne "") || ($r->{"tribute_type_1"} ne "") || ($r->{"tribute_hm_1"} ne "") ) { my $tribute = {}; $tribute->{"depositdate"} = $legacy->{"deposit_date"}; $tribute->{"batchid"} = $legacy->{"batch_number"}; $tribute->{"transactionid"} = $legacy->{"transaction_number"}; $tribute->{"giftdetailnum"} = 1; my $type = ""; if ($r->{"tribute_hm_1"} eq "In honor of") { $type = "H";} if ($r->{"tribute_hm_1"} eq "In memory of") { $type = "M";} $tribute->{"tribute_type"} = $type; if ($r->{"tribute_species_1"} eq "") { my $fn = $r->{"tribute_first_name_1"}; my $ln = $r->{"tribute_last_name_1"}; $tribute->{"tribute_name"} = "$ln $fn"; } else { $tribute->{"tribute_name"} = "PET"; } $tribute->{"tribute_amount"} = $detail->{"detail_amount"}; $tribute->{"tribute_emplid"} = ""; $tribute->{"tribute_occasion"} = ""; push @{$detail->{"tributes"}}, $tribute; } # second tribute if (($r->{"tribute_first_name_2"} ne "") || ($r->{"tribute_last_name_2"} ne "") || ($r->{"tribute_species_2"} ne "") || ($r->{"tribute_type_2"} ne "") || ($r->{"tribute_hm_2"} ne "") ) { my $tribute = {}; $tribute->{"depositdate"} = $legacy->{"deposit_date"}; $tribute->{"batchid"} = $legacy->{"batch_number"}; $tribute->{"transactionid"} = $legacy->{"transaction_number"}; $tribute->{"giftdetailnum"} = 1; my $type = ""; if ($r->{"tribute_hm_2"} eq "In honor of") { $type = "H";} if ($r->{"tribute_hm_2"} eq "In memory of") { $type = "M";} $tribute->{"tribute_type"} = $type; if ($r->{"tribute_species_2"} eq "") { my $fn = $r->{"tribute_first_name_2"}; my $ln = $r->{"tribute_last_name_2"}; $tribute->{"tribute_name"} = "$ln $fn"; } else { $tribute->{"tribute_name"} = "PET"; } $tribute->{"tribute_amount"} = $detail->{"detail_amount"}; $tribute->{"tribute_emplid"} = ""; $tribute->{"tribute_occasion"} = ""; push @{$detail->{"tributes"}}, $tribute; } push @$third, $detail; }