| Conditions | 4 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | protected static function canUpdatePaymentStatus(Vtiger_Record_Model $recordModel): bool |
||
| 31 | { |
||
| 32 | $returnValue = parent::canUpdatePaymentStatus($recordModel); |
||
| 33 | if (($returnValue || false !== $recordModel->getPreviousValue(static::$relatedRecordIdName)) && (int) $recordModel->get('currency_id') !== \App\Record::getCurrencyIdFromInventory($recordModel->get(static::$relatedRecordIdName), static::$moduleName) |
||
| 34 | ) { |
||
| 35 | \App\Log::warning('The payment is in a different currency than the related record: ' . $recordModel->get(static::$relatedRecordIdName)); |
||
| 36 | $returnValue = false; |
||
| 37 | } |
||
| 38 | return $returnValue; |
||
| 39 | } |
||
| 41 |