php 删除贷项通知单

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 删除贷项通知单相关的知识,希望对你有一定的参考价值。

<?php
//http://archive.sharpdotinc.com/magento-how-to-delete-a-credit-memo/
//Now Delete the Refund for an order but do not delete the order.
$order = Mage::getModel(‘sales/order’)->loadByIncrementId(‘XXX000320’);
//Delete Credit Memo
$creditMemos = $order->getCreditmemosCollection();
foreach($creditMemos as $cm){   //cancel each credit memo for the order
$state = $cm->getState();
if($state == 3){//Cancled
continue;
}
$cm->cancel()
->save()
->getOrder()->save(); //Needed to save the order to apply the canceled credit memo to all order items.
$cm->delete();
}

以上是关于php 删除贷项通知单的主要内容,如果未能解决你的问题,请参考以下文章

ebs 收款可以核销贷项通知单吗

在 Magento CE 1.9.2.1 的后端显示发票的贷项通知单按钮有啥要求?

sql [magento]为订单,报价单,发票,货件或贷项通知单设置下一个increment_id

credit memo是啥意思

如何在 WPF 中“单击”控件?

运行公式将值从正数更改为负数,然后自动填充到数据末尾