mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2026-03-03 02:47:02 +00:00
Working on dedicated credits for PEPPOL
This commit is contained in:
@@ -81,6 +81,8 @@ class UpdateCreditRequest extends Request
|
||||
|
||||
$rules['location_id'] = ['nullable', 'sometimes','bail', Rule::exists('locations', 'id')->where('company_id', $user->company()->id)->where('client_id', $this->credit->client_id)];
|
||||
|
||||
$rules['e_invoice'] = ['sometimes', 'nullable', new ValidInvoiceScheme()];
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class UpdateEInvoiceConfiguration extends Request
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'entity' => 'required|bail|in:invoice,client,company',
|
||||
'entity' => 'required|bail|in:credit,invoice,client,company',
|
||||
'payment_means' => 'sometimes|bail|array',
|
||||
'payment_means.*.code' => ['required_with:payment_means', 'bail', Rule::in(PaymentMeans::getPaymentMeansCodelist())],
|
||||
'payment_means.*.bic_swift' => Rule::forEach(function (string|null $value, string $attribute) {
|
||||
@@ -115,6 +115,7 @@ class UpdateEInvoiceConfiguration extends Request
|
||||
|
||||
return [...$rules, 'nullable'];
|
||||
}),
|
||||
'document_reference' => ['sometimes', 'bail', 'array'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -276,6 +276,7 @@ class Peppol extends AbstractService
|
||||
$this->p_invoice->Delivery = $this->getDelivery();
|
||||
|
||||
$this->setOrderReference()
|
||||
->setDocumentReference()
|
||||
->setTaxBreakdown()
|
||||
->setPaymentTerms()
|
||||
->addAttachments()
|
||||
@@ -496,6 +497,19 @@ class Peppol extends AbstractService
|
||||
return [$key => json_decode($this->toJson(), true)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the reference for this document,
|
||||
* ie: for a credit note, this reference would be the invoice it is referencing. Will always be stored on the e_invoice object.
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
private function setDocumentReference(): self
|
||||
{
|
||||
// InvoiceNinja\EInvoice\Models\Peppol\DocumentReferenceType
|
||||
|
||||
// We should only need to pull this in from the already stored object.
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* setOrderReference
|
||||
|
||||
Reference in New Issue
Block a user