Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
[RESOLVED] How to change invoice status in Admin panel? 
 
jazkat
Sr. Member
 
Total Posts:  154
Joined:  2009-07-09
 

When creating Invoice directly from Order in admin the invoice automatically gets marked as Paid.
I would like is to mark it as “Waiting for payment” or something similar, because not every Invoice that will be issued is going to be paid at that time. Some customers may even have “Payment due” option enabled.

Is there a way I can later change Invoice to Paid, which also means it will be shown as paid in store statistics.  Otherwise it just distorts real picture of store sale.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
jazkat
Sr. Member
 
Total Posts:  154
Joined:  2009-07-09
 

Hi tzyganu,

this is perfect, THANKS!  !!

Exactly what I wanted… grin I’m happy now LOL

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

I posted this before, but in the meanwhile my account was deleted \’through a human error\’ - they say.
Here is a possible solution:
In order to create a \’pending\’ invoice, the payment method you use for the order must allow you to.
For that you need to add in the payment method\’s model this member:

protected $_canCapture true;
You can add it right under
protected $_code  \'PAYMENT CODE HERE\';
For example if you want to do this for Check/money order you need to add the line above in app/code/core/Mage/Payment/Model/Method/Checkmo.php

After this when you create an invoice you will have an option near the save button to set the invoice status. (see picture attached). To create a pending invoice select \’Not capture\’.
If you want to mark it later as paid edit the invoice and between the buttons on to one called \’Capture\’ (see picture). Well you get the idea....

For security reasons a copy of this post can be found here:
http://marius-strajeru.blogspot.com/2010/04/how-to-change-invoice-status-in-admin.html

Image Attachments
pic1.JPGpic2.JPG
 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

The modifications above work but you are not able to edit the quantities invoiced anymore.
Add this to the payment model.

protected $_canCapturePartial true;
 
Magento Community Magento Community
Magento Community
Magento Community
 
AG Prime
Jr. Member
 
Avatar
Total Posts:  19
Joined:  2008-09-07
Cluj-Napoca
 

I tried but it doesn’t work. What version of Magento should it work on. I am using “Magento ver. 1.4.0.1”

Thanks,
Gabriel

 
Magento Community Magento Community
Magento Community
Magento Community
 
AG Prime
Jr. Member
 
Avatar
Total Posts:  19
Joined:  2008-09-07
Cluj-Napoca
 

Should I do something else besides modifying the Checkmo.php file?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

Salut Gabi,
You shouldn’t do anything else. For me this worked for all the version from 1.1.6 to 1.4.0.1. I have a feeling it works for other versions (previous or later) but I just didn’t have the chance to work with them.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tanius
Jr. Member
 
Total Posts:  21
Joined:  2010-10-04
 

I just tested tzyganu’s solution on Magento 1.4.1.1 with the (third party) Symmetrics Invoice payment method (from the MarketReady Germany modules), and it worked perfectly. So it seems that this solution is applicable to all kinds of offline payment methods, whether from Magento core or the community. It’s the best solution to this problem that I found on the Internet!

What I did concretely was this:

Opened the file app/code/community/Symmetrics/Invoice/Model/Method/Invoice.php and inserted these two lines right below “protected $_code = ‘invoice’;”:

protected $_canCapture true// Added by N. N. on yyyy-mm-dd.
protected $_canCapturePartial true// Added by N. N. on yyyy-mm-dd.
 
Magento Community Magento Community
Magento Community
Magento Community
 
ryukyufire
Jr. Member
 
Total Posts:  21
Joined:  2010-07-02
Melbourne, Australia
 

Thanks, tzyganu!

It worked!!!

Magento 1.5.1 and Purchase Order payment method(Purchaseorder.php).

 
Magento Community Magento Community
Magento Community
Magento Community
 
khamyl
Jr. Member
 
Total Posts:  2
Joined:  2011-10-03
 

I used the following edit to automaticaly set the CAPTURE method to NOT_CAPTURE for specific (my custom) payment methods:
After allowing the amount capturin’ in the payment methods (as tzyganu adviced) i modified the following file:

app/design/adminhtml/default/default/template/sales/order/invoice/create/items.phtml

in block

<div class="box-right entry-edit" id="invoice_totals">

after
<?php if ($this->canCapture()):?>
i added the following
<!-- Khamyl Add [autoCapture] -->
             
<?php $_paymentCode $this->getInvoice()->getOrder()->getPayment()->getMethodInstance()->getCode() ?>
             <?php 
//var_dump($_paymentCode)?>
             
<?php if (in_array($_paymentCode, array("bankpayment","cache","paymentondelivery"))):?>
              <?php 
echo "<small><font color='gray'><em>Automatic AMOUNT NOT CAPTURE (hidden)</em></font></small>" ?>
              
<input type="hidden" name="invoice[capture_case]" value="not_capture"/>
             
<?php else: ?>
             
<!-- Khamyl Add END-->

and you need to end the IF ELSE statement, I did it before

<?php elseif ($this->isGatewayUsed()):?>

so the entire edited block “invoice_totals” looks like this

<div class="box-right entry-edit" id="invoice_totals">
    <
div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals'?></h4></div>
    <
div class="order-totals">
        
