italia / fatturapa-testsdi Goto Github PK
View Code? Open in Web Editor NEWSistema d'Interscambio di test
License: GNU Affero General Public License v3.0
Sistema d'Interscambio di test
License: GNU Affero General Public License v3.0
to reproduce run ./vendor/bin/phpunit tests/FullDemo.php --filter testCheckExpiration2
and get:
1) FullDemo::testCheckExpiration2
Failed asserting that 0 matches expected 1.
.../tests/FullDemo.php:92
.../tests/FullDemo.php:865
this is caused by RicezioneFattureHandler::NotificaDecorrenzaTermini
:
R_EXPIRED
the invoice with invoice_id
received from ES, but that row in invoices table does not "belong" to recipient (it should set to R_EXPIRED
the invoice with remote_id
equal to invoice_id
received from sdi)it would be easier to implement RicezioneFattureHandler::NotificaDecorrenzaTermini
reusing code from TrasmissioneFattureHandler::NotificaDecorrenzaTermini
Nel WSDL risultate aggiungere i "restrictions" ai tipi come da file di esempio: http://www.fatturapa.gov.it/export/fatturazione/sdi/messaggi/v1.1/MessaggiTypes_v1.1.xsd
Esempio: guardare tipo "IdentificativoSdI_Type"
Executing any "php artisan" command inside the rpc directory gives me this error:
In Application.php line 937:
[Symfony\Component\HttpKernel\Exception\NotFoundHttpException]
When I try to open the welcome page I receive this laravel error:
Sorry, the page you are looking for could not be found.
Reading the ticket #40 I tried commenting this line and it works
https://github.com/italia/fatturapa-testsdi/blob/master/rpc/packages/fatturapa/control/src/ControlServiceProvider.php#L26
Even the welcome page starts working!
Considering the previous ticket, however, i have a working database that has already been created by the core migration so I really don't understand why this fix works.
The web.php file seems fine to me.
after #23 !
this would allow users to configure the test system, specifying which SDIcoop channel is registered to send/receive invoices for a given VAT no (partita IVA)
I'm trying to execute "sudo apt install php-cli php-fpm nginx php-soap php-mbstring php-dom php-zip composer nginx postgresql php-pgsql php-curl php-xml" but I receive this error "Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/apt"
I use macOS Mojave
Why?
impacts:
SdIRiceviNotificaHandler
and TrasmissioneFattureHandler
to set the status to {I,R}_{ACCEPTED,REFUSED}
based on Esito
)write tests beforehand !
It's always a bad idea to track settings files.
For laravel I started a pull request (#58) to use the .env file instead of requiring database.php editing.
For core and soap packages we could use default files that should be renamed to a standard and untracked name to be used.
integrate fatturapa-testui in this project
the static files are generated calling twig from the Makefile, it should be possible to serve them with a Laravel controller
currently persistency for the time-travel API:
https://github.com/italia/fatturapa-testsdi/blob/master/rpc/packages/fatturapa/libsdi/src/routes/web.php#L6
is implemented using a JSON file:
https://github.com/italia/fatturapa-testsdi/blob/master/database/app/lib/Base/Base.php#L9
we should support concurrent access
I get this error:
SQLSTATE[HY000]: General error: 1005 Can't create table testsdi
.#sql-7608_a0
(errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table notifications
add constraint noti fications_invoice_id_foreign
foreign key (invoice_id
) references invoices
(id
))
The problem is caused by the fact that invoices.id is unsigned however notifications.invoice_id is not
when the channels table has been populated with:
INSERT INTO channels(cedente, issuer) VALUES ('IT-23456789012', '0000003');
INSERT INTO channels(cedente, issuer) VALUES ('IT-99999999999', '0000003');
INSERT INTO channels(cedente, issuer) VALUES ('IT-19999999999', '0000003');
INSERT INTO channels(cedente, issuer) VALUES ('IT-88888888888', '0000002');
INSERT INTO channels(cedente, issuer) VALUES ('IT-18888888888', '0000002');
INSERT INTO channels(cedente, issuer) VALUES ('IT-11888888888', '0000002');
INSERT INTO channels(cedente, issuer) VALUES ('IT-11188888888', '0000002');
INSERT INTO channels(cedente, issuer) VALUES ('IT-77777777777', '0000001');
https://testsdi.simevo.com/sdi/rpc/issuers returns:
{
"issuers": [
"0000001",
"0000002",
"0000003",
"0000003",
"0000003",
"0000002",
"0000002",
"0000002",
"0000002",
"0000001"
]
}
where as it should return:
{
"issuers": [
"0000001",
"0000002",
"0000003"
]
}
and http://testsdi.simevo.com/sdi/rpc/actors returns:
{"actors":["sdi","td0000001","td0000002","td0000003","td0000003","td0000003","td0000002","td0000002","td0000002","td0000002","td0000001"]}
where as it should return:
{"actors":["sdi","td0000001","td0000002","td0000003"]}
write tests beforehand !
on POST /td000000x/rpc/upload
:
probably PHP’s max_upload_filesize
and nginx client_max_body_size
should also be set to 5 MB
when transmission fails, it should transmit files that are OK and move the others to I_INVALID
for example for issuer state machine, the state diagram currently shows that to go to I_INVALID
the invoice has to pass via I_TRANSMITTED
, but:
I_UPLOADED
(i.e. retry transmission)errore' field set will move invoice from
I_UPLOADEDstraight to
I_INVALID`When I add an invalid file, the issuer field of an invoice is not filled.
So when you dispatch the notification, we can't do this because we don't have issuer.
We should check the file name and extract the issuer from the file name (http://www.fatturapa.gov.it/export/fatturazione/it/c-11.htm)
Aggiungere ref="ds:Signature" come da file di esempio: http://www.fatturapa.gov.it/export/fatturazione/sdi/messaggi/v1.1/MessaggiTypes_v1.1.xsd
https://en.wikipedia.org/wiki/Message_Transmission_Optimization_Mechanism:
MTOM is the W3C Message Transmission Optimization Mechanism, a method of efficiently sending binary data to and from Web services.
the N_PENDING
status for notifications is really the same as N_RECEIVED
, they have the same description "event has been triggered and must be processed"
search in README all occurrences of N_PENDING & replace them with N_RECEIVED
currently actors are setup by manually symlinking in /var/www/html (see README)
user should be able to configure the number of simulated issuer/receiver (TD = trasmittente / destinatario) actors in rpc/config.php
dynamic routing will make sure that the actors will be reachable at:
/sdi
(there's only one exchange system)/td0000001
, /td0000002
... (td stands for trasmittente/destinatario, Italian for issuer/receiver)this involves:
This is the error
SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'cedente' used in key specification without a key length
I would define a new id field for this table and use it as index instead of a text field.
In alternative the quicker fix to keep all as it is is to define the key with a max length
Change 20180923120240_create_channels_table.php line 18
$table->primary('cedente');
in
$table->primary([DB::raw('cedente(191)')]);
The choice of 191 is related to compatibility with older version of mysql, innodb and utf8
https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes/31474509
if the channels table contains:
INSERT INTO channels(cedente, issuer) VALUES ('IT-01234567890', '0000001');
INSERT INTO channels(cedente, issuer) VALUES ('IT-12345678901', '0000002');
then these calls are invalid:
sdi
the only allowed actors are td0000001
and td0000002
Folder rpc/bootstrap/cache
is missing and in the "Configuring and Installing" readme section isn't explicitly written to create it.
If it's not present the artisan command will throw an error:
The /var/www/html/rpc/bootstrap/cache directory must be present and writable.
struttura base del README:
sudo apt install ...
http://teamdigitale1.example.com/sdi/test.php:
( ! ) Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] Call to undefined method stdClass::getNomeFile() in /var/www/html/sdi/SdIRiceviFile/SdIRiceviFile_service.php:41 Stack trace: #0 /var/www/html/sdi/SdIRiceviFile/SdIRiceviFile_service.php(41): SoapClient->__soapCall('RiceviFile', Array) #1 /var/www/html/sdi/test.php(26): SdIRiceviFile_service->RiceviFile(Object(fileSdIBase_Type)) #2 {main} thrown in /var/www/html/sdi/SdIRiceviFile/SdIRiceviFile_service.php on line 41
( ! ) SoapFault: Call to undefined method stdClass::getNomeFile() in /var/www/html/sdi/SdIRiceviFile/SdIRiceviFile_service.php on line 41
Call Stack
# Time Memory Function Location
1 0.0019 231128 {main}( ) .../test.php:0
2 0.0086 278608 SdIRiceviFile_service->RiceviFile( ) .../test.php:26
3 0.0086 279008 __soapCall ( ) .../SdIRiceviFile_service.php:41
I'm already working on it.
My idea is to use modrewrite and an .htaccess file to properly redirect to the different calls.
receiving / transmitting XML invoices with multiple FatturaElettronicaBody
elements
our development environment Debian stretch has php 7.0 so that's the max version we can use
invoices with actor LIKE 'td%'
can only have status LIKE 'I_%' OR status LIKE 'R_%'
invoices with actor LIKE 'sdi
can only have status LIKE 'E_%'
As per title all the uploaded invoices (even the very one used in the README gif) just go straight to the"I_INVALID: ES notified it was invalid " section. Is there a way to understand what's wrong? At the moment i'm getting literally zero feedback from the app.
Also clicking on "Add" in /sdi/rpc/mchannels throws a 400 error
SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "key" violates not-null constraintDETAIL: Failing row contains (9999993, IT-123456789, null, null). (SQL: insert into "actors" ("code", "id") values (IT-123456789, 9999993))
Any support would be very appreciated. Thank you!
to reproduce run ./vendor/bin/phpunit tests/FullDemo.php --filter testUploadWrongFileExtension
and get:
1) FullDemo::testUploadWrongFileExtension
Failed asserting that 200 matches expected 400.
.../tests/FullDemo.php:224
it should respond with http code 400 if I send a file with extension != 'xml'
I would suggest moving the Laravel packages to a dedicated repo. The main Laravel app is also not really required as its just a plain new Laravel installation that requires the packages via composer.
Something like
a separate Laravel-example app repo can than be created if needed with a new Laravel install and the composer.json setup to load the individual packages.
Hello, I get the last commit this morning and when I composer install :
In Connection.php line 664: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "channels" does not exist LINE 1: select distinct "issuer" from "channels" ^ (SQL: select distinct "issuer" from "channels") In Connection.php line 330: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "channels" does not exist LINE 1: select distinct "issuer" from "channels" ^ Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1 Script cd rpc && composer install handling the post-install-cmd event returned with error code 1
Looks like Laravel try to register ServiceProvider when executing php artisan package:discover
and the FatturaPa\Control\ControlServiceProvider includes routes/web.php which need to access to issuer table which does not already exist because we create tables after with php artisan migrate.
occasionally upon pushing files to the development server you may get errors accessing the storage
dirs; a quick fix is:
sudo chown www-data /var/www/html/sdi/database/storage/time_travel.json
better fix: setup the user/group for the storage
folders once and for all
Salve,
avrei bisogno di un chiarimento. Nella cartella soap/TrasmissioneFatture ci dovrebbe essere il codice per ricevere le notifiche da SDI: però non trovo il codice che, di fatto, scarica il file messaggio in un determinato percorso di destinazione oppure dove sta la variabile che lo contiene, una volta ricevuto.
Mi potreste indicare il file php e/o la sezione di codice che se ne occupa?
Oppure ho frainteso lo scopo del codice in oggetto?
Grazie.
according to separation of concerns best practice, the controllers in control package inside rpc are too messy and probably wrongly named
InvoiceController handles stuff which is not specific to invoices
they should be reassigned differently, for example based on the actors:
another option is to create helper classes
impacts:
write tests beforehand !
soap/SdIRiceviFile/SdIRiceviFileHandler.php
SdIRiceviFileHandler::RiceviFile validate submitted file using subset of Elenco_Controlli_V1.5:
on error, return error code
It would be nice if GET sdi/rpc/datetime
returned JSON such as:
{
timestamp: 150000000,
datetime: 2018-10-11 10:15:55.000000,
speed: 1000
}
provide a docker-compose to set up quicky an instance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.