Last active
July 26, 2023 09:34
-
-
Save runezero/4f9159a9bd8156bc2e0ed671b68e3934 to your computer and use it in GitHub Desktop.
[Create PrimaryPayer Update List] Create a list of Business Central paying customers to update based on the given Mandate data and customer number #billybird
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Class: Twikeyservice */ | |
$data = $this->getCompletedMandates(); | |
$result = []; | |
foreach ($data as $row) { | |
$order = json_decode($row->data, true); | |
$order['person']['phone'] = Api::validateMobileNumber($order['person']['phone'] ?? ""); | |
$result[] = [$order['person'], $row->customer_number, $row->location]; | |
$updateParams = [$order['person'], $row->customer_number, $row->location]; | |
Taskrunner::insertTask('30 20 * *', 'Twikeyservice::updatePrimaryPayerInfo', $updateParams, 1, true); | |
} | |
return ["count" => count($result), "data" => $result]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment