单一主体同步支出系统 其他专业人员

v1.8 2021-01-11 18:25 UTC

This package is auto-updated.

Last update: 2024-09-12 03:00:50 UTC


README

单一主体同步支出系统 其他专业人员 (s5ap)

一个使用 CdC 方法(CdC)开发的用于向税务机关发送费用的小型库。(更多详情)。

该库是为发送物理治疗费用发票而开发的。

安装

composer require lavorareperilmale/s5ap

使用

无需加密数据,加密在库内自动进行。使用示例,假设有一个费用表格

use lavorareperilmale\s5ap\Connettore;
// [...]

$connettore = new Connettore(); // Senza parametri per ambiente di test
// oppure per prod usare i propri dati:
// $connettore = new Connettore('Nome ut.','Password','Pin','CFProprietario','Piva'); 

foreach ($fatture as $fattura ) {
    // Assumendo che $fatture siano le fatture che si vogliono inviare
    $response = $connettore->invia(
                            $fattura->data_fattura,
                            $fattura->id_fattura, 
                            $fattura->data_pagamento,
                            $fattura->cliente->codice_fiscale,
                            number_format($fattura->valore,2)
    );
    if ( is_soap_fault($response) ) {
        // Qualcosa e' andato storto. Si puo' stampare messaggio con:
        echo $response->getMessage(); // Vedi https://php.ac.cn/manual/en/class.soapfault.php
        die("Qualcosa e' andato storto");
    }

    if ( $response->esitoChiamata == 0 || $response->esitoChiamata == 2 ) {
        // Invio andato a buon fine, magari con warnings
        echo $response->protocollo;
    } else {
        // Errore nell'invio: dump della risposta
        echo (serialize($response));
    }

除非特别指定,否则该方法默认采用以下值

$pagamentoTracciato="SI", 
$flagOpposizione=0,
$tipoSpesa="SP",
$naturaIVA="N2.1", // non soggetta iva 633/72
$tipoDocumento = "F"

待办事项

  • 添加测试
  • 重构选项传递
  • 验证是否存在与带前导零的字段(可能是PIN)的问题,例如现在使用SoapFixer的增值税号。
  • 其他事项。