Ejemplo n.º 1
0
        private void MontaDET_PIS(DET det)
        {
            xmlString.Append("<PIS>");

            switch (det.pis)
            {
            case PIS.PIS01_02:
                xmlString.Append("<PISAliq>");
                xmlString.Append("    <CST>" + det.pis_CST + "</CST>");
                xmlString.Append("    <vBC>" + det.pis_vBC + "</vBC>");
                xmlString.Append("    <pPIS>" + det.pis_pPIS + "</pPIS>");
                xmlString.Append("    <vPIS>" + det.pis_vPIS + "</vPIS>");
                xmlString.Append("</PISAliq>");
                break;

            case PIS.PIS03:
                xmlString.Append("<PISQtde>");
                xmlString.Append("    <CST>" + det.pis_CST + "</CST>");
                xmlString.Append("    <qBCProd>" + det.pis_qBCProd + "</qBCProd>");
                xmlString.Append("    <vAliqProd>" + det.pis_vAliqProd + "</vAliqProd>");
                xmlString.Append("    <vPIS>" + det.pis_vPIS + "</vPIS>");
                xmlString.Append("</PISQtde>");
                break;

            case PIS.PIS04_09:
                xmlString.Append("<PISNT>");
                xmlString.Append("    <CST>" + det.pis_CST + "</CST>");
                xmlString.Append("</PISNT>");
                break;

            case PIS.PIS99:
                xmlString.Append("<PISOutr>");
                xmlString.Append("    <CST>" + det.pis_CST + "</CST>");

                if (!String.IsNullOrEmpty(det.pis_vBC) && !String.IsNullOrEmpty(det.pis_pPIS))
                {
                    xmlString.Append("    <vBC>" + det.pis_vBC + "</vBC>");
                    xmlString.Append("    <pPIS>" + det.pis_pPIS + "</pPIS>");
                }
                else
                {
                    xmlString.Append("    <qBCProd>" + det.pis_qBCProd + "</qBCProd>");
                    xmlString.Append("    <vAliqProd>" + det.pis_vAliqProd + "</vAliqProd>");
                }

                xmlString.Append("    <vPIS>" + det.pis_vPIS + "</vPIS>");
                xmlString.Append("</PISOutr>");
                break;
            }

            xmlString.Append("</PIS>");
        }
Ejemplo n.º 2
0
        private void MontaDET_COFINS(DET det)
        {
            xmlString.Append("<COFINS>");

            switch (det.cofins)
            {
            case COFINS.CST01_02:
                xmlString.Append("<COFINSAliq>");
                xmlString.Append("    <CST>" + det.cofins_CST + "</CST>");
                xmlString.Append("    <vBC>" + det.cofins_vBC + "</vBC>");
                xmlString.Append("    <pCOFINS>" + det.cofins_pCOFINS + "</pCOFINS>");
                xmlString.Append("    <vCOFINS>" + det.cofins_vCOFINS + "</vCOFINS>");
                xmlString.Append("</COFINSAliq>");
                break;

            case COFINS.CST03:
                xmlString.Append("<COFINSQtde>");
                xmlString.Append("    <CST>" + det.cofins_CST + "</CST>");
                xmlString.Append("    <qBCProd>" + det.cofins_qBCProd + "</qBCProd>");
                xmlString.Append("    <vAliqProd>" + det.cofins_vAliqProd + "</vAliqProd>");
                xmlString.Append("    <vCOFINS>" + det.cofins_vCOFINS + "</vCOFINS>");
                xmlString.Append("</COFINSQtde>");
                break;

            case COFINS.CST04_09:
                xmlString.Append("<COFINSNT>");
                xmlString.Append("    <CST>" + det.cofins_CST + "</CST>");
                xmlString.Append("</COFINSNT>");
                break;

            case COFINS.CST99:
                xmlString.Append("<COFINSOutr>");
                xmlString.Append("    <CST>" + det.cofins_CST + "</CST>");

                if (!String.IsNullOrEmpty(det.cofins_vBC) && !String.IsNullOrEmpty(det.cofins_pCOFINS))
                {
                    xmlString.Append("    <vBC>" + det.cofins_vBC + "</vBC>");
                    xmlString.Append("    <pCOFINS>" + det.cofins_pCOFINS + "</pCOFINS>");
                }
                else
                {
                    xmlString.Append("    <qBCProd>" + det.cofins_qBCProd + "</qBCProd>");
                    xmlString.Append("    <vAliqProd>" + det.cofins_vAliqProd + "</vAliqProd>");
                }

                xmlString.Append("    <vCOFINS>" + det.cofins_vCOFINS + "</vCOFINS>");
                xmlString.Append("</COFINSOutr>");
                break;
            }

            xmlString.Append("</COFINS>");
        }
