ZakatFatoora - A simple way to implement e-invoicing (FATOORA) for iOS

Overview

ZakatFatoora

header

author: @AlmuhaidlyF

A simple way to implement e-invoicing (FATOORA) for iOS.

Zakat, Tax and Customs Authority Guide: Guide

Installation

To install this package, import https://github.com/smike7/ZakatFatoora in SPM.

usage example

Generates QR Code and the encoded string based on the giving input

seller: The seller's name / اسم البائع

vatRegistrationNumber: The VAT registration number of the seller (must be 15 characters) / رقم تعريف ضريبة القيمة المضافة

timeStamp: Time stamp of the invoice (date and time) / وقت وتاريخ الفاتورة

invoiceTotalWithVAT: invoice total (with VAT) / المجموع الكلي للفاتورة مع الضريبة

vatTotal: VAT total / ضريبة القيمة المضافة

import ZakatFatoora



ZakatFatoora.shared.generateQRCodeWithInfo(
    
    seller: "فيصل المهيدلي",
    vatRegistrationNumber: "123456789012345",
    timeStamp: "\(Date())",
    invoiceTotalWithVAT: "120",
    vatTotal: "\((15 * 120) / 100)"
    
) { result in
    
    switch result {
        
    case .failure(let error):
        
        print(error.rawValue)
        
    case .success(let results):
        
        self.yourImageView              = results.image
        self.yourTextView               = results.encodedString
    
    }
    
}

Testing

To test that the generated QR code complies with the regulations download this app.

Credits

MIT License

Copyright (c) 2022 Faisal H Almuhaidly

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Swift, the Swift logo, Xcode, Instruments, Cocoa Touch, Touch ID, AirDrop, iBeacon, iPhone, iPad, Safari, App Store, watchOS, tvOS, Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries.

You might also like...
This is a simple mobile app which is connect to the Twitter API
This is a simple mobile app which is connect to the Twitter API

Project 3 - My Twitter My Twitter is a basic twitter app to read your tweets. Time spent on two parts: 8.5 hours spent in total Twitter - Part II This

A simple self-development challenge application that aimed to learn

Movie List Challenge A simple self-development challenge application that aimed to learn "The Composable Architecture" basics and build a reactive str

Simple Background Fetch Tasks

Simple Background Fetch Tasks

A simple protocol package that does nothing

HasResult A simple protocol package that does nothing. The HasResult protocol has a simple result property and a ResultType associated type. This is m

A simple Hacker News mobile client

A simple Hacker News mobile client. Overview This app was built with the Hacker News API This is one of my first apps outside of a tut

A simple Swift sample code to reads ISO 10303-21 exchange structure (STEP P21) file for AP242 schema.

simpleP21ReadSample A simple sample code to reads ISO 10303-21 exchange structure (STEP P21) file for AP242 schema. by Tsutomu Yoshida, Minokamo Japan

A simple, reliable and scalable delivery API for transactional push notifications for websites and applications
A simple, reliable and scalable delivery API for transactional push notifications for websites and applications

Catapush is a simple, reliable and scalable delivery API for transactional push notifications for websites and applications. Ideal for sending data-dr

Eval for Swift - Easily evaluate simple expressions on the go

Eval for Swift Easily evaluate simple expressions on the go... This is a port of the BigEval.js/Eval.net library Features: Evaluate basic math operato

A simple To Do application written in React Native

Example To Do List application in react-native Requirements, install as needed: React Native: $ npm i -g react-native-cli watchman: $ brew install wa

Owner
Faisal H Almuhaidly
I'm an iOS developer / designer based in Riyadh, Saudi Arabia. I have a passion for programming and love to create for mobile and web devices.
Faisal H Almuhaidly
MicrofrontendGenerator - Script for creating micro frontends for Mobile in a simple and easy way

Introdução Template para a criação de SDK iOS. Existem duas opções de template:

Julio Fernandes Jr 4 Nov 2, 2022
Appwrite playground - a simple way to explore the Appwrite API & Appwrite Apple SDK

Appwrite's Apple Playground ?? Appwrite playground is a simple way to explore the Appwrite API & Appwrite Apple SDK. Use the source code of this repos

Appwrite 24 Nov 22, 2022
Wasmic allows you to run WebAssembly in a safe way on iOS.

wasmic-ios Bootstrap $ git clone https://github.com/kateinoigakukun/wasmic-ios.git $ git -c submodule."fastlane".update=none submodule update --init -

Yuta Saito 58 Dec 12, 2022
🌳 Environment – a nicer, type-safe way of working with environment variables in Swift.

?? Environment Welcome to Environment – a nicer, type-safe way of working with environment variables in Swift. Usage Access Environment Variables The

Will Lisac 31 Dec 17, 2022
A custom calculator for deg to rad conversion & the other way round

Lilium Features A custom calculator for deg to rad conversion & the other way round. How to use Slide up the dock and you should see Lilium. An activa

null 2 Nov 20, 2022
A novel way to set attributes to the Font in SwiftUI.

A novel way to set attributes to the Font in SwiftUI.

Riiid 6 Oct 13, 2022
A powerful, beautiful way to experience Formula1

F1 Pocket Companion A powerful, beautiful way to experience Formula1, right on your iPhone Note This project will probably change it's name. I'm curre

Liam Doyle 3 Nov 5, 2022
A simple project which shows how to pull off custom view controller transitions.

Custom View Controller Transitions This project explains and shows how to make custom view controller transitions in the most simple way possible. Eac

Jordan Morgan 91 Oct 23, 2022
A simple deamon that restores your window positions on external monitors.

Memmon Memmon remembers what your Mac forgets – A simple deamon that restores your window positions on external monitors. FAQ Why‽ I am frustrated! Wh

Helena Schobs 55 Dec 1, 2022
A simple project that shows a list of local coffee shop reviews

Project This is a simple project that shows a list of local coffee shop reviews Details Please use git and commit often with meaningful commit message

null 0 Oct 16, 2021