fvalencial/begrandafe

向Begranda API发送电子发票以供DIAN使用

0.1.5 2018-07-11 12:35 UTC

This package is not auto-updated.

Last update: 2024-10-03 05:45:59 UTC


README

通过Begranda API启用向DIAN发送电子发票

关于

Packagist StyleCI License

使用PHP库 begranda,您可以轻松、干净地发送电子发票给DIAN。

要求

使用Composer安装

执行 composer require fvalenciabg/begrandafe

发送发票

发送电子发票的简单流程

$endpoint = getenv("BG_ENDPOINT");
$key = getenv("BG_KEY");

$invoice = new Invoice($endpoint,$key);
$datetime = date("Y-m-d h:i:s");
$invoice->
    setInvoice("990000072")->
    setSeller([
        "nit"=>"3534533",
        "name"=>"Vendedor",
        "location"=>[
            "address"=>"Cl 46 AA 43",
            "countryCode"=>"CO",
            "city"=>"Medellín",
            "subdivission"=>"Poblado",
            "department"=>"Antioquia"
        ]
    ])->
    setDate($datetime)->
    setBase(100000.00)->
    setTotal(119000.00)->
    setIva(19000.00)->
    setIca(0)->
    setIpo(0)->
    setPaymentMethod(10)->
    setPaymentChannel(9)->
    setAuthorizationNumber("9000000123303363")->
    setAuthorizationPeriod("2018-05-05","2028-05-05")->
    setAuthorizationInvoiceFrom(990000000)->
    setAuthorizationInvoiceTo(995000000)->
    setBuyer([
        "nit"=>"45747373",
        "name"=>"Comprador",
        "type"=>31,
        "location"=>[
            "address"=>"CR 33 56 34",
            "countryCode"=>"CO",
            "city"=>"Medellin",
            "subdivission"=>"Belen",
            "department"=>"Antioquia"
        ]
    ]);
$invoice->send();

疑问

如果您有任何疑问或遇到问题,请随时通过 soporte@begranda.com 联系我们。