Пример #1
0
 public function getshipping_name_amount()
 {
     $shippingLink = AF::link(array('shipping' => 'update'), array('id' => $this->shipping_id));
     return '[<a href="' . $shippingLink . '">' . $this->shipping_id . '</a>] <a href="' . $shippingLink . '">' . $this->shipping_name . "</a> (" . Currency::getSingPrice($this->amount_shipping, $this->currency_id) . ")";
 }
Пример #2
0
 public function getvoidrefund_revenue_formatted()
 {
     return Currency::getSingPrice($this->voidrefund_revenue, $this->currency_id);
 }
Пример #3
0
 public function getsum_amount_formatted()
 {
     return Currency::getSingPrice($this->sum_amount, $this->currency_id);
 }
Пример #4
0
echo __('total');
?>
</b></td><td><?php 
echo $total['prospect_count'];
?>
</td><td><?php 
echo $total['initial_customers'];
?>
</td><td><?php 
echo $total['conversion_rate'];
?>
%</td><td><?php 
echo Currency::getSingPrice($total['gross_revenue'], $total['currency_id']);
?>
</td><td><?php 
echo Currency::getSingPrice($total['average_revenue'], $total['currency_id']);
?>
</td></tr>';
            $("#widget_Reports_table tbody").append(total);
        </script>
    <?}?>

    <?php 
$this->widget($pagination, array());
?>
</div>

