Changeset 2759

Show
Ignore:
Timestamp:
02/27/10 02:28:58 (2 years ago)
Author:
areski
Message:

fix bug on Mail tag : DAY_REMAINING_KEY

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/common/lib/admin.defines.php

    r2756 r2759  
    3232**/ 
    3333 
    34 define ("PHP_QUICK_PROFILER", false); 
     34define ("PHP_QUICK_PROFILER", true); 
    3535// Include PHP-Quick-Profiler 
    3636require_once('PhpQuickProfiler.php'); 
  • trunk/common/lib/agent.defines.php

    r2756 r2759  
    3232**/ 
    3333 
    34 define ("PHP_QUICK_PROFILER", false); 
     34define ("PHP_QUICK_PROFILER", true); 
    3535// Include PHP-Quick-Profiler 
    3636require_once('PhpQuickProfiler.php'); 
  • trunk/common/lib/customer.defines.php

    r2756 r2759  
    3232**/ 
    3333 
    34 define ("PHP_QUICK_PROFILER", false); 
     34define ("PHP_QUICK_PROFILER", true); 
    3535// Include PHP-Quick-Profiler 
    3636require_once('PhpQuickProfiler.php'); 
  • trunk/Cronjobs/a2billing_subscription_fee.php

    r2730 r2759  
    117117 
    118118 
    119 $billdaybefor_anniversery = $A2B->config['global']['subscription_bill_days_before_anniversary']; 
     119$billdaybefor_anniversary = $A2B->config['global']['subscription_bill_days_before_anniversary']; 
    120120 
    121121$currencies_list = get_currencies($A2B->DBHandle); 
     
    162162                $lastday_of_next_month= lastDayOfMonth(date("m",$next_bill_date),date("Y",$next_bill_date),"j"); 
    163163 
    164                 $limite_pay_date = date("Y-m-d",strtotime(" + $billdaybefor_anniversery day")) ; 
     164                $limite_pay_date = date("Y-m-d",strtotime(" + $billdaybefor_anniversary day")) ; 
    165165 
    166166                if ($day_startdate>$lastday_of_next_month){ 
     
    170170                } 
    171171 
    172                 $next_bill_date = date("Y-m-d",strtotime("$next_limite_pay_date - $billdaybefor_anniversery day")) ; 
     172                $next_bill_date = date("Y-m-d",strtotime("$next_limite_pay_date - $billdaybefor_anniversary day")) ; 
    173173                                break; 
    174174 
     
    204204                    $lastday_of_next_month= lastDayOfMonth(date("m",$next_bill_date),date("Y",$next_bill_date),"j"); 
    205205 
    206                     $limite_pay_date = date("Y-m-d",strtotime(" + $billdaybefor_anniversery day")) ; 
     206                    $limite_pay_date = date("Y-m-d",strtotime(" + $billdaybefor_anniversary day")) ; 
    207207 
    208208                    if ($day_startdate>$lastday_of_next_month){ 
     
    212212                    } 
    213213 
    214                     $next_bill_date = date("Y-m-d",strtotime("$next_limite_pay_date - $billdaybefor_anniversery day")) ; 
     214                    $next_bill_date = date("Y-m-d",strtotime("$next_limite_pay_date - $billdaybefor_anniversary day")) ; 
    215215 
    216216                } 
     
    280280                                        $title = gettext("SUBSCRIPTION INVOICE REMINDER"); 
    281281                                        $description = "Your credit was not enough to pay yours subscription automatically.\n"; 
    282                                         $description .= "You have $billdaybefor_anniversery days to pay this invoice (REF: $reference ) or the account will be automatically disactived \n\n"; 
     282                                        $description .= "You have $billdaybefor_anniversary days to pay this invoice (REF: $reference ) or the account will be automatically disactived \n\n"; 
    283283                                        $value_insert = " '$date' , '$card_id', '$title','$reference','$description',1,0"; 
    284284                                        $instance_table = new Table("cc_invoice", $field_insert); 
     
    300300                    } 
    301301 
    302                     $mail = new Mail(Mail::$TYPE_SUBSCRIPTION_UNPAID,$card['id'] ); 
    303                     $mail -> replaceInEmail(Mail::$DAY_REMAINING_KEY,$day_remaining ); 
    304                     $mail -> replaceInEmail(Mail::$INVOICE_REF_KEY,$reference); 
    305                     $mail -> replaceInEmail(Mail::$SUBSCRIPTION_FEE,$subscription['fee']); 
    306                     $mail -> replaceInEmail(Mail::$SUBSCRIPTION_ID,$subscription['id']); 
    307                     $mail -> replaceInEmail(Mail::$SUBSCRIPTION_LABEL,$subscription['product_name']); 
     302                    $mail = new Mail(Mail::$TYPE_SUBSCRIPTION_UNPAID, $card['id'] ); 
     303                    $mail -> replaceInEmail(Mail::$DAY_REMAINING_KEY, $billdaybefor_anniversary ); 
     304                    $mail -> replaceInEmail(Mail::$INVOICE_REF_KEY, $reference); 
     305                    $mail -> replaceInEmail(Mail::$SUBSCRIPTION_FEE, $subscription['fee']); 
     306                    $mail -> replaceInEmail(Mail::$SUBSCRIPTION_ID, $subscription['id']); 
     307                    $mail -> replaceInEmail(Mail::$SUBSCRIPTION_LABEL, $subscription['product_name']); 
    308308                    //insert charge 
    309309                    $QUERY = "INSERT INTO cc_charge (id_cc_card, amount, chargetype, id_cc_card_subscription, invoiced_status) VALUES ('" . $card['id'] . "', '" . $subscription['fee']  . "', '3','" . $subscription['card_subscription_id'] . "',1)"; 
     
    344344                if ($verbose_level >= 1) 
    345345                                        echo "==> UPDATE CARD QUERY:    $QUERY\n"; 
    346                 $mail = new Mail(Mail::$TYPE_SUBSCRIPTION_DISABLE_CARD,$card['id'] ); 
    347                 $mail -> replaceInEmail(Mail::$SUBSCRIPTION_FEE,$subscription['fee']); 
    348                 $mail -> replaceInEmail(Mail::$SUBSCRIPTION_ID,$subscription['id']); 
    349                 $mail -> replaceInEmail(Mail::$SUBSCRIPTION_LABEL,$subscription['product_name']); 
     346                $mail = new Mail(Mail::$TYPE_SUBSCRIPTION_DISABLE_CARD, $card['id'] ); 
     347                $mail -> replaceInEmail(Mail::$SUBSCRIPTION_FEE, $subscription['fee']); 
     348                $mail -> replaceInEmail(Mail::$SUBSCRIPTION_ID, $subscription['id']); 
     349                $mail -> replaceInEmail(Mail::$SUBSCRIPTION_LABEL, $subscription['product_name']); 
    350350                try { 
    351351                    $mail -> send();