Misafir adlı üyeden alıntı: mesajı görüntüle
Merhaba,
çok kütüphane denedim ama hiçbiri çalışmadı
https://github.com/ugurgunes95/fatura
sadece bunda formda eksik bilgi hatası alabildim. Node.js ile e arşiv fatura nasıl kesebilirim? Veya kodumdaki hata ne bilen varsa yardımcı olabilirse çok mutlu olurum.
const Fatura = require("./fatura");
const fatura = new Fatura();
fatura.setCredentials('11911111', '111111')
const today = new Date();
const day = today.getDate();
const month = today.getMonth() + 1; // Ay indeksi 0'dan başlar, bu yüzden +1 ekliyoruz
const year = today.getFullYear();
const tarih = `${day}/${month}/${year}`;
const today2 = new Date();
const hours = String(today2.getHours()).padStart(2, "0");
const minutes = String(today2.getMinutes()).padStart(2, "0");
const seconds = String(today2.getSeconds()).padStart(2, "0");
const saat = `${hours}:${minutes}:${seconds}`;
fatura.login().then(async res => {
console.log(`https://earsivportal.efatura.gov.tr/index.jsp?token=${res.token}&v=1685571150200`);
  fatura.createDraft({
    date: "01/06/2023",
    time: "01:23:48",
    taxIDOrTRID: "11111111111",
    taxOffice: "Beylikduzu",
    title: "FATIH AKIN",
    name: "",
    surname: "",
    fullAddress: "X Sok. Y Cad. No: 3 Z Istanbul",
    items: [
        {
        name: "Stickker",
        quantity: 1,
        unitPrice: 100,
        price: 100,
        VATRate: 18,
        VATAmount: 18
        }
    ],
    totalVAT: 18,
    grandTotal: 100.0,
    grandTotalInclVAT: 118.0,
    paymentTotal: 118.0
})
    .then(resp => {
      console.log(resp.data);
    })
    .catch(err => {
      // console.log(err.response.data);
    })
})
@Volt;
Çözse Çözse Volt Hocam Çözer