Edits history of script submission #5982 for ' Create Bill (quickbooks)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import QuickBooks from "node-quickbooks";
    
    type Quickbooks = {
      realmId: string;
      token: string;
      isSandBox: boolean;
    };
    
    export async function main(
      resource: Quickbooks,
      bill: {
        VendorRef: {
          value: string;
          name?: string;
        };
        Line: {
          Id?: string;
          DetailType: "AccountBasedExpenseLineDetail";
          Amount: number;
          AccountBasedExpenseLineDetail: {
            AccountRef: {
              value: string;
              name?: string;
            };
            TaxAmount?: number;
            TaxInclusiveAmt?: number;
            ClassRef?: {
              value: string;
              name?: string;
            };
            TaxCodeRef?: {
              value: string;
              name?: string;
            };
            BillableStatus?: string;
            CustomerRef?: {
              value: string;
              name?: string;
            };
          };
          Description?: string;
          LineNum?: number;
        }[];
        CurrencyRef?: {
          value: string;
          name?: string;
        };
      }
    ) {
      const qbo = new QuickBooks("", "", resource.token, false, resource.realmId, resource.isSandBox, true, null, "2.0");
    
      return new Promise((resolve, reject) => {
        qbo.createBill(bill, function (err: any, result: any) {
          if (err) {
            reject(err);
          } else {
            resolve(result);
          }
        });
      });
    }
    

    Submitted by hugo697 324 days ago

  • bun
    import QuickBooks from "node-quickbooks";
    
    type Quickbooks = {
      clientId: string;
      clientSecret: string;
      realmId: string;
      token: string;
      isSandBox: boolean;
    };
    
    export async function main(
      resource: Quickbooks,
      bill: {
        VendorRef: {
          value: string;
          name?: string;
        };
        Line: {
          Id?: string;
          DetailType: "AccountBasedExpenseLineDetail";
          Amount: number;
          AccountBasedExpenseLineDetail: {
            AccountRef: {
              value: string;
              name?: string;
            };
            TaxAmount?: number;
            TaxInclusiveAmt?: number;
            ClassRef?: {
              value: string;
              name?: string;
            };
            TaxCodeRef?: {
              value: string;
              name?: string;
            };
            BillableStatus?: string;
            CustomerRef?: {
              value: string;
              name?: string;
            };
          };
          Description?: string;
          LineNum?: number;
        }[];
        CurrencyRef?: {
          value: string;
          name?: string;
        };
      }
    ) {
      const qbo = new QuickBooks(
        resource.clientId,
        resource.clientSecret,
        resource.token,
        false,
        resource.realmId,
        resource.isSandBox,
        true,
        null,
        "2.0"
      );
    
      return new Promise((resolve, reject) => {
        qbo.createBill(bill, function (err: any, result: any) {
          if (err) {
            reject(err);
          } else {
            resolve(result);
          }
        });
      });
    }
    

    Submitted by hugo697 399 days ago

  • bun
    import QuickBooks from "node-quickbooks";
    
    type Quickbooks = {
      clientId: string;
      clientSecret: string;
      realmId: string;
      token: string;
      isSandBox: boolean;
    };
    
    export async function main(
      resource: Quickbooks,
      bill: {
        VendorRef: {
          value: string;
          name?: string;
        };
        Line: {
          Id?: string;
          DetailType: "AccountBasedExpenseLineDetail";
          Amount: number;
          AccountBasedExpenseLineDetail: {
            AccountRef: {
              value: string;
              name?: string;
            };
            TaxAmount?: number;
            TaxInclusiveAmt?: number;
            ClassRef?: {
              value: string;
              name?: string;
            };
            TaxCodeRef?: {
              value: string;
              name?: string;
            };
            BillableStatus?: string;
            CustomerRef?: {
              value: string;
              name?: string;
            };
          };
          Description?: string;
          LineNum?: number;
        }[];
        CurrencyRef?: {
          value: string;
          name?: string;
        };
      }
    ) {
      const qbo = new QuickBooks(
        resource.clientId,
        resource.clientSecret,
        resource.token,
        false,
        resource.realmId,
        resource.isSandBox,
        true,
        null,
        "2.0"
      );
    
      return new Promise((resolve, reject) => {
        qbo.createBill(bill, function (err: any, result: any) {
          if (err) {
            reject(err);
          } else {
            resolve(result);
          }
        });
      });
    }
    

    Submitted by hugo697 826 days ago