<script>
    $(document).ready(function(){

        $(".af_select_ajax").chosen({
Пример #5
0
?>
</td>';
                        <?}else{?>
                        total += '<td><?php 
echo isset($total["c{$i}_" . $field]) ? number_format($total["c{$i}_" . $field]) : '&mdash;';
?>
</td>';
                        <?}?>

                    <?}?>
                <?}else{?>
                    <?foreach($extraFields as $field){?>

                        <?if(in_array($field, array('refund_revenue', 'net_revenue', 'potential_revenue', 'chargeback_loss'))){?>
                        total += '<td><?php 
echo isset($total["c{$i}_" . $field]) ? Currency::getSingPrice(number_format($total["c{$i}_" . $field], 2), $item->gateway_currency) : '&mdash;';
?>
</td>';
                        <?}elseif(in_array($field, array('approval_rate', 'decline_rate', 'chargeback_rate', 'void_rate', 'cancel_rate', 'retention_rate'))){?>
                        total += '<td><?php 
echo isset($total["c{$i}_" . $field]) ? number_format($total["c{$i}_" . $field] * 100, 2) . '%' : '&mdash;';
?>
</td>';
                        <?}else{?>
                        total += '<td><?php 
echo isset($total["c{$i}_" . $field]) ? number_format($total["c{$i}_" . $field]) : '&mdash;';
?>
</td>';
                        <?}?>

                    <?}?>
Пример #6
0
 public function chargebackAction()
 {
     $clearArray = array();
     $this->filter($clearArray);
     if (!isset($this->params['cr_dates'])) {
         $today = date("d.m.Y");
         $this->params['cr_dates'] = $today . '-' . $today;
     }
     if (!isset($this->params['action_id'])) {
         $this->params['action_id'] = '29,30';
     }
     $pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params, 'ajax' => true));
     $models = AFActiveDataProvider::models('OrderLog', $this->params, $pagination);
     $dataProvider = $models->getChargebackReport();
     $total = $models->getChargebackTotalReport();
     //$totalAmount = (isset($total[0]['sum_amount']))?$total[0]['sum_amount']:0;
     $filterFields = $models->getoutFilterFields($clearArray, array('cr_dates'));
     $fields = array('gateway', 'campaign', 'action_chargeback_formatted', 'sum_amount_formatted');
     $currency = $models->getCurrency();
     $rTotal = count($currency) == 1 ? Currency::getSingPrice($total[0]['sum_amount'], $currency[0]['currency_id']) : false;
     $gateways = $models->getDSearchGateways();
     $campaigns = $models->getDSearchCampaigns();
     // set ajax table
     if (AF::isAjaxRequestModels()) {
         $this->view->includeFile('_chargeback_table', array('application', 'views', 'reports'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields, 'total' => $rTotal, 'fields' => $fields, 'gateways' => $gateways, 'campaigns' => $campaigns));
         die;
     }
     Assets::css('jquery-ui');
     Assets::js('//code.jquery.com/ui/1.10.3/jquery-ui.js');
     Assets::js('dateRange/jquery.daterange');
     Assets::js('ajax_table');
     $this->render('chargeback', array('dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields, 'fields' => $fields, 'gateways' => $gateways, 'campaigns' => $campaigns, 'total' => $rTotal));
 }
Пример #7
0
echo $extraParamsArray[3];
?>
] <?php 
echo $sids[$extraParamsArray[2]]['aff_name'];
?>
<?}else{?>&mdash;<?}?>
                            <?}?>
                        </td>
                        <?$countLine=0;foreach ($data as $key => $value){
                            $f=explode('_', $key, 2)?>
                            <td <?if(!in_array($f[1], $simpleReportFields)){?>class="rn_simple" <?}?> <?if($f[1]=='retention_rate' || ($f[1]=='net_revenue' && $f[0]=='c0') ){?>style="background-color: #eeeeee; border-right: 4px solid black"<?}?>>
                                <?
                                if (substr($key, -4) == 'rate')
                                    echo (number_format($value * 100, 2)) . '%';
                                elseif (substr($key, -6) == 'amount' || substr($key, -4) == 'loss' || substr($key, -7) == 'revenue')
                                    echo Currency::getSingPrice(number_format($value, 2), $reportCur[$extraParams]);
                                else
                                    echo $value;
                                ?>
                            </td>
                            <?$countLine++;}?>

                        <?
                        if( ($countTh-$countLine) > 0 ){
                            $allLine=count($extraFields[1])*($countR-1);
                            $shotLine=$countLine-count($extraFields[0]);
                            $countExtra=round($shotLine/count($extraFields[1]));
                            $ci=($countR-1)-$countExtra;

                            for($ii=0;$ii<$ci;$ii++)
                            {
Пример #8
0
 public function getaverage_revenue_formatted()
 {
     return Currency::getSingPrice($this->average_revenue, $this->currency_id);
 }
Пример #9
0
 function printAction()
 {
     $id = AF::get($this->params, 'id', FALSE);
     if (!$id) {
         throw new AFHttpException(0, 'no_id');
     }
     $orderArray = Order::getPrintFields($id);
     if (!$orderArray) {
         throw new AFHttpException(0, 'incorrect_id');
     }
     $orderModel = new Order();
     $orderModel->order_id = $id;
     $lables = $orderModel->attributeLabels();
     $orderInfo = array('full_order_id' => $orderArray['order_id'], 'created' => $orderArray['created'], 'status' => $orderArray['status'], 'campaign_name' => $orderArray['campaign_id'], 'amount_product' => Currency::getSingPrice($orderArray['amount_product'], $orderArray['currency_id']), 'amount_shipping' => Currency::getSingPrice($orderArray['amount_shipping'], $orderArray['currency_id']));
     if ($orderArray['amount_refunded']) {
         $orderInfo['amount_refunded'] = Currency::getSingPrice($orderArray['amount_refunded'], $orderArray['currency_id']);
     }
     $modelAttempt = new Attempt();
     $modelAttempt->getLastOrderAttempt($id, Attempt::DEBIT_TYPE);
     $orderInfo2 = array('payment_total' => Currency::getSingPrice($orderArray['payment_total'], $orderArray['currency_id']), 'AFID' => $orderArray['aff_id'], 'SID' => $orderArray['sid'], 'c1' => $orderArray['c1'], 'c2' => $orderArray['c2'], 'c3' => $orderArray['c3'], 'billing_cycle' => $orderArray['billing_cycle'], 'tracking_number' => $modelAttempt->tracking_number ? $modelAttempt->tracking_number : __('no'));
     $orderInfo2['rma_code'] = $orderArray['rma_code'] ? $orderArray['rma_code'] : __('no');
     $orderInfo2['gateway_name'] = $orderArray['gateway_name'];
     $orderInfo = array_merge($orderInfo, $orderInfo2);
     $customerInfo = array('order_customer_name' => $orderArray['fname'] . ' ' . $orderArray['lname'], 'email' => $orderArray['email'], 'ip' => long2ip($orderArray['ip']), 'phone' => $orderArray['phone'], 'order_address1' => $orderArray['address1'], 'order_address2' => $orderArray['address2'], 'order_city' => $orderArray['city'], 'order_state' => $orderArray['state_name'], 'order_country' => $orderArray['country_name'], 'order_zip' => $orderArray['zip'], 'order_billing_fname' => $orderArray['billing_country_id'] ? $orderArray['billing_fname'] : $orderArray['fname'], 'order_billing_lname' => $orderArray['billing_country_id'] ? $orderArray['billing_lname'] : $orderArray['lname'], 'order_billing_address1' => $orderArray['billing_country_id'] ? $orderArray['billing_address1'] : $orderArray['address1'], 'order_billing_address2' => $orderArray['billing_country_id'] ? $orderArray['billing_address2'] : $orderArray['address2'], 'order_billing_city' => $orderArray['billing_country_id'] ? $orderArray['billing_city'] : $orderArray['city'], 'order_billing_state' => $orderArray['billing_country_id'] ? $orderArray['billing_state_name'] : $orderArray['state_name'], 'order_billing_country' => $orderArray['billing_country_id'] ? $orderArray['billing_country_name'] : $orderArray['country_name'], 'order_billing_zip' => $orderArray['billing_country_id'] ? $orderArray['billing_zip'] : $orderArray['zip']);
     $paymentModel = new Payment();
     $paymentModel->fillFromArray($orderArray);
     $paymentInfo = array('payment_type' => $orderArray['payment_type']);
     if ($orderArray['payment_type'] == 'pn') {
         $addPaymentInfo = array('order_payment_status' => $modelAttempt->status, 'order_cc_number' => $paymentModel->cc_number_formatted, 'order_expiry_date' => $paymentModel->exp_date_formatted, 'order_transaction_id' => $modelAttempt->tracking_number ? $modelAttempt->tracking_number : __('no'));
         $paymentInfo = array_merge($paymentInfo, $addPaymentInfo);
     }
     $orderProducts = $orderModel->getOrderProducts();
     $this->layout = array('layouts', 'main_print');
     $this->render('print', array('order' => $orderArray, 'lables' => $lables, 'orderInfo' => $orderInfo, 'customerInfo' => $customerInfo, 'paymentInfo' => $paymentInfo, 'orderProducts' => $orderProducts));
 }