Skip to content

Instantly share code, notes, and snippets.

View hameed0z's full-sized avatar
🤟
chill & code!

Abdulhameed Abdulmuttalib hameed0z

🤟
chill & code!
View GitHub Profile
@hameed0z
hameed0z / al.md
Created September 9, 2025 12:18
how to add vat posting group and vat value to vendor api

Step by step to do it, it requires access to BC

Of course. Using the code provided involves a full development lifecycle in Business Central. Here’s a step-by-step guide on how to take that code and make it work in a real environment.

Prerequisites

  1. Access to a Business Central Sandbox/Development Environment: You need an environment where you have permission to install extensions. This is typically a sandbox tenant or a Docker container.
  2. Visual Studio Code (VS Code): The free code editor from Microsoft.
  3. AL Language Extension: Install the "AL Language" extension from the marketplace within VS Code.
  4. Basic Understanding of BC Development: Knowing how to connect VS Code to your environment.
from fastapi import BackgroundTasks, Header
from app import crud
from typing import Any, Optional
from app.api import deps
from sqlalchemy.orm import Session
@router.post("/publish")
async def publish_order(
background_tasks: BackgroundTasks,
db: Session = Depends(deps.get_db),
import math
from typing import Dict
from sqlalchemy.orm import Session, joinedload
from app.models import Recipient, User, Order
def paginated_report(self, db: Session, page: int = 0, per_page: int = 20) -> Dict:
offset = (page - 1) * per_page
query = (
db.query(Recipient)
.join(Order, Order.id == Recipient.order_id)

Discount

/discount => can be called any time before starting payment

response:

{
 message: string, 
 discount: {
@hameed0z
hameed0z / how-to-squash-commits-in-git.md
Created January 21, 2021 09:50 — forked from patik/how-to-squash-commits-in-git.md
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@hameed0z
hameed0z / python-qa.md
Last active January 16, 2022 11:02
some python interview technical question

Python questions with answers

Basic

1- What is pep 8?

  • PEP stands for Python Enhancement Proposal. It is a set of rules that specify how to format Python code for maximum readability.

2- What is namespace in Python?

  • A namespace is a naming system used to make sure that names are unique to avoid naming conflicts.
@hameed0z
hameed0z / pep8_cheatsheet.py
Created October 17, 2020 02:55 — forked from RichardBronosky/pep8_cheatsheet.py
PEP-8 cheatsheet
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py