gerardojbaez/sale-statements 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gerardojbaez/sale-statements

Composer 安装命令:

composer require gerardojbaez/sale-statements

包简介

A payment-agnostic sales records system for your Laravel application.

README 文档

README

A payment-agnostic sales records system for your Laravel application.

Easily store and manage your application's quotes, orders, invoices, and credit memos sales documents.

Used in production by Rentado.net and Full Help 🎉

Features

  • Support for quotes, orders, invoices and credit notes
  • Ability to generate orders from a quote, invoices from an order, credit memos from an invoice.
  • May be extended to support other sales documents.
  • Store discounts on statement and optionally associate it with select items
  • Per-item tax rates

TL;DR

use \Gerardojbaez\SaleStatements\Models\SaleStatement;
use \Gerardojbaez\SaleStatements\Models\SaleStatementType;

// Create Invoice sale statement
$invoice = SaleStatement::create(SaleStatementType::TYPE_ORDER);

// Add Billing and Shipping Address
$invoice->addresses()->create([
    'is_shipping' => true,
    'is_billing' => true,
    'line_1' => '711-2880 Nulla St',
    'locality' => 'Mankato', // City, Town, Municipality, etc...
    'administrative_area' => 'Mississipi', // State, Province, Region, etc...
    'country_code' => 'US',
    'postalcode' => 96522,
    'given_name' => 'Cecilia', // i.e., first name
    'additional_name' => 'J.', // Can be used to hold a middle name, or a patronymic.
    'family_name' => 'Chapman', // i.e., last name
    'organization' => 'Acme Co.',
]);

// Store a discount at the statement-level
$discount = $invoice->discounts()->create([
    'name' => 'Get 20% off of license!',
    'discount' => 20,
    'is_percentage' => true,
]);

// Store tax rate at the statement-level
$tax = $statement->taxes()->create([
    'name' => 'PR 10.5 %',
    'rate' => 0.105,
    'amount' => 2486
]);

// Add line item to statement
$item = $invoice->items()->create([
    'name' => 'Software license',
    'price' => 14900, // $149.00
    'quantity' => 1,
]);

// Optionally associate discount with item
$item->discounts()->attach($discount);

// Associate tax rate with item
$item->taxes()->attach($tax);

A note on PDFs, address and money formatting

Address and money formatting is something that varies a lot between applications, this is why PDF generation is not included in this package and may not be added in the future.

You may consider using Dompdf and Sparksuite's invoice template as a starting point. If your application already has addresses and money formatting, adding PDF with the above tools may be a trivial task.

A note on money values

All amounts are represented in the smallest unit (e.g., cents), so USD 5.00 is written as 500. For this reason, all database columns that store monetary values are using the INT data type.

I don't see the relation to my users or products table

There's no assumption of your billable and product models. If you need to add a relation or extend the base functionality, you are free to do so by altering the tables as needed and extending the default models.

Security

If you discover any security-related issue, please email g@gerardobaez.com instead of using the issue tracker.

License

Released under the MIT License. Please see the License file included for more information.

gerardojbaez/sale-statements 适用场景与选型建议

gerardojbaez/sale-statements 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 93 次下载、GitHub Stars 达 4, 最近一次更新时间为 2020 年 12 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 gerardojbaez/sale-statements 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 gerardojbaez/sale-statements 我们能提供哪些服务?
定制开发 / 二次开发

基于 gerardojbaez/sale-statements 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 93
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-08