|
| 1 | +export = ElectronicBilling; |
| 2 | +declare class ElectronicBilling extends AfipWebService { |
| 3 | + constructor(afip: any); |
| 4 | + /** |
| 5 | + * Gets last voucher number |
| 6 | + * |
| 7 | + * Asks to Afip servers for number of the last voucher created for |
| 8 | + * certain sales point and voucher type {@see WS Specification |
| 9 | + * item 4.15} |
| 10 | + * |
| 11 | + * @param int salesPoint Sales point to ask for last voucher |
| 12 | + * @param int type Voucher type to ask for last voucher |
| 13 | + * |
| 14 | + * @return int |
| 15 | + **/ |
| 16 | + getLastVoucher(salesPoint: any, type: any): Promise<any>; |
| 17 | + /** |
| 18 | + * Create a voucher from AFIP |
| 19 | + * |
| 20 | + * Send to AFIP servers request for create a voucher and assign |
| 21 | + * CAE to them {@see WS Specification item 4.1} |
| 22 | + * |
| 23 | + * @param array data Voucher parameters {@see WS Specification |
| 24 | + * item 4.1.3}, some arrays were simplified for easy use {@example |
| 25 | + * examples/createVoucher.js Example with all allowed |
| 26 | + * attributes} |
| 27 | + * @param bool returnResponse if is TRUE returns complete response |
| 28 | + * from AFIP |
| 29 | + * |
| 30 | + * @return array if returnResponse is set to false returns |
| 31 | + * [CAE : CAE assigned to voucher, CAEFchVto : Expiration date |
| 32 | + * for CAE (yyyy-mm-dd)] else returns complete response from |
| 33 | + * AFIP {@see WS Specification item 4.1.3} |
| 34 | + **/ |
| 35 | + createVoucher(data: any, returnResponse?: boolean): Promise<any>; |
| 36 | + /** |
| 37 | + * Create next voucher from AFIP |
| 38 | + * |
| 39 | + * This method combines Afip.getLastVoucher and Afip.createVoucher |
| 40 | + * for create the next voucher |
| 41 | + * |
| 42 | + * @param array data Same to data in Afip.createVoucher except that |
| 43 | + * don't need CbteDesde and CbteHasta attributes |
| 44 | + * |
| 45 | + * @return array [CAE : CAE assigned to voucher, CAEFchVto : Expiration |
| 46 | + * date for CAE (yyyy-mm-dd), voucherNumber : Number assigned to |
| 47 | + * voucher] |
| 48 | + **/ |
| 49 | + createNextVoucher(data: any): Promise<any>; |
| 50 | + /** |
| 51 | + * Get complete voucher information |
| 52 | + * |
| 53 | + * Asks to AFIP servers for complete information of voucher {@see WS |
| 54 | + * Specification item 4.19} |
| 55 | + * |
| 56 | + * @param int number Number of voucher to get information |
| 57 | + * @param int salesPoint Sales point of voucher to get information |
| 58 | + * @param int type Type of voucher to get information |
| 59 | + * |
| 60 | + * @return array|null returns array with complete voucher information |
| 61 | + * {@see WS Specification item 4.19} or null if there not exists |
| 62 | + **/ |
| 63 | + getVoucherInfo(number: any, salesPoint: any, type: any): Promise<any>; |
| 64 | + /** |
| 65 | + * Asks to AFIP Servers for sales points availables {@see WS |
| 66 | + * Specification item 4.11} |
| 67 | + * |
| 68 | + * @return array All sales points availables |
| 69 | + **/ |
| 70 | + getSalesPoints(): Promise<any>; |
| 71 | + /** |
| 72 | + * Asks to AFIP Servers for voucher types availables {@see WS |
| 73 | + * Specification item 4.4} |
| 74 | + * |
| 75 | + * @return array All voucher types availables |
| 76 | + **/ |
| 77 | + getVoucherTypes(): Promise<any>; |
| 78 | + /** |
| 79 | + * Asks to AFIP Servers for voucher concepts availables {@see WS |
| 80 | + * Specification item 4.5} |
| 81 | + * |
| 82 | + * @return array All voucher concepts availables |
| 83 | + **/ |
| 84 | + getConceptTypes(): Promise<any>; |
| 85 | + /** |
| 86 | + * Asks to AFIP Servers for document types availables {@see WS |
| 87 | + * Specification item 4.6} |
| 88 | + * |
| 89 | + * @return array All document types availables |
| 90 | + **/ |
| 91 | + getDocumentTypes(): Promise<any>; |
| 92 | + /** |
| 93 | + * Asks to AFIP Servers for aliquot availables {@see WS |
| 94 | + * Specification item 4.7} |
| 95 | + * |
| 96 | + * @return array All aliquot availables |
| 97 | + **/ |
| 98 | + getAliquotTypes(): Promise<any>; |
| 99 | + /** |
| 100 | + * Asks to AFIP Servers for currencies availables {@see WS |
| 101 | + * Specification item 4.8} |
| 102 | + * |
| 103 | + * @return array All currencies availables |
| 104 | + **/ |
| 105 | + getCurrenciesTypes(): Promise<any>; |
| 106 | + /** |
| 107 | + * Asks to AFIP Servers for voucher optional data available {@see WS |
| 108 | + * Specification item 4.9} |
| 109 | + * |
| 110 | + * @return array All voucher optional data available |
| 111 | + **/ |
| 112 | + getOptionsTypes(): Promise<any>; |
| 113 | + /** |
| 114 | + * Asks to AFIP Servers for tax availables {@see WS |
| 115 | + * Specification item 4.10} |
| 116 | + * |
| 117 | + * @return array All tax availables |
| 118 | + **/ |
| 119 | + getTaxTypes(): Promise<any>; |
| 120 | + /** |
| 121 | + * Asks to web service for servers status {@see WS |
| 122 | + * Specification item 4.14} |
| 123 | + * |
| 124 | + * @return object { AppServer : Web Service status, |
| 125 | + * DbServer : Database status, AuthServer : Autentication |
| 126 | + * server status} |
| 127 | + **/ |
| 128 | + getServerStatus(): Promise<any>; |
| 129 | + /** |
| 130 | + * Change date from AFIP used format (yyyymmdd) to yyyy-mm-dd |
| 131 | + * |
| 132 | + * @param string|int date to format |
| 133 | + * |
| 134 | + * @return string date in format yyyy-mm-dd |
| 135 | + **/ |
| 136 | + formatDate(date: any): any; |
| 137 | + /** |
| 138 | + * Make default request parameters for most of the operations |
| 139 | + * |
| 140 | + * @param string operation SOAP Operation to do |
| 141 | + * |
| 142 | + * @return array Request parameters |
| 143 | + **/ |
| 144 | + getWSInitialRequest(operation: any): Promise<{ |
| 145 | + Auth?: undefined; |
| 146 | + } | { |
| 147 | + Auth: { |
| 148 | + Token: any; |
| 149 | + Sign: any; |
| 150 | + Cuit: any; |
| 151 | + }; |
| 152 | + }>; |
| 153 | + /** |
| 154 | + * Check if occurs an error on Web Service request |
| 155 | + * |
| 156 | + * @param string operation SOAP operation to check |
| 157 | + * @param mixed results AFIP response |
| 158 | + * |
| 159 | + * @throws Exception if exists an error in response |
| 160 | + * |
| 161 | + * @return void |
| 162 | + **/ |
| 163 | + _checkErrors(operation: any, results: any): Promise<void>; |
| 164 | +} |
| 165 | +import AfipWebService = require("./AfipWebService"); |
0 commit comments