QuickBook桌面

时间:2018-09-17 13:10:32

标签: php quickbooks magento2.2.3

我们是否可以将数据从Quickbooks桌面同步到Magento 2,特别是如果发票在Quickbooks中标记为已付款/或已部分付款,它将数据同步到Magento 2吗?

我想从快速簿桌面到Magento 2同步发票,编辑订单状态,订单跟踪详细信息和RMA(退货)。

QuickBooks Desktop Integration的默认功能不支持此要求。

您可以指导我这一要求吗?

我在app / code / Magenest / QuickBooksDesktop / Model / Connector.php中编写了以下代码

function _quickbooks_invoice_import_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale)
{

    $attr_iteratorID = '';
    $attr_iterator = ' iterator="Start" ';
    if (empty($extra['iteratorID']))
    {
        $last = _quickbooks_get_last_run($user, $action);
        _quickbooks_set_last_run($user, $action);           

        _quickbooks_set_current_run($user, $action, $last);
    }
    else
    {
        $attr_iteratorID = ' iteratorID="' . $extra['iteratorID'] . '" ';
        $attr_iterator = ' iterator="Continue" ';

        $last = _quickbooks_get_current_run($user, $action);
    }

    $xml = '<?xml version="1.0" encoding="utf-8"?>
        <?qbxml version="' . $version . '"?>
        <QBXML>
            <QBXMLMsgsRq onError="stopOnError">
                <InvoiceQueryRq ' . $attr_iterator . ' ' . $attr_iteratorID . ' requestID="' . $requestID . '">
                    <MaxReturned>' . QB_QUICKBOOKS_MAX_RETURNED . '</MaxReturned>
                    <ModifiedDateRangeFilter>
                        <FromModifiedDate>' . $last . '</FromModifiedDate>
                    </ModifiedDateRangeFilter>
                    <IncludeLineItems>true</IncludeLineItems>
                    <OwnerID>0</OwnerID>
                </InvoiceQueryRq>   
            </QBXMLMsgsRq>
        </QBXML>';

    return $xml;
}

0 个答案:

没有答案