Announcement

Collapse
No announcement yet.

Indicate Customer Credit in Batch Report

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Indicate Customer Credit in Batch Report

    In one of my order batch reports, I need to be able to identify on an order if the customer used a credit on the order.

    Is there a variable?

    Ideally, I would like the original code and value the customer used to redeem. I need that info associated with the order.

    Sadly, in Miva it's not easy to determine that stuff in the Miva admin just by looking at the order. Or is it? Am I missing it?

    Even when looking at the payment info, here's an example. The customer for this order actually redeemed a $50 gift certificate, then paid $1.14. But this is how it looks in Order Processing:
    Authorized: $51.14
    Captured: $51.14
    Refunded: $0.00
    Net Captured: $51.14
    Payment Type: American Express

    Can we get the credit/gift certificate info separated? In a batch report?

    #2
    A credit is treated as a payment method in Miva. So when a credit is used in addition to a credit card, there will be two payment records which show up in the Order.

    In a batch report you can access the all the payment records for an order by using this foreach loop:

    Code:
    <mvt:foreach iterator="payment" array="order:payments">
    
    <mvt:foreach iterator="field" array="payment:fields">
         <table><tr><th>&mvt:field:label;</th><td>&mvt:field:value;</td></tr></table>
     </mvt:foreach>
    
    </mvt:foreach>
    There is also a payment type for each payment. You can check for this to see if the record is a credit.

    Code:
    <mvt:if expr="l.settings:payment:type EQ 5">
        This is a customer credit payment record
    </mvt:if>

    Last edited by Brennan; 07-12-16, 08:09 AM.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Thanks for the tips! But sadly I'm still having trouble.

      The foreach you posted only shows me info related to the credit card payment.

      Neither label nor value for the account credit displays.

      However when I add your second piece of code your statement does show ("This is a customer credit payment record").

      Here's a sample of my results of an order that used a credit


      Can I get the credit value used? Is it possible to get the gift certificate number that was used to create the account credit?


      Payment Method:American Express

      **This is a customer credit payment record**

      Name on Card: xxx
      Card Number: xxxxxxx
      Card Expiration: 06/2020
      First Data Order #: xxx
      Date: Sat Jul 09 20:01:41 2016
      AVS Response: YYYM
      Approval Code: xxx:
      Processor Reference Number: xxx
      Processor Response Code: A
      Last edited by Mark Stephens; 07-12-16, 10:07 AM.

      Comment


        #4
        What would be the proper mvt to get the labels/values from this iterator? mvt:payment doesn't pull it.

        Code:
        <mvt:foreach iterator="payment" array="order:payments">
        <table><tr><th>&mvt:payment:label;</th><td>&mvt:payment:value;</td></tr></table>
        </mvt:foreach>
        Last edited by Mark Stephens; 07-12-16, 10:47 AM.

        Comment


          #5
          I believe that's a multidimensional array so you first need to run

          <mvt:foreach iterator="payment" array="order:payments">

          Then use

          <mvt:foreach iterator="field" array="payment:fields">

          Bruce Golub
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment


            #6
            Thank you. Bruce!

            Sadly, the account credit will not display in that array. A payment by credit is payment:type 5, so I can make the batch report produce a basic message like "Credit Used!!"

            However there are no details such as: 1). the amount of the credit or 2). the originating gift certificate code. We issue our own gift certificate codes, so this is pretty important to us to associate it with an order.

            If an account credit is treated as a payment in Miva, why won't the details regarding the credit display in either the batch report or when looking at the payment in Order Processing?

            Essentially I need to see something like this in my batch report.

            Is this possible?
            Payment Type Amount
            Account Credit $25.00
            Visa $35.99
            Total $60.99

            Comment


              #7
              There is default code in the batch report Order Invoice template which already lists out the payments in that manner:

              Code:
              <mvt:foreach iterator="payment" array="order:payments">
                                  <mvt:if expr="( l.settings:payment:type EQ 2 ) OR
                                                ( l.settings:payment:type EQ 4 ) OR
                                                ( l.settings:payment:type EQ 7 )">
                                      <mvt:foreachcontinue />
                                  </mvt:if>
              
                                  <h2>
                                      <mvt:if expr="ISNULL l.settings:payment:descrip">
                                          <mvt:if expr="l.settings:payment:type EQ 6">
                                              Refund
                                          <mvt:else>
                                              Payment
                                          </mvt:if>
                                      <mvt:else>
                                          <mvt:if expr="l.settings:payment:type EQ 6">
                                              Refund:
                                          <mvt:else>
                                              Payment:
                                          </mvt:if>
                                          &mvt:payment:descrip;
                                      </mvt:if>
                                  </h2>
                                  <hr />
              
                                  <table><tr><th>Amount:</th><td>&mvt:payment:formatted_amount;</td></tr></table>
              
                                  <mvt:foreach iterator="field" array="payment:fields">
                                      <table><tr><th>&mvt:field:label;</th><td>&mvt:field:value;</td></tr></table>
                                  </mvt:foreach>
                                  <br />
                              </mvt:foreach>
              Brennan Heyde
              VP Product
              Miva, Inc.
              [email protected]
              https://www.miva.com

              Comment

              Working...
              X