mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-04-11 12:50:55 +00:00
Send in history
This commit is contained in:
parent
31976ff84c
commit
ecf59a8b83
3 changed files with 75 additions and 6046 deletions
|
@ -1525,10 +1525,13 @@ class RetailcrmHistory
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
if (RetailcrmTools::validateEntity($addressInvoice, null, true)) {
|
||||
$addressInvoice->id_customer = $customer->id;
|
||||
RetailcrmTools::assignAddressIdsByFields($customer, $addressInvoice);
|
||||
|
||||
self::setCompanyAndVatNumberForInvoiceAddress($order, $addressInvoice);
|
||||
|
||||
if (empty($addressInvoice->id)) {
|
||||
self::loadInPrestashop($addressInvoice, 'save');
|
||||
|
||||
|
@ -1954,6 +1957,24 @@ class RetailcrmHistory
|
|||
return $orderDetail;
|
||||
}
|
||||
|
||||
private static function setCompanyAndVatNumberForInvoiceAddress($crmOrder, $addressInvoice)
|
||||
{
|
||||
if (!RetailcrmTools::isCorporateEnabled()
|
||||
&& RetailcrmTools::isCampanyAndVatNumberSendEnabled()
|
||||
) {
|
||||
$company = $crmOrder['customFields']['ps_company'] ?? '';
|
||||
$vatNumber = $crmOrder['customFields']['ps_vat_number'] ?? '';
|
||||
|
||||
if ('' !== $company) {
|
||||
$addressInvoice->company = $company;
|
||||
}
|
||||
|
||||
if ('' !== $vatNumber) {
|
||||
$addressInvoice->vat_number = $vatNumber;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleError($order, $e)
|
||||
{
|
||||
RetailcrmLogger::writeCaller(
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue