BILLING MAILOUT
===============
# create file with HTML Headers for e-mailing of Monthly Statement
#assigns process id to $pid
$pid=$$;
# open mailout to notify The Auction Advertiser of useage
open(BREF,">/tmp/my_comment.$pid");
open(BREF2,">$billdate");
#print "AUCTIONEER EMAIL: $EMail::email{$au[0]}
\n";
print BREF "From: submit\@theauctionadvertiser.com\n";
print BREF "To: $EMail::email{$au[0]}\n";
print BREF "Cc: sales\@theauctionadvertiser.com\n";
print BREF "Subject: The Auction Advertiser: $tim2 Statement\n";
print BREF "MIME-Version: 1.0\n";
print BREF "Content-Type: text/html; charset=us-ascii\n";
print BREF "Content-Transfer-Encoding: 7bit\n";
X
XSIGNIFICANT DIFFERENCE HERE
X
print BREF "\n";
# START OF MAILOUT HEADER
@madd=split(/~/,$mobad{$au[0]});
print "
\n";
print " The Auction Advertiser \n"; print "326 South Big Island Road \n"; print "Demorestville, Ontario K0K 1W0 \n"; print " \n"; print "$madd[1] $madd[0] \n"; print "$madd[2] \n"; print "$madd[3] \n"; print "$madd[4], $madd[5] $madd[6] | \n";
print "\n";
print "\n";
print "The Auction Advertiser \n"; print "Promoting Ontario Auctioneers Since 1995 \n"; print "SALE SUBMISSIONS \n"; print "E-Mail: admin\@ontarioauctioneer.com \n"; print "E-Form: Our Submission Form \n"; # ALERT NOTICE TO BE INCLUDED # *************************** if($in{'imnoticeyes'}) { print " IMPORTANT NOTICE "; $in{'imnotice'}=~ s/\n/ /g; print "$in{'imnotice'}\n"; } # *************************** print " |
\n";
print BREF " The Auction Advertiser \n"; print BREF "326 South Big Island Road \n"; print BREF "Demorestville, Ontario K0K 1W0 \n"; print BREF " | \n";
print BREF "\n";
print BREF "\n";
print BREF "The Auction Advertiser \n"; print BREF "Promoting Ontario Auctioneers Since 1995 \n"; print BREF "SALE SUBMISSIONS \n"; #print BREF "E-Mail: admin\@ontarioauctioneer.com \n"; print BREF "E-Mail: admin\@ontarioauctioneer.com \n"; print BREF "E-Form: Our Submission Form \n"; print BREF2 "\n"; print BREF2 "
$date "; print BREF "Statement of Services by $in{'sr'} $tim2 Prepared For \n"; print BREF " ![]() \n"; print BREF2 " |
TYPE | "; # TYPE E/F print OFILE "SUBMIT | "; # SUBMISSION DATE print OFILE "DESCRIPTION | "; # SUBMISSION DETAILS print OFILE "AMT | "; # AMOUNT print OFILE "||||||||||||||||||||||
SUBMISSION DETAILS | "; print SFILE "TEXT COST (\$) | "; print SFILE "IMG | "; print SFILE "HST | "; print SFILE "ITEM | "; print SFILE "|||||||||||||||||||||
TYPE | "; print SFILE "SUBMIT | "; print SFILE "EVENT | "; print SFILE "DAY | "; print SFILE "TIME | "; print SFILE "COMMENT | "; print SFILE "REF | "; print SFILE "TAA | "; print SFILE "AAO | "; print SFILE "(\#) | "; print SFILE "(\$) | "; print SFILE "(\$) | "; print SFILE "(\$) | "; print SFILE "|||||||||||||
$ddata[2] | "; # TYPE E/F print OFILE "$ddata[3] | "; # SUBMISSION DATE print OFILE "$ddata[1] | "; # SUBMISSION DETAILS if($ddata[4]>=0) { print OFILE "$ddata[4] | "; # SALE DATE } elsif($ddata[1]=~/Balance/) { print OFILE "$ddata[4] | "; # PAYMENT AMOUNT } else { print OFILE "$ddata[4] | "; # PAYMENT AMOUNT } print OFILE "||||||||||||||||||||
$ddata[2] | "; # TYPE E/F print SFILE "$ddata[3] | "; # SUBMISSION DATE print SFILE "$ddata[4] | "; # SALE DATE print SFILE "$ddata[5] | "; # SALE DAY print SFILE "$ddata[6] | "; # SALE TIME print SFILE "$ddata[1] | "; # LOCATION print SFILE "$ddata[7] | "; # WORD CONTENT #********************** #GST RATE DETERMINATION #********************** #if($ddata[3] =~/Jul|Aug|Sep|Oct|Nov|Dec/){$rgst=0.130;} #else{$rgst=0.050;} $rgst=0.130; #********************** if(($ddata[7] =~ /N/)){$cost1=0.0001;} elsif(($ddata[2] eq "S")){$cost1=$ddata[7]*40.0000001;} # special services, units in dollars elsif(($ddata[2] eq "D")){$cost1=$ddata[7]*14.9500001;} # Domain Hosting charges, units in dollars elsif(($ddata[2] eq "R")){$cost1=$ddata[7];} # Domain Renewal charges, units in dollars elsif(($ddata[2] eq "A")){$cost1=$ddata[7]*30.0000001;} # Flash Ad charges, units in dollars elsif(($ddata[2] eq "B")){$cost1=$ddata[7]*10.0000001;} # eFlyer/Brochure, units in dollars elsif(($ddata[2] eq "P")){$cost1=$ddata[7]*10.0000001;} # NAA Posting charges, units in dollars elsif(($ddata[2] eq "4")){$cost1=$ddata[7];} # 4SaleNow Charges, units in dollars $5 + 1 photo FREE Additional photos $1.00 #else SALE SUBMITTED ON OR AFTER JULY 1 2009 #else($ddata[3] =~/Jul|Aug|Sep|Oct|Nov|Dec/) else { if(!($ddata[7]>0)) # NO WORDS { $cost1=0.00001; } elsif($ddata[7]==1) # UPDATED LISTING { $cost1=30.0000001; if ($ddata[2] eq "E"){$cost1=20.000001;} } elsif($ddata[7]>1) { $cost1=60.0000001; if ($ddata[2] eq "E"){$cost1=40.000001;} } } #else # SALE SUBMITTED ON OR BEFORE JUNE 30 #{ #if(!($ddata[7]>0)) # NO WORDS #{ #$cost1=0.00001; #} #elsif($ddata[7]==1) # UPDATED LISTING #{ #$cost1=20.0000001; #if ($ddata[2] eq "E"){$cost1=15.000001;} #} #elsif($ddata[7]>1) #{ #$cost1=40.0000001; #if ($ddata[2] eq "E"){$cost1=30.000001;} #} #} $cst1=substr($cost1,0,index($cost1,".")+3); print SFILE "$cst1 | "; # WORD COST #CHARGE FOR POSTING TO AAO SITE DECEMBER 18 2008 #$cost2="NO"; #if($ddata[8] eq "y"){$cst2="Y";} #else {$cst2="N";} $cost2=0.00; if($ddata[8] eq "y"){$cost2=5.001;} $cst2=substr($cost2,0,index($cost2,".")+3); print SFILE "$cst2 | "; # AAO SUBMISSION COST $cost3="NO"; if($ddata[10] == ""){$ddata[10]=0;} print SFILE "$ddata[10] | ";# NUMBER OF IMAGES $cost4 = $ddata[10]*1.000001; if($cost4 == 0){$cost4="0.0001";} $cst4=substr($cost4,0,index($cost4,".")+3); print SFILE "$cst4 | ";# IMAGE COST #if($ddata[9] eq "y"){$cost3="YES";} if(($cost1 + $cost2 + $cost4) > 0.05) { $cost3=$rgst*($cost1 + $cost2 + $cost4); $cost3=substr($cost3,0,index($cost3,".")+3); } else {$cost3=0.00;} print SFILE "$cost3 | "; # GST $tgst=$tgst+$cost3; $cost5 = $cost1 + $cost2 + $cost3 + $cost4; $cst5=substr($cost5,0,index($cost5,".")+3); #red colour for credit balances (negative amounts :-45.20 if($cst5>=0) { print SFILE "$cst5 | ";# SUBMISSION COST 0 or positive } else { print SFILE "($cst5) | ";# SUBMISSION COST negative } print SFILE "||||||||||||
"; printf SFILE ("CURRENT EVENT TOTAL INCLUDES G/HST (HST THIS MONTH: \$ %7.2f) | ",$tgst); print SFILE "";
}
else
{
print SFILE "";
printf SFILE ("MONTH END BALANCE INCLUDES G/HST (HST THIS MONTH: \$ %7.2f) | ",$tgst);
print SFILE "";
}
# added January 17 2017 to fix rounding of negative credit balances
#==================================================================
# $costt=$costt+0.001;
if($costt>=0){$costt=$costt+0.001;}
else{$costt=$costt-0.001;}
$cstt=substr($costt,0,index("\$".$costt,".")+2);
if($cstt>=0)
{
print SFILE "$cstt | | ||||||||||||||||||||||
\n";
print BREF2 "
| If you have any questions about this statement, please contact \n"; print "Thom McLauchlin ~ P: 613-885-8466 admin\@ontarioauctioneer.com |
\n";
print "If you have any questions about this statement, please contact \n"; print "Thom McLauchlin ~ Phone: 613-885-8466 ~ admin\@ontarioauctioneer.com |
\n";
print BREF "If you have any questions about this statement, please contact \n"; print BREF "Thom McLauchlin ~ 613-885-8466 ~ admin\@ontarioauctioneer.com |
\n";
print BREF2 "If you have any questions about this statement, please contact \n"; print BREF2 "Thom McLauchlin ~ 613-885-8466 ~ admin\@ontarioauctioneer.com |