| | |
| | | |
| | | $wFirmaContractorId = $this->getContractorId($invoiceData['clientId']); |
| | | $payment = Invoices\Payment::create( |
| | | Payments\PaymentMethod::transfer() |
| | | Payments\PaymentMethod::transfer(), |
| | | new \DateTime($invoiceData['dueDate']) |
| | | ); |
| | | |
| | | if ($wFirmaId) { |
| | |
| | | /** @var \Webit\WFirmaSDK\Invoices\Invoice $invoice */ |
| | | $changed = FALSE; |
| | | |
| | | if ($invoice->payment()->paymentMethod() != $payment->paymentMethod() |
| | | || $invoice->payment()->paymentDate() != $payment->paymentDate()) { |
| | | $invoice->changePayment($payment); |
| | | $changed = TRUE; |
| | | } |
| | | |
| | | if ($invoice->priceType() != Invoices\PriceType::brutto()) { |
| | | $invoice->changePriceType(Invoices\PriceType::brutto()); |
| | | $changed = TRUE; |