<?php echo $this->getChildHtml('invoice_totals'?>
        
<div class="order-totals-bottom">
          <
div class="divider"></div>
          
<?php if ($this->isCaptureAllowed()): ?>
            <?php 
if ($this->canCapture()):?>
              
<!-- Khamyl Add [autoCapture] blok-->
             
<?php $_paymentCode $this->getInvoice()->getOrder()->getPayment()->getMethodInstance()->getCode() ?>
             <?php 
//var_dump($_paymentCode)?>
             
<?php if (in_array($_paymentCode, array("bankpayment","cache","paymentondelivery"))):?>
              <?php 
echo "<small><font color='gray'><em>Automatic AMOUNT NOT CAPTURE (hidden)</em></font></small>" ?>
              
<input type="hidden" name="invoice[capture_case]" value="not_capture"/>
             
<?php else: ?>
             
<!-- Khamyl Add END-->
              <
p>
              <!--
                  <
label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Capture Amount'?></label>
                  <
input type="checkbox" name="invoice[do_capture]" id="invoice_do_capture" value="1" checked/>
              -->
                  <
label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Amount'?></label>
                  <
select name="invoice[capture_case]">
                      <
option value="online"><?php echo Mage::helper('sales')->__('Capture Online'?></option>
                      <
option value="offline"><?php echo Mage::helper('sales')->__('Capture Offline'?></option>
                      <
option value="not_capture"><?php echo Mage::helper('sales')->__('Not Capture'?></option>
                  </
select>
              </
p>
             
<?php endif; ?> <!-- Khamyl Add [autoCapture] row--> 
            
<?php elseif ($this->isGatewayUsed()):?>
                
<input type="hidden" name="invoice[capture_case]" value="offline"/>
                <
p><?php echo Mage::helper('sales')->__('Invoice will be created without communication with payment gateway.'?></p>
            
<?php endif?>
          <?php 
endif; ?>
          
<p>
              <
label class="normal" for="notify_customer"><?php echo Mage::helper('sales')->__('Append Comments'?></label>
              <
input id="notify_customer" name="invoice[comment_customer_notify]" value="1" type="checkbox" />
          </
p>
          
<?php if ($this->canSendInvoiceEmail()): ?>
          
<p>
              <
label class="normal" for="send_email"><?php echo Mage::helper('sales')->__('Email Copy of Invoice'?></label>
              <
input id="send_email" name="invoice[send_email]" value="1" type="checkbox" />
          </
p>
          
<?php endif; ?>
          
<div class="a-right">
          
<?php echo $this->getChildHtml('submit_button'?>
          
</div>
        </
div>
    </
div>
</
div>

Tested with Magento 1.6.0.0 and 1.6.1.0

 
Magento Community Magento Community
Magento Community
Magento Community
 
dk_mbx
Jr. Member
 
Total Posts:  19
Joined:  2011-02-13
 

Woooow worked great for me.

Can I add the dropdown to each payment type where i need this solution? furthermore is there any way to change the way of capturing the money? with this solution there is a “capture"-button to mark the invoice/order as payed. But can I also implement the dropdown to set the state when editing the order?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bondjack
Jr. Member
 
Total Posts:  8
Joined:  2010-10-28
 

Hi Guys, The above method does work in Magento 1.7 but still on my invoices it shows the grand total and not the open amount. Is there a way to get the due balance on the invoice when you choose to “not capture”?

so in the order menu I see this for the orders:

Subtotal €xx.xx
Shipping & Handling €xx.xx
Total Tax €xx.xx
Grand Total €xx.xx
Total Paid €xx.xx
Total Refunded €xx.xx
Total Due €xx.xx

but when I go to the invoice it only shows:

Subtotal €xx.xx
Shipping & Handling €xx.xx
Total Tax €xx.xx
Grand Total €xx.xx

I want so include:

Total Paid €xx.xx
Total Refunded €xx.xx
Total Due €xx.xx

on my email invoice and pdf invoice,

Any one? thx

 
Magento Community Magento Community
Magento Community
Magento Community
 
chrtho
Jr. Member
 
Total Posts:  11
Joined:  2012-05-08
Oslo
 

THANK YOU ALL for helping with this! This is great!
I find it strange that there is no FAQ about how to solve this. It was not easy to find.

If you have more suggestions about this topic or later versions of Magento change this or make this scripts unavailible to use - please update here!

Great!

 
Magento Community Magento Community
Magento Community
Magento Community
 
shani29
Jr. Member
 
Total Posts:  7
Joined:  2012-11-05
 

Hi,
I did this,and I saw the msg at the bottom of the invoice.. thanks!!

Question.. when I ship it, it still marks it complete!  Is there a way to ship it and leave it in Pending Payment??

Thanks!
Shani

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

Honestly, I have no idea.
But if you test it, please post the answer here.

Marius.

 
Magento Community Magento Community
Magento Community
Magento Community
 
niekvanhengel
Jr. Member
 
Total Posts:  2
Joined:  2012-06-29
 

After reading the manual (http://www.magentocommerce.com/wiki/welcome_to_the_magento_user_s_guide/chapter_8) I believe this should be done by selecting the method to capture the payment per payment method.

Not Capture - When the Invoice is submitted, the system will not capture the payment. However, it will be assumed that you will capture the payment through Magneto at a later date. Therefore, there will be a Capture button in the completed Invoice. Before capturing, you will be able to cancel the Invoice, and after capturing, you will be able to Credit Memo and Void the Invoice. Note: Do not select Not Capture from the drop-down unless you are certain that you are going to capture the payment through Magento at a later date. You will not be able to create a Credit Memo until the payment has been captured using the Capture button.

Strangest thing that the option Authorize and Capture in the Payment Action drop-down for my payment methods in the Payment Method tab of System > Configuration is not visible. Anybody an idea what happened to this option?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2