当前位置: 首页>>代码示例>>PHP>>正文


PHP WPSC_Purchase_Log::is_payment_declined方法代码示例

本文整理汇总了PHP中WPSC_Purchase_Log::is_payment_declined方法的典型用法代码示例。如果您正苦于以下问题:PHP WPSC_Purchase_Log::is_payment_declined方法的具体用法?PHP WPSC_Purchase_Log::is_payment_declined怎么用?PHP WPSC_Purchase_Log::is_payment_declined使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WPSC_Purchase_Log的用法示例。


在下文中一共展示了WPSC_Purchase_Log::is_payment_declined方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

    function do_sales_report()
    {
        global $wpdb;
        $trnsid = 1;
        $gateway_accounts = get_option('pbci_gateway_accounts', array());
        $export_accounts = get_option('pbci_export_accounts', array('sales_revenue' => 'Product Revenue', 'shipping' => 'Shipping', 'sales_tax_account' => 'Sales Tax Payable', 'sales_tax_payee' => 'Sales Tax'));
        $periods = array_keys($_POST['period']);
        $period_count = 0;
        $grand_total_items = 0;
        $grand_total_item_taxable = 0;
        $grand_total_item_non_taxable = 0;
        $grand_total_discounts = 0;
        $grand_total_discount_taxable = 0;
        $grand_total_discount_non_taxable = 0;
        $grand_total_shipping_transasctions = 0;
        $grand_total_shipping_taxable = 0;
        $grand_total_shipping_non_taxable = 0;
        $grand_total_tax_transactions = 0;
        $grand_total_tax_taxable = 0;
        $grand_total_tax_non_taxable = 0;
        $grand_total_transactions = 0;
        $grand_total_transaction_total_taxable = 0;
        $grand_total_transaction_total_non_taxable = 0;
        ob_start();
        foreach ($periods as $period) {
            $a = explode('-', $period);
            $year = $a[0];
            $month = $a[1];
            $period_count++;
            $sql = "SELECT ID FROM " . WPSC_TABLE_PURCHASE_LOGS . ' WHERE MONTH( FROM_UNIXTIME( date ) ) = ' . $month . ' AND YEAR( FROM_UNIXTIME( DATE ) ) = ' . $year . ' ORDER by date DESC';
            $result = $wpdb->get_col($sql, 0);
            $purchase_log_ids = array_map('intval', $result);
            $datestring = date("F Y", mktime(0, 0, 0, $month, 1, $year));
            $items = 0;
            $item_taxable = 0;
            $item_non_taxable = 0;
            $discounts = 0;
            $discount_taxable = 0;
            $discount_non_taxable = 0;
            $shipping_transasctions = 0;
            $shipping_taxable = 0;
            $shipping_non_taxable = 0;
            $tax_transactions = 0;
            $tax_taxable = 0;
            $tax_non_taxable = 0;
            $transactions = 0;
            $transaction_total_taxable = 0;
            $transaction_total_non_taxable = 0;
            $taxable_transactions = 0;
            $this_transaction_item_total = 0;
            $taxable_total = 0;
            $not_taxable_transactions = 0;
            $not_taxable_total = 0;
            $max_rows = 1;
            foreach ($purchase_log_ids as $purchase_log_id) {
                $purchase_log = new WPSC_Purchase_Log($purchase_log_id);
                $gateway_id = $purchase_log->get('gateway');
                $data = $purchase_log->get_data();
                //				if ( empty( $gateway_accounts[$gateway_id] ) ) {
                //					continue;
                //				}
                if ($purchase_log->is_incomplete_sale()) {
                    continue;
                }
                if ($purchase_log->is_payment_declined()) {
                    continue;
                }
                if ($purchase_log->is_refunded()) {
                    continue;
                }
                if ($purchase_log->is_refund_pending()) {
                    continue;
                }
                //				if ( ($purchase_log->get('processed') != WPSC_Purchase_Log::ACCEPTED_PAYMENT) && ($purchase_log->get('processed') != WPSC_Purchase_Log::CLOSED_ORDER) ) {
                //					continue;
                //				}
                $checkout_form_data = new WPSC_Checkout_Form_Data($purchase_log_id);
                $checkout = $checkout_form_data->get_data();
                $timestamp = $purchase_log->get('date');
                $thedate = date('m/d/Y', $timestamp);
                $transactions++;
                $t = floatval($purchase_log->get('wpec_taxes_total'));
                if ($t > 0) {
                    $is_taxable = true;
                    $taxable_transactions++;
                    $taxable_total += $this_transaction_item_total - $d;
                } else {
                    $is_taxable = false;
                    $not_taxable_transactions++;
                    $not_taxable_total += $this_transaction_item_total - $d;
                }
                if ($is_taxable) {
                    $transaction_total_taxable += $purchase_log->get('totalprice');
                } else {
                    $transaction_total_non_taxable += $purchase_log->get('totalprice');
                }
                $t = floatval($purchase_log->get('wpec_taxes_total'));
                if ($is_taxable) {
                    $tax_transactions++;
                    if ($is_taxable) {
//.........这里部分代码省略.........
开发者ID:JeffPyeBrook,项目名称:wpec-sales-report,代码行数:101,代码来源:pbci-wpec-sales-report.php


注:本文中的WPSC_Purchase_Log::is_payment_declined方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。