Ejemplo n.º 3
0
        private void MontaDET_IPI(DET det)
        {
            if (!String.IsNullOrEmpty(det.ipi_cIEnq))
            {
                xmlString.Append("<IPI>");

                xmlString.Append("<cEnq>" + det.ipi_cIEnq + "</cEnq>");

                switch (det.ipi)
                {
                case IPI.IPI00_49_50_99:
                    xmlString.Append("<IPITrib>");

                    xmlString.Append("    <CST>" + det.ipi_CST + "</CST>");

                    if (!String.IsNullOrEmpty(det.ipi_vBC))
                    {
                        xmlString.Append("    <vBC>" + det.ipi_vBC + "</vBC>");
                        xmlString.Append("    <pIPI>" + det.ipi_pIPI + "</pIPI>");
                    }
                    else
                    {
                        xmlString.Append("    <qUnid>" + det.ipi_qUnid + "</qUnid>");
                        xmlString.Append("    <vUnid>" + det.ipi_vUnid + "</vUnid>");
                    }

                    xmlString.Append("    <vIPI>" + det.ipi_vIPI + "</vIPI>");

                    xmlString.Append("</IPITrib>");
                    break;

                case IPI.IPI01_55:
                    xmlString.Append("<IPINT>");
                    xmlString.Append("    <CST>" + det.ipi_CST + "</CST>");
                    xmlString.Append("</IPINT>");
                    break;
                }

                xmlString.Append("</IPI>");
            }
        }
Ejemplo n.º 4
0
 public void AddDet(DET det)
 {
     detList.Add(det);
 }
