Invoice
Ekansio
Ekansio
$Invoice = $this->get('webservice','Ekansio')->getResource('Invoice'); $Invoice->Number = '123456'; // Laskunumero $Invoice->Type = ''; $Invoice->ReferenceNumber = '1070'; // Viitenumero $Invoice->Date = ''; // Laskun päivä $Invoice->DeliveryDate = ''; // Laskun toimitus- /saapumispäivä $Invoice->FreeText = ''; // Vapaateksti laskurivien jälkeen $Invoice->PrivateText = ''; // Vapaateksti laskurivien jälkeen $Payment = $Invoice->addPayment(); $Payment->NetDays = '14'; // Maksuehdon nettopäivät $Payment->StatusCode = ''; $Payment->Method = ''; $Payment->Terms = ''; $Payment->DueDate = ''; // Laskun eräpäivä $CashDiscount = $Invoice->addCashDiscount(); $CashDiscount->Days = '5'; // Maksuehtoon tulevat kassaalennuspäivät $CashDiscount->Percent = '10'; // Maksuehtoon tuleva kassa-alennus $OverdueFine = $Invoice->addOverdueFine(); $OverdueFine->Percent = ''; $OverdueFine->Text = ''; $Delivery = $Invoice->addDelivery(); $Delivery->Method = 'Asennettuna'; // Toimitustapa $Delivery->Date = ''; $Delivery->StartDate = ''; $Delivery->EndDate = ''; $Delivery->Terms = 'Sopimuksen mukaan'; // Toimitusehto $Seller = $Invoice->addSeller(); $Seller->ContactId = ''; $Seller->Identifier = '2318660-2'; $Seller->Reference = '654321'; // Viitteemme/Viitteenne $Seller->TaxCode = 'FI23186602'; $Seller->Name = 'Pingvin Designs Oy'; // Organisation name $Seller->Department = 'Kirjanpito'; // Osasto $Seller->OvtCode = ''; $Seller->Phone = '010 420 4540'; $Seller->Email = 'toimisto@ekansio.fi'; $Address = $Seller->addAddress(); $Address->Street = 'Lapintie 28'; $Address->AdditionalAddressLine = 'Kadunpuoleinen ovi'; $Address->Town = 'Tampere'; $Address->PostCode = '33210'; $Address->PostBox = '13'; $Address->Country = 'Finland'; $Address->CountryCode = 'FI'; $ContactPerson = $Seller->addContactPerson(); $ContactPerson->Name = ''; $BankAccount = $Seller->addBankAccount(); $BankAccount->BankName = ''; $BankAccount->IBAN = 'FI0 XXX 82236180006011'; $BankAccount->BIC = 'NDEAFIHH'; $Buyer = $Invoice->addBuyer(); $Buyer->ContactId = ''; $Buyer->Identifier = '2318660-2'; $Buyer->Reference = '654321'; // Viitteemme/Viitteenne $Buyer->TaxCode = 'FI23186602'; $Buyer->Name = 'Pingvin Designs Oy'; // Organisation name $Buyer->Department = 'Kirjanpito'; // Osasto $Buyer->OvtCode = ''; $Buyer->Phone = '010 420 4540'; $Buyer->Email = 'toimisto@ekansio.fi'; $Address = $Buyer->addAddress(); $Address->Street = 'Lapintie 28'; $Address->AdditionalAddressLine = 'Kadunpuoleinen ovi'; $Address->Town = 'Tampere'; $Address->PostCode = '33210'; $Address->PostBox = '13'; $Address->Country = 'Finland'; $Address->CountryCode = 'FI'; $ContactPerson = $Buyer->addContactPerson(); $ContactPerson->Name = ''; $BankAccount = $Buyer->addBankAccount(); $BankAccount->BankName = ''; $BankAccount->IBAN = 'FI0 XXX 82236180006011'; $BankAccount->BIC = 'NDEAFIHH'; $Recipient = $Invoice->addRecipient(); $Recipient->ContactId = ''; $Recipient->Identifier = '2318660-2'; $Recipient->Reference = '654321'; // Viitteemme/Viitteenne $Recipient->TaxCode = 'FI23186602'; $Recipient->Name = 'Pingvin Designs Oy'; // Organisation name $Recipient->Department = 'Kirjanpito'; // Osasto $Recipient->OvtCode = ''; $Recipient->Phone = '010 420 4540'; $Recipient->Email = 'toimisto@ekansio.fi'; $Address = $Recipient->addAddress(); $Address->Street = 'Lapintie 28'; $Address->AdditionalAddressLine = 'Kadunpuoleinen ovi'; $Address->Town = 'Tampere'; $Address->PostCode = '33210'; $Address->PostBox = '13'; $Address->Country = 'Finland'; $Address->CountryCode = 'FI'; $ContactPerson = $Recipient->addContactPerson(); $ContactPerson->Name = ''; $BankAccount = $Recipient->addBankAccount(); $BankAccount->BankName = ''; $BankAccount->IBAN = 'FI0 XXX 82236180006011'; $BankAccount->BIC = 'NDEAFIHH'; $Deliverer = $Invoice->addDeliverer(); $Deliverer->ContactId = ''; $Deliverer->Identifier = '2318660-2'; $Deliverer->Reference = '654321'; // Viitteemme/Viitteenne $Deliverer->TaxCode = 'FI23186602'; $Deliverer->Name = 'Pingvin Designs Oy'; // Organisation name $Deliverer->Department = 'Kirjanpito'; // Osasto $Deliverer->OvtCode = ''; $Deliverer->Phone = '010 420 4540'; $Deliverer->Email = 'toimisto@ekansio.fi'; $Address = $Deliverer->addAddress(); $Address->Street = 'Lapintie 28'; $Address->AdditionalAddressLine = 'Kadunpuoleinen ovi'; $Address->Town = 'Tampere'; $Address->PostCode = '33210'; $Address->PostBox = '13'; $Address->Country = 'Finland'; $Address->CountryCode = 'FI'; $ContactPerson = $Deliverer->addContactPerson(); $ContactPerson->Name = ''; $BankAccount = $Deliverer->addBankAccount(); $BankAccount->BankName = ''; $BankAccount->IBAN = 'FI0 XXX 82236180006011'; $BankAccount->BIC = 'NDEAFIHH'; $InvoiceLine = $Invoice->addInvoiceLine(); $InvoiceLine->ArticleIdentifier = '23456'; $InvoiceLine->BuyerArticleIdentifier = '23456'; $InvoiceLine->ArticleName = 'Product name'; $InvoiceLine->ArticleGroup = ''; $InvoiceLine->EanCode = ''; $InvoiceLine->SerialNumber = ''; $InvoiceLine->Description = ''; $InvoiceLine->Quantity = '2'; $InvoiceLine->Unit = 'kpl'; $InvoiceLine->VatRate = '24'; $InvoiceLine->DiscountPercent = '10'; // Alennusprosentti $InvoiceLine->UnitPrice = '100.00'; $InvoiceLine->UnitPurchasePrice = ''; $InvoiceLine->UnitPriceVat = '100.00'; $InvoiceLine->UnitPriceVatIncluded = '124.00'; $InvoiceLine->RowAmount = '200.00'; $InvoiceLine->RowVatAmount = '200.00'; $InvoiceLine->RowVatIncludedAmount = '248.00'; $InvoiceLine->ProposedAccountingIdentifier = '3000'; // Tiliöintiehdotus $InvoiceLine->AccountDimension = ''; $Dimension = $InvoiceLine->addDimension(); $Dimension->Name = 'Projekti'; // Laskentakohdeotsikko $Dimension->Item = 'Palkanlaskenta'; // Laskentakohde $Invoice->TotalVatExcludedAmount = '100'; $Invoice->TotalVatAmount = '24'; $Invoice->TotalVatIncludedAmount = '124'; $Invoice->sendRequest(); $Invoice->getSuccess(); // Tosi, jos onnistui $Invoice->getStatus(); // Vastauksen status tekstimuodossa $Invoice->getMessage(); // Vastauksen lisätieto $result = $Invoice->getResult(); // Vastauksen sisältö // TAI $response = $Invoice->getResponse(); // Vastauksen sisältö