Skip to content

Commit

Permalink
EArşiv Gelen Faturaları (Adıma Kesilen Belgeler) (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
demirdev authored Feb 24, 2022
1 parent 6086685 commit 0a3dc24
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ Her fatura için bir `uuid` oluşturulur. Bu `uuid` kullanılarak faturanın olu

İki tarih arasındaki tüm faturaları döner.

#### `getAllInvoicesIssuedToMeByDateRange(token, { startDate, endDate }): Array`

İki tarih arasındaki gelen faturaları (GİB'deki adıyla Adıma Düzenlenen Belgeleri) döner.

#### `signDraftInvoice(token, draftInvoice): void`

☢️ Fatura imzalama faturanın kesilmesi işlemidir ve **vergi sisteminde mali veri oluşturur.** Bu nedenle dikkatli kullanınız.
Expand Down
19 changes: 19 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const COMMANDS = {
"EARSIV_PORTAL_TASLAKLARI_GETIR",
"RG_BASITTASLAKLAR"
],
getAllInvoicesIssuedToMeByDateRange: [
"EARSIV_PORTAL_ADIMA_KESILEN_BELGELERI_GETIR",
"RG_BASITTASLAKLAR"
],
signDraftInvoice: [
"EARSIV_PORTAL_FATURA_HSM_CIHAZI_ILE_IMZALA",
"RG_BASITTASLAKLAR"
Expand Down Expand Up @@ -248,6 +252,20 @@ async function getAllInvoicesByDateRange(token, { startDate, endDate }) {
return invoices.data;
}

async function getAllInvoicesIssuedToMeByDateRange(token, { startDate, endDate }) {
const invoices = await runCommand(
token,
...COMMANDS.getAllInvoicesIssuedToMeByDateRange,
{
baslangic: startDate,
bitis: endDate,
hangiTip:"5000/30000",
table: []
}
);
return invoices.data;
}

async function findInvoice(token, draftInvoice) {
const { date, uuid } = draftInvoice;
const invoices = await getAllInvoicesByDateRange(token, date, date);
Expand Down Expand Up @@ -413,6 +431,7 @@ module.exports = {
getToken,
createDraftInvoice,
getAllInvoicesByDateRange,
getAllInvoicesIssuedToMeByDateRange,
findInvoice,
signDraftInvoice,
getDownloadURL,
Expand Down

0 comments on commit 0a3dc24

Please sign in to comment.