Ejemplo n.º 5
0
        private void MontaDET_ICMS(DET det)
        {
            xmlString.Append("<ICMS>");

            switch (det.icms)
            {
            case ICMS.ICMS00:
                xmlString.Append("<ICMS00>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                xmlString.Append("</ICMS00>");
                break;

            case ICMS.ICMS10:
                xmlString.Append("<ICMS10>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                if (!String.IsNullOrEmpty(det.icms_pMVAST))
                {
                    xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                }

                xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");

                xmlString.Append("</ICMS10>");
                break;

            case ICMS.ICMS20:
                xmlString.Append("<ICMS20>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                xmlString.Append("</ICMS20>");
                break;

            case ICMS.ICMS30:
                xmlString.Append("<ICMS30>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");
                xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");
                xmlString.Append("</ICMS30>");
                break;

            case ICMS.ICMS40_50:
                xmlString.Append("<ICMS40>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                xmlString.Append("</ICMS40>");
                break;

            case ICMS.ICMS51:
                xmlString.Append("<ICMS51>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                xmlString.Append("</ICMS51>");

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                }
                break;

            case ICMS.ICMS60:
                xmlString.Append("<ICMS60>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                xmlString.Append("</ICMS60>");
                break;

            case ICMS.ICMS70:
                xmlString.Append("<ICMS70>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                if (!String.IsNullOrEmpty(det.icms_pMVAST))
                {
                    xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                }

                xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");
                xmlString.Append("</ICMS70>");
                break;

            case ICMS.ICMS90:
                xmlString.Append("<ICMS90>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");

                if (!String.IsNullOrEmpty(det.icms_pRedBC))
                {
                    xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                }

                xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                if (!String.IsNullOrEmpty(det.icms_pMVAST))
                {
                    xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                }

                xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");
                xmlString.Append("</ICMS90>");
                break;

            case ICMS.ICMS101:
                xmlString.Append("<ICMSSN101>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                xmlString.Append("    <pCredSN>" + det.icms_pCredSN + "</pCredSN>");
                xmlString.Append("    <vCredICMSSN>" + det.icms_vCredICMSSN + "</vCredICMSSN>");
                xmlString.Append("</ICMSSN101>");
                break;

            case ICMS.ICMS102_400:
                xmlString.Append("<ICMSSN102>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                xmlString.Append("</ICMSSN102>");
                break;

            case ICMS.ICMS201:
                xmlString.Append("<ICMSSN201>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                }

                xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");

                xmlString.Append("</ICMSSN201>");
                break;

            case ICMS.ICMS202:
                xmlString.Append("<ICMSSN202>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                if (!String.IsNullOrEmpty(det.icms_pMVAST))
                {
                    xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                }

                xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");

                xmlString.Append("</ICMSSN202>");
                break;

            case ICMS.ICMS500:
                xmlString.Append("<ICMSSN500>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                xmlString.Append("    <vBCSTRet>" + det.icms_vBCSTRet + "</vBCSTRet>");
                xmlString.Append("    <vICMSSTRet>" + det.icms_vICMSSTRet + "</vICMSSTRet>");
                xmlString.Append("</ICMSSN500>");
                break;

            case ICMS.ICMS900:
                xmlString.Append("<ICMSSN900>");
                xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");

                if (!String.IsNullOrEmpty(det.icms_pRedBC))
                {
                    xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                }

                xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                if (!String.IsNullOrEmpty(det.icms_pMVAST))
                {
                    xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                }

                if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                {
                    xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                }

                xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");
                xmlString.Append("    <pCredSN>" + det.icms_pCredSN + "</pCredSN>");
                xmlString.Append("    <vCredICMSSN>" + det.icms_vCredICMSSN + "</vCredICMSSN>");
                xmlString.Append("</ICMSSN900>");
                break;
            }

            xmlString.Append("</ICMS>");
        }
Ejemplo n.º 6
0
        private void MontaDET_COFINS(DET det)
        {
            xmlString.Append("<COFINS>");

            switch (det.cofins)
            {
                case COFINS.CST01_02:
                    xmlString.Append("<COFINSAliq>");
                    xmlString.Append("    <CST>" + det.cofins_CST + "</CST>");
                    xmlString.Append("    <vBC>" + det.cofins_vBC + "</vBC>");
                    xmlString.Append("    <pCOFINS>" + det.cofins_pCOFINS + "</pCOFINS>");
                    xmlString.Append("    <vCOFINS>" + det.cofins_vCOFINS + "</vCOFINS>");
                    xmlString.Append("</COFINSAliq>");
                    break;
                case COFINS.CST03:
                    xmlString.Append("<COFINSQtde>");
                    xmlString.Append("    <CST>" + det.cofins_CST + "</CST>");
                    xmlString.Append("    <qBCProd>" + det.cofins_qBCProd + "</qBCProd>");
                    xmlString.Append("    <vAliqProd>" + det.cofins_vAliqProd + "</vAliqProd>");
                    xmlString.Append("    <vCOFINS>" + det.cofins_vCOFINS + "</vCOFINS>");
                    xmlString.Append("</COFINSQtde>");
                    break;
                case COFINS.CST04_09:
                    xmlString.Append("<COFINSNT>");
                    xmlString.Append("    <CST>" + det.cofins_CST + "</CST>");
                    xmlString.Append("</COFINSNT>");
                    break;
                case COFINS.CST99:
                    xmlString.Append("<COFINSOutr>");
                    xmlString.Append("    <CST>" + det.cofins_CST + "</CST>");

                    if (!String.IsNullOrEmpty(det.cofins_vBC) && !String.IsNullOrEmpty(det.cofins_pCOFINS))
                    {
                        xmlString.Append("    <vBC>" + det.cofins_vBC + "</vBC>");
                        xmlString.Append("    <pCOFINS>" + det.cofins_pCOFINS + "</pCOFINS>");
                    }
                    else
                    {
                        xmlString.Append("    <qBCProd>" + det.cofins_qBCProd + "</qBCProd>");
                        xmlString.Append("    <vAliqProd>" + det.cofins_vAliqProd + "</vAliqProd>");
                    }

                    xmlString.Append("    <vCOFINS>" + det.cofins_vCOFINS + "</vCOFINS>");
                    xmlString.Append("</COFINSOutr>");
                    break;
            }

            xmlString.Append("</COFINS>");
        }
Ejemplo n.º 7
0
        private void MontaDET_PIS(DET det)
        {
            xmlString.Append("<PIS>");

            switch (det.pis)
            {
                case PIS.PIS01_02:
                    xmlString.Append("<PISAliq>");
                    xmlString.Append("    <CST>" + det.pis_CST + "</CST>");
                    xmlString.Append("    <vBC>" + det.pis_vBC + "</vBC>");
                    xmlString.Append("    <pPIS>" + det.pis_pPIS + "</pPIS>");
                    xmlString.Append("    <vPIS>" + det.pis_vPIS + "</vPIS>");
                    xmlString.Append("</PISAliq>");
                    break;
                case PIS.PIS03:
                    xmlString.Append("<PISQtde>");
                    xmlString.Append("    <CST>" + det.pis_CST + "</CST>");
                    xmlString.Append("    <qBCProd>" + det.pis_qBCProd + "</qBCProd>");
                    xmlString.Append("    <vAliqProd>" + det.pis_vAliqProd + "</vAliqProd>");
                    xmlString.Append("    <vPIS>" + det.pis_vPIS + "</vPIS>");
                    xmlString.Append("</PISQtde>");
                    break;
                case PIS.PIS04_09:
                    xmlString.Append("<PISNT>");
                    xmlString.Append("    <CST>" + det.pis_CST + "</CST>");
                    xmlString.Append("</PISNT>");
                    break;
                case PIS.PIS99:
                    xmlString.Append("<PISOutr>");
                    xmlString.Append("    <CST>" + det.pis_CST + "</CST>");

                    if (!String.IsNullOrEmpty(det.pis_vBC) && !String.IsNullOrEmpty(det.pis_pPIS))
                    {
                        xmlString.Append("    <vBC>" + det.pis_vBC + "</vBC>");
                        xmlString.Append("    <pPIS>" + det.pis_pPIS + "</pPIS>");
                    }
                    else
                    {
                        xmlString.Append("    <qBCProd>" + det.pis_qBCProd + "</qBCProd>");
                        xmlString.Append("    <vAliqProd>" + det.pis_vAliqProd + "</vAliqProd>");
                    }

                    xmlString.Append("    <vPIS>" + det.pis_vPIS + "</vPIS>");
                    xmlString.Append("</PISOutr>");
                    break;
            }

            xmlString.Append("</PIS>");
        }
Ejemplo n.º 8
0
 public void AddDet(DET det)
 {
     detList.Add(det);
 }
Ejemplo n.º 9
0
        private void MontaDET_IPI(DET det)
        {
            if (!String.IsNullOrEmpty(det.ipi_cIEnq))
            {
                xmlString.Append("<IPI>");

                xmlString.Append("<cEnq>" + det.ipi_cIEnq + "</cEnq>");

                switch (det.ipi)
                {
                    case IPI.IPI00_49_50_99:
                        xmlString.Append("<IPITrib>");

                        xmlString.Append("    <CST>" + det.ipi_CST + "</CST>");

                        if (!String.IsNullOrEmpty(det.ipi_vBC))
                        {
                            xmlString.Append("    <vBC>" + det.ipi_vBC + "</vBC>");
                            xmlString.Append("    <pIPI>" + det.ipi_pIPI + "</pIPI>");
                        }
                        else
                        {
                            xmlString.Append("    <qUnid>" + det.ipi_qUnid + "</qUnid>");
                            xmlString.Append("    <vUnid>" + det.ipi_vUnid + "</vUnid>");
                        }

                        xmlString.Append("    <vIPI>" + det.ipi_vIPI + "</vIPI>");

                        xmlString.Append("</IPITrib>");
                        break;
                    case IPI.IPI01_55:
                        xmlString.Append("<IPINT>");
                        xmlString.Append("    <CST>" + det.ipi_CST + "</CST>");
                        xmlString.Append("</IPINT>");
                        break;
                }

                xmlString.Append("</IPI>");
            }
        }
Ejemplo n.º 10
0
        private void MontaDET_ICMS(DET det)
        {
            xmlString.Append("<ICMS>");

            switch (det.icms)
            {
                case ICMS.ICMS00:
                    xmlString.Append("<ICMS00>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                    xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                    xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                    xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                    xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                    xmlString.Append("</ICMS00>");
                    break;
                case ICMS.ICMS10:
                    xmlString.Append("<ICMS10>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                    xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                    xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                    xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                    xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                    xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                    if (!String.IsNullOrEmpty(det.icms_pMVAST))
                    {
                        xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                    }

                    xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                    xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                    xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");

                    xmlString.Append("</ICMS10>");
                    break;
                case ICMS.ICMS20:
                    xmlString.Append("<ICMS20>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                    xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                    xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                    xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                    xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                    xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                    xmlString.Append("</ICMS20>");
                    break;
                case ICMS.ICMS30:
                    xmlString.Append("<ICMS30>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                    xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");
                    xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                    xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                    xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                    xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                    xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");
                    xmlString.Append("</ICMS30>");
                    break;
                case ICMS.ICMS40_50:
                    xmlString.Append("<ICMS40>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                    xmlString.Append("</ICMS40>");
                    break;
                case ICMS.ICMS51:
                    xmlString.Append("<ICMS51>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                    xmlString.Append("</ICMS51>");

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                    }
                    break;
                case ICMS.ICMS60:
                    xmlString.Append("<ICMS60>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                    xmlString.Append("</ICMS60>");
                    break;
                case ICMS.ICMS70:
                    xmlString.Append("<ICMS70>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                    xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                    xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                    xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");
                    xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                    xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                    xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                    if (!String.IsNullOrEmpty(det.icms_pMVAST))
                    {
                        xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                    }

                    xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                    xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                    xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");
                    xmlString.Append("</ICMS70>");
                    break;
                case ICMS.ICMS90:
                    xmlString.Append("<ICMS90>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CST>" + det.icms_CST + "</CST>");
                    xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                    xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");

                    if (!String.IsNullOrEmpty(det.icms_pRedBC))
                    {
                        xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                    }

                    xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                    xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                    xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                    if (!String.IsNullOrEmpty(det.icms_pMVAST))
                    {
                        xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                    }

                    xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                    xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                    xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");
                    xmlString.Append("</ICMS90>");
                    break;
                case ICMS.ICMS101:
                    xmlString.Append("<ICMSSN101>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                    xmlString.Append("    <pCredSN>" + det.icms_pCredSN + "</pCredSN>");
                    xmlString.Append("    <vCredICMSSN>" + det.icms_vCredICMSSN + "</vCredICMSSN>");
                    xmlString.Append("</ICMSSN101>");
                    break;
                case ICMS.ICMS102_400:
                    xmlString.Append("<ICMSSN102>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                    xmlString.Append("</ICMSSN102>");
                    break;
                case ICMS.ICMS201:
                    xmlString.Append("<ICMSSN201>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                    xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                    }

                    xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                    xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                    xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");

                    xmlString.Append("</ICMSSN201>");
                    break;
                case ICMS.ICMS202:
                    xmlString.Append("<ICMSSN202>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                    xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                    if (!String.IsNullOrEmpty(det.icms_pMVAST))
                    {
                        xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                    }

                    xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                    xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                    xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");

                    xmlString.Append("</ICMSSN202>");
                    break;
                case ICMS.ICMS500:
                    xmlString.Append("<ICMSSN500>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                    xmlString.Append("    <vBCSTRet>" + det.icms_vBCSTRet + "</vBCSTRet>");
                    xmlString.Append("    <vICMSSTRet>" + det.icms_vICMSSTRet + "</vICMSSTRet>");
                    xmlString.Append("</ICMSSN500>");
                    break;
                case ICMS.ICMS900:
                    xmlString.Append("<ICMSSN900>");
                    xmlString.Append("    <orig>" + det.icms_orig + "</orig>");
                    xmlString.Append("    <CSOSN>" + det.icms_CSOSN + "</CSOSN>");
                    xmlString.Append("    <modBC>" + det.icms_modBC + "</modBC>");
                    xmlString.Append("    <vBC>" + det.icms_vBC + "</vBC>");

                    if (!String.IsNullOrEmpty(det.icms_pRedBC))
                    {
                        xmlString.Append("    <pRedBC>" + det.icms_pRedBC + "</pRedBC>");
                    }

                    xmlString.Append("    <pICMS>" + det.icms_pICMS + "</pICMS>");
                    xmlString.Append("    <vICMS>" + det.icms_vICMS + "</vICMS>");
                    xmlString.Append("    <modBCST>" + det.icms_modBCST + "</modBCST>");

                    if (!String.IsNullOrEmpty(det.icms_pMVAST))
                    {
                        xmlString.Append("    <pMVAST>" + det.icms_pMVAST + "</pMVAST>");
                    }

                    if (!String.IsNullOrEmpty(det.icms_pRedBCST))
                    {
                        xmlString.Append("    <pRedBCST>" + det.icms_pRedBCST + "</pRedBCST>");
                    }

                    xmlString.Append("    <vBCST>" + det.icms_vBCST + "</vBCST>");
                    xmlString.Append("    <pICMSST>" + det.icms_pICMSST + "</pICMSST>");
                    xmlString.Append("    <vICMSST>" + det.icms_vICMSST + "</vICMSST>");
                    xmlString.Append("    <pCredSN>" + det.icms_pCredSN + "</pCredSN>");
                    xmlString.Append("    <vCredICMSSN>" + det.icms_vCredICMSSN + "</vCredICMSSN>");
                    xmlString.Append("</ICMSSN900>");
                    break;
            }

            xmlString.Append("</ICMS>");
        }